40 etacut_(pset.getParameter<double>(
"etacut")),
41 ptcut_(pset.getParameter<double>(
"ptcut")),
42 deltaRStacut_(pset.getParameter<double>(
"deltaRStacut"))
54 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++) {
82 if (ZCand.
pdgId() == 23 && status == 3) {
85 if (muCand1->
status() == 3) {
88 if (muCandidate->
pdgId() == muCand1->
pdgId()) {
95 if (muCand2->
status() == 3) {
98 if (muCandidate->
pdgId() == muCand2->
pdgId()) {
104 double deltaR_Mu_Sta = 0;
105 int nMurecoTemp = nMureco;
108 for (i = MuonsMap->
begin(); i != MuonsMap->
end(); i++) {
110 if ((muCand1 == &mc) && (mc.
pt() > ptcut_) && (
std::abs(mc.
eta()) < etacut_)) {
116 if (nMureco == nMurecoTemp)
123 for (l = TracksMap->
begin(); l != TracksMap->
end(); l++) {
125 if ((muCand1 == &Trkmc) && (Trkmc.
pt() > ptcut_) && (
std::abs(Trkmc.
eta()) < etacut_)) {
133 for (n = StandAloneMap->
begin(); n != StandAloneMap->
end(); n++) {
135 if ((muCand1 == &Stamc) && (Stamc.pt() > ptcut_) && (
std::abs(Stamc.eta()) < etacut_)) {
138 deltaR_Mu_Sta =
deltaR(Stareco, *muCand1);
145 if ((nSta == nStaTemp + 1) && (nTrk == nTrkTemp + 1)) {
147 if ((deltaR_Mu_Sta < deltaRStacut_)) {
148 v_.push_back(deltaR_Mu_Sta);
149 cout <<
"Not matching from trk and sta matched to MC mu, to reconstruct a recoMU" << endl;
158 cout <<
"--- nMuMC == " << nMuMC << endl;
159 cout <<
"--- nMureco == " << nMureco << endl;
160 cout <<
"--- nSta == " << nSta << endl;
161 cout <<
"--- nTrk == " << nTrk << endl;
162 cout <<
"--- nNotMuMatching from a trk and sta matched to a Mu MC == " << nNotMuMatching << endl;
164 cout <<
" effMu == " << (double)nMureco / nMuMC << endl;
165 cout <<
" effTrk == " << (double)(nTrk + nMureco) / nMuMC << endl;
166 cout <<
" effSta == " << (double)(nSta + nMureco) / nMuMC << endl;
169 for (
unsigned int i = 0;
i < v_.size(); ++
i) {
170 cout <<
" delta R Mu Sta == " << v_[
i] << endl;
184 int nMuMC, nMureco,
nTrk, nSta, nNotMuMatching;
std::vector< GenParticle > GenParticleCollection
collection of GenParticles
EDGetTokenT< CandidateCollection > TracksToken_
const_iterator end() const
last iterator over the map (read only)
MCEfficiencyAnalyzer(const edm::ParameterSet &pset)
virtual const Candidate * daughter(size_type i) const =0
return daughter at a given position, i = 0, ... numberOfDaughters() - 1 (read only mode) ...
EDGetTokenT< CandidateCollection > zMuMuToken_
EDGetTokenT< CandidateCollection > StandAloneToken_
virtual int status() const =0
status word
#define DEFINE_FWK_MODULE(type)
EDGetTokenT< CandMatchMap > TracksMapToken_
virtual int pdgId() const =0
PDG identifier.
Abs< T >::type abs(const T &t)
void analyze(const edm::Event &event, const edm::EventSetup &setup) override
zMuMu
zMuMu vector of PSet is common to all categories except zMuTrk category
virtual double eta() const =0
momentum pseudorapidity
virtual double pt() const =0
transverse momentum
EDGetTokenT< CandMatchMap > StandAloneMapToken_
EDGetTokenT< CandMatchMap > MuonsMapToken_
EDGetTokenT< GenParticleCollection > genParticlesToken_
const_iterator begin() const
first iterator over the map (read only)
EDGetTokenT< CandidateCollection > MuonsToken_
virtual size_type numberOfDaughters() const =0
number of daughters