CMS 3D CMS Logo

List of all members | Public Member Functions | Static Public Member Functions | Private Types | Private Member Functions | Private Attributes
HLTScoutingEgammaProducer Class Reference

#include <HLTrigger/Egamma/src/HLTScoutingEgammaProducer.cc>

Inheritance diagram for HLTScoutingEgammaProducer:
edm::global::EDProducer<> edm::global::EDProducerBase edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

 HLTScoutingEgammaProducer (const edm::ParameterSet &)
 
 ~HLTScoutingEgammaProducer ()
 
- Public Member Functions inherited from edm::global::EDProducer<>
 EDProducer ()=default
 
- Public Member Functions inherited from edm::global::EDProducerBase
 EDProducerBase ()
 
ModuleDescription const & moduleDescription () const
 
virtual ~EDProducerBase ()
 
- Public Member Functions inherited from edm::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
std::vector< edm::ProductResolverIndex > const & indiciesForPutProducts (BranchType iBranchType) const
 
 ProducerBase ()
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
std::function< void(BranchDescription const &)> registrationCallback () const
 used by the fwk to register list of products More...
 
void resolvePutIndicies (BranchType iBranchType, std::unordered_multimap< std::string, edm::ProductResolverIndex > const &iIndicies, std::string const &moduleLabel)
 
virtual ~ProducerBase () noexcept(false)
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
void convertCurrentProcessAlias (std::string const &processName)
 Convert "@currentProcess" in InputTag process names to the actual current process name. More...
 
 EDConsumerBase ()
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
 EDConsumerBase (EDConsumerBase &&)=default
 
ProductResolverIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
std::vector< ProductResolverIndexAndSkipBit > const & itemsToGetFrom (BranchType iType) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
virtual ~EDConsumerBase () noexcept(false)
 

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &descriptions)
 
- Static Public Member Functions inherited from edm::global::EDProducerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 

Private Types

typedef edm::AssociationMap< edm::OneToValue< std::vector< reco::RecoEcalCandidate >, float, unsigned int > > RecoEcalCandMap
 

Private Member Functions

virtual void produce (edm::StreamID sid, edm::Event &iEvent, edm::EventSetup const &setup) const override final
 

Private Attributes

const edm::EDGetTokenT< RecoEcalCandMapDetaMap_
 
const edm::EDGetTokenT< RecoEcalCandMapDphiMap_
 
const edm::EDGetTokenT< RecoEcalCandMapEcalPFClusterIsoMap_
 
const edm::EDGetTokenT< reco::RecoEcalCandidateCollectionEgammaCandidateCollection_
 
const double egammaEtaCut
 
const edm::EDGetTokenT< reco::GsfTrackCollectionEgammaGsfTrackCollection_
 
const double egammaHoverECut
 
const double egammaPtCut
 
const edm::EDGetTokenT< RecoEcalCandMapEleGsfTrackIsoMap_
 
const edm::EDGetTokenT< RecoEcalCandMapHcalPFClusterIsoMap_
 
const edm::EDGetTokenT< RecoEcalCandMapHoverEMap_
 
const edm::EDGetTokenT< RecoEcalCandMapMissingHitsMap_
 
const edm::EDGetTokenT< RecoEcalCandMapOneOEMinusOneOPMap_
 
const edm::EDGetTokenT< RecoEcalCandMapSigmaIEtaIEtaMap_
 

Additional Inherited Members

- Public Types inherited from edm::global::EDProducerBase
typedef EDProducerBase ModuleType
 
- Public Types inherited from edm::ProducerBase
typedef ProductRegistryHelper::TypeLabelList TypeLabelList
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken consumes (TypeToGet const &id, edm::InputTag const &tag)
 
ConsumesCollector consumesCollector ()
 Use a ConsumesCollector to gather consumes information from helper functions. More...
 
template<typename ProductType , BranchType B = InEvent>
void consumesMany ()
 
void consumesMany (const TypeToGet &id)
 
template<BranchType B>
void consumesMany (const TypeToGet &id)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 

Detailed Description

Description: Producer for ScoutingElectron and ScoutingPhoton

Definition at line 44 of file HLTScoutingEgammaProducer.h.

Member Typedef Documentation

Definition at line 46 of file HLTScoutingEgammaProducer.h.

Constructor & Destructor Documentation

HLTScoutingEgammaProducer::HLTScoutingEgammaProducer ( const edm::ParameterSet iConfig)
explicit

Definition at line 22 of file HLTScoutingEgammaProducer.cc.

