CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
EgammaHLTPhotonTrackIsolationProducersRegional.cc
Go to the documentation of this file.
1 
10 
11 // Framework
18 
21 
25 
29 
30 
31 
32 
34 {
35 
36  recoEcalCandidateProducer_ = conf_.getParameter<edm::InputTag>("recoEcalCandidateProducer");
37  trackProducer_ = conf_.getParameter<edm::InputTag>("trackProducer");
38 
39  countTracks_ = conf_.getParameter<bool>("countTracks");
40 
41  egTrkIsoPtMin_ = conf_.getParameter<double>("egTrkIsoPtMin");
42  egTrkIsoConeSize_ = conf_.getParameter<double>("egTrkIsoConeSize");
43  egTrkIsoZSpan_ = conf_.getParameter<double>("egTrkIsoZSpan");
44  egTrkIsoRSpan_ = conf_.getParameter<double>("egTrkIsoRSpan");
45  egTrkIsoVetoConeSize_ = conf_.getParameter<double>("egTrkIsoVetoConeSize");
46  double egTrkIsoStripBarrel = conf_.getParameter<double>("egTrkIsoStripBarrel");
47  double egTrkIsoStripEndcap = conf_.getParameter<double>("egTrkIsoStripEndcap");
48 
49  test_ = new EgammaHLTTrackIsolation(egTrkIsoPtMin_,egTrkIsoConeSize_,
50  egTrkIsoZSpan_,egTrkIsoRSpan_,egTrkIsoVetoConeSize_,
51  egTrkIsoStripBarrel,egTrkIsoStripEndcap);
52 
53 
54  //register your products
55  produces < reco::RecoEcalCandidateIsolationMap >();
56 
57 }
58 
59 
61 
62 
63 //
64 // member functions
65 //
66 
67 // ------------ method called to produce the data ------------
68 void
70 {
71 
72  // Get the HLT filtered objects
74  iEvent.getByLabel(recoEcalCandidateProducer_,recoecalcandHandle);
75 
76  // Get the barrel hcal hits
78  iEvent.getByLabel(trackProducer_, trackHandle);
79  const reco::TrackCollection* trackCollection = trackHandle.product();
80 
81 
83 
84 
85 
86  for(reco::RecoEcalCandidateCollection::const_iterator iRecoEcalCand = recoecalcandHandle->begin(); iRecoEcalCand != recoecalcandHandle->end(); iRecoEcalCand++){
87 
88  reco::RecoEcalCandidateRef recoecalcandref(recoecalcandHandle,iRecoEcalCand -recoecalcandHandle ->begin());
89  const reco::RecoCandidate *tempiRecoEcalCand = &(*recoecalcandref);
90 
91  bool usePhotonVertex = false;
92 
93  float isol;
94  if (countTracks_) {
95  isol = test_->photonTrackCount(tempiRecoEcalCand,trackCollection,usePhotonVertex);
96  } else {
97  isol = test_->photonPtSum(tempiRecoEcalCand,trackCollection,usePhotonVertex);
98  }
99 
100  isoMap.insert(recoecalcandref, isol);
101 
102  }
103 
104  std::auto_ptr<reco::RecoEcalCandidateIsolationMap> isolMap(new reco::RecoEcalCandidateIsolationMap(isoMap));
105  iEvent.put(isolMap);
106 
107 }
108 
109 //define this as a plug-in
110 //DEFINE_FWK_MODULE(EgammaHLTTrackIsolationProducers);
T getParameter(std::string const &) const
std::vector< Track > TrackCollection
collection of Tracks
Definition: TrackFwd.h:10
int photonTrackCount(const reco::RecoCandidate *const recocand, const reco::TrackCollection *isoTracks, bool useVertex)
int iEvent
Definition: GenABIO.cc:243
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Definition: Event.h:94
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:361
void insert(const key_type &k, const data_type &v)
insert an association
T const * product() const
Definition: Handle.h:74
#define begin
Definition: vmac.h:31
float photonPtSum(const reco::RecoCandidate *const recocand, const reco::TrackCollection *isoTracks, bool useVertex)