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 
9 
11 
12 // Framework
14 
22 
24 
25 
27 
28  // use configuration file to setup input/output collection names
29  photonProducer_ (config.getParameter<edm::InputTag>("photonProducer")),
30 
31  trackProducer_ (config.getParameter<edm::InputTag>("trackProducer")),
32  beamspotProducer_ (config.getParameter<edm::InputTag>("BeamspotProducer")),
33 
34  ptMin_ (config.getParameter<double>("ptMin")),
35  intRadiusBarrel_ (config.getParameter<double>("intRadiusBarrel")),
36  intRadiusEndcap_ (config.getParameter<double>("intRadiusEndcap")),
37  stripBarrel_ (config.getParameter<double>("stripBarrel")),
38  stripEndcap_ (config.getParameter<double>("stripEndcap")),
39  extRadius_ (config.getParameter<double>("extRadius")),
40  maxVtxDist_ (config.getParameter<double>("maxVtxDist")),
41  drb_ (config.getParameter<double>("maxVtxDistXY"))
42 {
43 
44  //register your products
45  produces < edm::ValueMap<double> >();
46 }
47 
48 
50 
51 
52 //
53 // member functions
54 //
55 
56 // ------------ method called to produce the data ------------
57 void
59 {
60 
61  // Get the filtered objects
63  iEvent.getByLabel(photonProducer_,photonHandle);
64 
65  //get the tracks
67  iEvent.getByLabel(trackProducer_,tracks);
69 
71  iEvent.getByLabel(beamspotProducer_,beamSpotH);
73 
74  //prepare product
75  auto isoMap = std::make_unique<edm::ValueMap<double>>();
77  std::vector<double> retV(photonHandle->size(),0);
78 
80 
81  for(unsigned int i = 0 ; i < photonHandle->size(); ++i ){
82  double isoValue = myTkIsolation.getIso(&(photonHandle->at(i))).second;
83  retV[i] = isoValue;
84  }
85 
86  //fill and insert valuemap
87  filler.insert(photonHandle,retV.begin(),retV.end());
88  filler.fill();
89  iEvent.put(std::move(isoMap));
90 
91 }
92 
93 
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:137
std::vector< Track > TrackCollection
collection of Tracks
Definition: TrackFwd.h:14
Definition: config.py:1
int iEvent
Definition: GenABIO.cc:230
EgammaPhotonTkIsolationProducer(const edm::ParameterSet &)
void produce(edm::StreamID sid, edm::Event &, const edm::EventSetup &) const override
math::XYZPoint Point
point in the space
Definition: TrackBase.h:83
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:535
T const * product() const
Definition: Handle.h:81
HLT enums.
const Point & position() const
position
Definition: BeamSpot.h:62
def move(src, dest)
Definition: eostools.py:511