CMS 3D CMS Logo

List of all members | Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes
PFRecoTauDiscriminationAgainstElectron2 Class Reference
Inheritance diagram for PFRecoTauDiscriminationAgainstElectron2:
TauDiscriminationProducerBase< TauType, TauDiscriminator > edm::stream::EDProducer<>

Public Member Functions

void beginEvent (const edm::Event &, const edm::EventSetup &) override
 
double discriminate (const PFTauRef &) const override
 
 PFRecoTauDiscriminationAgainstElectron2 (const edm::ParameterSet &iConfig)
 
 ~PFRecoTauDiscriminationAgainstElectron2 () override
 
- Public Member Functions inherited from TauDiscriminationProducerBase< TauType, TauDiscriminator >
virtual double discriminate (const TauRef &tau) const =0
 
virtual void endEvent (edm::Event &)
 
void produce (edm::Event &, const edm::EventSetup &) override
 
 TauDiscriminationProducerBase (const edm::ParameterSet &iConfig)
 
 TauDiscriminationProducerBase ()
 
 ~TauDiscriminationProducerBase () override
 
- Public Member Functions inherited from edm::stream::EDProducer<>
 EDProducer ()=default
 
bool hasAbilityToProduceInLumis () const final
 
bool hasAbilityToProduceInRuns () const final
 

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &descriptions)
 
- Static Public Member Functions inherited from TauDiscriminationProducerBase< TauType, TauDiscriminator >
static void fillProducerDescriptions (edm::ParameterSetDescription &desc)
 

Private Member Functions

bool isInEcalCrack (double) const
 

Private Attributes

bool applyCut_GammaEnFrac_
 
bool applyCut_GammaEtaMom_
 
bool applyCut_GammaPhiMom_
 
bool applyCut_hcal3x3OverPLead_
 
bool applyCut_HLTSpecific_
 
bool applyCut_leadPFChargedHadrEoP_
 
AntiElectronIDCut2cuts2_
 
std::vector< pdoubleetaCracks_
 
std::vector< std::string > etaCracks_string_
 
double GammaEnFrac_barrel_max_
 
double GammaEnFrac_endcap_max_
 
double GammaEtaMom_barrel_max_
 
double GammaEtaMom_endcap_max_
 
double GammaPhiMom_barrel_max_
 
double GammaPhiMom_endcap_max_
 
double Hcal3x3OverPLead_barrel_max_
 
double Hcal3x3OverPLead_endcap_max_
 
bool keepTausInEcalCrack_
 
double LeadPFChargedHadrEoP_barrel_max_
 
double LeadPFChargedHadrEoP_barrel_min_
 
double LeadPFChargedHadrEoP_endcap_max1_
 
double LeadPFChargedHadrEoP_endcap_max2_
 
double LeadPFChargedHadrEoP_endcap_min1_
 
double LeadPFChargedHadrEoP_endcap_min2_
 
bool rejectTausInEcalCrack_
 
int verbosity_
 

Additional Inherited Members

- Public Types inherited from TauDiscriminationProducerBase< TauType, TauDiscriminator >
typedef std::vector< TauType > TauCollection
 
typedef edm::Ref< TauCollectionTauRef
 
typedef edm::RefProd< TauCollectionTauRefProd
 
- Public Types inherited from edm::stream::EDProducer<>
typedef CacheContexts< T... > CacheTypes
 
typedef CacheTypes::GlobalCache GlobalCache
 
typedef AbilityChecker< T... > HasAbility
 
typedef CacheTypes::LuminosityBlockCache LuminosityBlockCache
 
typedef LuminosityBlockContextT< LuminosityBlockCache, RunCache, GlobalCacheLuminosityBlockContext
 
typedef CacheTypes::LuminosityBlockSummaryCache LuminosityBlockSummaryCache
 
typedef CacheTypes::RunCache RunCache
 
typedef RunContextT< RunCache, GlobalCacheRunContext
 
typedef CacheTypes::RunSummaryCache RunSummaryCache
 
- Protected Attributes inherited from TauDiscriminationProducerBase< TauType, TauDiscriminator >
std::string moduleLabel_
 
double prediscriminantFailValue_
 
edm::EDGetTokenT< TauCollectionTau_token
 
size_t tauIndex_
 
