1 #ifndef MUSCLEFITMUONSELECTOR
2 #define MUSCLEFITMUONSELECTOR
15 #include "HepMC/GenParticle.h"
16 #include "HepMC/GenEvent.h"
32 const std::vector<int> & resfind,
33 const bool speedup,
const std::string & genParticlesName,
34 const bool compareToSimTracks,
const edm::InputTag & simTracksCollectionName,
35 const bool sherpa,
const bool debug) :
54 std::vector<GenMuonPair> & genPair,
55 std::vector<std::pair<lorentzVector,lorentzVector> > & simPair,
70 const std::vector<const pat::Muon*> & collMuSel,
71 std::vector<GenMuonPair> & genPair,
74 std::vector<GenMuonPair> & genPair,
75 std::vector<std::pair<lorentzVector,lorentzVector> > & simPair,
80 std::vector<std::pair<lorentzVector,lorentzVector> > & simPair,
87 std::vector<reco::LeafCandidate>
muons;
88 typename std::vector<T>::const_iterator track;
89 for( track = tracks.begin(); track != tracks.end(); ++track ) {
94 muons.push_back(
muon);
107 tracks.push_back(*(muon->globalTrack()));
108 else if(muon->isStandAloneMuon() &&
muonType_==2)
109 tracks.push_back(*(muon->outerTrack()));
110 else if(muon->isTrackerMuon() &&
muonType_==3)
111 tracks.push_back(*(muon->innerTrack()));
113 else if(
muonType_ == 10 && !(muon->isStandAloneMuon()) )
114 tracks.push_back(*(muon->innerTrack()));
115 else if(
muonType_ == 11 && muon->isGlobalMuon() )
116 tracks.push_back(*(muon->innerTrack()));
117 else if(
muonType_ == 13 && muon->isTrackerMuon() )
118 tracks.push_back(*(muon->innerTrack()));
std::vector< GenParticle > GenParticleCollection
collection of GenParticles
void selectMuons(const edm::Event &event, std::vector< reco::LeafCandidate > &muons, std::vector< GenMuonPair > &genPair, std::vector< std::pair< lorentzVector, lorentzVector > > &simPair, MuScleFitPlotter *plotter)
Main method used to select muons of type specified by muonType_ from the collection specified by muon...
void selectGeneratedMuons(const edm::Handle< pat::CompositeCandidateCollection > &collAll, const std::vector< const pat::Muon * > &collMuSel, std::vector< GenMuonPair > &genPair, MuScleFitPlotter *plotter)
For PATmuons the generator information is read directly from the PAT object.
std::pair< lorentzVector, lorentzVector > findSimMuFromRes(const edm::Handle< edm::HepMCProduct > &evtMC, const edm::Handle< edm::SimTrackContainer > &simTracks)
const std::string genParticlesName_
bool selTrackerMuon(const pat::Muon *aMuon)
Apply the Onia cuts to select trackerMuons.
void selectSimulatedMuons(const edm::Event &event, const bool ifHepMC, edm::Handle< edm::HepMCProduct > evtMC, std::vector< std::pair< lorentzVector, lorentzVector > > &simPair, MuScleFitPlotter *plotter)
MuScleFitMuonSelector(const edm::InputTag &muonLabel, const int muonType, const bool PATmuons, const std::vector< int > &resfind, const bool speedup, const std::string &genParticlesName, const bool compareToSimTracks, const edm::InputTag &simTracksCollectionName, const bool sherpa, const bool debug)
reco::Particle::LorentzVector lorentzVector
const bool compareToSimTracks_
static const unsigned int motherPdgIdArray[6]
const edm::InputTag muonLabel_
How EventSelector::AcceptEvent() decides whether to accept an event for output otherwise it is excluding the probing of A single or multiple positive and the trigger will pass if any such matching triggers are PASS or EXCEPTION[A criterion thatmatches no triggers at all is detected and causes a throw.] A single negative with an expectation of appropriate bit checking in the decision and the trigger will pass if any such matching triggers are FAIL or EXCEPTION A wildcarded negative criterion that matches more than one trigger in the trigger but the state exists so we define the behavior If all triggers are the negative crieriion will lead to accepting the event(this again matches the behavior of"!*"before the partial wildcard feature was incorporated).The per-event"cost"of each negative criterion with multiple relevant triggers is about the same as!*was in the past
GenMuonPair findGenMuFromRes(const reco::GenParticleCollection *genParticles)
void selectGenSimMuons(const edm::Event &event, std::vector< GenMuonPair > &genPair, std::vector< std::pair< lorentzVector, lorentzVector > > &simPair, MuScleFitPlotter *plotter)
std::vector< reco::LeafCandidate > fillMuonCollection(const std::vector< T > &tracks)
Template function used to convert the muon collection to a vector of reco::LeafCandidate.
const edm::InputTag simTracksCollectionName_
bool selGlobalMuon(const pat::Muon *aMuon)
Apply the Onia cuts to select globalMuons.
void takeSelectedMuonType(const T &muon, std::vector< reco::Track > &tracks)
Template function used to extract the selected muon type from the muon collection.
const std::vector< int > resfind_
math::XYZTLorentzVector LorentzVector
Lorentz vector.
Analysis-level muon class.
const reco::Candidate * getStatus1Muon(const reco::Candidate *status3Muon)