CMS 3D CMS Logo

List of all members | 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
 

Private Types

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

Private Attributes

bool cut_
 
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 13 of file PFRecoTauDiscriminationByInvMass.cc.

Member Typedef Documentation

Definition at line 47 of file PFRecoTauDiscriminationByInvMass.cc.

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

Definition at line 46 of file PFRecoTauDiscriminationByInvMass.cc.

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

Definition at line 45 of file PFRecoTauDiscriminationByInvMass.cc.

Constructor & Destructor Documentation

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

Definition at line 15 of file PFRecoTauDiscriminationByInvMass.cc.

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

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

Definition at line 41 of file PFRecoTauDiscriminationByInvMass.cc.

References discriminate().

41 {}

Member Function Documentation

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

Definition at line 55 of file PFRecoTauDiscriminationByInvMass.cc.

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

Referenced by ~PFRecoTauDiscriminationByInvMass().

55  {
56  double mass = tau->mass();
57  if (cut_) {
58  unsigned int charged = tau->signalPFChargedHadrCands().size();
59  unsigned int pizeros = tau->signalPiZeroCandidates().size();
60  DecayModeCutMap::const_iterator specificCut = decayModeCuts_.find(
61  std::make_pair(charged, pizeros));
62  // Cut does not exist for this decay mode
63  if (specificCut == decayModeCuts_.end() )
64  return (mass > min_default_ && mass < max_default_);
65  else
66  return (mass > specificCut->second.first &&
67  mass < specificCut->second.second);
68  }
69  // If we dont' cut, just return the mass
70  return mass;
71 }
U second(std::pair< T, U > const &p)

Member Data Documentation

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