edm::InputTag TauProducer_
 

Detailed Description

Definition at line 32 of file PFRecoTauDiscriminationAgainstElectron2.cc.

Constructor & Destructor Documentation

PFRecoTauDiscriminationAgainstElectron2::PFRecoTauDiscriminationAgainstElectron2 ( const edm::ParameterSet iConfig)
inlineexplicit

Definition at line 34 of file PFRecoTauDiscriminationAgainstElectron2.cc.

References edm::ParameterSet::getParameter().

36  {
37 
38  LeadPFChargedHadrEoP_barrel_min_ = iConfig.getParameter<double>("LeadPFChargedHadrEoP_barrel_min");
39  LeadPFChargedHadrEoP_barrel_max_ = iConfig.getParameter<double>("LeadPFChargedHadrEoP_barrel_max");
40  Hcal3x3OverPLead_barrel_max_ = iConfig.getParameter<double>("Hcal3x3OverPLead_barrel_max");
41  GammaEtaMom_barrel_max_ = iConfig.getParameter<double>("GammaEtaMom_barrel_max");
42  GammaPhiMom_barrel_max_ = iConfig.getParameter<double>("GammaPhiMom_barrel_max");
43  GammaEnFrac_barrel_max_ = iConfig.getParameter<double>("GammaEnFrac_barrel_max");
44  LeadPFChargedHadrEoP_endcap_min1_ = iConfig.getParameter<double>("LeadPFChargedHadrEoP_endcap_min1");
45  LeadPFChargedHadrEoP_endcap_max1_ = iConfig.getParameter<double>("LeadPFChargedHadrEoP_endcap_max1");
46  LeadPFChargedHadrEoP_endcap_min2_ = iConfig.getParameter<double>("LeadPFChargedHadrEoP_endcap_min2");
47  LeadPFChargedHadrEoP_endcap_max2_ = iConfig.getParameter<double>("LeadPFChargedHadrEoP_endcap_max2");
48  Hcal3x3OverPLead_endcap_max_ = iConfig.getParameter<double>("Hcal3x3OverPLead_endcap_max");
49  GammaEtaMom_endcap_max_ = iConfig.getParameter<double>("GammaEtaMom_endcap_max");
50  GammaPhiMom_endcap_max_ = iConfig.getParameter<double>("GammaPhiMom_endcap_max");
51  GammaEnFrac_endcap_max_ = iConfig.getParameter<double>("GammaEnFrac_endcap_max");
52  keepTausInEcalCrack_ = iConfig.getParameter<bool>("keepTausInEcalCrack");
53  rejectTausInEcalCrack_ = iConfig.getParameter<bool>("rejectTausInEcalCrack");
54 
55  applyCut_hcal3x3OverPLead_ = iConfig.getParameter<bool>("applyCut_hcal3x3OverPLead");
56  applyCut_leadPFChargedHadrEoP_ = iConfig.getParameter<bool>("applyCut_leadPFChargedHadrEoP");
57  applyCut_GammaEtaMom_ = iConfig.getParameter<bool>("applyCut_GammaEtaMom");
58  applyCut_GammaPhiMom_ = iConfig.getParameter<bool>("applyCut_GammaPhiMom");
59  applyCut_GammaEnFrac_ = iConfig.getParameter<bool>("applyCut_GammaEnFrac");
60  applyCut_HLTSpecific_ = iConfig.getParameter<bool>("applyCut_HLTSpecific");
61 
62  etaCracks_string_ = iConfig.getParameter<std::vector<std::string>>("etaCracks");
63 
64  verbosity_ = iConfig.getParameter<int>("verbosity");
65 
66  cuts2_ = new AntiElectronIDCut2();
67  }
T getParameter(std::string const &) const
TauDiscriminationProducerBase< reco::PFTau, reco::PFTauDiscriminator > PFTauDiscriminationProducerBase
PFRecoTauDiscriminationAgainstElectron2::~PFRecoTauDiscriminationAgainstElectron2 ( )
inlineoverride

Definition at line 73 of file PFRecoTauDiscriminationAgainstElectron2.cc.

References fillDescriptions().

74  { }

Member Function Documentation

void PFRecoTauDiscriminationAgainstElectron2::beginEvent ( const edm::Event evt,
const edm::EventSetup es 
)
overridevirtual

