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");
47 applyCut_PFElectronMVA_ = iConfig.
getParameter<
bool>(
"ApplyCut_PFElectronMVA");
48 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");
59 double discriminate(
const PFTauRef& pfTau)
const override;
63 ~PFRecoTauDiscriminationAgainstElectron()
override {}
66 bool isInEcalCrack(
double)
const;
68 bool applyCut_emFraction_;
69 double emFraction_maxValue_;
70 bool applyCut_hcalTotOverPLead_;
71 double hcalTotOverPLead_minValue_;
72 bool applyCut_hcalMaxOverPLead_;
73 double hcalMaxOverPLead_minValue_;
74 bool applyCut_hcal3x3OverPLead_;
75 double hcal3x3OverPLead_minValue_;
77 bool applyCut_EOverPLead_;
78 double EOverPLead_minValue_;
79 double EOverPLead_maxValue_;
80 bool applyCut_bremsRecoveryEOverPLead_;
81 double bremsRecoveryEOverPLead_minValue_;
82 double bremsRecoveryEOverPLead_maxValue_;
84 bool applyCut_electronPreID_;
86 bool applyCut_electronPreID_2D_;
87 double elecPreID0_EOverPLead_maxValue_;
88 double elecPreID0_HOverPLead_minValue_;
89 double elecPreID1_EOverPLead_maxValue_;
90 double elecPreID1_HOverPLead_minValue_;
92 bool applyCut_PFElectronMVA_;
93 double pfelectronMVA_maxValue_;
94 bool applyCut_ecalCrack_;
96 bool applyCut_bremCombined_;
97 double bremCombined_fraction_;
98 double bremCombined_maxHOP_;
99 double bremCombined_minMass_;
100 double bremCombined_stripSize_;
103 double PFRecoTauDiscriminationAgainstElectron::discriminate(
const PFTauRef& thePFTauRef)
const {
106 if ((*thePFTauRef).leadPFChargedHadrCand().isNull()) {
111 myleadTk = (*thePFTauRef).leadPFChargedHadrCand()->trackRef();
112 math::XYZPointF myleadTkEcalPos = (*thePFTauRef).leadPFChargedHadrCand()->positionAtECALEntrance();
114 if (applyCut_ecalCrack_ && isInEcalCrack(myleadTkEcalPos.eta())) {
120 bool decision =
false;
121 bool emfPass =
true, htotPass =
true, hmaxPass =
true;
122 bool h3x3Pass =
true, estripPass =
true, erecovPass =
true;
123 bool epreidPass =
true, epreid2DPass =
true;
124 bool mvaPass =
true, bremCombinedPass =
true;
126 if (applyCut_emFraction_) {
127 if ((*thePFTauRef).emFraction() > emFraction_maxValue_) {
131 if (applyCut_hcalTotOverPLead_) {
132 if ((*thePFTauRef).hcalTotOverPLead() < hcalTotOverPLead_minValue_) {
136 if (applyCut_hcalMaxOverPLead_) {
137 if ((*thePFTauRef).hcalMaxOverPLead() < hcalMaxOverPLead_minValue_) {
141 if (applyCut_hcal3x3OverPLead_) {
142 if ((*thePFTauRef).hcal3x3OverPLead() < hcal3x3OverPLead_minValue_) {
146 if (applyCut_EOverPLead_) {
147 if ((*thePFTauRef).ecalStripSumEOverPLead() > EOverPLead_minValue_ &&
148 (*thePFTauRef).ecalStripSumEOverPLead() < EOverPLead_maxValue_) {
154 if (applyCut_bremsRecoveryEOverPLead_) {
155 if ((*thePFTauRef).bremsRecoveryEOverPLead() > bremsRecoveryEOverPLead_minValue_ &&
156 (*thePFTauRef).bremsRecoveryEOverPLead() < bremsRecoveryEOverPLead_maxValue_) {
162 if (applyCut_electronPreID_) {
163 if ((*thePFTauRef).electronPreIDDecision()) {
170 if (applyCut_electronPreID_2D_) {
171 if (((*thePFTauRef).electronPreIDDecision() &&
172 ((*thePFTauRef).ecalStripSumEOverPLead() < elecPreID1_EOverPLead_maxValue_ ||
173 (*thePFTauRef).hcal3x3OverPLead() > elecPreID1_HOverPLead_minValue_)) ||
174 (!(*thePFTauRef).electronPreIDDecision() &&
175 ((*thePFTauRef).ecalStripSumEOverPLead() < elecPreID0_EOverPLead_maxValue_ ||
176 (*thePFTauRef).hcal3x3OverPLead() > elecPreID0_HOverPLead_minValue_))) {
179 epreid2DPass =
false;
183 if (applyCut_PFElectronMVA_) {
184 if ((*thePFTauRef).electronPreIDOutput() > pfelectronMVA_maxValue_) {
188 if (applyCut_bremCombined_) {
189 if (thePFTauRef->leadPFChargedHadrCand()->trackRef().
isNull()) {
193 if (thePFTauRef->signalPFChargedHadrCands().size() == 1 && thePFTauRef->signalPFGammaCands().empty()) {
194 if (thePFTauRef->leadPFChargedHadrCand()->hcalEnergy() / thePFTauRef->leadPFChargedHadrCand()->trackRef()->p() <
195 bremCombined_maxHOP_)
196 bremCombinedPass =
false;
197 }
else if (thePFTauRef->signalPFChargedHadrCands().size() == 1 && !thePFTauRef->signalPFGammaCands().empty()) {
201 for (
unsigned int Nc = 0; Nc < thePFTauRef->signalPFGammaCands().size(); ++Nc) {
203 if (fabs(thePFTauRef->leadPFChargedHadrCand()->trackRef()->eta() -
cand->eta()) < bremCombined_stripSize_)
205 emEnergy +=
cand->energy();
207 if (
bremEnergy / emEnergy > bremCombined_fraction_ && thePFTauRef->mass() < bremCombined_minMass_)
208 bremCombinedPass =
false;
212 decision = emfPass && htotPass && hmaxPass && h3x3Pass && estripPass && erecovPass && epreidPass && epreid2DPass &&
213 mvaPass && bremCombinedPass;
215 return (decision ? 1. : 0.);
218 bool PFRecoTauDiscriminationAgainstElectron::isInEcalCrack(
double eta)
const {
220 return (
eta < 0.018 || (
eta > 0.423 &&
eta < 0.461) || (
eta > 0.770 &&
eta < 0.806) ||
221 (
eta > 1.127 &&
eta < 1.163) || (
eta > 1.460 &&
eta < 1.558));
228 desc.add<
bool>(
"ApplyCut_ElectronPreID_2D",
false);
229 desc.add<
double>(
"ElecPreID0_HOverPLead_minValue", 0.05);
231 desc.add<
bool>(
"ApplyCut_ElectronPreID",
false);
232 desc.add<
bool>(
"ApplyCut_HcalTotOverPLead",
false);
233 desc.add<
double>(
"EOverPLead_minValue", 0.8);
234 desc.add<
double>(
"ElecPreID1_EOverPLead_maxValue", 0.8);
235 desc.add<
double>(
"HcalMaxOverPLead_minValue", 0.1);
236 desc.add<
double>(
"BremCombined_HOP", 0.1);
237 desc.add<
bool>(
"ApplyCut_EmFraction",
false);
238 desc.add<
double>(
"EmFraction_maxValue", 0.9);
239 desc.add<
double>(
"BremCombined_Mass", 0.55);
240 desc.add<
bool>(
"ApplyCut_PFElectronMVA",
true);
241 desc.add<
double>(
"PFElectronMVA_maxValue", -0.1);
242 desc.add<
bool>(
"ApplyCut_HcalMaxOverPLead",
false);
248 psd1.
add<
double>(
"cut");
254 desc.add<
bool>(
"ApplyCut_BremCombined",
false);
255 desc.add<
double>(
"Hcal3x3OverPLead_minValue", 0.1);
256 desc.add<
double>(
"ElecPreID1_HOverPLead_minValue", 0.15);
257 desc.add<
double>(
"ElecPreID0_EOverPLead_maxValue", 0.95);
258 desc.add<
double>(
"BremsRecoveryEOverPLead_minValue", 0.8);
259 desc.add<
bool>(
"ApplyCut_EcalCrackCut",
false);
260 desc.add<
double>(
"BremCombined_StripSize", 0.03);
261 desc.add<
double>(
"EOverPLead_maxValue", 1.8);
262 desc.add<
double>(
"HcalTotOverPLead_minValue", 0.1);
263 desc.add<
bool>(
"ApplyCut_BremsRecoveryEOverPLead",
false);
264 desc.add<
bool>(
"ApplyCut_Hcal3x3OverPLead",
false);
265 desc.add<
bool>(
"ApplyCut_EOverPLead",
false);
266 desc.add<
double>(
"BremCombined_Fraction", 0.99);
267 desc.add<
double>(
"BremsRecoveryEOverPLead_maxValue", 1.8);
268 descriptions.add(
"pfRecoTauDiscriminationAgainstElectron",
desc);
T getParameter(std::string const &) const
ParameterDescriptionBase * addOptional(U const &iLabel, T const &value)
#define DEFINE_FWK_MODULE(type)
bool isNonnull() const
Checks for non-null.
ROOT::Math::PositionVector3D< ROOT::Math::Cartesian3D< float > > XYZPointF
point in space with cartesian internal representation
ParameterDescriptionBase * add(U const &iLabel, T const &value)
bool isNull() const
Checks for null.
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)