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, TauDiscriminatorDataType, ConsumeType > 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, TauDiscriminatorDataType, ConsumeType >
virtual TauDiscriminatorDataType 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
 
 EDProducer (const EDProducer &)=delete
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginProcessBlocks () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndProcessBlocks () const final
 
bool hasAbilityToProduceInEndRuns () const final
 
const EDProduceroperator= (const EDProducer &)=delete
 

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &descriptions)
 
- Static Public Member Functions inherited from TauDiscriminationProducerBase< TauType, TauDiscriminator, TauDiscriminatorDataType, ConsumeType >
static void fillProducerDescriptions (edm::ParameterSetDescription &desc)
 
static std::string getTauTypeString ()
 helper method to retrieve tau type name, e.g. to build correct cfi getter More...
 

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, TauDiscriminatorDataType, ConsumeType >
typedef std::vector< TauType > TauCollection
 
typedef edm::Ref< TauCollectionTauRef
 
typedef edm::RefProd< TauCollectionTauRefProd
 
- Public Types inherited from edm::stream::EDProducer<>
using CacheTypes = CacheContexts< T... >
 
using GlobalCache = typename CacheTypes::GlobalCache
 
using HasAbility = AbilityChecker< T... >
 
using InputProcessBlockCache = typename CacheTypes::InputProcessBlockCache
 
using LuminosityBlockCache = typename CacheTypes::LuminosityBlockCache
 
using LuminosityBlockContext = LuminosityBlockContextT< LuminosityBlockCache, RunCache, GlobalCache >
 
using LuminosityBlockSummaryCache = typename CacheTypes::LuminosityBlockSummaryCache
 
using RunCache = typename CacheTypes::RunCache
 
using RunContext = RunContextT< RunCache, GlobalCache >
 
using RunSummaryCache = typename CacheTypes::RunSummaryCache
 
- Protected Attributes inherited from TauDiscriminationProducerBase< TauType, TauDiscriminator, TauDiscriminatorDataType, ConsumeType >
std::string moduleLabel_
 
double prediscriminantFailValue_
 
edm::EDGetTokenT< TauCollectionTau_token
 
size_t tauIndex_
 
edm::InputTag TauProducer_
 

Detailed Description

Definition at line 33 of file PFRecoTauDiscriminationAgainstElectron2.cc.

Constructor & Destructor Documentation

◆ PFRecoTauDiscriminationAgainstElectron2()

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

Definition at line 35 of file PFRecoTauDiscriminationAgainstElectron2.cc.

References edm::ParameterSet::getParameter().

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

◆ ~PFRecoTauDiscriminationAgainstElectron2()

PFRecoTauDiscriminationAgainstElectron2::~PFRecoTauDiscriminationAgainstElectron2 ( )
inlineoverride

Definition at line 72 of file PFRecoTauDiscriminationAgainstElectron2.cc.

72 {}

Member Function Documentation

◆ beginEvent()

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

Reimplemented from TauDiscriminationProducerBase< TauType, TauDiscriminator, TauDiscriminatorDataType, ConsumeType >.

Definition at line 111 of file PFRecoTauDiscriminationAgainstElectron2.cc.

111  {
118 
127 
129 
136  //Ecal cracks in eta
137  etaCracks_.clear();
138  TPRegexp regexpParser_range("([0-9.e+/-]+):([0-9.e+/-]+)");
139  for (std::vector<std::string>::const_iterator etaCrack = etaCracks_string_.begin();
140  etaCrack != etaCracks_string_.end();
141  ++etaCrack) {
142  TObjArray* subStrings = regexpParser_range.MatchS(etaCrack->data());
143  if (subStrings->GetEntries() == 3) {
144  //std::cout << "substrings(1) = " << ((TObjString*)subStrings->At(1))->GetString() << std::endl;
145  double range_begin = ((TObjString*)subStrings->At(1))->GetString().Atof();
146  //std::cout << "substrings(2) = " << ((TObjString*)subStrings->At(2))->GetString() << std::endl;
147  double range_end = ((TObjString*)subStrings->At(2))->GetString().Atof();
148  etaCracks_.push_back(pdouble(range_begin, range_end));
149  }
150  }
151 
153 }
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)

