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

typedef ValueMap<float> IsolationCollection

Definition at line 47 of file ZMuMu_MCanalyzer.cc.

Function Documentation

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

References Exception, edm::errors::InvalidReference, isolation(), reco::Candidate::masterClone(), and RPCpg::mu.

Referenced by ZMuMu_MCanalyzer::analyze().

138  {
139  const pat::Muon * mu = dynamic_cast<const pat::Muon *>(&*c->masterClone());
140  if(mu != nullptr) return isolation(mu, ptThreshold, etEcalThreshold, etHcalThreshold ,dRVetoTrk, dRTrk, dREcal , dRHcal, alpha, beta, relativeIsolation);
141  const pat::GenericParticle * trk = dynamic_cast<const pat::GenericParticle*>(&*c->masterClone());
142  if(trk != nullptr) return isolation(trk, ptThreshold, etEcalThreshold, etHcalThreshold ,dRVetoTrk, dRTrk, dREcal ,
143  dRHcal, alpha, beta, relativeIsolation);
145  << "Candidate daughter #0 is neither pat::Muons nor pat::GenericParticle\n";
146  return -1;
147 }
float alpha
Definition: AMPTWrapper.h:95
Analysis-level Generic Particle class (e.g. for hadron or muon not fully reconstructed) ...
const int mu
Definition: Constants.h:22
virtual const CandidateBaseRef & masterClone() const =0
Analysis-level muon class.
Definition: Muon.h:50
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)
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 102 of file ZMuMu_MCanalyzer.cc.

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

Referenced by candidateIsolation().

102  {
103  // on 34X:
104  const pat::IsoDeposit * trkIso = t->isoDeposit(pat::TrackIso);
105  // const pat::IsoDeposit * trkIso = t->trackerIsoDeposit();
106  // on 34X
107  const pat::IsoDeposit * ecalIso = t->isoDeposit(pat::EcalIso);
108  // const pat::IsoDeposit * ecalIso = t->ecalIsoDeposit();
109  // on 34X
110  const pat::IsoDeposit * hcalIso = t->isoDeposit(pat::HcalIso);
111  // const pat::IsoDeposit * hcalIso = t->hcalIsoDeposit();
112 
113  Direction dir = Direction(t->eta(), t->phi());
114 
115  pat::IsoDeposit::AbsVetos vetosTrk;
116  vetosTrk.push_back(new ConeVeto( dir, dRVetoTrk ));
117  vetosTrk.push_back(new ThresholdVeto( ptThreshold ));
118 
119  pat::IsoDeposit::AbsVetos vetosEcal;
120  vetosEcal.push_back(new ConeVeto( dir, 0.));
121  vetosEcal.push_back(new ThresholdVeto( etEcalThreshold ));
122 
123  pat::IsoDeposit::AbsVetos vetosHcal;
124  vetosHcal.push_back(new ConeVeto( dir, 0. ));
125  vetosHcal.push_back(new ThresholdVeto( etHcalThreshold ));
126 
127  double isovalueTrk = (trkIso->sumWithin(dRTrk,vetosTrk));
128  double isovalueEcal = (ecalIso->sumWithin(dREcal,vetosEcal));
129  double isovalueHcal = (hcalIso->sumWithin(dRHcal,vetosHcal));
130 
131 
132  double iso = alpha*( ((1+beta)/2*isovalueEcal) + ((1-beta)/2*isovalueHcal) ) + ((1-alpha)*isovalueTrk) ;
133  if(relativeIsolation) iso /= t->pt();
134  return iso;
135 }
float alpha
Definition: AMPTWrapper.h:95
double sumWithin(double coneSize, const AbsVetos &vetos=AbsVetos(), bool skipDepositVeto=false) const
Definition: IsoDeposit.cc:138
dbl *** dir
Definition: mlp_gen.cc:35
isodeposit::AbsVetos AbsVetos
Definition: IsoDeposit.h:51
static const edm::ParameterSetDescriptionFillerPluginFactory::PMaker<edm::ParameterSetDescriptionFiller< ZMuMu_MCanalyzer > > s_filler__LINE__ ( "ZMuMu_MCanalyzer"  )
static
static const edm::MakerPluginFactory ::PMaker< edm::WorkerMaker< ZMuMu_MCanalyzer > > s_maker__LINE__ ( "ZMuMu_MCanalyzer"  )
static