CMS 3D CMS Logo

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/Provenance/interface/RunLumiEventNumber.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 const edm::ParameterSetDescriptionFillerPluginFactory::PMaker< edm::ParameterSetDescriptionFiller< ZToLLEdmNtupleDumper > > s_filler__LINE__ ("ZToLLEdmNtupleDumper")
 
static const 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 96 of file ZToLLEdmNtupleDumper.cc.

References EnergyCorrector::c, Exception, edm::errors::InvalidReference, isolation(), and RPCpg::mu.

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

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

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

Referenced by candIsolation().

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