|
|
Go to the documentation of this file. 1 #ifndef MUSCLEFITMUONSELECTOR
2 #define MUSCLEFITMUONSELECTOR
16 #include "HepMC/GenParticle.h"
17 #include "HepMC/GenEvent.h"
34 const std::vector<int>&
resfind,
37 const bool compareToSimTracks,
61 std::vector<MuScleFitMuon>&
muons,
62 std::vector<GenMuonPair>& genPair,
63 std::vector<std::pair<lorentzVector, lorentzVector> >& simPair,
78 const std::vector<const pat::Muon*>& collMuSel,
79 std::vector<GenMuonPair>& genPair,
82 std::vector<GenMuonPair>& genPair,
83 std::vector<std::pair<lorentzVector, lorentzVector> >& simPair,
89 std::vector<std::pair<lorentzVector, lorentzVector> >& simPair,
95 std::vector<MuScleFitMuon>
muons;
96 typename std::vector<T>::const_iterator
track;
101 Double_t hitsTk(0), hitsMuon(0), ptError(0);
102 if (
const reco::Muon* myMu = dynamic_cast<const reco::Muon*>(&(*
track))) {
103 hitsTk = myMu->innerTrack()->hitPattern().numberOfValidTrackerHits();
104 hitsMuon = myMu->innerTrack()->hitPattern().numberOfValidMuonHits();
105 ptError = myMu->innerTrack()->ptError();
106 }
else if (
const pat::Muon* myMu = dynamic_cast<const pat::Muon*>(&(*
track))) {
107 hitsTk = myMu->innerTrack()->hitPattern().numberOfValidTrackerHits();
108 hitsMuon = myMu->innerTrack()->hitPattern().numberOfValidMuonHits();
109 ptError = myMu->innerTrack()->ptError();
110 }
else if (
const reco::Track* myMu = dynamic_cast<const reco::Track*>(&(*
track))) {
111 hitsTk = myMu->hitPattern().numberOfValidTrackerHits();
112 hitsMuon = myMu->hitPattern().numberOfValidMuonHits();
113 ptError = myMu->ptError();
119 std::cout <<
"[MuScleFitMuonSelector::fillMuonCollection] after MuScleFitMuon initialization" << std::endl;
129 template <
typename T>
const bool compareToSimTracks_
static const unsigned int motherPdgIdArray[6]
std::pair< lorentzVector, lorentzVector > findSimMuFromRes(const edm::Handle< edm::HepMCProduct > &evtMC, const edm::Handle< edm::SimTrackContainer > &simTracks)
const reco::Candidate * getStatus3Muon(const reco::Candidate *status3Muon)
std::vector< GenParticle > GenParticleCollection
collection of GenParticles
GenMuonPair findGenMuFromRes(const reco::GenParticleCollection *genParticles)
bool selTrackerMuon(const pat::Muon *aMuon)
Apply the Onia cuts to select trackerMuons.
Analysis-level muon class.
const edm::InputTag muonLabel_
math::XYZTLorentzVector LorentzVector
Lorentz vector.
bool selGlobalMuon(const pat::Muon *aMuon)
Apply the Onia cuts to select globalMuons.
const std::vector< int > resfind_
const std::string genParticlesName_
void selectSimulatedMuons(const edm::Event &event, const bool ifHepMC, edm::Handle< edm::HepMCProduct > evtMC, std::vector< std::pair< lorentzVector, lorentzVector > > &simPair, MuScleFitPlotter *plotter)
void selectGenSimMuons(const edm::Event &event, std::vector< GenMuonPair > &genPair, std::vector< std::pair< lorentzVector, lorentzVector > > &simPair, MuScleFitPlotter *plotter)
const edm::InputTag simTracksCollectionName_
const reco::Candidate * getStatus1Muon(const reco::Candidate *status3Muon)
void takeSelectedMuonType(const T &muon, std::vector< reco::Track > &tracks)
Template function used to extract the selected muon type from the muon collection.
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::vector< MuScleFitMuon > fillMuonCollection(const std::vector< T > &tracks)
Template function used to convert the muon collection to a vector of reco::LeafCandidate.
reco::Particle::LorentzVector lorentzVector
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)
void selectMuons(const edm::Event &event, std::vector< MuScleFitMuon > &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...