CMS 3D CMS Logo

Classes | Typedefs | Functions
ZMuMu_MCanalyzer.cc File Reference
#include "DataFormats/Common/interface/AssociationVector.h"
#include "DataFormats/HepMCCandidate/interface/GenParticle.h"
#include "DataFormats/Candidate/interface/CandMatchMap.h"
#include "FWCore/Framework/interface/EDAnalyzer.h"
#include "DataFormats/Candidate/interface/Particle.h"
#include "DataFormats/Candidate/interface/Candidate.h"
#include "DataFormats/Candidate/interface/CandidateFwd.h"
#include "DataFormats/RecoCandidate/interface/RecoCandidate.h"
#include "DataFormats/MuonReco/interface/Muon.h"
#include "FWCore/ParameterSet/interface/ParameterSet.h"
#include "FWCore/Framework/interface/Event.h"
#include "FWCore/Framework/interface/EventSetup.h"
#include "FWCore/Utilities/interface/InputTag.h"
#include "DataFormats/Candidate/interface/OverlapChecker.h"
#include "DataFormats/Math/interface/deltaR.h"
#include "DataFormats/PatCandidates/interface/Muon.h"
#include "DataFormats/PatCandidates/interface/GenericParticle.h"
#include "DataFormats/PatCandidates/interface/TriggerObjectStandAlone.h"
#include "DataFormats/PatCandidates/interface/PATObject.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 "TH1.h"
#include "TH2.h"
#include "TH3.h"
#include <vector>
#include "FWCore/ServiceRegistry/interface/Service.h"
#include "CommonTools/UtilAlgos/interface/TFileService.h"
#include "DataFormats/Common/interface/Handle.h"
#include "DataFormats/Candidate/interface/CandAssociation.h"
#include "DataFormats/Math/interface/LorentzVector.h"
#include "DataFormats/TrackReco/interface/Track.h"
#include <iostream>
#include <iterator>
#include <cmath>
#include "FWCore/Framework/interface/MakerMacros.h"

Go to the source code of this file.

Classes

class  ZMuMu_MCanalyzer
 

Typedefs

typedef ValueMap< float > IsolationCollection
 

Functions

