CMS 3D CMS Logo

EgammaPhotonTkNumIsolationProducer.cc
Go to the documentation of this file.
1 //*****************************************************************************
2 // File: EgammaPhotonTkNumIsolationProducer.cc
3 // ----------------------------------------------------------------------------
4 // OrigAuth: Matthias Mozer
5 // Institute: IIHE-VUB
6 //=============================================================================
7 //*****************************************************************************
8 
10 
11 // Framework
13 
18 
20 
22  :
23 
24  // use configuration file to setup input/output collection names
25  photonProducer_(config.getParameter<edm::InputTag>("photonProducer")),
26 
27  trackProducer_(config.getParameter<edm::InputTag>("trackProducer")),
28  beamspotProducer_(config.getParameter<edm::InputTag>("BeamspotProducer")),
29 
30  ptMin_(config.getParameter<double>("ptMin")),
31  intRadiusBarrel_(config.getParameter<double>("intRadiusBarrel")),
32  intRadiusEndcap_(config.getParameter<double>("intRadiusEndcap")),
33  stripBarrel_(config.getParameter<double>("stripBarrel")),
34  stripEndcap_(config.getParameter<double>("stripEndcap")),
35  extRadius_(config.getParameter<double>("extRadius")),
36  maxVtxDist_(config.getParameter<double>("maxVtxDist")),
37  drb_(config.getParameter<double>("maxVtxDistXY"))
38 
39 {
40  //register your products
41  produces<edm::ValueMap<int>>();
42 }
43 
45 
46 //
47 // member functions
48 //
49 
50 // ------------ method called to produce the data ------------
53  const edm::EventSetup& iSetup) const {
54  // Get the filtered objects
56  iEvent.getByLabel(photonProducer_, photonHandle);
57 
58  //get the tracks
60  iEvent.getByLabel(trackProducer_, tracks);
61  const reco::TrackCollection* trackCollection = tracks.product();
62 
63  //get beamspot
65  iEvent.getByLabel(beamspotProducer_, beamSpotH);
67 
68  //prepare product
69  auto isoMap = std::make_unique<edm::ValueMap<int>>();
71  std::vector<int> retV(photonHandle->size(), 0);
72 
73  PhotonTkIsolation myTkIsolation(extRadius_,
78  ptMin_,
80  drb_,
82  beamspot);
83 
84  for (unsigned int i = 0; i < photonHandle->size(); ++i) {
85  int isoValue = myTkIsolation.getIso(&(photonHandle->at(i))).first;
86  retV[i] = isoValue;
87  }
88 
89  //fill and insert valuemap
90  filler.insert(photonHandle, retV.begin(), retV.end());
91  filler.fill();
92  iEvent.put(std::move(isoMap));
93 }
PhotonTkIsolation
Definition: PhotonTkIsolation.h:22
EgammaPhotonTkNumIsolationProducer::ptMin_
const double ptMin_
Definition: EgammaPhotonTkNumIsolationProducer.h:32
edm::StreamID
Definition: StreamID.h:30
EgammaPhotonTkNumIsolationProducer.h
Handle.h
PDWG_EXOHSCP_cff.tracks
tracks
Definition: PDWG_EXOHSCP_cff.py:28
mps_fire.i
i
Definition: mps_fire.py:355
EgammaPhotonTkNumIsolationProducer::stripEndcap_
const double stripEndcap_
Definition: EgammaPhotonTkNumIsolationProducer.h:36
edm
HLT enums.
Definition: AlignableModifier.h:19
EgammaPhotonTkNumIsolationProducer::drb_
const double drb_
Definition: EgammaPhotonTkNumIsolationProducer.h:39
EgammaPhotonTkNumIsolationProducer::intRadiusBarrel_
const double intRadiusBarrel_
Definition: EgammaPhotonTkNumIsolationProducer.h:33
EgammaPhotonTkNumIsolationProducer::stripBarrel_
const double stripBarrel_
Definition: EgammaPhotonTkNumIsolationProducer.h:35
edm::Handle
Definition: AssociativeIterator.h:50
config
Definition: config.py:1
TrackFwd.h
BeamSpot.h
EgammaPhotonTkNumIsolationProducer::~EgammaPhotonTkNumIsolationProducer
~EgammaPhotonTkNumIsolationProducer() override
Definition: EgammaPhotonTkNumIsolationProducer.cc:44
beamspot
Definition: BeamSpotWrite2Txt.h:8
reco::BeamSpot::position
const Point & position() const
position
Definition: BeamSpot.h:59
EgammaPhotonTkNumIsolationProducer::maxVtxDist_
const double maxVtxDist_
Definition: EgammaPhotonTkNumIsolationProducer.h:38
HLT_2018_cff.InputTag
InputTag
Definition: HLT_2018_cff.py:79016
edm::ParameterSet
Definition: ParameterSet.h:36
EgammaPhotonTkNumIsolationProducer::EgammaPhotonTkNumIsolationProducer
EgammaPhotonTkNumIsolationProducer(const edm::ParameterSet &)
Definition: EgammaPhotonTkNumIsolationProducer.cc:21
CandAssociation.h
duplicaterechits_cfi.trackCollection
trackCollection
Definition: duplicaterechits_cfi.py:4
trigObjTnPSource_cfi.filler
filler
Definition: trigObjTnPSource_cfi.py:21
EgammaPhotonTkNumIsolationProducer::beamspotProducer_
const edm::InputTag beamspotProducer_
Definition: EgammaPhotonTkNumIsolationProducer.h:30
iEvent
int iEvent
Definition: GenABIO.cc:224
edm::EventSetup
Definition: EventSetup.h:57
EgammaPhotonTkNumIsolationProducer::trackProducer_
const edm::InputTag trackProducer_
Definition: EgammaPhotonTkNumIsolationProducer.h:29
EgammaPhotonTkNumIsolationProducer::extRadius_
const double extRadius_
Definition: EgammaPhotonTkNumIsolationProducer.h:37
reco::TrackBase::Point
math::XYZPoint Point
point in the space
Definition: TrackBase.h:80
PhotonTkIsolation.h
eostools.move
def move(src, dest)
Definition: eostools.py:511
EgammaPhotonTkNumIsolationProducer::produce
void produce(edm::StreamID sid, edm::Event &, const edm::EventSetup &) const override
Definition: EgammaPhotonTkNumIsolationProducer.cc:51
EgammaPhotonTkNumIsolationProducer::intRadiusEndcap_
const double intRadiusEndcap_
Definition: EgammaPhotonTkNumIsolationProducer.h:34
Candidate.h
edm::helper::Filler
Definition: ValueMap.h:22
edm::Event
Definition: Event.h:73
reco::TrackCollection
std::vector< Track > TrackCollection
collection of Tracks
Definition: TrackFwd.h:14
EgammaPhotonTkNumIsolationProducer::photonProducer_
const edm::InputTag photonProducer_
Definition: EgammaPhotonTkNumIsolationProducer.h:28