CMS 3D CMS Logo

List of all members | Public Member Functions | Private Types | Private Attributes
RecoTauMVATransform Class Reference
Inheritance diagram for RecoTauMVATransform:
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 &) override
 
double discriminate (const reco::PFTauRef &) const override
 
 RecoTauMVATransform (const edm::ParameterSet &pset)
 
 ~RecoTauMVATransform ()
 
- 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
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
 
void convertCurrentProcessAlias (std::string const &processName)
 Convert "@currentProcess" in InputTag process names to the actual current process name. More...
 
 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 boost::ptr_map< reco::PFTau::hadronicDecayMode, TGraph > TransformMap
 

Private Attributes

edm::Handle< reco::PFTauDiscriminatordisc_
 
edm::InputTag input_
 
TransformMap transforms_
 

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 45 of file RecoTauMVATransform.cc.

Member Typedef Documentation

typedef boost::ptr_map<reco::PFTau::hadronicDecayMode, TGraph> RecoTauMVATransform::TransformMap
private

Definition at line 55 of file RecoTauMVATransform.cc.

Constructor & Destructor Documentation

RecoTauMVATransform::RecoTauMVATransform ( const edm::ParameterSet pset)
explicit

Definition at line 63 of file RecoTauMVATransform.cc.

References mvaPFMET_leptons_cfi::decayMode, edm::ParameterSet::getParameter(), input_, hpstanc_transforms::nCharged, hpstanc_transforms::nPiZeros, TauDiscriminationProducerBase< TauType, TauDiscriminator >::prediscriminantFailValue_, create_public_lumi_plots::transform, hpstanc_transforms::transforms, transforms_, reco::tau::translateDecayMode(), and HistogramManager_cfi::VPSet().

65  input_ = pset.getParameter<edm::InputTag>("toTransform");
66  typedef std::vector<edm::ParameterSet> VPSet;
67  const VPSet& transforms = pset.getParameter<VPSet>("transforms");
69  BOOST_FOREACH(const edm::ParameterSet &transform, transforms) {
70  unsigned int nCharged = transform.getParameter<unsigned int>("nCharged");
71  unsigned int nPiZeros = transform.getParameter<unsigned int>("nPiZeros");
72  // Get the transform
73  const edm::ParameterSet &transformImpl =
74  transform.getParameter<edm::ParameterSet>("transform");
75  // Get the acutal decay mode
77  reco::tau::translateDecayMode(nCharged, nPiZeros);
78 
79  if (!transforms_.count(decayMode)) {
80  // Add it
81  transforms_.insert(decayMode, buildTransform(transformImpl));
82  } else {
83  edm::LogError("DecayModeNotUnique") << "The tau decay mode with "
84  "nCharged/nPiZero = " << nCharged << "/" << nPiZeros <<
85  " dm: " << decayMode <<
86  " is associated to multiple MVA transforms, "
87  "the second instantiation is being ignored!!!";
88  }
89  }
90 }
T getParameter(std::string const &) const
PFTau::hadronicDecayMode translateDecayMode(unsigned int nCharged, unsigned int nPiZero)
TauDiscriminationProducerBase< reco::PFTau, reco::PFTauDiscriminator > PFTauDiscriminationProducerBase
hadronicDecayMode
Definition: PFTau.h:36
RecoTauMVATransform::~RecoTauMVATransform ( )
inline

Definition at line 48 of file RecoTauMVATransform.cc.

References beginEvent(), and discriminate().

48 {}

Member Function Documentation

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

Reimplemented from TauDiscriminationProducerBase< TauType, TauDiscriminator >.

Definition at line 94 of file RecoTauMVATransform.cc.

References disc_, edm::Event::getByLabel(), and input_.

Referenced by ~RecoTauMVATransform().

94  {
95  evt.getByLabel(input_, disc_);
96 }
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:416
edm::Handle< reco::PFTauDiscriminator > disc_
double RecoTauMVATransform::discriminate ( const reco::PFTauRef tau) const
override

Definition at line 98 of file RecoTauMVATransform.cc.

References DEFINE_FWK_MODULE, TauDiscriminationProducerBase< TauType, TauDiscriminator >::prediscriminantFailValue_, mps_fire::result, metsig::tau, create_public_lumi_plots::transform, and transforms_.

Referenced by ~RecoTauMVATransform().

98  {
99  // Check if we support this decay mode:
100  TransformMap::const_iterator transformIter =
101  transforms_.find(tau->decayMode());
102  // Unsupported DM
103  if (transformIter == transforms_.end())
105  const TGraph *transform = transformIter->second;
106  // Get the discriminator output to transform
107  double value = (*disc_)[tau];
108  double result = transform->Eval(value);
109  return result;
110 }
Definition: value.py:1

Member Data Documentation

edm::Handle<reco::PFTauDiscriminator> RecoTauMVATransform::disc_
private

Definition at line 59 of file RecoTauMVATransform.cc.

Referenced by beginEvent().

edm::InputTag RecoTauMVATransform::input_
private

Definition at line 58 of file RecoTauMVATransform.cc.

Referenced by beginEvent(), and RecoTauMVATransform().

TransformMap RecoTauMVATransform::transforms_
private

Definition at line 56 of file RecoTauMVATransform.cc.

Referenced by discriminate(), and RecoTauMVATransform().