CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
ZToMuMuIsoDepositSelector< Isolator > Class Template Reference

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, edm::ConsumesCollector &iC)
 

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 58 of file ZToMuMuIsoDepositSelector.cc.

Constructor & Destructor Documentation

◆ ZToMuMuIsoDepositSelector()

template<typename Isolator >
ZToMuMuIsoDepositSelector< Isolator >::ZToMuMuIsoDepositSelector ( const edm::ParameterSet cfg,
edm::ConsumesCollector iC 
)
inline

Definition at line 60 of file ZToMuMuIsoDepositSelector.cc.

61  : isolator_(cfg.template getParameter<double>("isoCut")),
62  ptThreshold(cfg.getUntrackedParameter<double>("ptThreshold")),
63  etEcalThreshold(cfg.getUntrackedParameter<double>("etEcalThreshold")),
64  etHcalThreshold(cfg.getUntrackedParameter<double>("etHcalThreshold")),
65  dRVetoTrk(cfg.getUntrackedParameter<double>("deltaRVetoTrk")),
66  dRTrk(cfg.getUntrackedParameter<double>("deltaRTrk")),
67  dREcal(cfg.getUntrackedParameter<double>("deltaREcal")),
68  dRHcal(cfg.getUntrackedParameter<double>("deltaRHcal")),
69  alpha(cfg.getUntrackedParameter<double>("alpha")),
70  beta(cfg.getUntrackedParameter<double>("beta")),
71  relativeIsolation(cfg.template getParameter<bool>("relativeIsolation")) {}

Member Function Documentation

◆ candIsolation()

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

Definition at line 104 of file ZToMuMuIsoDepositSelector.cc.

104  {
105  const pat::Muon* mu = dynamic_cast<const pat::Muon*>(c);
106  if (mu != nullptr)
107  return isolation(mu);
108  const pat::GenericParticle* trk = dynamic_cast<const pat::GenericParticle*>(c);
109  if (trk != nullptr)
110  return isolation(trk);
112  << "Candidate daughter #0 is neither pat::Muons nor pat::GenericParticle\n";
113  return -1;
114  }

References HltBtagPostValidation_cff::c, Exception, edm::errors::InvalidReference, and amptDefaultParameters_cff::mu.

◆ isolation()

template<typename Isolator >
template<typename T >
double ZToMuMuIsoDepositSelector< Isolator >::isolation ( const T t) const
inline

Definition at line 74 of file ZToMuMuIsoDepositSelector.cc.

74  {
75  const pat::IsoDeposit* trkIso = t->isoDeposit(pat::TrackIso);
76  const pat::IsoDeposit* ecalIso = t->isoDeposit(pat::EcalIso);
77  const pat::IsoDeposit* hcalIso = t->isoDeposit(pat::HcalIso);
78 
79  Direction dir = Direction(t->eta(), t->phi());
80 
81  IsoDeposit::AbsVetos vetosTrk;
82  vetosTrk.push_back(new ConeVeto(dir, dRVetoTrk));
83  vetosTrk.push_back(new ThresholdVeto(ptThreshold));
84 
85  IsoDeposit::AbsVetos vetosEcal;
86  vetosEcal.push_back(new ConeVeto(dir, 0.));
87  vetosEcal.push_back(new ThresholdVeto(etEcalThreshold));
88 
89  IsoDeposit::AbsVetos vetosHcal;
90  vetosHcal.push_back(new ConeVeto(dir, 0.));
91  vetosHcal.push_back(new ThresholdVeto(etHcalThreshold));
92 
93  double isovalueTrk = (trkIso->sumWithin(dRTrk, vetosTrk));
94  double isovalueEcal = (ecalIso->sumWithin(dREcal, vetosEcal));
95  double isovalueHcal = (hcalIso->sumWithin(dRHcal, vetosHcal));
96 
97  double iso =
98  alpha * (((1 + beta) / 2 * isovalueEcal) + ((1 - beta) / 2 * isovalueHcal)) + ((1 - alpha) * isovalueTrk);
100  iso /= t->pt();
101  return iso;
102  }

References zMuMuMuonUserData::alpha, zMuMuMuonUserData::beta, DeadROC_duringRun::dir, zMuMuMuonUserData::dREcal, zMuMuMuonUserData::dRHcal, zMuMuMuonUserData::dRTrk, zMuMuMuonUserData::dRVetoTrk, pat::EcalIso, zMuMuMuonUserData::etEcalThreshold, zMuMuMuonUserData::etHcalThreshold, pat::HcalIso, ewkMuLumiMonitorDQM_cfi::ptThreshold, ZMuMuCategoriesNtuples_cff::relativeIsolation, reco::IsoDeposit::sumWithin(), submitPVValidationJobs::t, pat::TrackIso, and ZMuMuCategoriesSequences_cff::trkIso.

◆ operator()()

template<typename Isolator >
bool ZToMuMuIsoDepositSelector< Isolator >::operator() ( const reco::Candidate z) const
inline

Definition at line 115 of file ZToMuMuIsoDepositSelector.cc.

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

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

Member Data Documentation

◆ alpha

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

