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)
 
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
edm::ParameterSetDescriptionFillerPluginFactory::PMaker
< edm::ParameterSetDescriptionFiller
< ZToLLEdmNtupleDumper > > 
s_filler__LINE__ ("ZToLLEdmNtupleDumper")
 
static
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 93 of file ZToLLEdmNtupleDumper.cc.

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

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

93  {
94  const pat::Muon * mu = dynamic_cast<const pat::Muon *>(c);
95  if(mu != 0) return isolation(mu, ptThreshold, etEcalThreshold, etHcalThreshold ,dRVetoTrk, dRTrk, dREcal , dRHcal, alpha, beta, relativeIsolation);
96  const pat::GenericParticle * trk = dynamic_cast<const pat::GenericParticle*>(c);
97  if(trk != 0) return isolation(trk, ptThreshold, etEcalThreshold, etHcalThreshold ,dRVetoTrk, dRTrk, dREcal , dRHcal, alpha, beta, relativeIsolation);
99  << "Candidate daughter #0 is neither pat::Muons nor pat::GenericParticle\n";
100  return -1;
101  }
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:23
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 57 of file ZToLLEdmNtupleDumper.cc.

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

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