◆ discriminate()

double PFRecoTauDiscriminationAgainstElectron2::discriminate ( const PFTauRef thePFTauRef) const
override

Definition at line 155 of file PFRecoTauDiscriminationAgainstElectron2.cc.

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

155  {
156  double discriminator = 0.;
157 
158  // ensure tau has at least one charged object
159 
160  if ((*thePFTauRef).leadChargedHadrCand().isNull()) {
161  return 0.;
162  } else {
163  discriminator = cuts2_->Discriminator(*thePFTauRef);
164  }
165 
166  if (verbosity_) {
167  std::cout << " Taus : " << TauProducer_ << std::endl;
168  std::cout << "<PFRecoTauDiscriminationAgainstElectron2::discriminate>:" << std::endl;
169  std::cout << " tau: Pt = " << thePFTauRef->pt() << ", eta = " << thePFTauRef->eta()
170  << ", phi = " << thePFTauRef->phi() << std::endl;
171  std::cout << " discriminator value = " << discriminator << std::endl;
172  std::cout << " Prongs in tau: " << thePFTauRef->signalChargedHadrCands().size() << std::endl;
173  }
174 
175  return discriminator;
176 }
double Discriminator(float TauPt, float TauEta, float TauLeadChargedPFCandPt, float TauLeadChargedPFCandEtaAtEcalEntrance, float TauLeadPFChargedHadrEoP, float TauHcal3x3OverPLead, float TauGammaEtaMom, float TauGammaPhiMom, float TauGammaEnFrac)

◆ fillDescriptions()

void PFRecoTauDiscriminationAgainstElectron2::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
static

Definition at line 184 of file PFRecoTauDiscriminationAgainstElectron2.cc.

References edm::ConfigurationDescriptions::add(), edm::ParameterSetDescription::add(), edm::ParameterSetDescription::addOptional(), submitPVResolutionJobs::desc, HLT_2022v14_cff::InputTag, and AlCaHLTBitMon_QueryRunRegistry::string.

184  {
185  // pfRecoTauDiscriminationAgainstElectron2
187  desc.add<bool>("rejectTausInEcalCrack", false);
188  desc.add<edm::InputTag>("PFTauProducer", edm::InputTag("pfRecoTauProducer"));
189  desc.add<bool>("applyCut_GammaEnFrac", true);
190  desc.add<bool>("applyCut_HLTSpecific", true);
191  desc.add<double>("GammaEnFrac_barrel_max", 0.15);
192  desc.add<bool>("keepTausInEcalCrack", true);
193  {
195  psd0.add<std::string>("BooleanOperator", "and");
196  {
198  psd1.add<double>("cut");
199  psd1.add<edm::InputTag>("Producer");
200  psd0.addOptional<edm::ParameterSetDescription>("leadTrack", psd1);
201  }
202  desc.add<edm::ParameterSetDescription>("Prediscriminants", psd0);
203  }
204  desc.add<bool>("applyCut_GammaPhiMom", false);
205  desc.add<double>("GammaPhiMom_endcap_max", 1.5);
206  desc.add<double>("GammaPhiMom_barrel_max", 1.5);
207  desc.add<bool>("applyCut_leadPFChargedHadrEoP", true);
208  desc.add<double>("LeadPFChargedHadrEoP_barrel_max", 1.01);
209  desc.add<double>("GammaEtaMom_endcap_max", 1.5);
210  desc.add<double>("GammaEtaMom_barrel_max", 1.5);
211  desc.add<double>("Hcal3x3OverPLead_endcap_max", 0.1);
212  desc.add<double>("LeadPFChargedHadrEoP_barrel_min", 0.99);
213  desc.add<double>("LeadPFChargedHadrEoP_endcap_max2", 1.01);
214  desc.add<double>("LeadPFChargedHadrEoP_endcap_min1", 0.7);
215  desc.add<double>("LeadPFChargedHadrEoP_endcap_min2", 0.99);
216  desc.add<double>("LeadPFChargedHadrEoP_endcap_max1", 1.3);
217  desc.add<int>("verbosity", 0);
218  desc.add<double>("GammaEnFrac_endcap_max", 0.2);
219  desc.add<bool>("applyCut_hcal3x3OverPLead", true);
220  desc.add<bool>("applyCut_GammaEtaMom", false);
221  desc.add<std::vector<std::string>>("etaCracks",
222  {
223  "0.0:0.018",
224  "0.423:0.461",
225  "0.770:0.806",
226  "1.127:1.163",
227  "1.460:1.558",
228  });
229  desc.add<double>("Hcal3x3OverPLead_barrel_max", 0.2);
230  descriptions.add("pfRecoTauDiscriminationAgainstElectron2", desc);
231 }
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)

