15 unsigned int n =
c->numberOfDaughters();
16 for (
unsigned int i = 0;
i <
n; ++
i) {
18 if (fabs(
d->pdgId()) == 13)
35 etaDau0Min_(etaDau0Min),
36 etaDau0Max_(etaDau0Max),
37 etaDau1Min_(etaDau1Min),
38 etaDau1Max_(etaDau1Max),
41 massMinZMC_(massMinZMC),
42 massMaxZMC_(massMaxZMC) {}
45 if (
c.numberOfDaughters() < 2)
47 if (
c.numberOfDaughters() >= 6)
51 if (
c.numberOfDaughters() > 2) {
52 if (
d0->numberOfDaughters() > 0)
54 if (
d1->numberOfDaughters() > 0)
59 if ((fabs(
d0->eta()) > etaDau0Min_ && fabs(
d1->eta()) > etaDau1Min_ && fabs(
d0->eta()) < etaDau0Max_ &&
60 fabs(
d1->eta()) < etaDau1Max_) ||
61 (fabs(
d0->eta()) > etaDau1Min_ && fabs(
d1->eta()) > etaDau0Min_ && fabs(
d0->eta()) < etaDau1Max_ &&
62 fabs(
d1->eta()) < etaDau0Max_)) {
64 if (
d0->pt() > ptMin_ &&
d1->pt() > ptMin_) {
67 if (
m > massMin_ &&
m < massMax_)
69 if (
c.mass() > massMinZMC_ &&
c.mass() < massMaxZMC_)
76 double ptMin_, etaDau0Min_, etaDau0Max_, etaDau1Min_, etaDau1Max_, massMin_, massMax_, massMinZMC_, massMaxZMC_;
85 void endJob()
override;
90 long nZToMuMu_, selZToMuMu_, nZToMuMuMC_, selZToMuMuMC_, nZToMuMuMCMatched_,
selZToMuMuMCMatched_, nZToMuMuMCDen_;
96 zToMuMuMC_(
cfg.getParameter<
InputTag>(
"zToMuMuMC")),
97 zToMuMuMatched_(
cfg.getParameter<
InputTag>(
"zToMuMuMatched")),
105 nZToMuMuMCMatched_(0),
106 selZToMuMuMCMatched_(0),
108 select_(
cfg.getParameter<double>(
"ptMin"),
109 cfg.getParameter<double>(
"etaDau0Min"),
110 cfg.getParameter<double>(
"etaDau0Max"),
111 cfg.getParameter<double>(
"etaDau1Min"),
112 cfg.getParameter<double>(
"etaDau1Max"),
113 cfg.getParameter<double>(
"massMin"),
114 cfg.getParameter<double>(
"massMax"),
115 cfg.getParameter<double>(
"massMinZMC"),
116 cfg.getParameter<double>(
"massMaxZMC")),
117 select_OnlyMassCut_(-1,
124 cfg.getParameter<double>(
"massMinZMC"),
125 cfg.getParameter<double>(
"massMaxZMC")) {}
135 long nZToMuMuMC = zToMuMuMC->
size();
136 long nZToMuMuMatched = zToMuMuMatched->
size();
143 for (
long i = 0;
i < nZToMuMuMC; ++
i) {
151 for (
long i = 0;
i < nZToMuMuMatched; ++
i) {
164 int selectMC =
select_(*mcRef);
169 if (selectZ != selectMC) {
170 cout <<
">>> select reco: " << selectZ <<
", select mc: " << selectMC << endl;
171 if ((selectZ * selectMC) == 0)
173 if (
z.numberOfDaughters() > 1) {
175 if (mcRef->numberOfDaughters() > 1) {
177 double m =
z.mass(), mcm = (mcd0->
p4() + mcd1->p4()).
mass();
178 cout <<
">>> reco pt1, eta1: " <<
d0->pt() <<
", " <<
d0->eta() <<
", 2: " <<
d1->pt() <<
", " <<
d1->eta()
179 <<
", mass = " <<
m << endl;
180 cout <<
">>> mc pt1, eta1: " << mcd0->
pt() <<
", " << mcd0->
eta() <<
", 2: " << mcd1->pt() <<
", "
181 << mcd1->eta() <<
", mass = " << mcm << endl;
186 if ((selectZ == 3) && (selectMC == 3))
194 double errZToMuMu =
sqrt(effZToMuMu * (1. - effZToMuMu) /
nZToMuMu_);
196 double errZToMuMuMC =
sqrt(effZToMuMuMC * (1. - effZToMuMuMC) /
nZToMuMuMC_);
198 double errZToMuMuMCDen =
sqrt(effZToMuMuMCDen * (1. - effZToMuMuMCDen) /
nZToMuMuMCDen_);
204 << effZToMuMuMCMatched <<
" +/- " << errZToMuMuMCMatched << endl;
205 cout <<
" if the two numbers above are the same we can neglete resolution effect and quote the acceptance as the "
208 cout <<
"********* acceptance m>sampleMCMassCut (usually 20 or 40) ******** " << endl;
210 << errZToMuMuMC << endl;
211 cout <<
"********* acceptance in the given mass range ******** " << endl;
213 << errZToMuMuMCDen << endl;