CMS 3D CMS Logo

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

Public Member Functions

void beginEvent (const edm::Event &event, const edm::EventSetup &eventSetup) override
 
double discriminate (const reco::PFTauRef &) const override
 
 RecoTauDecayModeCutMultiplexer (const edm::ParameterSet &pset)
 
 ~RecoTauDecayModeCutMultiplexer () override
 
- Public Member Functions inherited from TauDiscriminationProducerBase< TauType, TauDiscriminator >
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, double > DecayModeCutMap
 
typedef std::pair< unsigned int, unsigned int > IntPair
 

Private Attributes

DecayModeCutMap decayModeCuts_
 
edm::Handle< reco::PFTauDiscriminatorhandle_
 
edm::InputTag toMultiplex_
 
edm::EDGetTokenT< reco::PFTauDiscriminatortoMultiplex_token
 

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

Member Typedef Documentation

typedef std::map<IntPair, double> RecoTauDecayModeCutMultiplexer::DecayModeCutMap
private

Definition at line 18 of file RecoTauDecayModeCutMultiplexer.cc.

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

Definition at line 17 of file RecoTauDecayModeCutMultiplexer.cc.

Constructor & Destructor Documentation

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

Definition at line 26 of file RecoTauDecayModeCutMultiplexer.cc.

References decayModeCuts_, tauJetCorrFactors_cfi::decayModes, symbols::dm, edm::ParameterSet::getParameter(), toMultiplex_, toMultiplex_token, and HistogramManager_cfi::VPSet().

28  toMultiplex_ = pset.getParameter<edm::InputTag>("toMultiplex");
29  toMultiplex_token = consumes<reco::PFTauDiscriminator>(toMultiplex_);
30  typedef std::vector<edm::ParameterSet> VPSet;
31  const VPSet& decayModes = pset.getParameter<VPSet>("decayModes");
32  // Setup our cut map
33  for(auto const& dm : decayModes) {
34  // Get the mass window for each decay mode
35  decayModeCuts_.insert(std::make_pair(
36  // The decay mode as a key
37  std::make_pair(
38  dm.getParameter<uint32_t>("nCharged"),
39  dm.getParameter<uint32_t>("nPiZeros")),
40  // The selection
41  dm.getParameter<double>("cut")
42  ));
43  }
44 }
T getParameter(std::string const &) const
edm::EDGetTokenT< reco::PFTauDiscriminator > toMultiplex_token
TauDiscriminationProducerBase< reco::PFTau, reco::PFTauDiscriminator > PFTauDiscriminationProducerBase
RecoTauDecayModeCutMultiplexer::~RecoTauDecayModeCutMultiplexer ( )
inlineoverride

Definition at line 11 of file RecoTauDecayModeCutMultiplexer.cc.

References beginEvent(), discriminate(), and fillDescriptions().

11 {}

Member Function Documentation

void RecoTauDecayModeCutMultiplexer::beginEvent ( const edm::Event event,
const edm::EventSetup eventSetup 
)
overridevirtual

Reimplemented from TauDiscriminationProducerBase< TauType, TauDiscriminator >.

Definition at line 47 of file RecoTauDecayModeCutMultiplexer.cc.

References edm::Event::getByToken(), handle_, and toMultiplex_token.

Referenced by ~RecoTauDecayModeCutMultiplexer().

48  {
49  evt.getByToken(toMultiplex_token, handle_);
50 }
edm::Handle< reco::PFTauDiscriminator > handle_
edm::EDGetTokenT< reco::PFTauDiscriminator > toMultiplex_token
double RecoTauDecayModeCutMultiplexer::discriminate ( const reco::PFTauRef tau) const
override

Definition at line 53 of file RecoTauDecayModeCutMultiplexer.cc.

References decayModeCuts_, TauDiscriminationProducerBase< TauType, TauDiscriminator >::prediscriminantFailValue_, and metsig::tau.

Referenced by ~RecoTauDecayModeCutMultiplexer().

53  {
54  double disc_result = (*handle_)[tau];
55  DecayModeCutMap::const_iterator cutIter =
56  decayModeCuts_.find(std::make_pair(tau->signalChargedHadrCands().size(),
57  tau->signalPiZeroCandidates().size()));
58 
59  // Return null if it doesn't exist
60  if (cutIter == decayModeCuts_.end()) {
62  }
63  // See if the discriminator passes our cuts
64  return disc_result > cutIter->second;
65 }
void RecoTauDecayModeCutMultiplexer::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
static

Definition at line 68 of file RecoTauDecayModeCutMultiplexer.cc.

References edm::ConfigurationDescriptions::add(), edm::ParameterSetDescription::add(), edm::ParameterSetDescription::addVPSet(), DEFINE_FWK_MODULE, and TauDiscriminationProducerBase< TauType, TauDiscriminator >::fillProducerDescriptions().

Referenced by ~RecoTauDecayModeCutMultiplexer().

68  {
69  // recoTauDecayModeCutMultiplexer
71 
72  desc.add<edm::InputTag>("toMultiplex");
73 
74  edm::ParameterSetDescription vpsd_decayModes;
75 
76  vpsd_decayModes.add<uint32_t>("nCharged");
77  vpsd_decayModes.add<uint32_t>("nPiZeros");
78  vpsd_decayModes.add<double>("cut");
79 
80  // name description no defaults items
81  desc.addVPSet("decayModes", vpsd_decayModes);
82 
83  fillProducerDescriptions(desc); // inherited from the base
84 
85  descriptions.add("recoTauDecayModeCutMultiplexer", desc);
86 }
ParameterDescriptionBase * addVPSet(U const &iLabel, ParameterSetDescription const &validator, std::vector< ParameterSet > const &defaults)
static void fillProducerDescriptions(edm::ParameterSetDescription &desc)
ParameterDescriptionBase * add(U const &iLabel, T const &value)
void add(std::string const &label, ParameterSetDescription const &psetDescription)

Member Data Documentation

DecayModeCutMap RecoTauDecayModeCutMultiplexer::decayModeCuts_
private
edm::Handle<reco::PFTauDiscriminator> RecoTauDecayModeCutMultiplexer::handle_
private

Definition at line 22 of file RecoTauDecayModeCutMultiplexer.cc.

Referenced by beginEvent().

edm::InputTag RecoTauDecayModeCutMultiplexer::toMultiplex_
private

Definition at line 21 of file RecoTauDecayModeCutMultiplexer.cc.

Referenced by RecoTauDecayModeCutMultiplexer().

edm::EDGetTokenT<reco::PFTauDiscriminator> RecoTauDecayModeCutMultiplexer::toMultiplex_token
private

Definition at line 23 of file RecoTauDecayModeCutMultiplexer.cc.

Referenced by beginEvent(), and RecoTauDecayModeCutMultiplexer().