Reimplemented from TauDiscriminationProducerBase< TauType, TauDiscriminator >.

Definition at line 112 of file PFRecoTauDiscriminationAgainstElectron2.cc.

113 {
120  );
121 
130  );
131 
133 
140  );
141  //Ecal cracks in eta
142  etaCracks_.clear();
143  TPRegexp regexpParser_range("([0-9.e+/-]+):([0-9.e+/-]+)");
144  for ( std::vector<std::string>::const_iterator etaCrack = etaCracks_string_.begin();
145  etaCrack != etaCracks_string_.end(); ++etaCrack ) {
146  TObjArray* subStrings = regexpParser_range.MatchS(etaCrack->data());
147  if ( subStrings->GetEntries() == 3 ) {
148  //std::cout << "substrings(1) = " << ((TObjString*)subStrings->At(1))->GetString() << std::endl;
149  double range_begin = ((TObjString*)subStrings->At(1))->GetString().Atof();
150  //std::cout << "substrings(2) = " << ((TObjString*)subStrings->At(2))->GetString() << std::endl;
151  double range_end = ((TObjString*)subStrings->At(2))->GetString().Atof();
152  etaCracks_.push_back(pdouble(range_begin, range_end));
153  }
154  }
155 
157 
158 }
void ApplyCut_EcalCrack(bool keepAll_, bool rejectAll_)
void SetBarrelCutValues(float TauLeadPFChargedHadrEoP_min, float TauLeadPFChargedHadrEoP_max, float TauHcal3x3OverPLead_max, float TauGammaEtaMom_max, float TauGammaPhiMom_max, float TauGammaEnFrac_max)
std::pair< double, double > pdouble
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)
void SetEcalCracks(const std::vector< pdouble > &etaCracks)
void ApplyCuts(bool applyCut_hcal3x3OverPLead, bool applyCut_leadPFChargedHadrEoP, bool applyCut_GammaEtaMom, bool applyCut_GammaPhiMom, bool applyCut_GammaEnFrac, bool applyCut_HLTSpecific)
double PFRecoTauDiscriminationAgainstElectron2::discriminate ( const PFTauRef thePFTauRef) const
override

Definition at line 160 of file PFRecoTauDiscriminationAgainstElectron2.cc.

References gather_cfg::cout, and mvaPFMET_leptons_cfi::discriminator.

161 {
162  double discriminator = 0.;
163 
164  // ensure tau has at least one charged object
165 
166  if( (*thePFTauRef).leadChargedHadrCand().isNull() )
167  {
168  return 0.;
169  }
170  else
171  {
172  discriminator = cuts2_->Discriminator(*thePFTauRef);
173  }
174 
175 
176  if ( verbosity_ ) {
177  std::cout<<" Taus : "<<TauProducer_<<std::endl;
178  std::cout << "<PFRecoTauDiscriminationAgainstElectron2::discriminate>:" << std::endl;
179  std::cout << " tau: Pt = " << thePFTauRef->pt() << ", eta = " << thePFTauRef->eta() << ", phi = " << thePFTauRef->phi() << std::endl;
180  std::cout << " discriminator value = " << discriminator << std::endl;
181  std::cout << " Prongs in tau: " << thePFTauRef->signalChargedHadrCands().size() << std::endl;
182  }
183 
184  return discriminator;
185 }
double Discriminator(float TauPt, float TauEta, float TauLeadChargedPFCandPt, float TauLeadChargedPFCandEtaAtEcalEntrance, float TauLeadPFChargedHadrEoP, float TauHcal3x3OverPLead, float TauGammaEtaMom, float TauGammaPhiMom, float TauGammaEnFrac)
void PFRecoTauDiscriminationAgainstElectron2::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
static

Definition at line 199 of file PFRecoTauDiscriminationAgainstElectron2.cc.

References edm::ConfigurationDescriptions::add(), edm::ParameterSetDescription::add(), edm::ParameterSetDescription::addOptional(), DEFINE_FWK_MODULE, and AlCaHLTBitMon_QueryRunRegistry::string.

