41 etacut_( pset.getParameter<double>(
"etacut" ) ),
42 ptcut_( pset.getParameter<double>(
"ptcut" ) ),
43 deltaRStacut_( pset.getParameter<double>(
"deltaRStacut" ) )
46 nMuMC =0; nMureco =0; nTrk=0; nSta=0; nNotMuMatching =0 ;
53 event.getByToken(zMuMuToken_, zMuMu);
57 event.getByToken(MuonsToken_, Muons);
60 event.getByToken(TracksToken_, Tracks);
63 event.getByToken(StandAloneToken_, StandAlone);
66 event.getByToken(MuonsMapToken_, MuonsMap);
69 event.getByToken(TracksMapToken_, TracksMap);
72 event.getByToken(StandAloneMapToken_, StandAloneMap);
75 event.getByToken(genParticlesToken_, genParticles);
78 for(
unsigned int k = 0;
k < genParticles->size();
k++ )
80 const Candidate & ZCand = (*genParticles)[
k ];
83 if (ZCand.
pdgId()==23&& status==3 )
105 if (muCandidate->
pdgId() == muCand2->
pdgId() )
112 double deltaR_Mu_Sta =0;
113 int nMurecoTemp = nMureco;
115 CandMatchMap::const_iterator
i;
116 for(i = MuonsMap->begin(); i != MuonsMap->end(); i++ )
119 if ((muCand1 == &mc) && (mc.
pt()>ptcut_) && (
abs(mc.
eta()<etacut_)))
126 if (nMureco == nMurecoTemp )
132 CandMatchMap::const_iterator
l;
133 for(l = TracksMap->begin(); l != TracksMap->end(); l++ )
136 if (( muCand1 == & Trkmc) && (Trkmc.
pt()>ptcut_) && (
abs(Trkmc.
eta()<etacut_)))
144 CandMatchMap::const_iterator
n;
145 for(n = StandAloneMap->begin(); n != StandAloneMap->end(); n++ )
147 const Candidate & Stareco = * n ->
key, & Stamc = * n -> val;
148 if ((muCand1 == &Stamc ) && (Stamc.pt()>ptcut_) && (
abs(Stamc.eta()<etacut_)))
152 deltaR_Mu_Sta =
deltaR(Stareco, *muCand1);
159 if ((nSta == nStaTemp + 1) && (nTrk == nTrkTemp + 1 ) )
162 if ((deltaR_Mu_Sta< deltaRStacut_))
164 v_.push_back(deltaR_Mu_Sta) ;
165 cout <<
"Not matching from trk and sta matched to MC mu, to reconstruct a recoMU" << endl;
178 cout <<
"--- nMuMC == "<<nMuMC<<endl;
179 cout <<
"--- nMureco == "<<nMureco<<endl;
180 cout <<
"--- nSta == "<<nSta<<endl;
181 cout <<
"--- nTrk == "<<nTrk<<endl;
182 cout <<
"--- nNotMuMatching from a trk and sta matched to a Mu MC == "<<nNotMuMatching<<endl;
185 cout<<
" effMu == "<<(double) nMureco/nMuMC<<endl;
186 cout<<
" effTrk == "<< (double)(nTrk + nMureco) /nMuMC<<endl;
187 cout<<
" effSta == "<< (double)(nSta + nMureco) / nMuMC<<endl;
190 vector< int >::const_iterator
p2;
191 for (
unsigned int i =0 ;
i < v_.size(); ++
i )
193 cout<<
" delta R Mu Sta == "<< v_[
i]<<endl;
212 int nMuMC, nMureco,
nTrk, nSta, nNotMuMatching;
std::vector< GenParticle > GenParticleCollection
collection of GenParticles
virtual const Candidate * daughter(size_type i) const =0
return daughter at a given position, i = 0, ... numberOfDaughters() - 1 (read only mode) ...
EDGetTokenT< CandidateCollection > TracksToken_
virtual double pt() const =0
transverse momentum
#define DEFINE_FWK_MODULE(type)
MCEfficiencyAnalyzer(const edm::ParameterSet &pset)
virtual int status() const =0
status word
EDGetTokenT< CandidateCollection > zMuMuToken_
EDGetTokenT< CandidateCollection > StandAloneToken_
virtual size_type numberOfDaughters() const =0
number of daughters
EDGetTokenT< CandMatchMap > TracksMapToken_
Abs< T >::type abs(const T &t)
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
string key
FastSim: produces sample of signal events, overlayed with premixed minbias events.
virtual void endJob() override
double deltaR(double eta1, double eta2, double phi1, double phi2)
virtual int pdgId() const =0
PDG identifier.
EDGetTokenT< CandMatchMap > StandAloneMapToken_
EDGetTokenT< CandMatchMap > MuonsMapToken_
EDGetTokenT< GenParticleCollection > genParticlesToken_
virtual void analyze(const edm::Event &event, const edm::EventSetup &setup) override
EDGetTokenT< CandidateCollection > MuonsToken_
tuple zMuMu
zMuMu vector of PSet is common to all categories except zMuTrk category
virtual double eta() const =0
momentum pseudorapidity