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);
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++) {
134 const Candidate &Stareco = *
n->key, &Stamc = *
n->val;
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;