CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Types | Public Member Functions | Private Types | Private Member Functions | Private Attributes
TauDiscriminationAgainstMuon< TauType, TauDiscriminator > Class Template Reference
Inheritance diagram for TauDiscriminationAgainstMuon< TauType, TauDiscriminator >:
TauDiscriminationProducerBase< TauType, TauDiscriminator > edm::EDProducer edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Types

typedef std::vector< TauType > TauCollection
 
typedef edm::Ref< TauCollectionTauRef
 
- 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
 

Public Member Functions

void beginEvent (const edm::Event &, const edm::EventSetup &)
 
double discriminate (const TauRef &)
 
 TauDiscriminationAgainstMuon (const edm::ParameterSet &)
 
 ~TauDiscriminationAgainstMuon ()
 
- Public Member Functions inherited from TauDiscriminationProducerBase< TauType, TauDiscriminator >
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 &)
 
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 ()
 
ProductHolderIndex indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductHolderIndex > &) const
 
void itemsToGet (BranchType, std::vector< ProductHolderIndex > &) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

Private Types

enum  { kNoSegMatch, kTwoDCut, kMerePresence, kCombined }
 

Private Member Functions

bool evaluateMuonVeto (const reco::Muon &)
 

Private Attributes

double coeffCaloComp_
 
double coeffSegmComp_
 
int discriminatorOption_
 
double dRmatch_
 
double muonCompCut_
 
edm::Handle< reco::MuonCollectionmuons_
 
edm::InputTag muonSource_
 

Additional Inherited Members

- 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
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::InputTag TauProducer_
 

Detailed Description

template<class TauType, class TauDiscriminator>
class TauDiscriminationAgainstMuon< TauType, TauDiscriminator >

Definition at line 24 of file TauDiscriminationAgainstMuon.cc.

Member Typedef Documentation

template<class TauType , class TauDiscriminator >
typedef std::vector<TauType> TauDiscriminationAgainstMuon< TauType, TauDiscriminator >::TauCollection

Definition at line 28 of file TauDiscriminationAgainstMuon.cc.

template<class TauType , class TauDiscriminator >
typedef edm::Ref<TauCollection> TauDiscriminationAgainstMuon< TauType, TauDiscriminator >::TauRef

Definition at line 29 of file TauDiscriminationAgainstMuon.cc.

Member Enumeration Documentation

template<class TauType , class TauDiscriminator >
anonymous enum
private

Constructor & Destructor Documentation

template<class TauType , class TauDiscriminator >
TauDiscriminationAgainstMuon< TauType, TauDiscriminator >::TauDiscriminationAgainstMuon ( const edm::ParameterSet cfg)
explicit

Definition at line 55 of file TauDiscriminationAgainstMuon.cc.

References TauDiscriminationAgainstMuon< TauType, TauDiscriminator >::coeffCaloComp_, TauDiscriminationAgainstMuon< TauType, TauDiscriminator >::coeffSegmComp_, TauDiscriminationAgainstMuon< TauType, TauDiscriminator >::discriminatorOption_, TauDiscriminationAgainstMuon< TauType, TauDiscriminator >::dRmatch_, edm::hlt::Exception, edm::ParameterSet::exists(), edm::ParameterSet::getParameter(), TauDiscriminationAgainstMuon< TauType, TauDiscriminator >::kCombined, TauDiscriminationAgainstMuon< TauType, TauDiscriminator >::kMerePresence, TauDiscriminationAgainstMuon< TauType, TauDiscriminator >::kNoSegMatch, TauDiscriminationAgainstMuon< TauType, TauDiscriminator >::kTwoDCut, TauDiscriminationAgainstMuon< TauType, TauDiscriminator >::muonCompCut_, TauDiscriminationAgainstMuon< TauType, TauDiscriminator >::muonSource_, AlCaHLTBitMon_QueryRunRegistry::string, and edm::errors::UnimplementedFeature.

57 {
58  //if ( cfg.exists("muonSource") ) muonSource_ = cfg.getParameter<edm::InputTag>("muonSource");
59  muonSource_ = cfg.getParameter<edm::InputTag>("muonSource");
60  dRmatch_ = ( cfg.exists("dRmatch") ) ? cfg.getParameter<double>("dRmatch") : 0.5;
61 
62  std::string discriminatorOption_string = cfg.getParameter<std::string>("discriminatorOption");
63  if ( discriminatorOption_string == "noSegMatch" ) discriminatorOption_ = kNoSegMatch;
64  else if ( discriminatorOption_string == "twoDCut" ) discriminatorOption_ = kTwoDCut;
65  else if ( discriminatorOption_string == "merePresence" ) discriminatorOption_ = kMerePresence;
66  else if ( discriminatorOption_string == "combined" ) discriminatorOption_ = kCombined;
67  else {
68  throw edm::Exception(edm::errors::UnimplementedFeature) << " Invalid Discriminator Option! Please check cfi file \n";
69  }
70 
71  coeffCaloComp_ = cfg.getParameter<double>("caloCompCoefficient");
72  coeffSegmComp_ = cfg.getParameter<double>("segmCompCoefficient");
73  muonCompCut_ = cfg.getParameter<double>("muonCompCut");
74 }
T getParameter(std::string const &) const
bool exists(std::string const &parameterName) const
checks if a parameter exists
template<class TauType , class TauDiscriminator >
TauDiscriminationAgainstMuon< TauType, TauDiscriminator >::~TauDiscriminationAgainstMuon ( )
inline