◆ isInEcalCrack()

bool PFRecoTauDiscriminationAgainstElectron2::isInEcalCrack ( double  eta) const
private

Definition at line 178 of file PFRecoTauDiscriminationAgainstElectron2.cc.

References PVValHelper::eta.

178  {
179  eta = fabs(eta);
180  return (eta < 0.018 || (eta > 0.423 && eta < 0.461) || (eta > 0.770 && eta < 0.806) || (eta > 1.127 && eta < 1.163) ||
181  (eta > 1.460 && eta < 1.558));
182 }

Member Data Documentation

◆ applyCut_GammaEnFrac_

bool PFRecoTauDiscriminationAgainstElectron2::applyCut_GammaEnFrac_
private

Definition at line 105 of file PFRecoTauDiscriminationAgainstElectron2.cc.

◆ applyCut_GammaEtaMom_

bool PFRecoTauDiscriminationAgainstElectron2::applyCut_GammaEtaMom_
private

Definition at line 103 of file PFRecoTauDiscriminationAgainstElectron2.cc.

◆ applyCut_GammaPhiMom_

bool PFRecoTauDiscriminationAgainstElectron2::applyCut_GammaPhiMom_
private

Definition at line 104 of file PFRecoTauDiscriminationAgainstElectron2.cc.

◆ applyCut_hcal3x3OverPLead_

bool PFRecoTauDiscriminationAgainstElectron2::applyCut_hcal3x3OverPLead_
private

Definition at line 101 of file PFRecoTauDiscriminationAgainstElectron2.cc.

◆ applyCut_HLTSpecific_

bool PFRecoTauDiscriminationAgainstElectron2::applyCut_HLTSpecific_
private

Definition at line 106 of file PFRecoTauDiscriminationAgainstElectron2.cc.

◆ applyCut_leadPFChargedHadrEoP_

bool PFRecoTauDiscriminationAgainstElectron2::applyCut_leadPFChargedHadrEoP_
private

Definition at line 102 of file PFRecoTauDiscriminationAgainstElectron2.cc.

◆ cuts2_

AntiElectronIDCut2* PFRecoTauDiscriminationAgainstElectron2::cuts2_
private

Definition at line 81 of file PFRecoTauDiscriminationAgainstElectron2.cc.

◆ etaCracks_

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

Definition at line 78 of file PFRecoTauDiscriminationAgainstElectron2.cc.

◆ etaCracks_string_

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

Definition at line 79 of file PFRecoTauDiscriminationAgainstElectron2.cc.

◆ GammaEnFrac_barrel_max_

double PFRecoTauDiscriminationAgainstElectron2::GammaEnFrac_barrel_max_
private

Definition at line 88 of file PFRecoTauDiscriminationAgainstElectron2.cc.

◆ GammaEnFrac_endcap_max_

double PFRecoTauDiscriminationAgainstElectron2::GammaEnFrac_endcap_max_
private

