CMS 3D CMS Logo

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

Public Member Functions

double discriminate (const reco::PFTauRef &) const override
 
 PFRecoTauDiscriminationByInvMass (const edm::ParameterSet &pset)
 
 ~PFRecoTauDiscriminationByInvMass () override
 
- Public Member Functions inherited from TauDiscriminationProducerBase< TauType, TauDiscriminator >
virtual void beginEvent (const edm::Event &, const edm::EventSetup &)
 
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 Types

typedef std::map< IntPair, DoublePairDecayModeCutMap
 
typedef std::pair< double, double > DoublePair
 
typedef std::pair< unsigned int, unsigned int > IntPair
 

Private Attributes

DecayModeCutMap decayModeCuts_
 
double max_default_
 
double min_default_
 

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 14 of file PFRecoTauDiscriminationByInvMass.cc.

Member Typedef Documentation

Definition at line 45 of file PFRecoTauDiscriminationByInvMass.cc.

typedef std::pair<double, double> PFRecoTauDiscriminationByInvMass::DoublePair
private

Definition at line 44 of file PFRecoTauDiscriminationByInvMass.cc.

typedef std::pair<unsigned int, unsigned int> PFRecoTauDiscriminationByInvMass::IntPair
private

Definition at line 43 of file PFRecoTauDiscriminationByInvMass.cc.

Constructor & Destructor Documentation

PFRecoTauDiscriminationByInvMass::PFRecoTauDiscriminationByInvMass ( const edm::ParameterSet pset)
inlineexplicit

Definition at line 16 of file PFRecoTauDiscriminationByInvMass.cc.

References decayModeCuts_, edm::ParameterSet::getParameter(), edm::ParameterSet::getParameterNamesForType(), max_default_, min_default_, hpstanc_transforms::nCharged, and TauGenJetsDecayModeSelectorAllHadrons_cfi::select.

18  // If select is not set, just return the invariant mass
19  const edm::ParameterSet &select = pset.getParameter<edm::ParameterSet>("select");
20  // Get default cuts
21  min_default_ = select.getParameter<double>("min");
22  max_default_ = select.getParameter<double>("max");
23  // Get decay mode specific cuts
24  std::vector<std::string> decayModeCutNames =
26  for(auto const& dmName : decayModeCutNames) {
27  const edm::ParameterSet &dmPSet =
28  select.getParameter<edm::ParameterSet>(dmName);
29  unsigned int nCharged = dmPSet.getParameter<unsigned int>("charged");
30  unsigned int nPiZero = dmPSet.getParameter<unsigned int>("pizeros");
31  double minCut = dmPSet.getParameter<double>("min");
32  double maxCut = dmPSet.getParameter<double>("max");
33  // Add our dm-specific cut to the map
34  decayModeCuts_[std::make_pair(nCharged, nPiZero)] =
35  std::make_pair(minCut, maxCut);
36  }
37  }
T getParameter(std::string const &) const
std::vector< std::string > getParameterNamesForType(bool trackiness=true) const
Definition: ParameterSet.h:169
TauDiscriminationProducerBase< reco::PFTau, reco::PFTauDiscriminator > PFTauDiscriminationProducerBase
PFRecoTauDiscriminationByInvMass::~PFRecoTauDiscriminationByInvMass ( )
inlineoverride

Definition at line 38 of file PFRecoTauDiscriminationByInvMass.cc.

References discriminate(), and fillDescriptions().

38 {}

Member Function Documentation

double PFRecoTauDiscriminationByInvMass::discriminate ( const reco::PFTauRef tau) const
override

Definition at line 52 of file PFRecoTauDiscriminationByInvMass.cc.

References decayModeCuts_, ResonanceBuilder::mass, max_default_, min_default_, and edm::second().

Referenced by ~PFRecoTauDiscriminationByInvMass().

52  {
53  double mass = tau->mass();
54  unsigned int charged = tau->signalChargedHadrCands().size();
55  unsigned int pizeros = tau->signalPiZeroCandidates().size();
56  DecayModeCutMap::const_iterator specificCut = decayModeCuts_.find(
57  std::make_pair(charged, pizeros));
58  // Cut does not exist for this decay mode
59  if (specificCut == decayModeCuts_.end() )
60  return (mass > min_default_ && mass < max_default_);
61  else
62  return (mass > specificCut->second.first &&
63  mass < specificCut->second.second);
64  // If we dont' cut, just return the mass
65  return mass;
66 }
U second(std::pair< T, U > const &p)
void PFRecoTauDiscriminationByInvMass::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
static

Definition at line 69 of file PFRecoTauDiscriminationByInvMass.cc.

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

Referenced by ~PFRecoTauDiscriminationByInvMass().

69  {
70  // pfRecoTauDiscriminationByInvMass
72  {
74  psd0.add<std::string>("BooleanOperator", "and");
75  {
77  psd1.add<double>("cut");
78  psd1.add<edm::InputTag>("Producer");
79  psd0.addOptional<edm::ParameterSetDescription>("leadTrack", psd1);
80  }
81  desc.add<edm::ParameterSetDescription>("Prediscriminants", psd0);
82  }
83  {
85  psd0.add<double>("max");
86  psd0.add<double>("min");
87  desc.add<edm::ParameterSetDescription>("select", psd0);
88  }
89  desc.add<edm::InputTag>("PFTauProducer", edm::InputTag("pfRecoTauProducer"));
90  descriptions.add("pfRecoTauDiscriminationByInvMass", desc);
91 }
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)

Member Data Documentation

DecayModeCutMap PFRecoTauDiscriminationByInvMass::decayModeCuts_
private
double PFRecoTauDiscriminationByInvMass::max_default_
private
double PFRecoTauDiscriminationByInvMass::min_default_
private