double candidateIsolation (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< ZMuMu_MCanalyzer > > s_filler__LINE__ ("ZMuMu_MCanalyzer")
 
static const edm::MakerPluginFactory ::PMaker< edm::WorkerMaker< ZMuMu_MCanalyzer > > s_maker__LINE__ ("ZMuMu_MCanalyzer")
 

Typedef Documentation

◆ IsolationCollection

typedef ValueMap<float> IsolationCollection

Definition at line 47 of file ZMuMu_MCanalyzer.cc.

Function Documentation

◆ candidateIsolation()

double candidateIsolation ( 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 151 of file ZMuMu_MCanalyzer.cc.

161  {
162  const pat::Muon* mu = dynamic_cast<const pat::Muon*>(&*c->masterClone());
163  if (mu != nullptr)
164  return isolation(mu,
165  ptThreshold,
168  dRVetoTrk,
169  dRTrk,
170  dREcal,
171  dRHcal,
172  alpha,
173  beta,
175  const pat::GenericParticle* trk = dynamic_cast<const pat::GenericParticle*>(&*c->masterClone());
176  if (trk != nullptr)
177  return isolation(trk,
178  ptThreshold,
181  dRVetoTrk,
182  dRTrk,
183  dREcal,
184  dRHcal,
185  alpha,
186  beta,
189  << "Candidate daughter #0 is neither pat::Muons nor pat::GenericParticle\n";
190  return -1;
191 }

References zMuMuMuonUserData::alpha, zMuMuMuonUserData::beta, HltBtagPostValidation_cff::c, zMuMuMuonUserData::dREcal, zMuMuMuonUserData::dRHcal, zMuMuMuonUserData::dRTrk, zMuMuMuonUserData::dRVetoTrk, zMuMuMuonUserData::etEcalThreshold, zMuMuMuonUserData::etHcalThreshold, Exception, edm::errors::InvalidReference, isolation(), amptDefaultParameters_cff::mu, ewkMuLumiMonitorDQM_cfi::ptThreshold, and ZMuMuCategoriesNtuples_cff::relativeIsolation.

Referenced by ZMuMu_MCanalyzer::analyze().

◆ isolation()

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 105 of file ZMuMu_MCanalyzer.cc.

115  {
116  // on 34X:
117  const pat::IsoDeposit* trkIso = t->isoDeposit(pat::TrackIso);
118  // const pat::IsoDeposit * trkIso = t->trackerIsoDeposit();
119  // on 34X
120  const pat::IsoDeposit* ecalIso = t->isoDeposit(pat::EcalIso);
121  // const pat::IsoDeposit * ecalIso = t->ecalIsoDeposit();
122  // on 34X
123  const pat::IsoDeposit* hcalIso = t->isoDeposit(pat::HcalIso);
124  // const pat::IsoDeposit * hcalIso = t->hcalIsoDeposit();
125 
126  Direction dir = Direction(t->eta(), t->phi());
127 
128  pat::IsoDeposit::AbsVetos vetosTrk;
129  vetosTrk.push_back(new ConeVeto(dir, dRVetoTrk));
130  vetosTrk.push_back(new ThresholdVeto(ptThreshold));
131 
132  pat::IsoDeposit::AbsVetos vetosEcal;
133  vetosEcal.push_back(new ConeVeto(dir, 0.));
134  vetosEcal.push_back(new ThresholdVeto(etEcalThreshold));
135 
136  pat::IsoDeposit::AbsVetos vetosHcal;
137  vetosHcal.push_back(new ConeVeto(dir, 0.));
138  vetosHcal.push_back(new ThresholdVeto(etHcalThreshold));
139 
140  double isovalueTrk = (trkIso->sumWithin(dRTrk, vetosTrk));
141  double isovalueEcal = (ecalIso->sumWithin(dREcal, vetosEcal));
142  double isovalueHcal = (hcalIso->sumWithin(dRHcal, vetosHcal));
143 
144  double iso =
145  alpha * (((1 + beta) / 2 * isovalueEcal) + ((1 - beta) / 2 * isovalueHcal)) + ((1 - alpha) * isovalueTrk);
146  if (relativeIsolation)
147  iso /= t->pt();
148  return iso;
149 }

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.

Referenced by candidateIsolation().

◆ s_filler__LINE__()

static const edm::ParameterSetDescriptionFillerPluginFactory::PMaker<edm::ParameterSetDescriptionFiller< ZMuMu_MCanalyzer > > s_filler__LINE__ ( "ZMuMu_MCanalyzer"  )
static

◆ s_maker__LINE__()

static const edm::MakerPluginFactory ::PMaker< edm::WorkerMaker< ZMuMu_MCanalyzer > > s_maker__LINE__ ( "ZMuMu_MCanalyzer"  )
static
ewkMuLumiMonitorDQM_cfi.ptThreshold
ptThreshold
Definition: ewkMuLumiMonitorDQM_cfi.py:13
zMuMuMuonUserData.dRHcal
dRHcal
Definition: zMuMuMuonUserData.py:19
pat::EcalIso
Definition: Isolation.h:11
edm::errors::InvalidReference
Definition: EDMException.h:39
amptDefaultParameters_cff.mu
mu
Definition: amptDefaultParameters_cff.py:16
zMuMuMuonUserData.alpha
alpha
zGenParticlesMatch = cms.InputTag(""),
Definition: zMuMuMuonUserData.py:9
zMuMuMuonUserData.beta
beta
Definition: zMuMuMuonUserData.py:10
ZMuMuCategoriesSequences_cff.trkIso
trkIso
Definition: ZMuMuCategoriesSequences_cff.py:140
pat::Muon
Analysis-level muon class.
Definition: Muon.h:51
reco::isodeposit::ConeVeto
Definition: IsoDepositVetos.h:9
zMuMuMuonUserData.dREcal
dREcal
Definition: zMuMuMuonUserData.py:18
isolation
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: ZMuMu_MCanalyzer.cc:105
zMuMuMuonUserData.dRTrk
dRTrk
Definition: zMuMuMuonUserData.py:17
reco::IsoDeposit::AbsVetos
isodeposit::AbsVetos AbsVetos
Definition: IsoDeposit.h:53
pat::GenericParticle
Analysis-level Generic Particle class (e.g. for hadron or muon not fully reconstructed)
Definition: GenericParticle.h:38
ZMuMuCategoriesNtuples_cff.relativeIsolation
relativeIsolation
Definition: ZMuMuCategoriesNtuples_cff.py:27
zMuMuMuonUserData.dRVetoTrk
dRVetoTrk
Definition: zMuMuMuonUserData.py:16
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
zMuMuMuonUserData.etEcalThreshold
etEcalThreshold
Definition: zMuMuMuonUserData.py:14
HltBtagPostValidation_cff.c
c
Definition: HltBtagPostValidation_cff.py:31
reco::isodeposit::ThresholdVeto
Definition: IsoDepositVetos.h:21
reco::isodeposit::Direction
Definition: IsoDepositDirection.h:19
Exception
Definition: hltDiff.cc:246
reco::IsoDeposit
Definition: IsoDeposit.h:49
submitPVValidationJobs.t
string t
Definition: submitPVValidationJobs.py:644
zMuMuMuonUserData.etHcalThreshold
etHcalThreshold
Definition: zMuMuMuonUserData.py:15
DeadROC_duringRun.dir
dir
Definition: DeadROC_duringRun.py:23