CMS 3D CMS Logo

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

List of all members.

Public Types

typedef std::vector< TauType > TauCollection
typedef edm::Ref< TauCollectionTauRef

Public Member Functions

void beginEvent (const edm::Event &, const edm::EventSetup &)
double discriminate (const TauRef &)
 TauDiscriminationAgainstMuon (const edm::ParameterSet &)
 ~TauDiscriminationAgainstMuon ()

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_

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
template<class TauType , class TauDiscriminator >
typedef edm::Ref<TauCollection> TauDiscriminationAgainstMuon< TauType, TauDiscriminator >::TauRef

Member Enumeration Documentation

template<class TauType , class TauDiscriminator >
anonymous enum [private]
Enumerator:
kNoSegMatch 
kTwoDCut 
kMerePresence 
kCombined 

Definition at line 46 of file TauDiscriminationAgainstMuon.cc.


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_, 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.

  : TauDiscriminationProducerBase<TauType, TauDiscriminator>(cfg) 
{
  //if ( cfg.exists("muonSource") ) muonSource_ = cfg.getParameter<edm::InputTag>("muonSource");
  muonSource_ = cfg.getParameter<edm::InputTag>("muonSource");
  dRmatch_ = ( cfg.exists("dRmatch") ) ? cfg.getParameter<double>("dRmatch") : 0.5;

  std::string discriminatorOption_string = cfg.getParameter<std::string>("discriminatorOption");  
  if      ( discriminatorOption_string == "noSegMatch"   ) discriminatorOption_ = kNoSegMatch;
  else if ( discriminatorOption_string == "twoDCut"      ) discriminatorOption_ = kTwoDCut;
  else if ( discriminatorOption_string == "merePresence" ) discriminatorOption_ = kMerePresence;
  else if ( discriminatorOption_string == "combined"     ) discriminatorOption_ = kCombined;
  else {
    throw edm::Exception(edm::errors::UnimplementedFeature) << " Invalid Discriminator Option! Please check cfi file \n";
  }

  coeffCaloComp_ = cfg.getParameter<double>("caloCompCoefficient");
  coeffSegmComp_ = cfg.getParameter<double>("segmCompCoefficient");
  muonCompCut_ = cfg.getParameter<double>("muonCompCut");
}
template<class TauType , class TauDiscriminator >
TauDiscriminationAgainstMuon< TauType, TauDiscriminator >::~TauDiscriminationAgainstMuon ( ) [inline]

Definition at line 32 of file TauDiscriminationAgainstMuon.cc.

{} 

Member Function Documentation

template<class TauType , class TauDiscriminator >
void TauDiscriminationAgainstMuon< TauType, TauDiscriminator >::beginEvent ( const edm::Event evt,
const edm::EventSetup evtSetup 
) [virtual]
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.

{
  bool decision = true; 

  for ( reco::MuonCollection::const_iterator muon = muons_->begin();
        muon != muons_->end(); ++muon ) {
    if ( reco::deltaR(muon->p4(), tau->p4()) < dRmatch_ ) decision &= evaluateMuonVeto(*muon);
  }

  return (decision ? 1. : 0.);
}
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().

{
  bool decision = true; 

  if ( discriminatorOption_ == kNoSegMatch ) {
    if ( muon.numberOfMatches() > 0 ) decision = false;
  } else if ( discriminatorOption_ == kTwoDCut ) {
    double segmComp = muon::segmentCompatibility(muon);
    double caloComp = muon.caloCompatibility(); 
    if ( (coeffCaloComp_*segmComp + coeffSegmComp_*caloComp) > muonCompCut_ ) decision = false;
  } else if ( discriminatorOption_ == kMerePresence ) {
    decision = false;
  } else if ( discriminatorOption_ == kCombined ) { // testing purpose only
    unsigned int muonType = 0;
    if      ( muon.isGlobalMuon()  ) muonType = 1;
    else if ( muon.isCaloMuon()    ) muonType = 2;
    else if ( muon.isTrackerMuon() ) muonType = 3;

    bool eta_veto = ( fabs(muon.eta()) > 2.3 || (fabs(muon.eta()) > 1.4 && fabs(muon.eta()) < 1.6) ) ? true : false;
    bool phi_veto = ( muon.phi() < 0.1 && muon.phi() > -0.1 ) ? true : false;

    if ( muonType != 1 || muon.numberOfMatches() > 0 || eta_veto || phi_veto ) decision = false;
  }

  return decision;
}

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]