bool PseudoTopAnalyser::passesEventSelection( const MCParticlePointer pseudoLepton, const ParticlePointer pseudoNeutrino, const JetCollection pseudoJets, const MCParticleCollection pseudoBs, const ParticleCollection allPseudoLeptons, const ParticlePointer pseudoMET ) { // Event selection taken from here : https://twiki.cern.ch/twiki/bin/view/LHCPhysics/ParticleLevelTopDefinitions unsigned int numberGoodLeptons = 0; unsigned int numberVetoLeptons = 0; ParticlePointer leadingLepton; for ( unsigned int leptonIndex = 0; leptonIndex < allPseudoLeptons.size(); ++ leptonIndex ) { const ParticlePointer lepton = allPseudoLeptons.at(leptonIndex); // Check if this is a good signal type lepton if ( lepton->pt() > minLeptonPt_ && fabs(lepton->eta()) < maxLeptonAbsEta_ ) { ++numberGoodLeptons; if ( leadingLepton == 0 ) leadingLepton = lepton; } // Check if this is a veto lepton if ( lepton->pt() > minVetoLeptonPt_ && fabs(lepton->eta()) < maxVetoLeptonAbsEta_ ) { ++numberVetoLeptons; } } // Neutrino pt sum bool passesNeutrinoSumPt = false; if ( pseudoMET != 0 ) { if ( pseudoMET->pt() > minNeutrinoSumPt_ ) passesNeutrinoSumPt = true; } // W MT bool passesWMT = false; if ( leadingLepton != 0 && pseudoMET != 0 ) { double genMT = sqrt( 2 * leadingLepton->pt() * pseudoMET->pt() * ( 1 - cos(leadingLepton->phi() - pseudoMET->phi() ) ) ); if (genMT > minWMt_) passesWMT = true; } // Jets unsigned int numberGoodJets = 0; unsigned int numberGoodBJets = 0; for ( unsigned int jetIndex = 0; jetIndex < pseudoJets.size(); ++ jetIndex ) { const JetPointer jet = pseudoJets.at(jetIndex); // Check if this is a good jet if ( jet->pt() > minJetPt_ && fabs(jet->eta()) < maxJetAbsEta_ ) { ++numberGoodJets; // Check if this is also a good b jet if ( fabs( jet->partonFlavour() ) == 5 ) { ++numberGoodBJets; } } } if ( numberGoodLeptons == 1 && numberVetoLeptons <= 1 && passesNeutrinoSumPt && passesWMT && numberGoodJets >= minNJets_ && numberGoodBJets >= minNBJets_ ) { return true; } else return false; }
unsigned short Particle::getClosest(const ParticleCollection& particles) const { unsigned short idOfClosest = 999; double closestDR = 999.; for (unsigned short index = 0; index < particles.size(); ++index) { double DR = deltaR(particles.at(index)); if (DR < closestDR) { closestDR = DR; idOfClosest = index; } } return idOfClosest; }