References ~HLTScoutingEgammaProducer().

22  :
23  EgammaCandidateCollection_(consumes<reco::RecoEcalCandidateCollection>
24  (iConfig.getParameter<edm::InputTag>("EgammaCandidates"))),
25  EgammaGsfTrackCollection_(consumes<reco::GsfTrackCollection>
26  (iConfig.getParameter<edm::InputTag>("EgammaGsfTracks"))),
27  SigmaIEtaIEtaMap_(consumes<RecoEcalCandMap>(iConfig.getParameter<edm::InputTag>(
28  "SigmaIEtaIEtaMap"))),
29  HoverEMap_(consumes<RecoEcalCandMap>(iConfig.getParameter<edm::InputTag>("HoverEMap"))),
30  DetaMap_(consumes<RecoEcalCandMap>(iConfig.getParameter<edm::InputTag>("DetaMap"))),
31  DphiMap_(consumes<RecoEcalCandMap>(iConfig.getParameter<edm::InputTag>("DphiMap"))),
32  MissingHitsMap_(consumes<RecoEcalCandMap>(iConfig.getParameter<edm::InputTag>(
33  "MissingHitsMap"))),
34  OneOEMinusOneOPMap_(consumes<RecoEcalCandMap>(iConfig.getParameter<edm::InputTag>(
35  "OneOEMinusOneOPMap"))),
36  EcalPFClusterIsoMap_(consumes<RecoEcalCandMap>(iConfig.getParameter<edm::InputTag>(
37  "EcalPFClusterIsoMap"))),
38  EleGsfTrackIsoMap_(consumes<RecoEcalCandMap>(iConfig.getParameter<edm::InputTag>(
39  "EleGsfTrackIsoMap"))),
40  HcalPFClusterIsoMap_(consumes<RecoEcalCandMap>(iConfig.getParameter<edm::InputTag>(
41  "HcalPFClusterIsoMap"))),
42  egammaPtCut(iConfig.getParameter<double>("egammaPtCut")),
43  egammaEtaCut(iConfig.getParameter<double>("egammaEtaCut")),
44  egammaHoverECut(iConfig.getParameter<double>("egammaHoverECut"))
45 {
46  //register products
47  produces<ScoutingElectronCollection>();
48  produces<ScoutingPhotonCollection>();
49 }
T getParameter(std::string const &) const
const edm::EDGetTokenT< RecoEcalCandMap > SigmaIEtaIEtaMap_
const edm::EDGetTokenT< reco::GsfTrackCollection > EgammaGsfTrackCollection_
const edm::EDGetTokenT< RecoEcalCandMap > EleGsfTrackIsoMap_
const edm::EDGetTokenT< RecoEcalCandMap > HoverEMap_
const edm::EDGetTokenT< reco::RecoEcalCandidateCollection > EgammaCandidateCollection_
const edm::EDGetTokenT< RecoEcalCandMap > DetaMap_
const edm::EDGetTokenT< RecoEcalCandMap > OneOEMinusOneOPMap_
const edm::EDGetTokenT< RecoEcalCandMap > MissingHitsMap_
const edm::EDGetTokenT< RecoEcalCandMap > DphiMap_
const edm::EDGetTokenT< RecoEcalCandMap > HcalPFClusterIsoMap_
const edm::EDGetTokenT< RecoEcalCandMap > EcalPFClusterIsoMap_
HLTScoutingEgammaProducer::~HLTScoutingEgammaProducer ( )
default

Member Function Documentation

void HLTScoutingEgammaProducer::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
static

Definition at line 208 of file HLTScoutingEgammaProducer.cc.

References edm::ConfigurationDescriptions::add(), and edm::ParameterSetDescription::add().

