CMS 3D CMS Logo

Classes | Functions
ZToLLEdmNtupleDumper.cc File Reference
#include "FWCore/Framework/interface/EDProducer.h"
#include "FWCore/Utilities/interface/InputTag.h"
#include "DataFormats/Common/interface/Handle.h"
#include "FWCore/Framework/interface/Event.h"
#include "FWCore/ParameterSet/interface/ParameterSet.h"
#include "DataFormats/Provenance/interface/RunLumiEventNumber.h"
#include "DataFormats/HepMCCandidate/interface/GenParticle.h"
#include "DataFormats/Candidate/interface/CandMatchMap.h"
#include "DataFormats/Candidate/interface/Candidate.h"
#include "DataFormats/PatCandidates/interface/Muon.h"
#include "DataFormats/PatCandidates/interface/GenericParticle.h"
#include "FWCore/Utilities/interface/EDMException.h"
#include "DataFormats/PatCandidates/interface/TriggerObjectStandAlone.h"
#include "DataFormats/RecoCandidate/interface/IsoDeposit.h"
#include "DataFormats/RecoCandidate/interface/IsoDepositFwd.h"
#include "DataFormats/PatCandidates/interface/Isolation.h"
#include "DataFormats/Common/interface/ValueMap.h"
#include "DataFormats/RecoCandidate/interface/IsoDepositVetos.h"
#include "DataFormats/RecoCandidate/interface/IsoDepositDirection.h"
#include "DataFormats/BeamSpot/interface/BeamSpot.h"
#include <vector>
#include "FWCore/Framework/interface/MakerMacros.h"

Go to the source code of this file.

Classes

class  ZToLLEdmNtupleDumper
 

Functions

double candIsolation (const reco::Candidate *c, double ptThreshold, double etEcalThreshold, double etHcalThreshold, double dRVetoTrk, double dRTrk, double dREcal, double dRHcal, double alpha, double beta, bool relativeIsolation)
 
template<typename T >
double isolation (const T *t, double ptThreshold, double etEcalThreshold, double etHcalThreshold, double dRVetoTrk, double dRTrk, double dREcal, double dRHcal, double alpha, double beta, bool relativeIsolation)
 
static const edm::ParameterSetDescriptionFillerPluginFactory::PMaker< edm::ParameterSetDescriptionFiller< ZToLLEdmNtupleDumper > > s_filler__LINE__ ("ZToLLEdmNtupleDumper")
 
static const edm::MakerPluginFactory::PMaker< edm::WorkerMaker< ZToLLEdmNtupleDumper > > s_maker__LINE__ ("ZToLLEdmNtupleDumper")
 

Function Documentation

double candIsolation ( const reco::Candidate c,
double  ptThreshold,
double  etEcalThreshold,
double  etHcalThreshold,
double  dRVetoTrk,
double  dRTrk,
double  dREcal,
double  dRHcal,
double  alpha,
double  beta,
bool  relativeIsolation 
)

Definition at line 105 of file ZToLLEdmNtupleDumper.cc.

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

Referenced by ZToMuMuIsoDepositSelector< Isolator >::operator()(), and ZToLLEdmNtupleDumper::produce().

115  {
116  const pat::Muon *mu = dynamic_cast<const pat::Muon *>(c);
117  if (mu != nullptr)
118  return isolation(mu,
119  ptThreshold,
122  dRVetoTrk,
123  dRTrk,
124  dREcal,
125  dRHcal,
126  alpha,
127  beta,
129  const pat::GenericParticle *trk = dynamic_cast<const pat::GenericParticle *>(c);
130  if (trk != nullptr)
131  return isolation(trk,
132  ptThreshold,
135  dRVetoTrk,
136  dRTrk,
137  dREcal,
138  dRHcal,
139  alpha,
140  beta,
143  << "Candidate daughter #0 is neither pat::Muons nor pat::GenericParticle\n";
144  return -1;
145 }
Analysis-level Generic Particle class (e.g. for hadron or muon not fully reconstructed) ...
double isolation(const T *t, double ptThreshold, double etEcalThreshold, double etHcalThreshold, double dRVetoTrk, double dRTrk, double dREcal, double dRHcal, double alpha, double beta, bool relativeIsolation)
alpha
zGenParticlesMatch = cms.InputTag(""),
Analysis-level muon class.
Definition: Muon.h:51
template<typename T >
double isolation ( const T t,
double  ptThreshold,
double  etEcalThreshold,
double  etHcalThreshold,
double  dRVetoTrk,
double  dRTrk,
double  dREcal,
double  dRHcal,
double  alpha,
double  beta,
bool  relativeIsolation 
)

Definition at line 59 of file ZToLLEdmNtupleDumper.cc.

References zMuMuMuonUserData::beta, DeadROC_duringRun::dir, pat::EcalIso, pat::HcalIso, reco::IsoDeposit::sumWithin(), pat::TrackIso, and ZMuMuCategoriesSequences_cff::trkIso.

Referenced by candIsolation().

69  {
70  // on 34X:
71  const pat::IsoDeposit *trkIso = t->isoDeposit(pat::TrackIso);
72  // const pat::IsoDeposit * trkIso = t->trackerIsoDeposit();
73  // on 34X
74  const pat::IsoDeposit *ecalIso = t->isoDeposit(pat::EcalIso);
75  // const pat::IsoDeposit * ecalIso = t->ecalIsoDeposit();
76  // on 34X
77  const pat::IsoDeposit *hcalIso = t->isoDeposit(pat::HcalIso);
78  // const pat::IsoDeposit * hcalIso = t->hcalIsoDeposit();
79 
80  Direction dir = Direction(t->eta(), t->phi());
81 
83  vetosTrk.push_back(new ConeVeto(dir, dRVetoTrk));
84  vetosTrk.push_back(new ThresholdVeto(ptThreshold));
85 
86  pat::IsoDeposit::AbsVetos vetosEcal;
87  vetosEcal.push_back(new ConeVeto(dir, 0.));
88  vetosEcal.push_back(new ThresholdVeto(etEcalThreshold));
89 
90  pat::IsoDeposit::AbsVetos vetosHcal;
91  vetosHcal.push_back(new ConeVeto(dir, 0.));
92  vetosHcal.push_back(new ThresholdVeto(etHcalThreshold));
93 
94  double isovalueTrk = (trkIso->sumWithin(dRTrk, vetosTrk));
95  double isovalueEcal = (ecalIso->sumWithin(dREcal, vetosEcal));
96  double isovalueHcal = (hcalIso->sumWithin(dRHcal, vetosHcal));
97 
98  double iso =
99  alpha * (((1 + beta) / 2 * isovalueEcal) + ((1 - beta) / 2 * isovalueHcal)) + ((1 - alpha) * isovalueTrk);
100  if (relativeIsolation)
101  iso /= t->pt();
102  return iso;
103 }
double sumWithin(double coneSize, const AbsVetos &vetos=AbsVetos(), bool skipDepositVeto=false) const
Definition: IsoDeposit.cc:137
alpha
zGenParticlesMatch = cms.InputTag(""),
isodeposit::AbsVetos AbsVetos
Definition: IsoDeposit.h:53
static const edm::ParameterSetDescriptionFillerPluginFactory::PMaker<edm::ParameterSetDescriptionFiller< ZToLLEdmNtupleDumper > > s_filler__LINE__ ( "ZToLLEdmNtupleDumper"  )
static
static const edm::MakerPluginFactory ::PMaker< edm::WorkerMaker< ZToLLEdmNtupleDumper > > s_maker__LINE__ ( "ZToLLEdmNtupleDumper"  )
static