CMS 3D CMS Logo

Public Member Functions | Private Attributes

ZToMuMuIsoDepositSelector< Isolator > Class Template Reference

List of all members.

Public Member Functions

double candIsolation (const reco::Candidate *c) const
template<typename T >
double isolation (const T *t) const
bool operator() (const reco::Candidate &z) const
 ZToMuMuIsoDepositSelector (const edm::ParameterSet &cfg)

Private Attributes

double alpha
double beta
double dREcal
double dRHcal
double dRTrk
double dRVetoTrk
double etEcalThreshold
double etHcalThreshold
Isolator isolator_
double ptThreshold
bool relativeIsolation

Detailed Description

template<typename Isolator>
class ZToMuMuIsoDepositSelector< Isolator >

Definition at line 61 of file ZToMuMuIsoDepositSelector.cc.


Constructor & Destructor Documentation

template<typename Isolator >
ZToMuMuIsoDepositSelector< Isolator >::ZToMuMuIsoDepositSelector ( const edm::ParameterSet cfg) [inline]

Definition at line 63 of file ZToMuMuIsoDepositSelector.cc.

                                                         :
    isolator_(cfg.template getParameter<double>("isoCut")),
    ptThreshold(cfg.getUntrackedParameter<double>("ptThreshold")),
    etEcalThreshold(cfg.getUntrackedParameter<double>("etEcalThreshold")),
    etHcalThreshold(cfg.getUntrackedParameter<double>("etHcalThreshold")),
    dRVetoTrk(cfg.getUntrackedParameter<double>("deltaRVetoTrk")),
    dRTrk(cfg.getUntrackedParameter<double>("deltaRTrk")),
    dREcal(cfg.getUntrackedParameter<double>("deltaREcal")),
    dRHcal(cfg.getUntrackedParameter<double>("deltaRHcal")),
    alpha(cfg.getUntrackedParameter<double>("alpha")),
    beta(cfg.getUntrackedParameter<double>("beta")),
    relativeIsolation(cfg.template getParameter<bool>("relativeIsolation")) {
  }

Member Function Documentation

template<typename Isolator >
double ZToMuMuIsoDepositSelector< Isolator >::candIsolation ( const reco::Candidate c) const [inline]

Definition at line 107 of file ZToMuMuIsoDepositSelector.cc.

References trackerHits::c, Exception, edm::errors::InvalidReference, and RPCpg::mu.

                                                     {
    const pat::Muon * mu = dynamic_cast<const pat::Muon *>(c);
    if(mu != 0) return isolation(mu);
    const pat::GenericParticle * trk = dynamic_cast<const pat::GenericParticle*>(c);
    if(trk != 0) return isolation(trk);
    throw edm::Exception(edm::errors::InvalidReference) 
      << "Candidate daughter #0 is neither pat::Muons nor pat::GenericParticle\n";      
    return -1;
  }
template<typename Isolator >
template<typename T >
double ZToMuMuIsoDepositSelector< Isolator >::isolation ( const T t) const [inline]

Definition at line 78 of file ZToMuMuIsoDepositSelector.cc.

References alpha, beta, dir, pat::EcalIso, pat::HcalIso, reco::IsoDeposit::sumWithin(), and pat::TrackIso.

                                      {
    const pat::IsoDeposit * trkIso = t->isoDeposit(pat::TrackIso);
    const pat::IsoDeposit * ecalIso = t->isoDeposit(pat::EcalIso);
    const pat::IsoDeposit * hcalIso = t->isoDeposit(pat::HcalIso);   
    
    Direction dir = Direction(t->eta(), t->phi());
    
    IsoDeposit::AbsVetos vetosTrk;
    vetosTrk.push_back(new ConeVeto( dir, dRVetoTrk ));
    vetosTrk.push_back(new ThresholdVeto( ptThreshold ));
    
    IsoDeposit::AbsVetos vetosEcal;
    vetosEcal.push_back(new ConeVeto( dir, 0.));
    vetosEcal.push_back(new ThresholdVeto( etEcalThreshold ));
    
    IsoDeposit::AbsVetos vetosHcal;
    vetosHcal.push_back(new ConeVeto( dir, 0. ));
    vetosHcal.push_back(new ThresholdVeto( etHcalThreshold ));

    double isovalueTrk = (trkIso->sumWithin(dRTrk,vetosTrk));
    double isovalueEcal = (ecalIso->sumWithin(dREcal,vetosEcal));
    double isovalueHcal = (hcalIso->sumWithin(dRHcal,vetosHcal));
    

    double iso = alpha*( ((1+beta)/2*isovalueEcal) + ((1-beta)/2*isovalueHcal) ) + ((1-alpha)*isovalueTrk) ;
    if(relativeIsolation) iso /= t->pt();
    return iso;
  }