208  {
210  desc.add<edm::InputTag>("EgammaCandidates", edm::InputTag("hltEgammaCandidates"));
211  desc.add<edm::InputTag>("EgammaGsfTracks", edm::InputTag("hltEgammaGsfTracks"));
212  desc.add<edm::InputTag>("SigmaIEtaIEtaMap", edm::InputTag(
213  "hltEgammaClusterShape:sigmaIEtaIEta5x5"));
214  desc.add<edm::InputTag>("HoverEMap", edm::InputTag("hltEgammaHoverE"));
215  desc.add<edm::InputTag>("DetaMap", edm::InputTag("hltEgammaGsfTrackVars:Deta"));
216  desc.add<edm::InputTag>("DphiMap", edm::InputTag("hltEgammaGsfTrackVars:Dphi"));
217  desc.add<edm::InputTag>("MissingHitsMap", edm::InputTag("hltEgammaGsfTrackVars:MissingHits"));
218  desc.add<edm::InputTag>("OneOEMinusOneOPMap", edm::InputTag(
219  "hltEgammaGsfTrackVars:OneOESuperMinusOneOP"));
220  desc.add<edm::InputTag>("EcalPFClusterIsoMap", edm::InputTag("hltEgammaEcalPFClusterIso"));
221  desc.add<edm::InputTag>("EleGsfTrackIsoMap", edm::InputTag("hltEgammaEleGsfTrackIso"));
222  desc.add<edm::InputTag>("HcalPFClusterIsoMap", edm::InputTag("hltEgammaHcalPFClusterIso"));
223  desc.add<double>("egammaPtCut", 4.0);
224  desc.add<double>("egammaEtaCut", 2.5);
225  desc.add<double>("egammaHoverECut", 1.0);
226  descriptions.add("hltScoutingEgammaProducer", desc);
227 }
ParameterDescriptionBase * add(U const &iLabel, T const &value)
void add(std::string const &label, ParameterSetDescription const &psetDescription)
void HLTScoutingEgammaProducer::produce ( edm::StreamID  sid,
edm::Event iEvent,
edm::EventSetup const &  setup 
) const
finaloverrideprivatevirtual

Implements edm::global::EDProducerBase.

Definition at line 54 of file HLTScoutingEgammaProducer.cc.

References edm::RefToBase< T >::castTo(), ALCARECOTkAlJpsiMuMu_cff::charge, allConversions_cfi::d0, DetaMap_, DphiMap_, allConversions_cfi::dz, EcalPFClusterIsoMap_, EgammaCandidateCollection_, egammaEtaCut, EgammaGsfTrackCollection_, egammaHoverECut, egammaPtCut, EleGsfTrackIsoMap_, edm::Event::getByToken(), edm::getRef(), HcalPFClusterIsoMap_, HoverEMap_, diffTreeTool::index, edm::Ref< C, T, F >::isAvailable(), edm::Ref< C, T, F >::isNull(), MissingHitsMap_, eostools::move(), OneOEMinusOneOPMap_, edm::Event::put(), SurveyInfoScenario_cff::seed, SigmaIEtaIEtaMap_, and HiIsolationCommonParameters_cff::track.

