12 #include "GaudiKernel/IToolSvc.h"
42 const std::string&
name,
43 const IInterface*
parent ) :
46 m_ReconElectronsPlots(0,
"Zee/ReconElectrons/",
"Electrons"),
47 m_TrueElectronsPlots(0,
"Zee/TrueElectrons/",
"True Electrons"),
48 m_TrueFwdElectronsPlots(0,
"Zee/TrueFwdElectrons/",
"True FWD Electrons"),
49 m_ZeePlots(0,
"Zee/Zee/",
"Zee"),
50 m_FWDZeePlots(0,
"Zee/FWDZee/",
"FWD Zee"),
51 m_drmin_elreco_truth(0), m_matchedE(false),
52 m_matched_electron(NULL),
53 m_drmin_phreco_truth(0), m_matchedP(false)
88 return StatusCode::SUCCESS;
94 std::vector<HistData>
hists =
plots.retrieveBookedHistograms();
100 return StatusCode::SUCCESS;
118 return StatusCode::SUCCESS;
160 bool loose =
false, medium =
false, tight =
false, lhloose =
false, lhmedium =
false, lhtight =
false, oq =
false;
161 electron -> passSelection(loose,
"Loose");
162 electron -> passSelection(medium,
"Medium");
163 electron -> passSelection(tight,
"Tight");
164 electron -> passSelection(lhloose,
"LHLoose");
165 electron -> passSelection(lhmedium,
"LHMedium");
166 electron -> passSelection(lhtight,
"LHTight");
239 for(
auto truth_part : *truth_particles)
244 if(std::abs(truth_part -> eta()) >
m_EtaCentCut )
continue;
265 bool loose =
false, medium =
false, tight =
false, lhloose =
false, lhmedium =
false, lhtight =
false, oq =
false;
327 for (
auto truth_part : *truth_particles){
341 bool loose =
false, tight =
false;
373 electron -> passSelection(medium,
"Medium");
374 if (medium ==
false)
continue;
378 }
else if (nel >= 1 &&
electron ->
pt() > z_el[0] ->
pt()) {
381 }
else if (nel == 1 || (nel >= 2 &&
electron ->
pt() > z_el[1] ->
pt())) {
397 electron -> passSelection(medium,
"Medium");
403 }
else if (nel >= 1 &&
electron ->
pt() > z_el[0] ->
pt()) {
406 }
else if (nel == 1 || (nel >= 2 &&
electron ->
pt() > z_el[1] ->
pt())) {
426 }
else if (nel >= 1 &&
electron ->
pt() > z_el[0] ->
pt()) {
429 }
else if (nel == 1 || (nel >= 2 &&
electron ->
pt() > z_el[1] ->
pt())) {
440 TLorentzVector el4v[2], elclus4v[2], eltrack4v[2];
441 bool inAcceptance[2];
442 for (
int i = 0;
i < 2;
i++) {
443 el4v[
i] = z_el[
i] -> p4();
453 eltrack4v[
i] = trackp -> p4();
459 if (
hits&& (iPixHits + iSCTHits > 3)){
461 double e = z_el[
i] -> caloCluster() ->
e();
463 double eta = trackp -> eta();
464 double phi = trackp -> phi();
467 double p = std::sqrt(
e*
e -
m*
m);
468 double pt =
p * 1/std::cosh(eta);
471 double pz =
p * std::tanh(eta);
473 el4v[
i] = TLorentzVector(
px,
py,
pz,
e);
479 TLorentzVector
z = el4v[0] + el4v[1];
481 bool z_passed_cuts =
true;
484 bool bothLoose =
false, bothMedium =
false, bothTight =
false, bothOQ =
false;
485 bool loose1 =
false, loose2 =
false, medium1 =
false, medium2 =
false, tight1 =
false, tight2 =
false;
487 z_el[0] -> passSelection(loose1,
"Loose");
488 z_el[1] -> passSelection(loose2,
"Loose");
489 z_el[0] -> passSelection(medium1,
"Medium");
490 z_el[1] -> passSelection(medium2,
"Medium");
491 z_el[0] -> passSelection(tight1,
"Tight");
492 z_el[1] -> passSelection(tight2,
"Tight");
495 if ( loose1 && loose2 ) bothLoose =
true;
496 if ( medium1 && medium2 ) bothMedium =
true;
497 if ( tight1 && tight2 ) bothTight =
true;
499 if (elclus4v[0].Perp()*(1./
GeV) <
m_PtCentCut || !inAcceptance[0]) z_passed_cuts =
false;
500 if (elclus4v[1].Perp()*(1./
GeV) <
m_PtCentCut || !inAcceptance[1]) z_passed_cuts =
false;
507 if (z_el[0] ->
charge() + z_el[1] ->
charge() != 0) OS =
false;
510 if(z_passed_cuts && OS){
532 if(z_passed_cuts && !OS){
572 electron -> passSelection(medium,
"Medium");
573 if (medium ==
false)
continue;
577 }
else if (nelcent >= 1 &&
electron ->
pt() > zfwd_el[0] ->
pt()) {
584 for (
auto fwd_electron : *fwd_electrons){
590 fwd_electron -> passSelection(tight,
"Tight");
591 if (tight ==
false)
continue;
594 zfwd_el[1] = fwd_electron;
595 }
else if (nelfwd >= 1 && fwd_electron ->
pt() > zfwd_el[1] ->
pt()) {
596 zfwd_el[1] = fwd_electron;
602 for (
auto fwd_electron : *fwd_electrons){
608 fwd_electron -> passSelection(loose,
"Loose");
609 if (loose ==
false)
continue;
612 zfwd_el[1] = fwd_electron;
613 }
else if (nelfwd >= 1 && fwd_electron ->
pt() > zfwd_el[1] ->
pt()) {
614 zfwd_el[1] = fwd_electron;
620 for (
auto fwd_electron : *fwd_electrons){
625 zfwd_el[1] = fwd_electron;
626 }
else if (nelfwd >= 1 && fwd_electron ->
pt() > zfwd_el[1] ->
pt()) {
627 zfwd_el[1] = fwd_electron;
635 TLorentzVector elfwd4v[2];
636 bool inAcceptance[2];
639 double e = zfwd_el[0] -> caloCluster() ->
e();
640 double etaclus = zfwd_el[0] -> caloCluster() -> eta();
641 double eta = zfwd_el[0] -> trackParticle() -> eta();
642 double phi = zfwd_el[0] -> trackParticle() -> phi();
644 float pt =
e * 1/std::cosh(eta);
647 float pz =
e * std::tanh(eta);
649 elfwd4v[0] = TLorentzVector(
px,
py,
pz,
e);
652 elfwd4v[1] = zfwd_el[1] -> p4();
655 bool tight_cent =
false, loose_fwd =
false, tight_fwd =
false;
657 float ptcone40_value = -100;
658 zfwd_el[0] -> passSelection(tight_cent,
"Tight");
659 zfwd_el[1] -> passSelection(loose_fwd,
"Loose");
660 zfwd_el[1] -> passSelection(tight_fwd,
"Tight");
665 TLorentzVector zfwd = elfwd4v[0] + elfwd4v[1];
667 bool zfwd_passed_cuts =
true;
668 if ( !(tight_cent && ptcone40_value < 2000.)) zfwd_passed_cuts =
false;
670 if (elfwd4v[0].Perp()*(1./
GeV) <
m_PtCentCut || !inAcceptance[0]) zfwd_passed_cuts =
false;
671 if (elfwd4v[1].Perp()*(1./
GeV) <
m_PtFwdCut || !inAcceptance[1]) zfwd_passed_cuts =
false;
673 if(zfwd_passed_cuts){
696 return StatusCode::SUCCESS;
712 return StatusCode::SUCCESS;
723 double dr_reco_truth = truth_electron -> p4().DeltaR(
electron -> p4());
741 for (
auto photon : *photons){
742 double dr_reco_truth = truth_electron -> p4().DeltaR(
photon -> p4());