template<typename Isolator >
bool ZToMuMuIsoDepositSelector< Isolator >::operator() ( const reco::Candidate z) const [inline]

Definition at line 116 of file ZToMuMuIsoDepositSelector.cc.

References candIsolation(), reco::Candidate::daughter(), Exception, reco::Candidate::hasMasterClone(), edm::errors::InvalidReference, reco::Candidate::masterClone(), and reco::Candidate::numberOfDaughters().

                                                 {
    if(z.numberOfDaughters()!=2) 
      throw edm::Exception(edm::errors::InvalidReference) 
        << "Candidate has " << z.numberOfDaughters() << " daughters, 2 expected\n";
    const reco::Candidate * dau0 = z.daughter(0);
    const reco::Candidate * dau1 = z.daughter(1);
    if(!(dau0->hasMasterClone()&&dau1->hasMasterClone()))
      throw edm::Exception(edm::errors::InvalidReference) 
        << "Candidate daughters have no master clone\n"; 
    const reco::Candidate * m0 = &*dau0->masterClone(), * m1 = &*dau1->masterClone();
    return isolator_(candIsolation(m0), candIsolation(m1));
  }

Member Data Documentation

template<typename Isolator >
double ZToMuMuIsoDepositSelector< Isolator >::alpha [private]

Definition at line 130 of file ZToMuMuIsoDepositSelector.cc.

template<typename Isolator >
double ZToMuMuIsoDepositSelector< Isolator >::beta [private]

Definition at line 130 of file ZToMuMuIsoDepositSelector.cc.

template<typename Isolator >
double ZToMuMuIsoDepositSelector< Isolator >::dREcal [private]

Definition at line 130 of file ZToMuMuIsoDepositSelector.cc.

template<typename Isolator >
double ZToMuMuIsoDepositSelector< Isolator >::dRHcal [private]

Definition at line 130 of file ZToMuMuIsoDepositSelector.cc.

template<typename Isolator >
double ZToMuMuIsoDepositSelector< Isolator >::dRTrk [private]

Definition at line 130 of file ZToMuMuIsoDepositSelector.cc.

template<typename Isolator >
double ZToMuMuIsoDepositSelector< Isolator >::dRVetoTrk [private]

Definition at line 130 of file ZToMuMuIsoDepositSelector.cc.

template<typename Isolator >
double ZToMuMuIsoDepositSelector< Isolator >::etEcalThreshold [private]

Definition at line 130 of file ZToMuMuIsoDepositSelector.cc.

template<typename Isolator >
double ZToMuMuIsoDepositSelector< Isolator >::etHcalThreshold [private]

Definition at line 130 of file ZToMuMuIsoDepositSelector.cc.

template<typename Isolator >
Isolator ZToMuMuIsoDepositSelector< Isolator >::isolator_ [private]

Definition at line 129 of file ZToMuMuIsoDepositSelector.cc.

template<typename Isolator >
double ZToMuMuIsoDepositSelector< Isolator >::ptThreshold [private]

Definition at line 130 of file ZToMuMuIsoDepositSelector.cc.

template<typename Isolator >
bool ZToMuMuIsoDepositSelector< Isolator >::relativeIsolation [private]

Definition at line 131 of file ZToMuMuIsoDepositSelector.cc.