199  {
200  // pfRecoTauDiscriminationAgainstElectron2
202  desc.add<bool>("rejectTausInEcalCrack", false);
203  desc.add<edm::InputTag>("PFTauProducer", edm::InputTag("pfRecoTauProducer"));
204  desc.add<bool>("applyCut_GammaEnFrac", true);
205  desc.add<bool>("applyCut_HLTSpecific", true);
206  desc.add<double>("GammaEnFrac_barrel_max", 0.15);
207  desc.add<bool>("keepTausInEcalCrack", true);
208  {
210  psd0.add<std::string>("BooleanOperator", "and");
211  {
213  psd1.add<double>("cut");
214  psd1.add<edm::InputTag>("Producer");
215  psd0.addOptional<edm::ParameterSetDescription>("leadTrack", psd1);
216  }
217  desc.add<edm::ParameterSetDescription>("Prediscriminants", psd0);
218  }
219  desc.add<bool>("applyCut_GammaPhiMom", false);
220  desc.add<double>("GammaPhiMom_endcap_max", 1.5);
221  desc.add<double>("GammaPhiMom_barrel_max", 1.5);
222  desc.add<bool>("applyCut_leadPFChargedHadrEoP", true);
223  desc.add<double>("LeadPFChargedHadrEoP_barrel_max", 1.01);
224  desc.add<double>("GammaEtaMom_endcap_max", 1.5);
225  desc.add<double>("GammaEtaMom_barrel_max", 1.5);
226  desc.add<double>("Hcal3x3OverPLead_endcap_max", 0.1);
227  desc.add<double>("LeadPFChargedHadrEoP_barrel_min", 0.99);
228  desc.add<double>("LeadPFChargedHadrEoP_endcap_max2", 1.01);
229  desc.add<double>("LeadPFChargedHadrEoP_endcap_min1", 0.7);
230  desc.add<double>("LeadPFChargedHadrEoP_endcap_min2", 0.99);
231  desc.add<double>("LeadPFChargedHadrEoP_endcap_max1", 1.3);
232  desc.add<int>("verbosity", 0);
233  desc.add<double>("GammaEnFrac_endcap_max", 0.2);
234  desc.add<bool>("applyCut_hcal3x3OverPLead", true);
235  desc.add<bool>("applyCut_GammaEtaMom", false);
236  desc.add<std::vector<std::string>>("etaCracks", {
237  "0.0:0.018",
238  "0.423:0.461",
239  "0.770:0.806",
240  "1.127:1.163",
241  "1.460:1.558",
242  });
243  desc.add<double>("Hcal3x3OverPLead_barrel_max", 0.2);
244  descriptions.add("pfRecoTauDiscriminationAgainstElectron2", desc);
245 }
ParameterDescriptionBase * addOptional(U const &iLabel, T const &value)
ParameterDescriptionBase * add(U const &iLabel, T const &value)
void add(std::string const &label, ParameterSetDescription const &psetDescription)
bool PFRecoTauDiscriminationAgainstElectron2::isInEcalCrack ( double  eta) const
private

Definition at line 188 of file PFRecoTauDiscriminationAgainstElectron2.cc.

189 {
190  eta = fabs(eta);
191  return (eta < 0.018 ||
192  (eta>0.423 && eta<0.461) ||
193  (eta>0.770 && eta<0.806) ||
194  (eta>1.127 && eta<1.163) ||
195  (eta>1.460 && eta<1.558));
196 }

Member Data Documentation

bool PFRecoTauDiscriminationAgainstElectron2::applyCut_GammaEnFrac_
private

Definition at line 106 of file PFRecoTauDiscriminationAgainstElectron2.cc.

bool PFRecoTauDiscriminationAgainstElectron2::applyCut_GammaEtaMom_
private

Definition at line 104 of file PFRecoTauDiscriminationAgainstElectron2.cc.

bool PFRecoTauDiscriminationAgainstElectron2::applyCut_GammaPhiMom_
private

Definition at line 105 of file PFRecoTauDiscriminationAgainstElectron2.cc.

bool PFRecoTauDiscriminationAgainstElectron2::applyCut_hcal3x3OverPLead_
private

Definition at line 102 of file PFRecoTauDiscriminationAgainstElectron2.cc.

bool PFRecoTauDiscriminationAgainstElectron2::applyCut_HLTSpecific_
private

