CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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 edm::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)
 
 DEFINE_FWK_MODULE (ZMuMu_MCanalyzer)
 
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)
 

Typedef Documentation

Definition at line 169 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 137 of file ZMuMu_MCanalyzer.cc.

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

Referenced by ZMuMu_MCanalyzer::analyze().

137  {
138  const pat::Muon * mu = dynamic_cast<const pat::Muon *>(&*c->masterClone());
139  if(mu != 0) return isolation(mu, ptThreshold, etEcalThreshold, etHcalThreshold ,dRVetoTrk, dRTrk, dREcal , dRHcal, alpha, beta, relativeIsolation);
140  const pat::GenericParticle * trk = dynamic_cast<const pat::GenericParticle*>(&*c->masterClone());
141  if(trk != 0) return isolation(trk, ptThreshold, etEcalThreshold, etHcalThreshold ,dRVetoTrk, dRTrk, dREcal ,
142  dRHcal, alpha, beta, relativeIsolation);
144  << "Candidate daughter #0 is neither pat::Muons nor pat::GenericParticle\n";
145  return -1;
146 }
const double beta
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
Analysis-level muon class.
Definition: Muon.h:50
virtual const CandidateBaseRef & masterClone() const =0
DEFINE_FWK_MODULE ( ZMuMu_MCanalyzer  )
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 101 of file ZMuMu_MCanalyzer.cc.

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

101  {
102  // on 34X:
103  const pat::IsoDeposit * trkIso = t->isoDeposit(pat::TrackIso);
104  // const pat::IsoDeposit * trkIso = t->trackerIsoDeposit();
105  // on 34X
106  const pat::IsoDeposit * ecalIso = t->isoDeposit(pat::EcalIso);
107  // const pat::IsoDeposit * ecalIso = t->ecalIsoDeposit();
108  // on 34X
109  const pat::IsoDeposit * hcalIso = t->isoDeposit(pat::HcalIso);
110  // const pat::IsoDeposit * hcalIso = t->hcalIsoDeposit();
111 
112  Direction dir = Direction(t->eta(), t->phi());
113 
114  pat::IsoDeposit::AbsVetos vetosTrk;
115  vetosTrk.push_back(new ConeVeto( dir, dRVetoTrk ));
116  vetosTrk.push_back(new ThresholdVeto( ptThreshold ));
117 
118  pat::IsoDeposit::AbsVetos vetosEcal;
119  vetosEcal.push_back(new ConeVeto( dir, 0.));
120  vetosEcal.push_back(new ThresholdVeto( etEcalThreshold ));
121 
122  pat::IsoDeposit::AbsVetos vetosHcal;
123  vetosHcal.push_back(new ConeVeto( dir, 0. ));
124  vetosHcal.push_back(new ThresholdVeto( etHcalThreshold ));
125 
126  double isovalueTrk = (trkIso->sumWithin(dRTrk,vetosTrk));
127  double isovalueEcal = (ecalIso->sumWithin(dREcal,vetosEcal));
128  double isovalueHcal = (hcalIso->sumWithin(dRHcal,vetosHcal));
129 
130 
131  double iso = alpha*( ((1+beta)/2*isovalueEcal) + ((1-beta)/2*isovalueHcal) ) + ((1-alpha)*isovalueTrk) ;
132  if(relativeIsolation) iso /= t->pt();
133  return iso;
134 }
const double beta
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