55 {
56  using namespace edm;
57 
58  std::unique_ptr<ScoutingElectronCollection> outElectrons(new ScoutingElectronCollection());
59  std::unique_ptr<ScoutingPhotonCollection> outPhotons(new ScoutingPhotonCollection());
60 
61  // Get RecoEcalCandidate
62  Handle<reco::RecoEcalCandidateCollection> EgammaCandidateCollection;
64  EgammaCandidateCollection)){
65  iEvent.put(std::move(outElectrons));
66  iEvent.put(std::move(outPhotons));
67  return;
68  }
69 
70  // Get GsfTrack
71  Handle<reco::GsfTrackCollection> EgammaGsfTrackCollection;
73  EgammaGsfTrackCollection)){
74  iEvent.put(std::move(outElectrons));
75  iEvent.put(std::move(outPhotons));
76  return;
77  }
78 
79  // Get SigmaIEtaIEtaMap
80  Handle<RecoEcalCandMap> SigmaIEtaIEtaMap;
81  if(!iEvent.getByToken(SigmaIEtaIEtaMap_, SigmaIEtaIEtaMap)){
82  iEvent.put(std::move(outElectrons));
83  iEvent.put(std::move(outPhotons));
84  return;
85  }
86 
87  // Get HoverEMap
88  Handle<RecoEcalCandMap> HoverEMap;
89  if(!iEvent.getByToken(HoverEMap_, HoverEMap)){
90  iEvent.put(std::move(outElectrons));
91  iEvent.put(std::move(outPhotons));
92  return;
93  }
94 
95  // Get DetaMap
97  if(!iEvent.getByToken(DetaMap_, DetaMap)){
98  iEvent.put(std::move(outElectrons));
99  iEvent.put(std::move(outPhotons));
100  return;
101  }
102 
103  // Get DphiMap
104  Handle<RecoEcalCandMap> DphiMap;
105  if(!iEvent.getByToken(DphiMap_, DphiMap)){
106  iEvent.put(std::move(outElectrons));
107  iEvent.put(std::move(outPhotons));
108  return;
109  }
110 
111  // Get MissingHitsMap
112  Handle<RecoEcalCandMap> MissingHitsMap;
113  if(!iEvent.getByToken(MissingHitsMap_, MissingHitsMap)){
114  iEvent.put(std::move(outElectrons));
115  iEvent.put(std::move(outPhotons));
116  return;
117  }
118 
119  // Get 1/E - 1/p Map
120  Handle<RecoEcalCandMap> OneOEMinusOneOPMap;
121  if(!iEvent.getByToken(OneOEMinusOneOPMap_, OneOEMinusOneOPMap)){
122  iEvent.put(std::move(outElectrons));
123  iEvent.put(std::move(outPhotons));
124  return;
125  }
126 
127  // Get EcalPFClusterIsoMap
128  Handle<RecoEcalCandMap> EcalPFClusterIsoMap;
129  if(!iEvent.getByToken(EcalPFClusterIsoMap_, EcalPFClusterIsoMap)){
130  iEvent.put(std::move(outElectrons));
131  iEvent.put(std::move(outPhotons));
132  return;
133  }
134 
135  // Get EleGsfTrackIsoMap
136  Handle<RecoEcalCandMap> EleGsfTrackIsoMap;
137  if(!iEvent.getByToken(EleGsfTrackIsoMap_, EleGsfTrackIsoMap)){
138  iEvent.put(std::move(outElectrons));
139  iEvent.put(std::move(outPhotons));
140  return;
141  }
142 
143  // Get HcalPFClusterIsoMap
144  Handle<RecoEcalCandMap> HcalPFClusterIsoMap;
145  if(!iEvent.getByToken(HcalPFClusterIsoMap_, HcalPFClusterIsoMap)){
146  iEvent.put(std::move(outElectrons));
147  iEvent.put(std::move(outPhotons));
148  return;
149  }
150 
151  // Produce electrons and photons
152  int index = 0;
153  for (auto &candidate : *EgammaCandidateCollection) {
154  reco::RecoEcalCandidateRef candidateRef = getRef(EgammaCandidateCollection, index);
155  ++index;
156  if (candidateRef.isNull() && !candidateRef.isAvailable())
157  continue;
158 
159  if ((*HoverEMap)[candidateRef] > egammaHoverECut)
160  continue;
161  if (candidate.pt() < egammaPtCut)
162  continue;
163  if (fabs(candidate.eta()) > egammaEtaCut)
164  continue;
165 
166  reco::SuperClusterRef scRef = candidate.superCluster();
167  if (scRef.isNull() && !scRef.isAvailable())
168  continue;
169  float d0 = 0.0;
170  float dz = 0.0;
171  int charge = -999;
172  for (auto &track: *EgammaGsfTrackCollection) {
173  RefToBase<TrajectorySeed> seed = track.extra()->seedRef();
175  RefToBase<reco::CaloCluster> caloCluster = elseed->caloCluster();
176  reco::SuperClusterRef scRefFromTrk = caloCluster.castTo<reco::SuperClusterRef>() ;
177  if (scRefFromTrk == scRef) {
178  d0 = track.d0();
179  dz = track.dz();
180  charge = track.charge();
181  }
182  }
183  if (charge == -999) { // No associated track. Candidate is a scouting photon
184  outPhotons->emplace_back(candidate.pt(), candidate.eta(), candidate.phi(),
185  candidate.mass(), (*SigmaIEtaIEtaMap)[candidateRef],
186  (*HoverEMap)[candidateRef],
187  (*EcalPFClusterIsoMap)[candidateRef],
188  (*HcalPFClusterIsoMap)[candidateRef]);
189  } else { // Candidate is a scouting electron
190  outElectrons->emplace_back(candidate.pt(), candidate.eta(), candidate.phi(),
191  candidate.mass(), d0, dz, (*DetaMap)[candidateRef],
192  (*DphiMap)[candidateRef], (*SigmaIEtaIEtaMap)[candidateRef],
193  (*HoverEMap)[candidateRef],
194  (*OneOEMinusOneOPMap)[candidateRef],
195  (*MissingHitsMap)[candidateRef], charge,
196  (*EcalPFClusterIsoMap)[candidateRef],
197  (*HcalPFClusterIsoMap)[candidateRef],
198  (*EleGsfTrackIsoMap)[candidateRef]);
199  }
200  }
201 
202  // Put output
203  iEvent.put(std::move(outElectrons));
204  iEvent.put(std::move(outPhotons));
205 }
helper::MatcherGetRef< C >::ref_type getRef(const Handle< C > &c, size_t k)
Definition: getRef.h:28
bool isAvailable() const
Definition: Ref.h:576
const edm::EDGetTokenT< RecoEcalCandMap > SigmaIEtaIEtaMap_
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:122
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:460
const edm::EDGetTokenT< reco::GsfTrackCollection > EgammaGsfTrackCollection_
const edm::EDGetTokenT< RecoEcalCandMap > EleGsfTrackIsoMap_
const edm::EDGetTokenT< RecoEcalCandMap > HoverEMap_
const edm::EDGetTokenT< reco::RecoEcalCandidateCollection > EgammaCandidateCollection_
const edm::EDGetTokenT< RecoEcalCandMap > DetaMap_
bool isNull() const
Checks for null.
Definition: Ref.h:249
std::vector< ScoutingElectron > ScoutingElectronCollection
const edm::EDGetTokenT< RecoEcalCandMap > OneOEMinusOneOPMap_
const edm::EDGetTokenT< RecoEcalCandMap > MissingHitsMap_
const edm::EDGetTokenT< RecoEcalCandMap > DphiMap_
REF castTo() const
Definition: RefToBase.h:286
HLT enums.
const edm::EDGetTokenT< RecoEcalCandMap > HcalPFClusterIsoMap_
std::vector< ScoutingPhoton > ScoutingPhotonCollection
def move(src, dest)
Definition: eostools.py:510
const edm::EDGetTokenT< RecoEcalCandMap > EcalPFClusterIsoMap_