Definition at line 129 of file ZToMuMuIsoDepositSelector.cc.

◆ beta

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

Definition at line 129 of file ZToMuMuIsoDepositSelector.cc.

◆ dREcal

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

Definition at line 129 of file ZToMuMuIsoDepositSelector.cc.

◆ dRHcal

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

Definition at line 129 of file ZToMuMuIsoDepositSelector.cc.

◆ dRTrk

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

Definition at line 129 of file ZToMuMuIsoDepositSelector.cc.

◆ dRVetoTrk

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

Definition at line 129 of file ZToMuMuIsoDepositSelector.cc.

◆ etEcalThreshold

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

Definition at line 129 of file ZToMuMuIsoDepositSelector.cc.

◆ etHcalThreshold

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

Definition at line 129 of file ZToMuMuIsoDepositSelector.cc.

◆ isolator_

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

Definition at line 128 of file ZToMuMuIsoDepositSelector.cc.

◆ ptThreshold

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

Definition at line 129 of file ZToMuMuIsoDepositSelector.cc.

◆ relativeIsolation

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

Definition at line 130 of file ZToMuMuIsoDepositSelector.cc.

ZToMuMuIsoDepositSelector::candIsolation
double candIsolation(const reco::Candidate *c) const
Definition: ZToMuMuIsoDepositSelector.cc:104
pat::EcalIso
Definition: Isolation.h:11
edm::errors::InvalidReference
Definition: EDMException.h:39
ZToMuMuIsoDepositSelector::isolation
double isolation(const T *t) const
Definition: ZToMuMuIsoDepositSelector.cc:74
amptDefaultParameters_cff.mu
mu
Definition: amptDefaultParameters_cff.py:16
ZToMuMuIsoDepositSelector::dREcal
double dREcal
Definition: ZToMuMuIsoDepositSelector.cc:129
ZMuMuCategoriesSequences_cff.trkIso
trkIso
Definition: ZMuMuCategoriesSequences_cff.py:140
ZToMuMuIsoDepositSelector::beta
double beta
Definition: ZToMuMuIsoDepositSelector.cc:129
pat::Muon
Analysis-level muon class.
Definition: Muon.h:51
ZToMuMuIsoDepositSelector::etHcalThreshold
double etHcalThreshold
Definition: ZToMuMuIsoDepositSelector.cc:129
edm::Exception
Definition: EDMException.h:77
reco::isodeposit::ConeVeto
Definition: IsoDepositVetos.h:9
ZToMuMuIsoDepositSelector::relativeIsolation
bool relativeIsolation
Definition: ZToMuMuIsoDepositSelector.cc:130
reco::IsoDeposit::AbsVetos
isodeposit::AbsVetos AbsVetos
Definition: IsoDeposit.h:53
DDAxes::z
reco::Candidate::hasMasterClone
virtual bool hasMasterClone() const =0
ZToMuMuIsoDepositSelector::dRTrk
double dRTrk
Definition: ZToMuMuIsoDepositSelector.cc:129
pat::GenericParticle
Analysis-level Generic Particle class (e.g. for hadron or muon not fully reconstructed)
Definition: GenericParticle.h:38
pat::TrackIso
Definition: Isolation.h:10
reco::IsoDeposit::sumWithin
double sumWithin(double coneSize, const AbsVetos &vetos=AbsVetos(), bool skipDepositVeto=false) const
Definition: IsoDeposit.cc:137
pat::HcalIso
Definition: Isolation.h:12
HltBtagPostValidation_cff.c
c
Definition: HltBtagPostValidation_cff.py:31
reco::isodeposit::ThresholdVeto
Definition: IsoDepositVetos.h:21
looper.cfg
cfg
Definition: looper.py:297
reco::Candidate
Definition: Candidate.h:27
ZToMuMuIsoDepositSelector::ptThreshold
double ptThreshold
Definition: ZToMuMuIsoDepositSelector.cc:129
reco::isodeposit::Direction
Definition: IsoDepositDirection.h:19
ZToMuMuIsoDepositSelector::dRHcal
double dRHcal
Definition: ZToMuMuIsoDepositSelector.cc:129
Exception
Definition: hltDiff.cc:246
ZToMuMuIsoDepositSelector::isolator_
Isolator isolator_
Definition: ZToMuMuIsoDepositSelector.cc:128
reco::IsoDeposit
Definition: IsoDeposit.h:49
ZToMuMuIsoDepositSelector::etEcalThreshold
double etEcalThreshold
Definition: ZToMuMuIsoDepositSelector.cc:129
reco::Candidate::masterClone
virtual const CandidateBaseRef & masterClone() const =0
ZToMuMuIsoDepositSelector::alpha
double alpha
Definition: ZToMuMuIsoDepositSelector.cc:129
submitPVValidationJobs.t
string t
Definition: submitPVValidationJobs.py:644
ZToMuMuIsoDepositSelector::dRVetoTrk
double dRVetoTrk
Definition: ZToMuMuIsoDepositSelector.cc:129
DeadROC_duringRun.dir
dir
Definition: DeadROC_duringRun.py:23