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<> edm::stream::EDProducerBase edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

double discriminate (const reco::PFTauRef &) const override
 
 PFRecoTauDiscriminationByInvMass (const edm::ParameterSet &pset)
 
 ~PFRecoTauDiscriminationByInvMass ()
 
- Public Member Functions inherited from TauDiscriminationProducerBase< TauType, TauDiscriminator >
virtual void beginEvent (const edm::Event &evt, const edm::EventSetup &evtSetup)
 
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
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
std::vector< edm::ProductResolverIndex > const & indiciesForPutProducts (BranchType iBranchType) const
 
 ProducerBase ()
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
std::function< void(BranchDescription const &)> registrationCallback () const
 used by the fwk to register list of products More...
 
void resolvePutIndicies (BranchType iBranchType, std::unordered_multimap< std::string, edm::ProductResolverIndex > const &iIndicies, std::string const &moduleLabel)
 
virtual ~ProducerBase () noexcept(false)
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
 EDConsumerBase ()
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
 EDConsumerBase (EDConsumerBase &&)=default
 
ProductResolverIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
std::vector< ProductResolverIndexAndSkipBit > const & itemsToGetFrom (BranchType iType) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
virtual ~EDConsumerBase () noexcept(false)
 

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
 
- Public Types inherited from edm::stream::EDProducerBase
typedef EDProducerAdaptorBase ModuleType
 
- Public Types inherited from edm::ProducerBase
typedef ProductRegistryHelper::TypeLabelList TypeLabelList
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- 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::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 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 ( )
inline

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