Definition at line 96 of file PFRecoTauDiscriminationAgainstElectron2.cc.

◆ GammaEtaMom_barrel_max_

double PFRecoTauDiscriminationAgainstElectron2::GammaEtaMom_barrel_max_
private

Definition at line 86 of file PFRecoTauDiscriminationAgainstElectron2.cc.

◆ GammaEtaMom_endcap_max_

double PFRecoTauDiscriminationAgainstElectron2::GammaEtaMom_endcap_max_
private

Definition at line 94 of file PFRecoTauDiscriminationAgainstElectron2.cc.

◆ GammaPhiMom_barrel_max_

double PFRecoTauDiscriminationAgainstElectron2::GammaPhiMom_barrel_max_
private

Definition at line 87 of file PFRecoTauDiscriminationAgainstElectron2.cc.

◆ GammaPhiMom_endcap_max_

double PFRecoTauDiscriminationAgainstElectron2::GammaPhiMom_endcap_max_
private

Definition at line 95 of file PFRecoTauDiscriminationAgainstElectron2.cc.

◆ Hcal3x3OverPLead_barrel_max_

double PFRecoTauDiscriminationAgainstElectron2::Hcal3x3OverPLead_barrel_max_
private

Definition at line 85 of file PFRecoTauDiscriminationAgainstElectron2.cc.

◆ Hcal3x3OverPLead_endcap_max_

double PFRecoTauDiscriminationAgainstElectron2::Hcal3x3OverPLead_endcap_max_
private

Definition at line 93 of file PFRecoTauDiscriminationAgainstElectron2.cc.

◆ keepTausInEcalCrack_

bool PFRecoTauDiscriminationAgainstElectron2::keepTausInEcalCrack_
private

Definition at line 98 of file PFRecoTauDiscriminationAgainstElectron2.cc.

◆ LeadPFChargedHadrEoP_barrel_max_

double PFRecoTauDiscriminationAgainstElectron2::LeadPFChargedHadrEoP_barrel_max_
private

Definition at line 84 of file PFRecoTauDiscriminationAgainstElectron2.cc.

◆ LeadPFChargedHadrEoP_barrel_min_

double PFRecoTauDiscriminationAgainstElectron2::LeadPFChargedHadrEoP_barrel_min_
private

Definition at line 83 of file PFRecoTauDiscriminationAgainstElectron2.cc.

◆ LeadPFChargedHadrEoP_endcap_max1_

double PFRecoTauDiscriminationAgainstElectron2::LeadPFChargedHadrEoP_endcap_max1_
private

Definition at line 90 of file PFRecoTauDiscriminationAgainstElectron2.cc.

◆ LeadPFChargedHadrEoP_endcap_max2_

double PFRecoTauDiscriminationAgainstElectron2::LeadPFChargedHadrEoP_endcap_max2_
private

Definition at line 92 of file PFRecoTauDiscriminationAgainstElectron2.cc.

◆ LeadPFChargedHadrEoP_endcap_min1_

double PFRecoTauDiscriminationAgainstElectron2::LeadPFChargedHadrEoP_endcap_min1_
private

Definition at line 89 of file PFRecoTauDiscriminationAgainstElectron2.cc.

◆ LeadPFChargedHadrEoP_endcap_min2_

double PFRecoTauDiscriminationAgainstElectron2::LeadPFChargedHadrEoP_endcap_min2_
private

Definition at line 91 of file PFRecoTauDiscriminationAgainstElectron2.cc.

◆ rejectTausInEcalCrack_

bool PFRecoTauDiscriminationAgainstElectron2::rejectTausInEcalCrack_
private

Definition at line 99 of file PFRecoTauDiscriminationAgainstElectron2.cc.

◆ verbosity_

int PFRecoTauDiscriminationAgainstElectron2::verbosity_
private

Definition at line 108 of file PFRecoTauDiscriminationAgainstElectron2.cc.