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

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

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_, 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:355
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 }
double deltaR(double eta1, double phi1, double eta2, double phi2)
Definition: deltaR.h:19
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:149
bool isGlobalMuon() const
Definition: Muon.h:148
virtual double eta() const
momentum pseudorapidity
bool isCaloMuon() const
Definition: Muon.h:151
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:40
virtual double phi() const
momentum azimuthal angle
float caloCompatibility() const
Definition: Muon.h:101

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