CMS 3D CMS Logo

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

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 95 of file ZToLLEdmNtupleDumper.cc.

References trackerHits::c, edm::hlt::Exception, edm::errors::InvalidReference, and RPCpg::mu.

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

95  {
96  const pat::Muon * mu = dynamic_cast<const pat::Muon *>(c);
97  if(mu != 0) return isolation(mu, ptThreshold, etEcalThreshold, etHcalThreshold ,dRVetoTrk, dRTrk, dREcal , dRHcal, alpha, beta, relativeIsolation);
98  const pat::GenericParticle * trk = dynamic_cast<const pat::GenericParticle*>(c);
99  if(trk != 0) return isolation(trk, ptThreshold, etEcalThreshold, etHcalThreshold ,dRVetoTrk, dRTrk, dREcal , dRHcal, alpha, beta, relativeIsolation);
101  << "Candidate daughter #0 is neither pat::Muons nor pat::GenericParticle\n";
102  return -1;
103  }
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
DEFINE_FWK_MODULE ( ZToLLEdmNtupleDumper  )
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 beta, dir, pat::EcalIso, pat::HcalIso, reco::IsoDeposit::sumWithin(), and pat::TrackIso.

59  {
60  // on 34X:
61 const pat::IsoDeposit * trkIso = t->isoDeposit(pat::TrackIso);
62 // const pat::IsoDeposit * trkIso = t->trackerIsoDeposit();
63  // on 34X
64 const pat::IsoDeposit * ecalIso = t->isoDeposit(pat::EcalIso);
65 // const pat::IsoDeposit * ecalIso = t->ecalIsoDeposit();
66 // on 34X
67 const pat::IsoDeposit * hcalIso = t->isoDeposit(pat::HcalIso);
68 // const pat::IsoDeposit * hcalIso = t->hcalIsoDeposit();
69 
70  Direction dir = Direction(t->eta(), t->phi());
71 
73  vetosTrk.push_back(new ConeVeto( dir, dRVetoTrk ));
74  vetosTrk.push_back(new ThresholdVeto( ptThreshold ));
75 
76  pat::IsoDeposit::AbsVetos vetosEcal;
77  vetosEcal.push_back(new ConeVeto( dir, 0.));
78  vetosEcal.push_back(new ThresholdVeto( etEcalThreshold ));
79 
80  pat::IsoDeposit::AbsVetos vetosHcal;
81  vetosHcal.push_back(new ConeVeto( dir, 0. ));
82  vetosHcal.push_back(new ThresholdVeto( etHcalThreshold ));
83 
84  double isovalueTrk = (trkIso->sumWithin(dRTrk,vetosTrk));
85  double isovalueEcal = (ecalIso->sumWithin(dREcal,vetosEcal));
86  double isovalueHcal = (hcalIso->sumWithin(dRHcal,vetosHcal));
87 
88 
89  double iso = alpha*( ((1+beta)/2*isovalueEcal) + ((1-beta)/2*isovalueHcal) ) + ((1-alpha)*isovalueTrk) ;
90  if(relativeIsolation) iso /= t->pt();
91  return iso;
92  }
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