9 #ifndef RECOTAUTAG_RECOTAU_AntiElectronIDCut2_H
10 #define RECOTAUTAG_RECOTAU_AntiElectronIDCut2_H
20 typedef std::pair<double, double>
pdouble;
29 float TauLeadChargedPFCandPt,
30 float TauLeadChargedPFCandEtaAtEcalEntrance,
31 float TauLeadPFChargedHadrEoP,
32 float TauHcal3x3OverPLead,
35 float TauGammaEnFrac);
39 float TauLeadChargedPFCandPt,
40 float TauLeadChargedPFCandEtaAtEcalEntrance,
41 float TauLeadPFChargedHadrEoP,
42 float TauHcal3x3OverPLead,
43 const std::vector<float>& GammasdEta,
44 const std::vector<float>& GammasdPhi,
45 const std::vector<float>& GammasPt);
49 float TauLeadChargedPFCandEtaAtEcalEntrance = -99.;
50 float TauLeadChargedPFCandPt = -99.;
51 const std::vector<reco::PFCandidatePtr>& signalPFCands = thePFTau.signalPFCands();
52 for (std::vector<reco::PFCandidatePtr>::const_iterator pfCandidate = signalPFCands.begin();
53 pfCandidate != signalPFCands.end();
56 if ((*pfCandidate)->trackRef().isNonnull())
57 track = (*pfCandidate)->trackRef().get();
58 else if ((*pfCandidate)->muonRef().isNonnull() && (*pfCandidate)->muonRef()->innerTrack().isNonnull())
59 track = (*pfCandidate)->muonRef()->innerTrack().get();
60 else if ((*pfCandidate)->muonRef().isNonnull() && (*pfCandidate)->muonRef()->globalTrack().isNonnull())
61 track = (*pfCandidate)->muonRef()->globalTrack().get();
62 else if ((*pfCandidate)->muonRef().isNonnull() && (*pfCandidate)->muonRef()->outerTrack().isNonnull())
63 track = (*pfCandidate)->muonRef()->outerTrack().get();
64 else if ((*pfCandidate)->gsfTrackRef().isNonnull())
65 track = (*pfCandidate)->gsfTrackRef().get();
67 if (track->
pt() > TauLeadChargedPFCandPt) {
68 TauLeadChargedPFCandEtaAtEcalEntrance = (*pfCandidate)->positionAtECALEntrance().
eta();
69 TauLeadChargedPFCandPt = track->
pt();
74 float TauPt = thePFTau.pt();
75 float TauEta = thePFTau.eta();
77 float TauLeadPFChargedHadrEoP = 0.;
78 if (thePFTau.leadPFChargedHadrCand()->p() > 0.) {
80 TauLeadPFChargedHadrEoP = thePFTau.leadPFChargedHadrCand()->ecalEnergy() / thePFTau.leadPFChargedHadrCand()->p();
83 std::vector<float> GammasdEta;
84 std::vector<float> GammasdPhi;
85 std::vector<float> GammasPt;
86 for (
unsigned i = 0;
i < thePFTau.signalGammaCands().size(); ++
i) {
88 if (thePFTau.leadChargedHadrCand().isNonnull()) {
89 GammasdEta.push_back(gamma->eta() - thePFTau.leadChargedHadrCand()->eta());
90 GammasdPhi.push_back(gamma->phi() - thePFTau.leadChargedHadrCand()->phi());
92 GammasdEta.push_back(gamma->eta() - thePFTau.eta());
93 GammasdPhi.push_back(gamma->phi() - thePFTau.phi());
95 GammasPt.push_back(gamma->pt());
98 float TauHcal3x3OverPLead = thePFTau.hcal3x3OverPLead();
102 TauLeadChargedPFCandPt,
103 TauLeadChargedPFCandEtaAtEcalEntrance,
104 TauLeadPFChargedHadrEoP,
112 float TauLeadPFChargedHadrEoP_max,
113 float TauHcal3x3OverPLead_max,
114 float TauGammaEtaMom_max,
115 float TauGammaPhiMom_max,
116 float TauGammaEnFrac_max);
119 float TauLeadPFChargedHadrEoP_max_1,
120 float TauLeadPFChargedHadrEoP_min_2,
121 float TauLeadPFChargedHadrEoP_max_2,
122 float TauHcal3x3OverPLead_max,
123 float TauGammaEtaMom_max,
124 float TauGammaPhiMom_max,
125 float TauGammaEnFrac_max);
140 for (
size_t i = 0;
i < etaCracks.size();
i++)
float TauGammaEtaMom_endcap_max_
bool Tau_applyCut_GammaPhiMom_
float TauLeadPFChargedHadrEoP_barrel_max_
std::pair< double, double > pdouble
tuple applyCut_HLTSpecific
void ApplyCut_EcalCrack(bool keepAll_, bool rejectAll_)
float TauGammaEnFrac_barrel_max_
float TauLeadPFChargedHadrEoP_endcap_max1_
bool Tau_applyCut_leadPFChargedHadrEoP_
double Discriminator(float TauPt, float TauEta, float TauLeadChargedPFCandPt, float TauLeadChargedPFCandEtaAtEcalEntrance, float TauLeadPFChargedHadrEoP, float TauHcal3x3OverPLead, float TauGammaEtaMom, float TauGammaPhiMom, float TauGammaEnFrac)
float TauLeadPFChargedHadrEoP_endcap_min2_
bool Tau_applyCut_GammaEnFrac_
tuple applyCut_leadPFChargedHadrEoP
double eta() const
pseudorapidity of momentum vector
void SetBarrelCutValues(float TauLeadPFChargedHadrEoP_min, float TauLeadPFChargedHadrEoP_max, float TauHcal3x3OverPLead_max, float TauGammaEtaMom_max, float TauGammaPhiMom_max, float TauGammaEnFrac_max)
double pt() const
track transverse momentum
tuple applyCut_GammaEnFrac
bool rejectAllInEcalCrack_
bool Tau_applyCut_hcal3x3OverPLead_
bool Tau_applyCut_GammaEtaMom_
std::vector< pdouble > ecalCracks_
float TauGammaPhiMom_endcap_max_
float TauGammaEtaMom_barrel_max_
bool Tau_applyCut_HLTSpecific_
bool isInEcalCrack(double eta) const
float TauLeadPFChargedHadrEoP_endcap_max2_
float TauGammaEnFrac_endcap_max_
float TauGammaPhiMom_barrel_max_
float TauLeadPFChargedHadrEoP_barrel_min_
tuple applyCut_hcal3x3OverPLead
float TauLeadPFChargedHadrEoP_endcap_min1_
void SetEndcapCutValues(float TauLeadPFChargedHadrEoP_min_1, float TauLeadPFChargedHadrEoP_max_1, float TauLeadPFChargedHadrEoP_min_2, float TauLeadPFChargedHadrEoP_max_2, float TauHcal3x3OverPLead_max, float TauGammaEtaMom_max, float TauGammaPhiMom_max, float TauGammaEnFrac_max)
float TauHcal3x3OverPLead_endcap_max_
void SetEcalCracks(const std::vector< pdouble > &etaCracks)
float TauHcal3x3OverPLead_barrel_max_
void ApplyCuts(bool applyCut_hcal3x3OverPLead, bool applyCut_leadPFChargedHadrEoP, bool applyCut_GammaEtaMom, bool applyCut_GammaPhiMom, bool applyCut_GammaEnFrac, bool applyCut_HLTSpecific)
double Discriminator(const T &thePFTau)
tuple applyCut_GammaPhiMom
tuple applyCut_GammaEtaMom