21 emFraction_maxValue_ = iConfig.
getParameter<
double>(
"EmFraction_maxValue");
22 applyCut_emFraction_ = iConfig.
getParameter<
bool>(
"ApplyCut_EmFraction");
23 hcalTotOverPLead_minValue_ = iConfig.
getParameter<
double>(
"HcalTotOverPLead_minValue");
24 applyCut_hcalTotOverPLead_ = iConfig.
getParameter<
bool>(
"ApplyCut_HcalTotOverPLead");
25 hcalMaxOverPLead_minValue_ = iConfig.
getParameter<
double>(
"HcalMaxOverPLead_minValue");
26 applyCut_hcalMaxOverPLead_ = iConfig.
getParameter<
bool>(
"ApplyCut_HcalMaxOverPLead");
27 hcal3x3OverPLead_minValue_ = iConfig.
getParameter<
double>(
"Hcal3x3OverPLead_minValue");
29 applyCut_hcal3x3OverPLead_ = iConfig.
getParameter<
bool>(
"ApplyCut_Hcal3x3OverPLead");
30 EOverPLead_minValue_ = iConfig.
getParameter<
double>(
"EOverPLead_minValue");
31 EOverPLead_maxValue_ = iConfig.
getParameter<
double>(
"EOverPLead_maxValue");
32 applyCut_EOverPLead_ = iConfig.
getParameter<
bool>(
"ApplyCut_EOverPLead");
33 bremsRecoveryEOverPLead_minValue_ = iConfig.
getParameter<
double>(
"BremsRecoveryEOverPLead_minValue");
34 bremsRecoveryEOverPLead_maxValue_ = iConfig.
getParameter<
double>(
"BremsRecoveryEOverPLead_maxValue");
36 applyCut_bremsRecoveryEOverPLead_ = iConfig.
getParameter<
bool>(
"ApplyCut_BremsRecoveryEOverPLead");
38 applyCut_electronPreID_ = iConfig.
getParameter<
bool>(
"ApplyCut_ElectronPreID");
40 applyCut_electronPreID_2D_ = iConfig.
getParameter<
bool>(
"ApplyCut_ElectronPreID_2D");
42 elecPreID0_EOverPLead_maxValue_ = iConfig.
getParameter<
double>(
"ElecPreID0_EOverPLead_maxValue");
43 elecPreID0_HOverPLead_minValue_ = iConfig.
getParameter<
double>(
"ElecPreID0_HOverPLead_minValue");
44 elecPreID1_EOverPLead_maxValue_ = iConfig.
getParameter<
double>(
"ElecPreID1_EOverPLead_maxValue");
45 elecPreID1_HOverPLead_minValue_ = iConfig.
getParameter<
double>(
"ElecPreID1_HOverPLead_minValue");
48 applyCut_PFElectronMVA_ = iConfig.
getParameter<
bool>(
"ApplyCut_PFElectronMVA");
49 pfelectronMVA_maxValue_ = iConfig.
getParameter<
double>(
"PFElectronMVA_maxValue");
53 applyCut_ecalCrack_ = iConfig.
getParameter<
bool>(
"ApplyCut_EcalCrackCut");
55 applyCut_bremCombined_ = iConfig.
getParameter<
bool>(
"ApplyCut_BremCombined");
56 bremCombined_fraction_ = iConfig.
getParameter<
double>(
"BremCombined_Fraction");
57 bremCombined_maxHOP_ = iConfig.
getParameter<
double>(
"BremCombined_HOP");
58 bremCombined_minMass_ = iConfig.
getParameter<
double>(
"BremCombined_Mass");
59 bremCombined_stripSize_ = iConfig.
getParameter<
double>(
"BremCombined_StripSize");
63 double discriminate(
const PFTauRef& pfTau)
const override;
67 ~PFRecoTauDiscriminationAgainstElectron()
override{}
70 bool isInEcalCrack(
double)
const;
72 bool applyCut_emFraction_;
73 double emFraction_maxValue_;
74 bool applyCut_hcalTotOverPLead_;
75 double hcalTotOverPLead_minValue_;
76 bool applyCut_hcalMaxOverPLead_;
77 double hcalMaxOverPLead_minValue_;
78 bool applyCut_hcal3x3OverPLead_;
79 double hcal3x3OverPLead_minValue_;
81 bool applyCut_EOverPLead_;
82 double EOverPLead_minValue_;
83 double EOverPLead_maxValue_;
84 bool applyCut_bremsRecoveryEOverPLead_;
85 double bremsRecoveryEOverPLead_minValue_;
86 double bremsRecoveryEOverPLead_maxValue_;
88 bool applyCut_electronPreID_;
90 bool applyCut_electronPreID_2D_;
91 double elecPreID0_EOverPLead_maxValue_;
92 double elecPreID0_HOverPLead_minValue_;
93 double elecPreID1_EOverPLead_maxValue_;
94 double elecPreID1_HOverPLead_minValue_;
96 bool applyCut_PFElectronMVA_;
97 double pfelectronMVA_maxValue_;
98 bool applyCut_ecalCrack_;
100 bool applyCut_bremCombined_;
101 double bremCombined_fraction_;
102 double bremCombined_maxHOP_;
103 double bremCombined_minMass_;
104 double bremCombined_stripSize_;
110 double PFRecoTauDiscriminationAgainstElectron::discriminate(
const PFTauRef& thePFTauRef)
const 117 if( (*thePFTauRef).leadPFChargedHadrCand().isNull() )
124 myleadTk=(*thePFTauRef).leadPFChargedHadrCand()->trackRef();
125 math::XYZPointF myleadTkEcalPos = (*thePFTauRef).leadPFChargedHadrCand()->positionAtECALEntrance();
128 if (applyCut_ecalCrack_ && isInEcalCrack(myleadTkEcalPos.eta()))
135 bool decision =
false;
136 bool emfPass =
true, htotPass =
true, hmaxPass =
true;
137 bool h3x3Pass =
true, estripPass =
true, erecovPass =
true;
138 bool epreidPass =
true, epreid2DPass =
true;
139 bool mvaPass =
true, bremCombinedPass =
true;
141 if (applyCut_emFraction_) {
142 if ((*thePFTauRef).emFraction() > emFraction_maxValue_) {
146 if (applyCut_hcalTotOverPLead_) {
147 if ((*thePFTauRef).hcalTotOverPLead() < hcalTotOverPLead_minValue_) {
151 if (applyCut_hcalMaxOverPLead_) {
152 if ((*thePFTauRef).hcalMaxOverPLead() < hcalMaxOverPLead_minValue_) {
156 if (applyCut_hcal3x3OverPLead_) {
157 if ((*thePFTauRef).hcal3x3OverPLead() < hcal3x3OverPLead_minValue_) {
161 if (applyCut_EOverPLead_) {
162 if ((*thePFTauRef).ecalStripSumEOverPLead() > EOverPLead_minValue_ &&
163 (*thePFTauRef).ecalStripSumEOverPLead() < EOverPLead_maxValue_) {
169 if (applyCut_bremsRecoveryEOverPLead_) {
170 if ((*thePFTauRef).bremsRecoveryEOverPLead() > bremsRecoveryEOverPLead_minValue_ &&
171 (*thePFTauRef).bremsRecoveryEOverPLead() < bremsRecoveryEOverPLead_maxValue_) {
177 if (applyCut_electronPreID_) {
178 if ((*thePFTauRef).electronPreIDDecision()) {
185 if (applyCut_electronPreID_2D_) {
187 ((*thePFTauRef).electronPreIDDecision() &&
188 ((*thePFTauRef).ecalStripSumEOverPLead() < elecPreID1_EOverPLead_maxValue_ ||
189 (*thePFTauRef).hcal3x3OverPLead() > elecPreID1_HOverPLead_minValue_))
191 (!(*thePFTauRef).electronPreIDDecision() &&
192 ((*thePFTauRef).ecalStripSumEOverPLead() < elecPreID0_EOverPLead_maxValue_ ||
193 (*thePFTauRef).hcal3x3OverPLead() > elecPreID0_HOverPLead_minValue_))
197 epreid2DPass =
false;
201 if (applyCut_PFElectronMVA_) {
202 if ((*thePFTauRef).electronPreIDOutput()>pfelectronMVA_maxValue_) {
206 if (applyCut_bremCombined_) {
207 if (thePFTauRef->leadPFChargedHadrCand()->trackRef().
isNull()) {
211 if(thePFTauRef->signalPFChargedHadrCands().size()==1 && thePFTauRef->signalPFGammaCands().empty()) {
212 if(thePFTauRef->leadPFChargedHadrCand()->hcalEnergy()/thePFTauRef->leadPFChargedHadrCand()->trackRef()->p()<bremCombined_maxHOP_)
213 bremCombinedPass =
false;
215 else if(thePFTauRef->signalPFChargedHadrCands().size()==1 && !thePFTauRef->signalPFGammaCands().empty()) {
219 for(
unsigned int Nc = 0 ;Nc < thePFTauRef->signalPFGammaCands().size();++Nc)
222 if(fabs(thePFTauRef->leadPFChargedHadrCand()->trackRef()->eta()-cand->
eta())<bremCombined_stripSize_)
223 bremEnergy+=cand->
energy();
226 if(bremEnergy/emEnergy>bremCombined_fraction_&&thePFTauRef->mass()<bremCombined_minMass_)
227 bremCombinedPass =
false;
232 decision = emfPass && htotPass && hmaxPass &&
233 h3x3Pass && estripPass && erecovPass && epreidPass && epreid2DPass && mvaPass &&bremCombinedPass;
235 return (decision ? 1. : 0.);
239 PFRecoTauDiscriminationAgainstElectron::isInEcalCrack(
double eta)
const 242 return (eta < 0.018 ||
243 (eta>0.423 && eta<0.461) ||
244 (eta>0.770 && eta<0.806) ||
245 (eta>1.127 && eta<1.163) ||
246 (eta>1.460 && eta<1.558));
254 desc.
add<
bool>(
"ApplyCut_ElectronPreID_2D",
false);
255 desc.
add<
double>(
"ElecPreID0_HOverPLead_minValue", 0.05);
257 desc.add<
bool>(
"ApplyCut_ElectronPreID",
false);
258 desc.add<
bool>(
"ApplyCut_HcalTotOverPLead",
false);
259 desc.add<
double>(
"EOverPLead_minValue", 0.8);
260 desc.add<
double>(
"ElecPreID1_EOverPLead_maxValue", 0.8);
261 desc.add<
double>(
"HcalMaxOverPLead_minValue", 0.1);
262 desc.add<
double>(
"BremCombined_HOP", 0.1);
263 desc.add<
bool>(
"ApplyCut_EmFraction",
false);
264 desc.add<
double>(
"EmFraction_maxValue", 0.9);
265 desc.add<
double>(
"BremCombined_Mass", 0.55);
266 desc.add<
bool>(
"ApplyCut_PFElectronMVA",
true);
267 desc.add<
double>(
"PFElectronMVA_maxValue", -0.1);
268 desc.add<
bool>(
"ApplyCut_HcalMaxOverPLead",
false);
274 psd1.
add<
double>(
"cut");
280 desc.
add<
bool>(
"ApplyCut_BremCombined",
false);
281 desc.add<
double>(
"Hcal3x3OverPLead_minValue", 0.1);
282 desc.add<
double>(
"ElecPreID1_HOverPLead_minValue", 0.15);
283 desc.add<
double>(
"ElecPreID0_EOverPLead_maxValue", 0.95);
284 desc.add<
double>(
"BremsRecoveryEOverPLead_minValue", 0.8);
285 desc.add<
bool>(
"ApplyCut_EcalCrackCut",
false);
286 desc.add<
double>(
"BremCombined_StripSize", 0.03);
287 desc.add<
double>(
"EOverPLead_maxValue", 1.8);
288 desc.add<
double>(
"HcalTotOverPLead_minValue", 0.1);
289 desc.add<
bool>(
"ApplyCut_BremsRecoveryEOverPLead",
false);
290 desc.add<
bool>(
"ApplyCut_Hcal3x3OverPLead",
false);
291 desc.add<
bool>(
"ApplyCut_EOverPLead",
false);
292 desc.add<
double>(
"BremCombined_Fraction", 0.99);
293 desc.add<
double>(
"BremsRecoveryEOverPLead_maxValue", 1.8);
294 descriptions.add(
"pfRecoTauDiscriminationAgainstElectron", desc);
T getParameter(std::string const &) const
ParameterDescriptionBase * addOptional(U const &iLabel, T const &value)
bool isNonnull() const
Checks for non-null.
double eta() const final
momentum pseudorapidity
ROOT::Math::PositionVector3D< ROOT::Math::Cartesian3D< float > > XYZPointF
point in space with cartesian internal representation
#define DEFINE_FWK_MODULE(type)
double energy() const final
energy
ParameterDescriptionBase * add(U const &iLabel, T const &value)
bool isNull() const
Checks for null.
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)