CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
EgammaElectronTkIsolationProducer Class Reference

#include <EgammaElectronTkIsolationProducer.h>

Inheritance diagram for EgammaElectronTkIsolationProducer:
edm::stream::EDProducer<>

Public Member Functions

 EgammaElectronTkIsolationProducer (const edm::ParameterSet &)
 
void produce (edm::Event &, const edm::EventSetup &) override
 
 ~EgammaElectronTkIsolationProducer () override
 
- Public Member Functions inherited from edm::stream::EDProducer<>
 EDProducer ()=default
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndRuns () const final
 

Private Attributes

edm::InputTag beamspotProducer_
 
edm::ParameterSet conf_
 
double drb_
 
edm::InputTag electronProducer_
 
double extRadius_
 
double intRadiusBarrel_
 
double intRadiusEndcap_
 
double maxVtxDist_
 
double ptMin_
 
double stripBarrel_
 
double stripEndcap_
 
edm::InputTag trackProducer_
 

Additional Inherited Members

- Public Types inherited from edm::stream::EDProducer<>
typedef CacheContexts< T... > CacheTypes
 
typedef CacheTypes::GlobalCache GlobalCache
 
typedef AbilityChecker< T... > HasAbility
 
typedef CacheTypes::LuminosityBlockCache LuminosityBlockCache
 
typedef LuminosityBlockContextT< LuminosityBlockCache, RunCache, GlobalCacheLuminosityBlockContext
 
typedef CacheTypes::LuminosityBlockSummaryCache LuminosityBlockSummaryCache
 
typedef CacheTypes::RunCache RunCache
 
typedef RunContextT< RunCache, GlobalCacheRunContext
 
typedef CacheTypes::RunSummaryCache RunSummaryCache
 

Detailed Description

Definition at line 20 of file EgammaElectronTkIsolationProducer.h.

Constructor & Destructor Documentation

◆ EgammaElectronTkIsolationProducer()

EgammaElectronTkIsolationProducer::EgammaElectronTkIsolationProducer ( const edm::ParameterSet config)
explicit

Definition at line 25 of file EgammaElectronTkIsolationProducer.cc.

25  : conf_(config) {
26  // use configuration file to setup input/output collection names
27  electronProducer_ = conf_.getParameter<edm::InputTag>("electronProducer");
28 
29  trackProducer_ = conf_.getParameter<edm::InputTag>("trackProducer");
30  beamspotProducer_ = conf_.getParameter<edm::InputTag>("BeamspotProducer");
31 
32  ptMin_ = conf_.getParameter<double>("ptMin");
33  intRadiusBarrel_ = conf_.getParameter<double>("intRadiusBarrel");
34  intRadiusEndcap_ = conf_.getParameter<double>("intRadiusEndcap");
35  stripBarrel_ = conf_.getParameter<double>("stripBarrel");
36  stripEndcap_ = conf_.getParameter<double>("stripEndcap");
37  extRadius_ = conf_.getParameter<double>("extRadius");
38  maxVtxDist_ = conf_.getParameter<double>("maxVtxDist");
39  drb_ = conf_.getParameter<double>("maxVtxDistXY");
40 
41  //register your products
42  produces<edm::ValueMap<double>>();
43 }

References beamspotProducer_, conf_, drb_, electronProducer_, extRadius_, edm::ParameterSet::getParameter(), intRadiusBarrel_, intRadiusEndcap_, maxVtxDist_, ptMin_, stripBarrel_, stripEndcap_, and trackProducer_.

◆ ~EgammaElectronTkIsolationProducer()

EgammaElectronTkIsolationProducer::~EgammaElectronTkIsolationProducer ( )
override

Definition at line 45 of file EgammaElectronTkIsolationProducer.cc.

45 {}

Member Function Documentation

◆ produce()

void EgammaElectronTkIsolationProducer::produce ( edm::Event iEvent,
const edm::EventSetup iSetup 
)
override

Definition at line 47 of file EgammaElectronTkIsolationProducer.cc.

47  {
48  // Get the filtered objects
50  iEvent.getByLabel(electronProducer_, electronHandle);
51 
52  //get the tracks
54  iEvent.getByLabel(trackProducer_, tracks);
55  const reco::TrackCollection* trackCollection = tracks.product();
56 
57  //prepare product
58  auto isoMap = std::make_unique<edm::ValueMap<double>>();
60  std::vector<double> retV(electronHandle->size(), 0);
61 
63  iEvent.getByLabel(beamspotProducer_, beamSpotH);
64  reco::TrackBase::Point beamspot = beamSpotH->position();
65 
66  ElectronTkIsolation myTkIsolation(extRadius_,
71  ptMin_,
73  drb_,
75  beamspot);
76 
77  for (unsigned int i = 0; i < electronHandle->size(); ++i) {
78  double isoValue = myTkIsolation.getPtTracks(&(electronHandle->at(i)));
79  retV[i] = isoValue;
80  }
81 
82  //fill and insert valuemap
83  filler.insert(electronHandle, retV.begin(), retV.end());
84  filler.fill();
85  iEvent.put(std::move(isoMap));
86 }