Definition at line 32 of file TauDiscriminationAgainstMuon.cc.

32 {}

Member Function Documentation

template<class TauType , class TauDiscriminator >
void TauDiscriminationAgainstMuon< TauType, TauDiscriminator >::beginEvent ( const edm::Event evt,
const edm::EventSetup evtSetup 
)
virtual

Reimplemented from TauDiscriminationProducerBase< TauType, TauDiscriminator >.

Definition at line 77 of file TauDiscriminationAgainstMuon.cc.

References edm::Event::getByLabel().

78 {
80 }
edm::Handle< reco::MuonCollection > muons_
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:361
template<class TauType , class TauDiscriminator >
double TauDiscriminationAgainstMuon< TauType, TauDiscriminator >::discriminate ( const TauRef tau)
virtual

Implements TauDiscriminationProducerBase< TauType, TauDiscriminator >.

Definition at line 111 of file TauDiscriminationAgainstMuon.cc.

References reco::deltaR(), and metsig::muon.

112 {
113  bool decision = true;
114 
115  for ( reco::MuonCollection::const_iterator muon = muons_->begin();
116  muon != muons_->end(); ++muon ) {
117  if ( reco::deltaR(muon->p4(), tau->p4()) < dRmatch_ ) decision &= evaluateMuonVeto(*muon);
118  }
119 
120  return (decision ? 1. : 0.);
121 }
auto deltaR(const T1 &t1, const T2 &t2) -> decltype(t1.eta())
Definition: deltaR.h:30
edm::Handle< reco::MuonCollection > muons_
template<class TauType , class TauDiscriminator >
bool TauDiscriminationAgainstMuon< TauType, TauDiscriminator >::evaluateMuonVeto ( const reco::Muon muon)
private

Definition at line 83 of file TauDiscriminationAgainstMuon.cc.

References reco::Muon::caloCompatibility(), reco::LeafCandidate::eta(), reco::Muon::isCaloMuon(), reco::Muon::isGlobalMuon(), reco::Muon::isTrackerMuon(), reco::Muon::numberOfMatches(), reco::LeafCandidate::phi(), and muon::segmentCompatibility().

84 {
85  bool decision = true;
86 
88  if ( muon.numberOfMatches() > 0 ) decision = false;
89  } else if ( discriminatorOption_ == kTwoDCut ) {
90  double segmComp = muon::segmentCompatibility(muon);
91  double caloComp = muon.caloCompatibility();
92  if ( (coeffCaloComp_*segmComp + coeffSegmComp_*caloComp) > muonCompCut_ ) decision = false;
93  } else if ( discriminatorOption_ == kMerePresence ) {
94  decision = false;
95  } else if ( discriminatorOption_ == kCombined ) { // testing purpose only
96  unsigned int muonType = 0;
97  if ( muon.isGlobalMuon() ) muonType = 1;
98  else if ( muon.isCaloMuon() ) muonType = 2;
99  else if ( muon.isTrackerMuon() ) muonType = 3;
100 
101  bool eta_veto = ( fabs(muon.eta()) > 2.3 || (fabs(muon.eta()) > 1.4 && fabs(muon.eta()) < 1.6) ) ? true : false;
102  bool phi_veto = ( muon.phi() < 0.1 && muon.phi() > -0.1 ) ? true : false;
103 
104  if ( muonType != 1 || muon.numberOfMatches() > 0 || eta_veto || phi_veto ) decision = false;
105  }
106 
107  return decision;
108 }
bool isTrackerMuon() const
Definition: Muon.h:220
bool isGlobalMuon() const
Definition: Muon.h:219
bool isCaloMuon() const
Definition: Muon.h:222
virtual float phi() const GCC11_FINAL
momentum azimuthal angle
float segmentCompatibility(const reco::Muon &muon, reco::Muon::ArbitrationType arbitrationType=reco::Muon::SegmentAndTrackArbitration)
int numberOfMatches(ArbitrationType type=SegmentAndTrackArbitration) const
get number of chambers with matched segments
Definition: Muon.cc:60
virtual float eta() const GCC11_FINAL
momentum pseudorapidity
float caloCompatibility() const
Definition: Muon.h:151

Member Data Documentation

template<class TauType , class TauDiscriminator >
double TauDiscriminationAgainstMuon< TauType, TauDiscriminator >::coeffCaloComp_
private
template<class TauType , class TauDiscriminator >
double TauDiscriminationAgainstMuon< TauType, TauDiscriminator >::coeffSegmComp_
private
template<class TauType , class TauDiscriminator >
int TauDiscriminationAgainstMuon< TauType, TauDiscriminator >::discriminatorOption_
private
template<class TauType , class TauDiscriminator >
double TauDiscriminationAgainstMuon< TauType, TauDiscriminator >::dRmatch_
private
template<class TauType , class TauDiscriminator >
double TauDiscriminationAgainstMuon< TauType, TauDiscriminator >::muonCompCut_
private
template<class TauType , class TauDiscriminator >
edm::Handle<reco::MuonCollection> TauDiscriminationAgainstMuon< TauType, TauDiscriminator >::muons_
private

Definition at line 43 of file TauDiscriminationAgainstMuon.cc.

template<class TauType , class TauDiscriminator >
edm::InputTag TauDiscriminationAgainstMuon< TauType, TauDiscriminator >::muonSource_
private