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  recoEcalCandidateProducer_(consumes<reco::RecoEcalCandidateCollection> (config.getParameter<edm::InputTag>("recoEcalCandidateProducer"))),
18  trackProducer_ (consumes<reco::TrackCollection>(config.getParameter<edm::InputTag>("trackProducer"))),
19  countTracks_ (config.getParameter<bool>("countTracks")),
20  egTrkIsoPtMin_ (config.getParameter<double>("egTrkIsoPtMin")),
21  egTrkIsoConeSize_ (config.getParameter<double>("egTrkIsoConeSize")),
22  egTrkIsoZSpan_ (config.getParameter<double>("egTrkIsoZSpan")),
23  egTrkIsoRSpan_ (config.getParameter<double>("egTrkIsoRSpan")),
24  egTrkIsoVetoConeSize_ (config.getParameter<double>("egTrkIsoVetoConeSize")),
25  egTrkIsoStripBarrel_ (config.getParameter<double>("egTrkIsoStripBarrel")),
26  egTrkIsoStripEndcap_ (config.getParameter<double>("egTrkIsoStripEndcap")) {
27 
31 
32  //register your products
33  produces < reco::RecoEcalCandidateIsolationMap >();
34 }
35 
37  delete test_;
38 }
39 
42  desc.add<edm::InputTag>(("recoEcalCandidateProducer"), edm::InputTag("hltL1SeededRecoEcalCandidate"));
43  desc.add<edm::InputTag>(("trackProducer"), edm::InputTag("hltL1SeededEgammaRegionalCTFFinalFitWithMaterial"));
44  desc.add<bool>(("countTracks"), false);
45  desc.add<double>(("egTrkIsoPtMin"), 1.0);
46  desc.add<double>(("egTrkIsoConeSize"), 0.29);
47  desc.add<double>(("egTrkIsoZSpan"), 999999.0);
48  desc.add<double>(("egTrkIsoRSpan"), 999999.0);
49  desc.add<double>(("egTrkIsoVetoConeSize"), 0.06);
50  desc.add<double>(("egTrkIsoStripBarrel"), 0.03);
51  desc.add<double>(("egTrkIsoStripEndcap"), 0.03);
52  descriptions.add(("hltEgammaHLTPhotonTrackIsolationProducersRegional"), desc);
53 }
54 
55 
56 // ------------ method called to produce the data ------------
57 void
59 
60  // Get the HLT filtered objects
62  iEvent.getByToken(recoEcalCandidateProducer_,recoecalcandHandle);
63 
64  // Get the barrel hcal hits
66  iEvent.getByToken(trackProducer_, trackHandle);
67  const reco::TrackCollection* trackCollection = trackHandle.product();
68 
69  reco::RecoEcalCandidateIsolationMap isoMap(recoecalcandHandle);
70 
71  for(unsigned int iRecoEcalCand=0; iRecoEcalCand<recoecalcandHandle->size(); iRecoEcalCand++) {
72 
73  reco::RecoEcalCandidateRef recoecalcandref(recoecalcandHandle, iRecoEcalCand);
74 
75  bool usePhotonVertex = false;
76 
77  float isol;
78  if (countTracks_) {
79  isol = test_->photonTrackCount(&(*recoecalcandref), trackCollection, usePhotonVertex);
80  } else {
81  isol = test_->photonPtSum(&(*recoecalcandref), trackCollection, usePhotonVertex);
82  }
83 
84  isoMap.insert(recoecalcandref, isol);
85 
86  }
87 
88  std::auto_ptr<reco::RecoEcalCandidateIsolationMap> isolMap(new reco::RecoEcalCandidateIsolationMap(isoMap));
89  iEvent.put(isolMap);
90 
91 }
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:457
virtual void produce(edm::StreamID sid, edm::Event &, const edm::EventSetup &) const override
std::vector< Track > TrackCollection
collection of Tracks
Definition: TrackFwd.h:13
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:115
ParameterDescriptionBase * add(U const &iLabel, T const &value)
const edm::EDGetTokenT< reco::RecoEcalCandidateCollection > recoEcalCandidateProducer_
T const * product() const
Definition: Handle.h:81
void insert(const key_type &k, const data_type &v)
insert an association
void add(std::string const &label, ParameterSetDescription const &psetDescription)
std::vector< RecoEcalCandidate > RecoEcalCandidateCollection
collectin of RecoEcalCandidate objects
float photonPtSum(const reco::RecoCandidate *const recocand, const reco::TrackCollection *isoTracks, bool useVertex)