CMS 3D CMS Logo

EgammaPhotonTkIsolationProducer.cc
Go to the documentation of this file.
1 //*****************************************************************************
2 // File: EgammaPhotonTkIsolationProducer.cc
3 // ----------------------------------------------------------------------------
4 // OrigAuth: Matthias Mozer
5 // Institute: IIHE-VUB
6 //=============================================================================
7 //*****************************************************************************
8 
10 
11 // Framework
13 
21 
23 
25  :
26 
27  // use configuration file to setup input/output collection names
28  photonProducer_(config.getParameter<edm::InputTag>("photonProducer")),
29 
30  trackProducer_(config.getParameter<edm::InputTag>("trackProducer")),
31  beamspotProducer_(config.getParameter<edm::InputTag>("BeamspotProducer")),
32 
33  ptMin_(config.getParameter<double>("ptMin")),
34  intRadiusBarrel_(config.getParameter<double>("intRadiusBarrel")),
35  intRadiusEndcap_(config.getParameter<double>("intRadiusEndcap")),
36  stripBarrel_(config.getParameter<double>("stripBarrel")),
37  stripEndcap_(config.getParameter<double>("stripEndcap")),
38  extRadius_(config.getParameter<double>("extRadius")),
39  maxVtxDist_(config.getParameter<double>("maxVtxDist")),
40  drb_(config.getParameter<double>("maxVtxDistXY")) {
41  //register your products
42  produces<edm::ValueMap<double>>();
43 }
44 
46 
47 //
48 // member functions
49 //
50 
51 // ------------ method called to produce the data ------------
54  const edm::EventSetup& iSetup) const {
55  // Get the filtered objects
57  iEvent.getByLabel(photonProducer_, photonHandle);
58 
59  //get the tracks
61  iEvent.getByLabel(trackProducer_, tracks);
62  const reco::TrackCollection* trackCollection = tracks.product();
63 
65  iEvent.getByLabel(beamspotProducer_, beamSpotH);
67 
68  //prepare product
69  auto isoMap = std::make_unique<edm::ValueMap<double>>();
71  std::vector<double> 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  double isoValue = myTkIsolation.getIso(&(photonHandle->at(i))).second;
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:20
edm::StreamID
Definition: StreamID.h:30
Handle.h
PDWG_EXOHSCP_cff.tracks
tracks
Definition: PDWG_EXOHSCP_cff.py:28
mps_fire.i
i
Definition: mps_fire.py:428
EgammaPhotonTkIsolationProducer::maxVtxDist_
const double maxVtxDist_
Definition: EgammaPhotonTkIsolationProducer.h:38
EgammaPhotonTkIsolationProducer::extRadius_
const double extRadius_
Definition: EgammaPhotonTkIsolationProducer.h:37
edm
HLT enums.
Definition: AlignableModifier.h:19
HLT_FULL_cff.InputTag
InputTag
Definition: HLT_FULL_cff.py:85964
EgammaPhotonTkIsolationProducer::EgammaPhotonTkIsolationProducer
EgammaPhotonTkIsolationProducer(const edm::ParameterSet &)
Definition: EgammaPhotonTkIsolationProducer.cc:24
EgammaPhotonTkIsolationProducer::~EgammaPhotonTkIsolationProducer
~EgammaPhotonTkIsolationProducer() override
Definition: EgammaPhotonTkIsolationProducer.cc:45
EgammaPhotonTkIsolationProducer::produce
void produce(edm::StreamID sid, edm::Event &, const edm::EventSetup &) const override
Definition: EgammaPhotonTkIsolationProducer.cc:52
edm::Handle
Definition: AssociativeIterator.h:50
RecoCandidate.h
config
Definition: config.py:1
EgammaPhotonTkIsolationProducer.h
TrackFwd.h
BeamSpot.h
beamspot
Definition: BeamSpotWrite2Txt.h:8
EgammaPhotonTkIsolationProducer::intRadiusBarrel_
const double intRadiusBarrel_
Definition: EgammaPhotonTkIsolationProducer.h:33
EgammaPhotonTkIsolationProducer::drb_
const double drb_
Definition: EgammaPhotonTkIsolationProducer.h:39
EgammaPhotonTkIsolationProducer::intRadiusEndcap_
const double intRadiusEndcap_
Definition: EgammaPhotonTkIsolationProducer.h:34
reco::BeamSpot::position
const Point & position() const
position
Definition: BeamSpot.h:59
edm::ParameterSet
Definition: ParameterSet.h:47
EgammaPhotonTkIsolationProducer::trackProducer_
const edm::InputTag trackProducer_
Definition: EgammaPhotonTkIsolationProducer.h:29
CandAssociation.h
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
EgammaPhotonTkIsolationProducer::stripBarrel_
const double stripBarrel_
Definition: EgammaPhotonTkIsolationProducer.h:35
edm::EventSetup
Definition: EventSetup.h:57
EgammaPhotonTkIsolationProducer::photonProducer_
const edm::InputTag photonProducer_
Definition: EgammaPhotonTkIsolationProducer.h:28
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
SuperClusterFwd.h
SuperCluster.h
EgammaPhotonTkIsolationProducer::stripEndcap_
const double stripEndcap_
Definition: EgammaPhotonTkIsolationProducer.h:36
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
EgammaPhotonTkIsolationProducer::ptMin_
const double ptMin_
Definition: EgammaPhotonTkIsolationProducer.h:32
EgammaPhotonTkIsolationProducer::beamspotProducer_
const edm::InputTag beamspotProducer_
Definition: EgammaPhotonTkIsolationProducer.h:30