CMS 3D CMS Logo

EgammaHLTPhotonTrackIsolationProducersRegional.cc
Go to the documentation of this file.
1 // -*- C++ -*-
2 //
3 // Package: EgammaHLTProducers
4 // Class: EgammaHLTPhotonTrackIsolationProducersRegional
5 //
8 //
9 // Original Author: Monica Vazquez Acosta (CERN)
10 // Created: Tue Jun 13 14:48:33 CEST 2006
11 // $Id: EgammaHLTPhotonTrackIsolationProducersRegional.h,v 1.1 2007/03/23 17:22:54 ghezzi Exp $
12 //
13 //
14 
15 // system include files
16 #include <memory>
17 
18 // user include files
21 
24 
26 
30 
33 
35 
39 
41 public:
44 
45  static void fillDescriptions(edm::ConfigurationDescriptions& descriptions);
46  void produce(edm::StreamID sid, edm::Event&, const edm::EventSetup&) const override;
47 
48 private:
49  // ----------member data ---------------------------
50 
53 
54  //edm::ParameterSet conf_;
55 
56  const bool countTracks_;
57 
58  const double egTrkIsoPtMin_;
59  const double egTrkIsoConeSize_;
60  const double egTrkIsoZSpan_;
61  const double egTrkIsoRSpan_;
62  const double egTrkIsoVetoConeSize_;
63  const double egTrkIsoStripBarrel_;
64  const double egTrkIsoStripEndcap_;
65 
67 };
68 
71  : recoEcalCandidateProducer_(
72  consumes<reco::RecoEcalCandidateCollection>(config.getParameter<edm::InputTag>("recoEcalCandidateProducer"))),
73  trackProducer_(consumes<reco::TrackCollection>(config.getParameter<edm::InputTag>("trackProducer"))),
74  countTracks_(config.getParameter<bool>("countTracks")),
75  egTrkIsoPtMin_(config.getParameter<double>("egTrkIsoPtMin")),
76  egTrkIsoConeSize_(config.getParameter<double>("egTrkIsoConeSize")),
77  egTrkIsoZSpan_(config.getParameter<double>("egTrkIsoZSpan")),
78  egTrkIsoRSpan_(config.getParameter<double>("egTrkIsoRSpan")),
79  egTrkIsoVetoConeSize_(config.getParameter<double>("egTrkIsoVetoConeSize")),
80  egTrkIsoStripBarrel_(config.getParameter<double>("egTrkIsoStripBarrel")),
81  egTrkIsoStripEndcap_(config.getParameter<double>("egTrkIsoStripEndcap")) {
89 
90  //register your products
91  produces<reco::RecoEcalCandidateIsolationMap>();
92 }
93 
95 
98  desc.add<edm::InputTag>(("recoEcalCandidateProducer"), edm::InputTag("hltL1SeededRecoEcalCandidate"));
99  desc.add<edm::InputTag>(("trackProducer"), edm::InputTag("hltL1SeededEgammaRegionalCTFFinalFitWithMaterial"));
100  desc.add<bool>(("countTracks"), false);
101  desc.add<double>(("egTrkIsoPtMin"), 1.0);
102  desc.add<double>(("egTrkIsoConeSize"), 0.29);
103  desc.add<double>(("egTrkIsoZSpan"), 999999.0);
104  desc.add<double>(("egTrkIsoRSpan"), 999999.0);
105  desc.add<double>(("egTrkIsoVetoConeSize"), 0.06);
106  desc.add<double>(("egTrkIsoStripBarrel"), 0.03);
107  desc.add<double>(("egTrkIsoStripEndcap"), 0.03);
108  descriptions.add(("hltEgammaHLTPhotonTrackIsolationProducersRegional"), desc);
109 }
110 
111 // ------------ method called to produce the data ------------
114  const edm::EventSetup&) const {
115  // Get the HLT filtered objects
117  iEvent.getByToken(recoEcalCandidateProducer_, recoecalcandHandle);
118 
119  // Get the barrel hcal hits
121  iEvent.getByToken(trackProducer_, trackHandle);
122  const reco::TrackCollection* trackCollection = trackHandle.product();
123 
124  reco::RecoEcalCandidateIsolationMap isoMap(recoecalcandHandle);
125 
126  for (unsigned int iRecoEcalCand = 0; iRecoEcalCand < recoecalcandHandle->size(); iRecoEcalCand++) {
127  reco::RecoEcalCandidateRef recoecalcandref(recoecalcandHandle, iRecoEcalCand);
128 
129  bool usePhotonVertex = false;
130 
131  float isol;
132  if (countTracks_) {
133  isol = test_->photonTrackCount(&(*recoecalcandref), trackCollection, usePhotonVertex);
134  } else {
135  isol = test_->photonPtSum(&(*recoecalcandref), trackCollection, usePhotonVertex);
136  }
137 
138  isoMap.insert(recoecalcandref, isol);
139  }
140 
141  iEvent.put(std::make_unique<reco::RecoEcalCandidateIsolationMap>(isoMap));
142 }
143 
RecoEcalCandidateIsolation.h
ConfigurationDescriptions.h
edm::StreamID
Definition: StreamID.h:30
reco::RecoEcalCandidateCollection
std::vector< RecoEcalCandidate > RecoEcalCandidateCollection
collectin of RecoEcalCandidate objects
Definition: RecoEcalCandidateFwd.h:9
electrons_cff.bool
bool
Definition: electrons_cff.py:366
EgammaHLTPhotonTrackIsolationProducersRegional::egTrkIsoStripBarrel_
const double egTrkIsoStripBarrel_
Definition: EgammaHLTPhotonTrackIsolationProducersRegional.cc:63
edm::Handle::product
T const * product() const
Definition: Handle.h:70
EgammaHLTPhotonTrackIsolationProducersRegional::egTrkIsoRSpan_
const double egTrkIsoRSpan_
Definition: EgammaHLTPhotonTrackIsolationProducersRegional.cc:61
edm::EDGetTokenT< reco::RecoEcalCandidateCollection >
EgammaHLTTrackIsolation
Definition: EgammaHLTTrackIsolation.h:42
edm
HLT enums.
Definition: AlignableModifier.h:19
HLT_FULL_cff.InputTag
InputTag
Definition: HLT_FULL_cff.py:89301
edm::ParameterSetDescription
Definition: ParameterSetDescription.h:52
EgammaHLTPhotonTrackIsolationProducersRegional::fillDescriptions
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
Definition: EgammaHLTPhotonTrackIsolationProducersRegional.cc:96
reco
fixed size matrix
Definition: AlignmentAlgorithmBase.h:46
edm::Handle
Definition: AssociativeIterator.h:50
edm::Ref
Definition: AssociativeIterator.h:58
EgammaHLTPhotonTrackIsolationProducersRegional::~EgammaHLTPhotonTrackIsolationProducersRegional
~EgammaHLTPhotonTrackIsolationProducersRegional() override
Definition: EgammaHLTPhotonTrackIsolationProducersRegional.cc:94
config
Definition: config.py:1
MakerMacros.h
TrackingRecHit.h
Track.h
TrackFwd.h
DEFINE_FWK_MODULE
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
edm::ConfigurationDescriptions::add
void add(std::string const &label, ParameterSetDescription const &psetDescription)
Definition: ConfigurationDescriptions.cc:57
EgammaHLTPhotonTrackIsolationProducersRegional::egTrkIsoPtMin_
const double egTrkIsoPtMin_
Definition: EgammaHLTPhotonTrackIsolationProducersRegional.cc:58
EgammaHLTTrackIsolation::photonTrackCount
int photonTrackCount(const reco::RecoCandidate *const recocand, const reco::TrackCollection *isoTracks, bool useVertex)
Definition: EgammaHLTTrackIsolation.h:102
EgammaHLTTrackIsolation.h
EgammaHLTPhotonTrackIsolationProducersRegional::trackProducer_
const edm::EDGetTokenT< reco::TrackCollection > trackProducer_
Definition: EgammaHLTPhotonTrackIsolationProducersRegional.cc:52
ParameterSetDescription.h
EgammaHLTPhotonTrackIsolationProducersRegional::test_
EgammaHLTTrackIsolation * test_
Definition: EgammaHLTPhotonTrackIsolationProducersRegional.cc:66
edm::global::EDProducer
Definition: EDProducer.h:32
edm::ConfigurationDescriptions
Definition: ConfigurationDescriptions.h:28
EgammaHLTPhotonTrackIsolationProducersRegional
Definition: EgammaHLTPhotonTrackIsolationProducersRegional.cc:40
EgammaHLTPhotonTrackIsolationProducersRegional::egTrkIsoZSpan_
const double egTrkIsoZSpan_
Definition: EgammaHLTPhotonTrackIsolationProducersRegional.cc:60
edm::ParameterSet
Definition: ParameterSet.h:47
duplicaterechits_cfi.trackCollection
trackCollection
Definition: duplicaterechits_cfi.py:4
Event.h
EgammaHLTPhotonTrackIsolationProducersRegional::egTrkIsoConeSize_
const double egTrkIsoConeSize_
Definition: EgammaHLTPhotonTrackIsolationProducersRegional.cc:59
edm::AssociationMap
Definition: AssociationMap.h:48
iEvent
int iEvent
Definition: GenABIO.cc:224
EgammaHLTPhotonTrackIsolationProducersRegional::produce
void produce(edm::StreamID sid, edm::Event &, const edm::EventSetup &) const override
Definition: EgammaHLTPhotonTrackIsolationProducersRegional.cc:112
edm::EventSetup
Definition: EventSetup.h:58
edm::AssociationMap::insert
void insert(const key_type &k, const data_type &v)
insert an association
Definition: AssociationMap.h:166
EgammaHLTPhotonTrackIsolationProducersRegional::EgammaHLTPhotonTrackIsolationProducersRegional
EgammaHLTPhotonTrackIsolationProducersRegional(const edm::ParameterSet &)
Definition: EgammaHLTPhotonTrackIsolationProducersRegional.cc:69
submitPVResolutionJobs.desc
string desc
Definition: submitPVResolutionJobs.py:251
RecoEcalCandidate.h
EgammaHLTPhotonTrackIsolationProducersRegional::countTracks_
const bool countTracks_
Definition: EgammaHLTPhotonTrackIsolationProducersRegional.cc:56
Frameworkfwd.h
EgammaHLTPhotonTrackIsolationProducersRegional::egTrkIsoStripEndcap_
const double egTrkIsoStripEndcap_
Definition: EgammaHLTPhotonTrackIsolationProducersRegional.cc:64
EgammaHLTTrackIsolation::photonPtSum
float photonPtSum(const reco::RecoCandidate *const recocand, const reco::TrackCollection *isoTracks, bool useVertex)
Definition: EgammaHLTTrackIsolation.h:134
RecoEcalCandidateFwd.h
EgammaHLTPhotonTrackIsolationProducersRegional::recoEcalCandidateProducer_
const edm::EDGetTokenT< reco::RecoEcalCandidateCollection > recoEcalCandidateProducer_
Definition: EgammaHLTPhotonTrackIsolationProducersRegional.cc:51
ParameterSet.h
EDProducer.h
edm::Event
Definition: Event.h:73
edm::InputTag
Definition: InputTag.h:15
reco::TrackCollection
std::vector< Track > TrackCollection
collection of Tracks
Definition: TrackFwd.h:14
EgammaHLTPhotonTrackIsolationProducersRegional::egTrkIsoVetoConeSize_
const double egTrkIsoVetoConeSize_
Definition: EgammaHLTPhotonTrackIsolationProducersRegional.cc:62