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 
11 
15 
17 {
18 
19  recoEcalCandidateProducer_ = consumes<reco::RecoEcalCandidateCollection> (conf_.getParameter<edm::InputTag>("recoEcalCandidateProducer"));
20  trackProducer_ = consumes<reco::TrackCollection>(conf_.getParameter<edm::InputTag>("trackProducer"));
21 
22  countTracks_ = conf_.getParameter<bool>("countTracks");
23 
24  egTrkIsoPtMin_ = conf_.getParameter<double>("egTrkIsoPtMin");
25  egTrkIsoConeSize_ = conf_.getParameter<double>("egTrkIsoConeSize");
26  egTrkIsoZSpan_ = conf_.getParameter<double>("egTrkIsoZSpan");
27  egTrkIsoRSpan_ = conf_.getParameter<double>("egTrkIsoRSpan");
28  egTrkIsoVetoConeSize_ = conf_.getParameter<double>("egTrkIsoVetoConeSize");
29  double egTrkIsoStripBarrel = conf_.getParameter<double>("egTrkIsoStripBarrel");
30  double egTrkIsoStripEndcap = conf_.getParameter<double>("egTrkIsoStripEndcap");
31 
32  test_ = new EgammaHLTTrackIsolation(egTrkIsoPtMin_,egTrkIsoConeSize_,
33  egTrkIsoZSpan_,egTrkIsoRSpan_,egTrkIsoVetoConeSize_,
34  egTrkIsoStripBarrel,egTrkIsoStripEndcap);
35 
36 
37  //register your products
38  produces < reco::RecoEcalCandidateIsolationMap >();
39 
40 }
41 
43 
46  desc.add<edm::InputTag>(("recoEcalCandidateProducer"), edm::InputTag("hltL1SeededRecoEcalCandidate"));
47  desc.add<edm::InputTag>(("trackProducer"), edm::InputTag("hltL1SeededEgammaRegionalCTFFinalFitWithMaterial"));
48  desc.add<bool>(("countTracks"), false);
49  desc.add<double>(("egTrkIsoPtMin"), 1.0);
50  desc.add<double>(("egTrkIsoConeSize"), 0.29);
51  desc.add<double>(("egTrkIsoZSpan"), 999999.0);
52  desc.add<double>(("egTrkIsoRSpan"), 999999.0);
53  desc.add<double>(("egTrkIsoVetoConeSize"), 0.06);
54  desc.add<double>(("egTrkIsoStripBarrel"), 0.03);
55  desc.add<double>(("egTrkIsoStripEndcap"), 0.03);
56  descriptions.add(("hltEgammaHLTPhotonTrackIsolationProducersRegional"), desc);
57 }
58 
59 
60 // ------------ method called to produce the data ------------
61 void
63 {
64 
65  // Get the HLT filtered objects
67  iEvent.getByToken(recoEcalCandidateProducer_,recoecalcandHandle);
68 
69  // Get the barrel hcal hits
71  iEvent.getByToken(trackProducer_, trackHandle);
72  const reco::TrackCollection* trackCollection = trackHandle.product();
73 
75 
76  for(unsigned int iRecoEcalCand=0; iRecoEcalCand<recoecalcandHandle->size(); iRecoEcalCand++) {
77 
78  reco::RecoEcalCandidateRef recoecalcandref(recoecalcandHandle, iRecoEcalCand);
79 
80  bool usePhotonVertex = false;
81 
82  float isol;
83  if (countTracks_) {
84  isol = test_->photonTrackCount(&(*recoecalcandref), trackCollection, usePhotonVertex);
85  } else {
86  isol = test_->photonPtSum(&(*recoecalcandref), trackCollection, usePhotonVertex);
87  }
88 
89  isoMap.insert(recoecalcandref, isol);
90 
91  }
92 
93  std::auto_ptr<reco::RecoEcalCandidateIsolationMap> isolMap(new reco::RecoEcalCandidateIsolationMap(isoMap));
94  iEvent.put(isolMap);
95 
96 }
T getParameter(std::string const &) const
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:434
std::vector< Track > TrackCollection
collection of Tracks
Definition: TrackFwd.h:10
edm::EDGetTokenT< reco::RecoEcalCandidateCollection > recoEcalCandidateProducer_
int photonTrackCount(const reco::RecoCandidate *const recocand, const reco::TrackCollection *isoTracks, bool useVertex)
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
int iEvent
Definition: GenABIO.cc:230
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Definition: Event.h:116
ParameterDescriptionBase * add(U const &iLabel, T const &value)
void insert(const key_type &k, const data_type &v)
insert an association
void add(std::string const &label, ParameterSetDescription const &psetDescription)
T const * product() const
Definition: Handle.h:81
float photonPtSum(const reco::RecoCandidate *const recocand, const reco::TrackCollection *isoTracks, bool useVertex)