18 emFraction_maxValue_ = iConfig.
getParameter<
double>(
"EmFraction_maxValue");
19 applyCut_emFraction_ = iConfig.
getParameter<
bool>(
"ApplyCut_EmFraction");
20 hcalTotOverPLead_minValue_ = iConfig.
getParameter<
double>(
"HcalTotOverPLead_minValue");
21 applyCut_hcalTotOverPLead_ = iConfig.
getParameter<
bool>(
"ApplyCut_HcalTotOverPLead");
22 hcalMaxOverPLead_minValue_ = iConfig.
getParameter<
double>(
"HcalMaxOverPLead_minValue");
23 applyCut_hcalMaxOverPLead_ = iConfig.
getParameter<
bool>(
"ApplyCut_HcalMaxOverPLead");
24 hcal3x3OverPLead_minValue_ = iConfig.
getParameter<
double>(
"Hcal3x3OverPLead_minValue");
26 applyCut_hcal3x3OverPLead_ = iConfig.
getParameter<
bool>(
"ApplyCut_Hcal3x3OverPLead");
27 EOverPLead_minValue_ = iConfig.
getParameter<
double>(
"EOverPLead_minValue");
28 EOverPLead_maxValue_ = iConfig.
getParameter<
double>(
"EOverPLead_maxValue");
29 applyCut_EOverPLead_ = iConfig.
getParameter<
bool>(
"ApplyCut_EOverPLead");
30 bremsRecoveryEOverPLead_minValue_ = iConfig.
getParameter<
double>(
"BremsRecoveryEOverPLead_minValue");
31 bremsRecoveryEOverPLead_maxValue_ = iConfig.
getParameter<
double>(
"BremsRecoveryEOverPLead_maxValue");
33 applyCut_bremsRecoveryEOverPLead_ = iConfig.
getParameter<
bool>(
"ApplyCut_BremsRecoveryEOverPLead");
35 applyCut_electronPreID_ = iConfig.
getParameter<
bool>(
"ApplyCut_ElectronPreID");
37 applyCut_electronPreID_2D_ = iConfig.
getParameter<
bool>(
"ApplyCut_ElectronPreID_2D");
39 elecPreID0_EOverPLead_maxValue_ = iConfig.
getParameter<
double>(
"ElecPreID0_EOverPLead_maxValue");
40 elecPreID0_HOverPLead_minValue_ = iConfig.
getParameter<
double>(
"ElecPreID0_HOverPLead_minValue");
41 elecPreID1_EOverPLead_maxValue_ = iConfig.
getParameter<
double>(
"ElecPreID1_EOverPLead_maxValue");
42 elecPreID1_HOverPLead_minValue_ = iConfig.
getParameter<
double>(
"ElecPreID1_HOverPLead_minValue");
45 applyCut_PFElectronMVA_ = iConfig.
getParameter<
bool>(
"ApplyCut_PFElectronMVA");
46 pfelectronMVA_maxValue_ = iConfig.
getParameter<
double>(
"PFElectronMVA_maxValue");
50 applyCut_ecalCrack_ = iConfig.
getParameter<
bool>(
"ApplyCut_EcalCrackCut");
52 applyCut_bremCombined_ = iConfig.
getParameter<
bool>(
"ApplyCut_BremCombined");
53 bremCombined_fraction_ = iConfig.
getParameter<
double>(
"BremCombined_Fraction");
54 bremCombined_maxHOP_ = iConfig.
getParameter<
double>(
"BremCombined_HOP");
55 bremCombined_minMass_ = iConfig.
getParameter<
double>(
"BremCombined_Mass");
56 bremCombined_stripSize_ = iConfig.
getParameter<
double>(
"BremCombined_StripSize");
60 double discriminate(
const PFTauRef& pfTau)
const override;
62 ~PFRecoTauDiscriminationAgainstElectron(){}
65 bool isInEcalCrack(
double)
const;
67 bool applyCut_emFraction_;
68 double emFraction_maxValue_;
69 bool applyCut_hcalTotOverPLead_;
70 double hcalTotOverPLead_minValue_;
71 bool applyCut_hcalMaxOverPLead_;
72 double hcalMaxOverPLead_minValue_;
73 bool applyCut_hcal3x3OverPLead_;
74 double hcal3x3OverPLead_minValue_;
76 bool applyCut_EOverPLead_;
77 double EOverPLead_minValue_;
78 double EOverPLead_maxValue_;
79 bool applyCut_bremsRecoveryEOverPLead_;
80 double bremsRecoveryEOverPLead_minValue_;
81 double bremsRecoveryEOverPLead_maxValue_;
83 bool applyCut_electronPreID_;
85 bool applyCut_electronPreID_2D_;
86 double elecPreID0_EOverPLead_maxValue_;
87 double elecPreID0_HOverPLead_minValue_;
88 double elecPreID1_EOverPLead_maxValue_;
89 double elecPreID1_HOverPLead_minValue_;
91 bool applyCut_PFElectronMVA_;
92 double pfelectronMVA_maxValue_;
93 bool applyCut_ecalCrack_;
95 bool applyCut_bremCombined_;
96 double bremCombined_fraction_;
97 double bremCombined_maxHOP_;
98 double bremCombined_minMass_;
99 double bremCombined_stripSize_;
105 double PFRecoTauDiscriminationAgainstElectron::discriminate(
const PFTauRef& thePFTauRef)
const 112 if( (*thePFTauRef).leadPFChargedHadrCand().isNull() )
119 myleadTk=(*thePFTauRef).leadPFChargedHadrCand()->trackRef();
120 math::XYZPointF myleadTkEcalPos = (*thePFTauRef).leadPFChargedHadrCand()->positionAtECALEntrance();
123 if (applyCut_ecalCrack_ && isInEcalCrack(myleadTkEcalPos.eta()))
130 bool decision =
false;
131 bool emfPass =
true, htotPass =
true, hmaxPass =
true;
132 bool h3x3Pass =
true, estripPass =
true, erecovPass =
true;
133 bool epreidPass =
true, epreid2DPass =
true;
134 bool mvaPass =
true, bremCombinedPass =
true;
136 if (applyCut_emFraction_) {
137 if ((*thePFTauRef).emFraction() > emFraction_maxValue_) {
141 if (applyCut_hcalTotOverPLead_) {
142 if ((*thePFTauRef).hcalTotOverPLead() < hcalTotOverPLead_minValue_) {
146 if (applyCut_hcalMaxOverPLead_) {
147 if ((*thePFTauRef).hcalMaxOverPLead() < hcalMaxOverPLead_minValue_) {
151 if (applyCut_hcal3x3OverPLead_) {
152 if ((*thePFTauRef).hcal3x3OverPLead() < hcal3x3OverPLead_minValue_) {
156 if (applyCut_EOverPLead_) {
157 if ((*thePFTauRef).ecalStripSumEOverPLead() > EOverPLead_minValue_ &&
158 (*thePFTauRef).ecalStripSumEOverPLead() < EOverPLead_maxValue_) {
164 if (applyCut_bremsRecoveryEOverPLead_) {
165 if ((*thePFTauRef).bremsRecoveryEOverPLead() > bremsRecoveryEOverPLead_minValue_ &&
166 (*thePFTauRef).bremsRecoveryEOverPLead() < bremsRecoveryEOverPLead_maxValue_) {
172 if (applyCut_electronPreID_) {
173 if ((*thePFTauRef).electronPreIDDecision()) {
180 if (applyCut_electronPreID_2D_) {
182 ((*thePFTauRef).electronPreIDDecision() &&
183 ((*thePFTauRef).ecalStripSumEOverPLead() < elecPreID1_EOverPLead_maxValue_ ||
184 (*thePFTauRef).hcal3x3OverPLead() > elecPreID1_HOverPLead_minValue_))
186 (!(*thePFTauRef).electronPreIDDecision() &&
187 ((*thePFTauRef).ecalStripSumEOverPLead() < elecPreID0_EOverPLead_maxValue_ ||
188 (*thePFTauRef).hcal3x3OverPLead() > elecPreID0_HOverPLead_minValue_))
192 epreid2DPass =
false;
196 if (applyCut_PFElectronMVA_) {
197 if ((*thePFTauRef).electronPreIDOutput()>pfelectronMVA_maxValue_) {
201 if (applyCut_bremCombined_) {
202 if (thePFTauRef->leadPFChargedHadrCand()->trackRef().
isNull()) {
206 if(thePFTauRef->signalPFChargedHadrCands().size()==1 && thePFTauRef->signalPFGammaCands().size()==0) {
207 if(thePFTauRef->leadPFChargedHadrCand()->hcalEnergy()/thePFTauRef->leadPFChargedHadrCand()->trackRef()->p()<bremCombined_maxHOP_)
208 bremCombinedPass =
false;
210 else if(thePFTauRef->signalPFChargedHadrCands().size()==1 && thePFTauRef->signalPFGammaCands().size()>0) {
214 for(
unsigned int Nc = 0 ;Nc < thePFTauRef->signalPFGammaCands().size();++Nc)
217 if(fabs(thePFTauRef->leadPFChargedHadrCand()->trackRef()->eta()-cand->
eta())<bremCombined_stripSize_)
218 bremEnergy+=cand->
energy();
221 if(bremEnergy/emEnergy>bremCombined_fraction_&&thePFTauRef->mass()<bremCombined_minMass_)
222 bremCombinedPass =
false;
227 decision = emfPass && htotPass && hmaxPass &&
228 h3x3Pass && estripPass && erecovPass && epreidPass && epreid2DPass && mvaPass &&bremCombinedPass;
230 return (decision ? 1. : 0.);
234 PFRecoTauDiscriminationAgainstElectron::isInEcalCrack(
double eta)
const 237 return (eta < 0.018 ||
238 (eta>0.423 && eta<0.461) ||
239 (eta>0.770 && eta<0.806) ||
240 (eta>1.127 && eta<1.163) ||
241 (eta>1.460 && eta<1.558));
T getParameter(std::string const &) const
bool isNonnull() const
Checks for non-null.
virtual double eta() const final
momentum pseudorapidity
#define DEFINE_FWK_MODULE(type)
ROOT::Math::PositionVector3D< ROOT::Math::Cartesian3D< float > > XYZPointF
point in space with cartesian internal representation
virtual double energy() const final
energy
bool isNull() const
Checks for null.