49 using namespace isodeposit;
57 void endJob()
override;
74 *h_ProbeOk_eta_no_FSR, *h_ProbeOk_pt_no_FSR;
75 TH1D *h_trackProbe_eta_FSR, *
h_trackProbe_pt_FSR, *h_staProbe_eta_FSR, *h_staProbe_pt_FSR, *h_ProbeOk_eta_FSR,
78 bool FSR_mu,
FSR_tk, FSR_mu0, FSR_mu1;
93 dRVeto_(
pset.getUntrackedParameter<double>(
"veto")),
94 dRTrk_(
pset.getUntrackedParameter<double>(
"deltaRTrk")),
95 ptThreshold_(
pset.getUntrackedParameter<double>(
"ptThreshold")) {
103 h_zmass_FSR = fs->
make<TH1D>(
"h_zmass_FRS",
"Invariant Z mass distribution", 200, 0, 200);
104 h_zmass_no_FSR = fs->
make<TH1D>(
"h_zmass_no_FSR",
"Invariant Z mass distribution", 200, 0, 200);
105 h_zMuSamass_FSR = fs->
make<TH1D>(
"h_zMuSamass_FRS",
"Invariant Z mass distribution", 200, 0, 200);
107 h_zMuTkmass_FSR = fs->
make<TH1D>(
"h_zMuTkmass_FRS",
"Invariant Z mass distribution", 200, 0, 200);
109 h_Iso_ = fs->
make<TH1D>(
"h_iso",
"Isolation distribution of muons without FSR", 100, 0, 20);
110 h_Iso_FSR_ = fs->
make<TH1D>(
"h_iso_FSR",
"Isolation distribution of muons with FSR ", 100, 0, 20);
112 "h_iso_3D",
"Isolation distribution of muons without FSR", 100, 20, 100, 100, -2.0, 2.0, 100, 0, 20);
114 "h_iso_FSR_3D",
"Isolation distribution of muons with FSR ", 100, 20, 100, 100, -2.0, 2.0, 100, 0, 20);
116 fs->
make<TH2D>(
"h_staProbe_pt_eta_no_FSR",
"Pt vs Eta StandAlone without FSR ", 100, 20, 100, 100, -2.0, 2.0);
118 fs->
make<TH2D>(
"h_staProbe_pt_eta_FSR",
"Pt vs Eta StandAlone with FSR ", 100, 20, 100, 100, -2.0, 2.0);
120 fs->
make<TH2D>(
"h_ProbeOk_pt_eta_no_FSR",
"Pt vs Eta probeOk without FSR ", 100, 20, 100, 100, -2.0, 2.0);
122 fs->
make<TH2D>(
"h_ProbeOk_pt_eta_FSR",
"Pt vs Eta probeOk with FSR ", 100, 20, 100, 100, -2.0, 2.0);
150 cout <<
"********** New Event ***********" << endl;
152 if (!
zMuMu->empty()) {
154 for (
unsigned int i = 0;
i <
zMuMu->size(); ++
i) {
161 const pat::Muon& mu0 = dynamic_cast<const pat::Muon&>(*dau0);
162 const pat::Muon& mu1 = dynamic_cast<const pat::Muon&>(*dau1);
164 double zmass = zMuMuCand.
mass();
165 double pt0 = mu0.
pt();
166 double pt1 = mu1.
pt();
167 double eta0 = mu0.
eta();
169 if (pt0 > 20 &&
pt1 > 20 &&
abs(eta0) < 2 &&
abs(
eta1) < 2 && zmass > 20 && zmass < 200) {
173 cout <<
" Zmumu cuts && matched" << endl;
191 double Tracker_isovalue_mu0 = mu0TrackIso->
sumWithin(
dRTrk_, vetos_mu0);
192 double Tracker_isovalue_mu1 = mu1TrackIso->
sumWithin(
dRTrk_, vetos_mu1);
199 if (!mu0HLTMatches.empty())
201 if (!mu1HLTMatches.empty())
211 cout <<
" muone0" << endl;
212 cout <<
" num di daughters = " << num_dau_muon0 << endl;
213 if (num_dau_muon0 > 1) {
214 for (
int j = 0;
j < num_dau_muon0; ++
j) {
216 cout <<
" dauther[" <<
j <<
"] pdgId = " <<
id << endl;
222 cout <<
" muone1" << endl;
223 cout <<
" num di daughters = " << num_dau_muon1 << endl;
224 if (num_dau_muon1 > 1) {
225 for (
int j = 0;
j < num_dau_muon1; ++
j) {
227 cout <<
" dauther[" <<
j <<
"] pdgId = " <<
id << endl;
239 cout <<
"muon 1 is triggered " << endl;
241 cout <<
"and muon 0 does FSR" << endl;
251 cout <<
"and muon 0 doesn't FSR" << endl;
265 h_Iso_->Fill(Tracker_isovalue_mu0);
266 h_Iso_3D_->Fill(pt0, eta0, Tracker_isovalue_mu0);
270 cout <<
"muon 0 is triggered" << endl;
272 cout <<
"and muon 1 does FSR" << endl;
283 cout <<
"and muon 1 doesn't FSR" << endl;
297 h_Iso_->Fill(Tracker_isovalue_mu1);
307 if (!
zMuSa->empty()) {
309 for (
unsigned int i = 0;
i <
zMuSa->size(); ++
i) {
317 const pat::Muon& mu0 = dynamic_cast<const pat::Muon&>(*dau0);
318 const pat::Muon& mu1 = dynamic_cast<const pat::Muon&>(*dau1);
320 double zmass = zMuSaCand.
mass();
321 double pt0 = mu0.
pt();
322 double pt1 = mu1.
pt();
323 double eta0 = mu0.
eta();
325 if (pt0 > 20 &&
pt1 > 20 &&
abs(eta0) < 2 &&
abs(
eta1) < 2 && zmass > 20 && zmass < 200) {
328 cout <<
" Zmusa cuts && matched" << endl;
346 double Tracker_isovalue_mu0 = mu0TrackIso->
sumWithin(
dRTrk_, vetos_mu0);
347 double Tracker_isovalue_mu1 = mu1TrackIso->
sumWithin(
dRTrk_, vetos_mu1);
354 if (!mu0HLTMatches.empty())
356 if (!mu1HLTMatches.empty())
366 cout <<
" muone0" << endl;
367 cout <<
" num di daughters = " << num_dau_muon0 << endl;
368 if (num_dau_muon0 > 1) {
369 for (
int j = 0;
j < num_dau_muon0; ++
j) {
371 cout <<
" dauther[" <<
j <<
"] pdgId = " <<
id << endl;
377 cout <<
" muone1" << endl;
378 cout <<
" num di daughters = " << num_dau_muon1 << endl;
379 if (num_dau_muon1 > 1) {
380 for (
int j = 0;
j < num_dau_muon1; ++
j) {
382 cout <<
" dauther[" <<
j <<
"] pdgId = " <<
id << endl;
406 h_Iso_->Fill(Tracker_isovalue_mu1);
425 h_Iso_->Fill(Tracker_isovalue_mu0);
426 h_Iso_3D_->Fill(pt0, eta0, Tracker_isovalue_mu0);
435 if (!zMuTk->
empty()) {
437 for (
unsigned int i = 0;
i < zMuTk->
size(); ++
i) {
442 const pat::Muon& mu0 = dynamic_cast<const pat::Muon&>(*dau0);
445 double zmass = zMuTkCand.
mass();
446 double pt0 = mu0.
pt();
447 double pt1 = mu1.
pt();
448 double eta0 = mu0.
eta();
450 if (pt0 > 20 &&
pt1 > 20 &&
abs(eta0) < 2 &&
abs(
eta1) < 2 && zmass > 20 && zmass < 200) {
455 cout <<
" ZmuTk cuts && matched" << endl;
481 cout <<
"numero di figli muone0 = " << num_dau_muon0 << endl;
482 cout <<
"numero di figli muone1 = " << num_dau_muon1 << endl;
484 cout <<
" muon" << endl;
485 cout <<
" num di daughters = " << num_dau_muon0 << endl;
486 if (num_dau_muon0 > 1) {
487 for (
int j = 0;
j < num_dau_muon0; ++
j) {
489 cout <<
" dau[" <<
j <<
"] pdg ID = " <<
id << endl;
497 cout <<
" traccia" << endl;
498 cout <<
" num di daughters = " << num_dau_muon1 << endl;
499 if (num_dau_muon1 > 1) {
500 for (
int j = 0;
j < num_dau_muon1; ++
j) {
502 cout <<
" dau[" <<
j <<
"] pdg ID = " <<
id << endl;
510 cout <<
"Mu Isolation = " << Tracker_isovalue_mu << endl;
511 cout <<
"Track Isolation = " << Tracker_isovalue_tk << endl;
516 h_Iso_->Fill(Tracker_isovalue_mu);
517 h_Iso_3D_->Fill(pt0, eta0, Tracker_isovalue_mu);
525 h_Iso_->Fill(Tracker_isovalue_tk);
537 cout <<
" ============= Summary ==========" << endl;
539 cout <<
" 1)Numero di ZMuMu matched dopo i tagli cinematici = " <<
zmmcounter << endl;
540 cout <<
" 2)Numero di ZMuSa matched dopo i tagli cinematici = " <<
zmscounter << endl;
541 cout <<
" 3)Numero di ZMuTk matched dopo i tagli cinematici = " <<
zmtcounter << endl;
544 double eff_iso_FSR = (double)icut1 / (
double)n1;
545 double err_iso_FSR =
sqrt(eff_iso_FSR * (1 - eff_iso_FSR) / n1);
546 double n2 =
h_Iso_->Integral();
547 double icut2 =
h_Iso_->Integral(0, 15);
548 double eff_iso = (double)icut2 / (
double)n2;
549 double err_iso =
sqrt(eff_iso * (1 - eff_iso) / n2);
550 cout <<
" ============= Isolation Efficiecy ==========" << endl;
551 cout <<
"Isolation Efficiency = " << eff_iso <<
" +/- " << err_iso << endl;
552 cout <<
"Isolation Efficiency with FSR = " << eff_iso_FSR <<
" +/- " << err_iso_FSR << endl;