Member Data Documentation

const edm::EDGetTokenT<RecoEcalCandMap> HLTScoutingEgammaProducer::DetaMap_
private

Definition at line 61 of file HLTScoutingEgammaProducer.h.

Referenced by produce().

const edm::EDGetTokenT<RecoEcalCandMap> HLTScoutingEgammaProducer::DphiMap_
private

Definition at line 62 of file HLTScoutingEgammaProducer.h.

Referenced by produce().

const edm::EDGetTokenT<RecoEcalCandMap> HLTScoutingEgammaProducer::EcalPFClusterIsoMap_
private

Definition at line 65 of file HLTScoutingEgammaProducer.h.

Referenced by produce().

const edm::EDGetTokenT<reco::RecoEcalCandidateCollection> HLTScoutingEgammaProducer::EgammaCandidateCollection_
private

Definition at line 57 of file HLTScoutingEgammaProducer.h.

Referenced by produce().

const double HLTScoutingEgammaProducer::egammaEtaCut
private

Definition at line 70 of file HLTScoutingEgammaProducer.h.

Referenced by produce().

const edm::EDGetTokenT<reco::GsfTrackCollection> HLTScoutingEgammaProducer::EgammaGsfTrackCollection_
private

Definition at line 58 of file HLTScoutingEgammaProducer.h.

Referenced by produce().

const double HLTScoutingEgammaProducer::egammaHoverECut
private

Definition at line 71 of file HLTScoutingEgammaProducer.h.

Referenced by produce().

const double HLTScoutingEgammaProducer::egammaPtCut
private

Definition at line 69 of file HLTScoutingEgammaProducer.h.

Referenced by produce().

const edm::EDGetTokenT<RecoEcalCandMap> HLTScoutingEgammaProducer::EleGsfTrackIsoMap_
private

Definition at line 66 of file HLTScoutingEgammaProducer.h.

Referenced by produce().

const edm::EDGetTokenT<RecoEcalCandMap> HLTScoutingEgammaProducer::HcalPFClusterIsoMap_
private

Definition at line 67 of file HLTScoutingEgammaProducer.h.

Referenced by produce().

const edm::EDGetTokenT<RecoEcalCandMap> HLTScoutingEgammaProducer::HoverEMap_
private

Definition at line 60 of file HLTScoutingEgammaProducer.h.

Referenced by produce().

const edm::EDGetTokenT<RecoEcalCandMap> HLTScoutingEgammaProducer::MissingHitsMap_
private

Definition at line 63 of file HLTScoutingEgammaProducer.h.

Referenced by produce().

const edm::EDGetTokenT<RecoEcalCandMap> HLTScoutingEgammaProducer::OneOEMinusOneOPMap_
private

Definition at line 64 of file HLTScoutingEgammaProducer.h.

Referenced by produce().

const edm::EDGetTokenT<RecoEcalCandMap> HLTScoutingEgammaProducer::SigmaIEtaIEtaMap_
private

Definition at line 59 of file HLTScoutingEgammaProducer.h.

Referenced by produce().