test
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 Types | Private Attributes
RecoTauMVATransform Class Reference
Inheritance diagram for RecoTauMVATransform:
TauDiscriminationProducerBase< TauType, TauDiscriminator > edm::EDProducer edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

void beginEvent (const edm::Event &, const edm::EventSetup &) override
 
double discriminate (const reco::PFTauRef &) override
 
 RecoTauMVATransform (const edm::ParameterSet &pset)
 
 ~RecoTauMVATransform ()
 
- Public Member Functions inherited from TauDiscriminationProducerBase< TauType, TauDiscriminator >
virtual double discriminate (const TauRef &tau)=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::EDProducer
 EDProducer ()
 
ModuleDescription const & moduleDescription () const
 
virtual ~EDProducer ()
 
- 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
 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
 
bool registeredToConsume (ProductHolderIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

Private Types

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

Private Attributes

edm::Handle
< reco::PFTauDiscriminator
disc_
 
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
< TauCollection
TauRefProd
 
- Public Types inherited from edm::EDProducer
typedef EDProducer ModuleType
 
- Public Types inherited from edm::ProducerBase
typedef
ProductRegistryHelper::TypeLabelList 
TypeLabelList
 
- Static Public Member Functions inherited from edm::EDProducer
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
 
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 edm::ParameterSet::getParameter(), input_, reco::tau::helpers::nCharged(), TauDiscriminationProducerBase< TauType, TauDiscriminator >::prediscriminantFailValue_, create_public_lumi_plots::transform, hpstanc_transforms::transforms, transforms_, and reco::tau::translateDecayMode().

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)
unsigned int nCharged(const GenJet &jet)
TauDiscriminationProducerBase< reco::PFTau, reco::PFTauDiscriminator > PFTauDiscriminationProducerBase
hadronicDecayMode
Definition: PFTau.h:35
RecoTauMVATransform::~RecoTauMVATransform ( )
inline

Definition at line 48 of file RecoTauMVATransform.cc.

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_.

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

Definition at line 98 of file RecoTauMVATransform.cc.

References TauDiscriminationProducerBase< TauType, TauDiscriminator >::prediscriminantFailValue_, query::result, metsig::tau, create_public_lumi_plots::transform, transforms_, and relativeConstraints::value.

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 }
tuple result
Definition: query.py:137

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().