References beamspotProducer_, drb_, electronProducer_, extRadius_, trigObjTnPSource_cfi::filler, ElectronTkIsolation::getPtTracks(), mps_fire::i, iEvent, intRadiusBarrel_, intRadiusEndcap_, maxVtxDist_, eostools::move(), ptMin_, stripBarrel_, stripEndcap_, duplicaterechits_cfi::trackCollection, trackProducer_, and PDWG_EXOHSCP_cff::tracks.

Member Data Documentation

◆ beamspotProducer_

edm::InputTag EgammaElectronTkIsolationProducer::beamspotProducer_
private

◆ conf_

edm::ParameterSet EgammaElectronTkIsolationProducer::conf_
private

◆ drb_

double EgammaElectronTkIsolationProducer::drb_
private

◆ electronProducer_

edm::InputTag EgammaElectronTkIsolationProducer::electronProducer_
private

◆ extRadius_

double EgammaElectronTkIsolationProducer::extRadius_
private

◆ intRadiusBarrel_

double EgammaElectronTkIsolationProducer::intRadiusBarrel_
private

◆ intRadiusEndcap_

double EgammaElectronTkIsolationProducer::intRadiusEndcap_
private

◆ maxVtxDist_

double EgammaElectronTkIsolationProducer::maxVtxDist_
private

◆ ptMin_

double EgammaElectronTkIsolationProducer::ptMin_
private

◆ stripBarrel_

double EgammaElectronTkIsolationProducer::stripBarrel_
private

◆ stripEndcap_

double EgammaElectronTkIsolationProducer::stripEndcap_
private

◆ trackProducer_

edm::InputTag EgammaElectronTkIsolationProducer::trackProducer_
private
EgammaElectronTkIsolationProducer::beamspotProducer_
edm::InputTag beamspotProducer_
Definition: EgammaElectronTkIsolationProducer.h:30
PDWG_EXOHSCP_cff.tracks
tracks
Definition: PDWG_EXOHSCP_cff.py:28
mps_fire.i
i
Definition: mps_fire.py:355
EgammaElectronTkIsolationProducer::stripBarrel_
double stripBarrel_
Definition: EgammaElectronTkIsolationProducer.h:35
EgammaElectronTkIsolationProducer::stripEndcap_
double stripEndcap_
Definition: EgammaElectronTkIsolationProducer.h:36
edm::Handle< reco::GsfElectronCollection >
EgammaElectronTkIsolationProducer::intRadiusBarrel_
double intRadiusBarrel_
Definition: EgammaElectronTkIsolationProducer.h:33
EgammaElectronTkIsolationProducer::extRadius_
double extRadius_
Definition: EgammaElectronTkIsolationProducer.h:37
EgammaElectronTkIsolationProducer::conf_
edm::ParameterSet conf_
Definition: EgammaElectronTkIsolationProducer.h:41
config
Definition: config.py:1
EgammaElectronTkIsolationProducer::maxVtxDist_
double maxVtxDist_
Definition: EgammaElectronTkIsolationProducer.h:38
beamspot
Definition: BeamSpotWrite2Txt.h:8
EgammaElectronTkIsolationProducer::electronProducer_
edm::InputTag electronProducer_
Definition: EgammaElectronTkIsolationProducer.h:28
ElectronTkIsolation
Definition: ElectronTkIsolation.h:26
EgammaElectronTkIsolationProducer::trackProducer_
edm::InputTag trackProducer_
Definition: EgammaElectronTkIsolationProducer.h:29
duplicaterechits_cfi.trackCollection
trackCollection
Definition: duplicaterechits_cfi.py:4
trigObjTnPSource_cfi.filler
filler
Definition: trigObjTnPSource_cfi.py:21
iEvent
int iEvent
Definition: GenABIO.cc:224
EgammaElectronTkIsolationProducer::ptMin_
double ptMin_
Definition: EgammaElectronTkIsolationProducer.h:32
EgammaElectronTkIsolationProducer::drb_
double drb_
Definition: EgammaElectronTkIsolationProducer.h:39
reco::TrackBase::Point
math::XYZPoint Point
point in the space
Definition: TrackBase.h:80
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
eostools.move
def move(src, dest)
Definition: eostools.py:511
edm::helper::Filler
Definition: ValueMap.h:22
EgammaElectronTkIsolationProducer::intRadiusEndcap_
double intRadiusEndcap_
Definition: EgammaElectronTkIsolationProducer.h:34
edm::InputTag
Definition: InputTag.h:15
reco::TrackCollection
std::vector< Track > TrackCollection
collection of Tracks
Definition: TrackFwd.h:14