16 emFraction_maxValue_ = iConfig.
getParameter<
double>(
"EmFraction_maxValue");
17 applyCut_emFraction_ = iConfig.
getParameter<
bool>(
"ApplyCut_EmFraction");
18 hcalTotOverPLead_minValue_ = iConfig.
getParameter<
double>(
"HcalTotOverPLead_minValue");
19 applyCut_hcalTotOverPLead_ = iConfig.
getParameter<
bool>(
"ApplyCut_HcalTotOverPLead");
20 hcalMaxOverPLead_minValue_ = iConfig.
getParameter<
double>(
"HcalMaxOverPLead_minValue");
21 applyCut_hcalMaxOverPLead_ = iConfig.
getParameter<
bool>(
"ApplyCut_HcalMaxOverPLead");
22 hcal3x3OverPLead_minValue_ = iConfig.
getParameter<
double>(
"Hcal3x3OverPLead_minValue");
24 applyCut_hcal3x3OverPLead_ = iConfig.
getParameter<
bool>(
"ApplyCut_Hcal3x3OverPLead");
25 EOverPLead_minValue_ = iConfig.
getParameter<
double>(
"EOverPLead_minValue");
26 EOverPLead_maxValue_ = iConfig.
getParameter<
double>(
"EOverPLead_maxValue");
27 applyCut_EOverPLead_ = iConfig.
getParameter<
bool>(
"ApplyCut_EOverPLead");
28 bremsRecoveryEOverPLead_minValue_ = iConfig.
getParameter<
double>(
"BremsRecoveryEOverPLead_minValue");
29 bremsRecoveryEOverPLead_maxValue_ = iConfig.
getParameter<
double>(
"BremsRecoveryEOverPLead_maxValue");
31 applyCut_bremsRecoveryEOverPLead_ = iConfig.
getParameter<
bool>(
"ApplyCut_BremsRecoveryEOverPLead");
33 applyCut_electronPreID_ = iConfig.
getParameter<
bool>(
"ApplyCut_ElectronPreID");
35 applyCut_electronPreID_2D_ = iConfig.
getParameter<
bool>(
"ApplyCut_ElectronPreID_2D");
37 elecPreID0_EOverPLead_maxValue_ = iConfig.
getParameter<
double>(
"ElecPreID0_EOverPLead_maxValue");
38 elecPreID0_HOverPLead_minValue_ = iConfig.
getParameter<
double>(
"ElecPreID0_HOverPLead_minValue");
39 elecPreID1_EOverPLead_maxValue_ = iConfig.
getParameter<
double>(
"ElecPreID1_EOverPLead_maxValue");
40 elecPreID1_HOverPLead_minValue_ = iConfig.
getParameter<
double>(
"ElecPreID1_HOverPLead_minValue");
43 applyCut_PFElectronMVA_ = iConfig.
getParameter<
bool>(
"ApplyCut_PFElectronMVA");
44 pfelectronMVA_maxValue_ = iConfig.
getParameter<
double>(
"PFElectronMVA_maxValue");
48 applyCut_ecalCrack_ = iConfig.
getParameter<
bool>(
"ApplyCut_EcalCrackCut");
50 applyCut_bremCombined_ = iConfig.
getParameter<
bool>(
"ApplyCut_BremCombined");
51 bremCombined_fraction_ = iConfig.
getParameter<
double>(
"BremCombined_Fraction");
52 bremCombined_maxHOP_ = iConfig.
getParameter<
double>(
"BremCombined_HOP");
53 bremCombined_minMass_ = iConfig.
getParameter<
double>(
"BremCombined_Mass");
54 bremCombined_stripSize_ = iConfig.
getParameter<
double>(
"BremCombined_StripSize");
58 double discriminate(
const PFTauRef& pfTau)
override;
63 bool isInEcalCrack(
double)
const;
110 if( (*thePFTauRef).leadPFChargedHadrCand().isNull() )
117 myleadTk=(*thePFTauRef).leadPFChargedHadrCand()->trackRef();
118 math::XYZPointF myleadTkEcalPos = (*thePFTauRef).leadPFChargedHadrCand()->positionAtECALEntrance();
121 if (applyCut_ecalCrack_ && isInEcalCrack(myleadTkEcalPos.eta()))
128 bool decision =
false;
129 bool emfPass =
true, htotPass =
true, hmaxPass =
true;
130 bool h3x3Pass =
true, estripPass =
true, erecovPass =
true;
131 bool epreidPass =
true, epreid2DPass =
true;
132 bool mvaPass =
true, bremCombinedPass =
true;
134 if (applyCut_emFraction_) {
135 if ((*thePFTauRef).emFraction() > emFraction_maxValue_) {
139 if (applyCut_hcalTotOverPLead_) {
140 if ((*thePFTauRef).hcalTotOverPLead() < hcalTotOverPLead_minValue_) {
144 if (applyCut_hcalMaxOverPLead_) {
145 if ((*thePFTauRef).hcalMaxOverPLead() < hcalMaxOverPLead_minValue_) {
149 if (applyCut_hcal3x3OverPLead_) {
150 if ((*thePFTauRef).hcal3x3OverPLead() < hcal3x3OverPLead_minValue_) {
154 if (applyCut_EOverPLead_) {
155 if ((*thePFTauRef).ecalStripSumEOverPLead() > EOverPLead_minValue_ &&
156 (*thePFTauRef).ecalStripSumEOverPLead() < EOverPLead_maxValue_) {
162 if (applyCut_bremsRecoveryEOverPLead_) {
163 if ((*thePFTauRef).bremsRecoveryEOverPLead() > bremsRecoveryEOverPLead_minValue_ &&
164 (*thePFTauRef).bremsRecoveryEOverPLead() < bremsRecoveryEOverPLead_maxValue_) {
170 if (applyCut_electronPreID_) {
171 if ((*thePFTauRef).electronPreIDDecision()) {
178 if (applyCut_electronPreID_2D_) {
180 ((*thePFTauRef).electronPreIDDecision() &&
181 ((*thePFTauRef).ecalStripSumEOverPLead() < elecPreID1_EOverPLead_maxValue_ ||
182 (*thePFTauRef).hcal3x3OverPLead() > elecPreID1_HOverPLead_minValue_))
184 (!(*thePFTauRef).electronPreIDDecision() &&
185 ((*thePFTauRef).ecalStripSumEOverPLead() < elecPreID0_EOverPLead_maxValue_ ||
186 (*thePFTauRef).hcal3x3OverPLead() > elecPreID0_HOverPLead_minValue_))
190 epreid2DPass =
false;
194 if (applyCut_PFElectronMVA_) {
195 if ((*thePFTauRef).electronPreIDOutput()>pfelectronMVA_maxValue_) {
199 if (applyCut_bremCombined_) {
200 if (thePFTauRef->leadPFChargedHadrCand()->trackRef().
isNull()) {
204 if(thePFTauRef->signalPFChargedHadrCands().size()==1 && thePFTauRef->signalPFGammaCands().size()==0) {
205 if(thePFTauRef->leadPFChargedHadrCand()->hcalEnergy()/thePFTauRef->leadPFChargedHadrCand()->trackRef()->p()<bremCombined_maxHOP_)
206 bremCombinedPass =
false;
208 else if(thePFTauRef->signalPFChargedHadrCands().size()==1 && thePFTauRef->signalPFGammaCands().size()>0) {
212 for(
unsigned int Nc = 0 ;Nc < thePFTauRef->signalPFGammaCands().size();++Nc)
215 if(fabs(thePFTauRef->leadPFChargedHadrCand()->trackRef()->eta()-cand->eta())<bremCombined_stripSize_)
216 bremEnergy+=cand->energy();
217 emEnergy+=cand->energy();
219 if(bremEnergy/emEnergy>bremCombined_fraction_&&thePFTauRef->mass()<bremCombined_minMass_)
220 bremCombinedPass =
false;
225 decision = emfPass && htotPass && hmaxPass &&
226 h3x3Pass && estripPass && erecovPass && epreidPass && epreid2DPass && mvaPass &&bremCombinedPass;
228 return (decision ? 1. : 0.);
235 return (eta < 0.018 ||
236 (eta>0.423 && eta<0.461) ||
237 (eta>0.770 && eta<0.806) ||
238 (eta>1.127 && eta<1.163) ||
239 (eta>1.460 && eta<1.558));
double EOverPLead_minValue_
T getParameter(std::string const &) const
double elecPreID0_HOverPLead_minValue_
double elecPreID1_HOverPLead_minValue_
edm::InputTag PFTauProducer_
bool applyCut_electronPreID_2D_
double hcal3x3OverPLead_minValue_
double bremsRecoveryEOverPLead_maxValue_
bool isInEcalCrack(double) const
double pfelectronMVA_maxValue_
bool applyCut_bremCombined_
ROOT::Math::PositionVector3D< ROOT::Math::Cartesian3D< float > > XYZPointF
point in space with cartesian internal representation
bool applyCut_hcal3x3OverPLead_
bool isNonnull() const
Checks for non-null.
bool isNull() const
Checks for null.
~PFRecoTauDiscriminationAgainstElectron()
bool applyCut_bremsRecoveryEOverPLead_
double elecPreID1_EOverPLead_maxValue_
bool applyCut_emFraction_
double elecPreID0_EOverPLead_maxValue_
bool applyCut_electronPreID_
bool applyCut_hcalMaxOverPLead_
double bremCombined_maxHOP_
double bremCombined_minMass_
double emFraction_maxValue_
DEFINE_FWK_MODULE(CosmicTrackingParticleSelector)
double discriminate(const PFTauRef &pfTau) override
double hcalMaxOverPLead_minValue_
PFRecoTauDiscriminationAgainstElectron(const edm::ParameterSet &iConfig)
bool applyCut_EOverPLead_
double hcalTotOverPLead_minValue_
double bremsRecoveryEOverPLead_minValue_
bool applyCut_PFElectronMVA_
double EOverPLead_maxValue_
double bremCombined_stripSize_
bool applyCut_hcalTotOverPLead_
double bremCombined_fraction_