CMS 3D CMS Logo

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

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

Member Typedef Documentation

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

Definition at line 14 of file RecoTauDecayModeCutMultiplexer.cc.

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

Definition at line 13 of file RecoTauDecayModeCutMultiplexer.cc.

Constructor & Destructor Documentation

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

Definition at line 22 of file RecoTauDecayModeCutMultiplexer.cc.

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

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

Definition at line 8 of file RecoTauDecayModeCutMultiplexer.cc.

References beginEvent(), and discriminate().

8 {}

Member Function Documentation

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

Reimplemented from TauDiscriminationProducerBase< TauType, TauDiscriminator >.

Definition at line 43 of file RecoTauDecayModeCutMultiplexer.cc.

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

Referenced by ~RecoTauDecayModeCutMultiplexer().

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

Definition at line 49 of file RecoTauDecayModeCutMultiplexer.cc.

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

Referenced by ~RecoTauDecayModeCutMultiplexer().

49  {
50  double disc_result = (*handle_)[tau];
51  DecayModeCutMap::const_iterator cutIter =
52  decayModeCuts_.find(std::make_pair(tau->signalPFChargedHadrCands().size(),
53  tau->signalPiZeroCandidates().size()));
54 
55  // Return null if it doesn't exist
56  if (cutIter == decayModeCuts_.end()) {
58  }
59  // See if the discriminator passes our cuts
60  return disc_result > cutIter->second;
61 }

Member Data Documentation

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

Definition at line 18 of file RecoTauDecayModeCutMultiplexer.cc.

Referenced by beginEvent().

edm::InputTag RecoTauDecayModeCutMultiplexer::toMultiplex_
private

Definition at line 17 of file RecoTauDecayModeCutMultiplexer.cc.

Referenced by RecoTauDecayModeCutMultiplexer().

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

Definition at line 19 of file RecoTauDecayModeCutMultiplexer.cc.

Referenced by beginEvent(), and RecoTauDecayModeCutMultiplexer().