CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Member Functions | Private Attributes
PFRecoTauDiscriminationAgainstElectron2 Class Reference
Inheritance diagram for PFRecoTauDiscriminationAgainstElectron2:
TauDiscriminationProducerBase< TauType, TauDiscriminator > edm::stream::EDProducer<> edm::stream::EDProducerBase edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

void beginEvent (const edm::Event &, const edm::EventSetup &)
 
double discriminate (const PFTauRef &) const
 
 PFRecoTauDiscriminationAgainstElectron2 (const edm::ParameterSet &iConfig)
 
 ~PFRecoTauDiscriminationAgainstElectron2 ()
 
- Public Member Functions inherited from TauDiscriminationProducerBase< TauType, TauDiscriminator >
virtual double discriminate (const TauRef &tau) const =0
 
virtual void endEvent (edm::Event &evt)
 
void produce (edm::Event &, const edm::EventSetup &)
 
 TauDiscriminationProducerBase (const edm::ParameterSet &iConfig)
 
 TauDiscriminationProducerBase ()
 
virtual ~TauDiscriminationProducerBase ()
 
- Public Member Functions inherited from edm::stream::EDProducer<>
 EDProducer ()=default
 
- Public Member Functions inherited from edm::stream::EDProducerBase
 EDProducerBase ()
 
ModuleDescription const & moduleDescription () const
 
virtual ~EDProducerBase ()
 
- Public Member Functions inherited from edm::ProducerBase
 ProducerBase ()
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
std::function< void(BranchDescription
const &)> 
registrationCallback () const
 used by the fwk to register list of products More...
 
virtual ~ProducerBase ()
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
 EDConsumerBase ()
 
ProductHolderIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
std::vector
< ProductHolderIndexAndSkipBit >
const & 
itemsToGetFromEvent () const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesDependentUpon (const std::string &iProcessName, std::vector< const char * > &oModuleLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
bool registeredToConsume (ProductHolderIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

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
< TauCollection
TauRefProd
 
- 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, GlobalCache
LuminosityBlockContext
 
typedef
CacheTypes::LuminosityBlockSummaryCache 
LuminosityBlockSummaryCache
 
typedef CacheTypes::RunCache RunCache
 
typedef RunContextT< RunCache,
GlobalCache
RunContext
 
typedef CacheTypes::RunSummaryCache RunSummaryCache
 
- Public Types inherited from edm::stream::EDProducerBase
typedef EDProducerAdaptorBase ModuleType
 
- Public Types inherited from edm::ProducerBase
typedef
ProductRegistryHelper::TypeLabelList 
TypeLabelList
 
- Static Public Member Functions inherited from edm::stream::EDProducerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 
- Protected Member Functions inherited from edm::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken consumes (TypeToGet const &id, edm::InputTag const &tag)
 
ConsumesCollector consumesCollector ()
 Use a ConsumesCollector to gather consumes information from helper functions. More...
 
template<typename ProductType , BranchType B = InEvent>
void consumesMany ()
 
void consumesMany (const TypeToGet &id)
 
template<BranchType B>
void consumesMany (const TypeToGet &id)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
- 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 29 of file PFRecoTauDiscriminationAgainstElectron2.cc.

Constructor & Destructor Documentation

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

Definition at line 31 of file PFRecoTauDiscriminationAgainstElectron2.cc.

References edm::ParameterSet::exists(), and edm::ParameterSet::getParameter().

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

Definition at line 71 of file PFRecoTauDiscriminationAgainstElectron2.cc.

72  { }

Member Function Documentation

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

Reimplemented from TauDiscriminationProducerBase< TauType, TauDiscriminator >.

Definition at line 109 of file PFRecoTauDiscriminationAgainstElectron2.cc.

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

Definition at line 157 of file PFRecoTauDiscriminationAgainstElectron2.cc.

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

158 {
159  double discriminator = 0.;
160 
161  // ensure tau has at least one charged object
162 
163  if( (*thePFTauRef).leadPFChargedHadrCand().isNull() )
164  {
165  return 0.;
166  }
167  else
168  {
169  discriminator = cuts2_->Discriminator(*thePFTauRef);
170  }
171 
172 
173  if ( verbosity_ ) {
174  std::cout<<" Taus : "<<TauProducer_<<std::endl;
175  std::cout << "<PFRecoTauDiscriminationAgainstElectron2::discriminate>:" << std::endl;
176  std::cout << " tau: Pt = " << thePFTauRef->pt() << ", eta = " << thePFTauRef->eta() << ", phi = " << thePFTauRef->phi() << std::endl;
177  std::cout << " discriminator value = " << discriminator << std::endl;
178  std::cout << " Prongs in tau: " << thePFTauRef->signalPFChargedHadrCands().size() << std::endl;
179  }
180 
181  return discriminator;
182 }
tuple discriminator
double Discriminator(float TauPt, float TauEta, float TauLeadChargedPFCandPt, float TauLeadChargedPFCandEtaAtEcalEntrance, float TauLeadPFChargedHadrEoP, float TauHcal3x3OverPLead, float TauGammaEtaMom, float TauGammaPhiMom, float TauGammaEnFrac)
tuple cout
Definition: gather_cfg.py:121
bool PFRecoTauDiscriminationAgainstElectron2::isInEcalCrack ( double  eta) const
private

Definition at line 185 of file PFRecoTauDiscriminationAgainstElectron2.cc.

186 {
187  eta = fabs(eta);
188  return (eta < 0.018 ||
189  (eta>0.423 && eta<0.461) ||
190  (eta>0.770 && eta<0.806) ||
191  (eta>1.127 && eta<1.163) ||
192  (eta>1.460 && eta<1.558));
193 }
T eta() const

Member Data Documentation

bool PFRecoTauDiscriminationAgainstElectron2::applyCut_GammaEnFrac_
private

Definition at line 103 of file PFRecoTauDiscriminationAgainstElectron2.cc.

bool PFRecoTauDiscriminationAgainstElectron2::applyCut_GammaEtaMom_
private

Definition at line 101 of file PFRecoTauDiscriminationAgainstElectron2.cc.

bool PFRecoTauDiscriminationAgainstElectron2::applyCut_GammaPhiMom_
private

Definition at line 102 of file PFRecoTauDiscriminationAgainstElectron2.cc.

bool PFRecoTauDiscriminationAgainstElectron2::applyCut_hcal3x3OverPLead_
private

Definition at line 99 of file PFRecoTauDiscriminationAgainstElectron2.cc.

bool PFRecoTauDiscriminationAgainstElectron2::applyCut_HLTSpecific_
private

Definition at line 104 of file PFRecoTauDiscriminationAgainstElectron2.cc.

bool PFRecoTauDiscriminationAgainstElectron2::applyCut_leadPFChargedHadrEoP_
private

Definition at line 100 of file PFRecoTauDiscriminationAgainstElectron2.cc.

AntiElectronIDCut2* PFRecoTauDiscriminationAgainstElectron2::cuts2_
private

Definition at line 79 of file PFRecoTauDiscriminationAgainstElectron2.cc.

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

Definition at line 76 of file PFRecoTauDiscriminationAgainstElectron2.cc.

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

Definition at line 77 of file PFRecoTauDiscriminationAgainstElectron2.cc.

double PFRecoTauDiscriminationAgainstElectron2::GammaEnFrac_barrel_max_
private

Definition at line 86 of file PFRecoTauDiscriminationAgainstElectron2.cc.

double PFRecoTauDiscriminationAgainstElectron2::GammaEnFrac_endcap_max_
private

Definition at line 94 of file PFRecoTauDiscriminationAgainstElectron2.cc.

double PFRecoTauDiscriminationAgainstElectron2::GammaEtaMom_barrel_max_
private

Definition at line 84 of file PFRecoTauDiscriminationAgainstElectron2.cc.

double PFRecoTauDiscriminationAgainstElectron2::GammaEtaMom_endcap_max_
private

Definition at line 92 of file PFRecoTauDiscriminationAgainstElectron2.cc.

double PFRecoTauDiscriminationAgainstElectron2::GammaPhiMom_barrel_max_
private

Definition at line 85 of file PFRecoTauDiscriminationAgainstElectron2.cc.

double PFRecoTauDiscriminationAgainstElectron2::GammaPhiMom_endcap_max_
private

Definition at line 93 of file PFRecoTauDiscriminationAgainstElectron2.cc.

double PFRecoTauDiscriminationAgainstElectron2::Hcal3x3OverPLead_barrel_max_
private

Definition at line 83 of file PFRecoTauDiscriminationAgainstElectron2.cc.

double PFRecoTauDiscriminationAgainstElectron2::Hcal3x3OverPLead_endcap_max_
private

Definition at line 91 of file PFRecoTauDiscriminationAgainstElectron2.cc.

bool PFRecoTauDiscriminationAgainstElectron2::keepTausInEcalCrack_
private

Definition at line 96 of file PFRecoTauDiscriminationAgainstElectron2.cc.

double PFRecoTauDiscriminationAgainstElectron2::LeadPFChargedHadrEoP_barrel_max_
private

Definition at line 82 of file PFRecoTauDiscriminationAgainstElectron2.cc.

double PFRecoTauDiscriminationAgainstElectron2::LeadPFChargedHadrEoP_barrel_min_
private

Definition at line 81 of file PFRecoTauDiscriminationAgainstElectron2.cc.

double PFRecoTauDiscriminationAgainstElectron2::LeadPFChargedHadrEoP_endcap_max1_
private

Definition at line 88 of file PFRecoTauDiscriminationAgainstElectron2.cc.

double PFRecoTauDiscriminationAgainstElectron2::LeadPFChargedHadrEoP_endcap_max2_
private

Definition at line 90 of file PFRecoTauDiscriminationAgainstElectron2.cc.

double PFRecoTauDiscriminationAgainstElectron2::LeadPFChargedHadrEoP_endcap_min1_
private

Definition at line 87 of file PFRecoTauDiscriminationAgainstElectron2.cc.

double PFRecoTauDiscriminationAgainstElectron2::LeadPFChargedHadrEoP_endcap_min2_
private

Definition at line 89 of file PFRecoTauDiscriminationAgainstElectron2.cc.

bool PFRecoTauDiscriminationAgainstElectron2::rejectTausInEcalCrack_
private

Definition at line 97 of file PFRecoTauDiscriminationAgainstElectron2.cc.

int PFRecoTauDiscriminationAgainstElectron2::verbosity_
private

Definition at line 106 of file PFRecoTauDiscriminationAgainstElectron2.cc.