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_ = conf_.getParameter<edm::InputTag>("photonProducer");
30 
31  trackProducer_ = conf_.getParameter<edm::InputTag>("trackProducer");
32  beamspotProducer_ = conf_.getParameter<edm::InputTag>("BeamspotProducer");
33 
34  ptMin_ = conf_.getParameter<double>("ptMin");
35  intRadiusBarrel_ = conf_.getParameter<double>("intRadiusBarrel");
36  intRadiusEndcap_ = conf_.getParameter<double>("intRadiusEndcap");
37  stripBarrel_ = conf_.getParameter<double>("stripBarrel");
38  stripEndcap_ = conf_.getParameter<double>("stripEndcap");
39  extRadius_ = conf_.getParameter<double>("extRadius");
40  maxVtxDist_ = conf_.getParameter<double>("maxVtxDist");
41  drb_ = conf_.getParameter<double>("maxVtxDistXY");
42 
43  //register your products
44  produces < edm::ValueMap<double> >();
45 }
46 
47 
49 
50 
51 //
52 // member functions
53 //
54 
55 // ------------ method called to produce the data ------------
56 void
58 {
59 
60  // Get the filtered objects
62  iEvent.getByLabel(photonProducer_,photonHandle);
63 
64  //get the tracks
66  iEvent.getByLabel(trackProducer_,tracks);
68 
70  iEvent.getByLabel(beamspotProducer_,beamSpotH);
72 
73  //prepare product
74  auto isoMap = std::make_unique<edm::ValueMap<double>>();
76  std::vector<double> retV(photonHandle->size(),0);
77 
79 
80  for(unsigned int i = 0 ; i < photonHandle->size(); ++i ){
81  double isoValue = myTkIsolation.getIso(&(photonHandle->at(i))).second;
82  retV[i] = isoValue;
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 
T getParameter(std::string const &) const
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:15
Definition: config.py:1
int iEvent
Definition: GenABIO.cc:230
EgammaPhotonTkIsolationProducer(const edm::ParameterSet &)
math::XYZPoint Point
point in the space
Definition: TrackBase.h:83
void produce(edm::Event &, const edm::EventSetup &) override
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:535
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