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
PFRecoTauDiscriminationByInvMass Class Reference
Inheritance diagram for PFRecoTauDiscriminationByInvMass:
TauDiscriminationProducerBase< TauType, TauDiscriminator > edm::EDProducer edm::ProducerBase edm::ProductRegistryHelper

Public Member Functions

double discriminate (const reco::PFTauRef &)
 
 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)=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 ()
 
virtual ~EDProducer ()
 
- Public Member Functions inherited from edm::ProducerBase
 ProducerBase ()
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
boost::function< void(const
BranchDescription &)> 
registrationCallback () const
 used by the fwk to register list of products More...
 
virtual ~ProducerBase ()
 

Private Types

typedef std::map< IntPair,
DoublePair
DecayModeCutMap
 
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
< TauCollection
TauRefProd
 
- Public Types inherited from edm::EDProducer
typedef EDProducer ModuleType
 
typedef WorkerT< EDProducerWorkerType
 
- 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::EDProducer
CurrentProcessingContext const * currentContext () const
 
- Protected Member Functions inherited from edm::ProducerBase
template<class TProducer , class TMethod >
void callWhenNewProductsRegistered (TProducer *iProd, TMethod iMethod)
 
- Protected Attributes inherited from TauDiscriminationProducerBase< TauType, TauDiscriminator >
double prediscriminantFailValue_
 
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_, reco::tau::helpers::nCharged(), and benchmark_cfg::select.

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:195
unsigned int nCharged(const GenJet &jet)
TauDiscriminationProducerBase< reco::PFTau, reco::PFTauDiscriminator > PFTauDiscriminationProducerBase
PFRecoTauDiscriminationByInvMass::~PFRecoTauDiscriminationByInvMass ( )
inline

Definition at line 41 of file PFRecoTauDiscriminationByInvMass.cc.

41 {}

Member Function Documentation

double PFRecoTauDiscriminationByInvMass::discriminate ( const reco::PFTauRef tau)

Definition at line 55 of file PFRecoTauDiscriminationByInvMass.cc.

References cut_, decayModeCuts_, scaleCards::mass, max_default_, min_default_, and edm::second().

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)
tuple mass
Definition: scaleCards.py:27

Member Data Documentation

bool PFRecoTauDiscriminationByInvMass::cut_
private
DecayModeCutMap PFRecoTauDiscriminationByInvMass::decayModeCuts_
private
double PFRecoTauDiscriminationByInvMass::max_default_
private
double PFRecoTauDiscriminationByInvMass::min_default_
private