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