Definition at line 107 of file PFRecoTauDiscriminationAgainstElectron2.cc.

bool PFRecoTauDiscriminationAgainstElectron2::applyCut_leadPFChargedHadrEoP_
private

Definition at line 103 of file PFRecoTauDiscriminationAgainstElectron2.cc.

AntiElectronIDCut2* PFRecoTauDiscriminationAgainstElectron2::cuts2_
private

Definition at line 82 of file PFRecoTauDiscriminationAgainstElectron2.cc.

std::vector<pdouble> PFRecoTauDiscriminationAgainstElectron2::etaCracks_
private

Definition at line 79 of file PFRecoTauDiscriminationAgainstElectron2.cc.

std::vector<std::string> PFRecoTauDiscriminationAgainstElectron2::etaCracks_string_
private

Definition at line 80 of file PFRecoTauDiscriminationAgainstElectron2.cc.

double PFRecoTauDiscriminationAgainstElectron2::GammaEnFrac_barrel_max_
private

Definition at line 89 of file PFRecoTauDiscriminationAgainstElectron2.cc.

double PFRecoTauDiscriminationAgainstElectron2::GammaEnFrac_endcap_max_
private

Definition at line 97 of file PFRecoTauDiscriminationAgainstElectron2.cc.

double PFRecoTauDiscriminationAgainstElectron2::GammaEtaMom_barrel_max_
private

Definition at line 87 of file PFRecoTauDiscriminationAgainstElectron2.cc.

double PFRecoTauDiscriminationAgainstElectron2::GammaEtaMom_endcap_max_
private

Definition at line 95 of file PFRecoTauDiscriminationAgainstElectron2.cc.

double PFRecoTauDiscriminationAgainstElectron2::GammaPhiMom_barrel_max_
private

Definition at line 88 of file PFRecoTauDiscriminationAgainstElectron2.cc.

double PFRecoTauDiscriminationAgainstElectron2::GammaPhiMom_endcap_max_
private

Definition at line 96 of file PFRecoTauDiscriminationAgainstElectron2.cc.

double PFRecoTauDiscriminationAgainstElectron2::Hcal3x3OverPLead_barrel_max_
private

Definition at line 86 of file PFRecoTauDiscriminationAgainstElectron2.cc.

double PFRecoTauDiscriminationAgainstElectron2::Hcal3x3OverPLead_endcap_max_
private

Definition at line 94 of file PFRecoTauDiscriminationAgainstElectron2.cc.

bool PFRecoTauDiscriminationAgainstElectron2::keepTausInEcalCrack_
private

Definition at line 99 of file PFRecoTauDiscriminationAgainstElectron2.cc.

double PFRecoTauDiscriminationAgainstElectron2::LeadPFChargedHadrEoP_barrel_max_
private

Definition at line 85 of file PFRecoTauDiscriminationAgainstElectron2.cc.

double PFRecoTauDiscriminationAgainstElectron2::LeadPFChargedHadrEoP_barrel_min_
private

Definition at line 84 of file PFRecoTauDiscriminationAgainstElectron2.cc.

double PFRecoTauDiscriminationAgainstElectron2::LeadPFChargedHadrEoP_endcap_max1_
private

Definition at line 91 of file PFRecoTauDiscriminationAgainstElectron2.cc.

double PFRecoTauDiscriminationAgainstElectron2::LeadPFChargedHadrEoP_endcap_max2_
private

Definition at line 93 of file PFRecoTauDiscriminationAgainstElectron2.cc.

double PFRecoTauDiscriminationAgainstElectron2::LeadPFChargedHadrEoP_endcap_min1_
private

Definition at line 90 of file PFRecoTauDiscriminationAgainstElectron2.cc.

double PFRecoTauDiscriminationAgainstElectron2::LeadPFChargedHadrEoP_endcap_min2_
private

Definition at line 92 of file PFRecoTauDiscriminationAgainstElectron2.cc.

bool PFRecoTauDiscriminationAgainstElectron2::rejectTausInEcalCrack_
private

Definition at line 100 of file PFRecoTauDiscriminationAgainstElectron2.cc.

int PFRecoTauDiscriminationAgainstElectron2::verbosity_
private

Definition at line 109 of file PFRecoTauDiscriminationAgainstElectron2.cc.