CMS 3D CMS Logo

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

#include <EgammaIsoHcalDetIdCollectionProducer.h>

Inheritance diagram for EgammaIsoHcalDetIdCollectionProducer:
edm::stream::EDProducer<>

Public Member Functions

void beginRun (edm::Run const &, const edm::EventSetup &) final
 
 EgammaIsoHcalDetIdCollectionProducer (const edm::ParameterSet &)
 
void produce (edm::Event &, const edm::EventSetup &) override
 
- Public Member Functions inherited from edm::stream::EDProducer<>
 EDProducer ()=default
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginProcessBlocks () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndProcessBlocks () const final
 
bool hasAbilityToProduceInEndRuns () const final
 

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &descriptions)
 

Private Attributes

edm::EDGetTokenT< reco::GsfElectronCollectionelesToken_
 
EGHcalRecHitSelector hcalHitSelector_
 
std::string interestingDetIdCollection_
 
float minEleEt_
 
float minPhoEt_
 
float minSCEt_
 
edm::EDGetTokenT< reco::PhotonCollectionphosToken_
 
edm::EDGetTokenT< HBHERecHitCollectionrecHitsToken_
 
edm::EDGetTokenT< reco::SuperClusterCollectionsuperClustersToken_
 

Additional Inherited Members

- Public Types inherited from edm::stream::EDProducer<>
typedef CacheContexts< T... > CacheTypes
 
typedef CacheTypes::GlobalCache GlobalCache
 
typedef AbilityChecker< T... > HasAbility
 
typedef CacheTypes::LuminosityBlockCache LuminosityBlockCache
 
typedef LuminosityBlockContextT< LuminosityBlockCache, RunCache, GlobalCacheLuminosityBlockContext
 
typedef CacheTypes::LuminosityBlockSummaryCache LuminosityBlockSummaryCache
 
typedef CacheTypes::RunCache RunCache
 
typedef RunContextT< RunCache, GlobalCacheRunContext
 
typedef CacheTypes::RunSummaryCache RunSummaryCache
 

Detailed Description

Original author: Sam Harper (RAL)

Make a collection of detids to be kept tipically in a AOD rechit collection Modified from the ECAL version "InterestingDetIdCollectionProducer" to be HCAL

Definition at line 39 of file EgammaIsoHcalDetIdCollectionProducer.h.

Constructor & Destructor Documentation

◆ EgammaIsoHcalDetIdCollectionProducer()

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

Definition at line 9 of file EgammaIsoHcalDetIdCollectionProducer.cc.

10  : hcalHitSelector_(iConfig.getParameter<edm::ParameterSet>("hitSelection"), consumesCollector()) {
11  recHitsToken_ = consumes<HBHERecHitCollection>(iConfig.getParameter<edm::InputTag>("recHitsLabel"));
12  elesToken_ = consumes<reco::GsfElectronCollection>(iConfig.getParameter<edm::InputTag>("elesLabel"));
13 
14  phosToken_ = consumes<reco::PhotonCollection>(iConfig.getParameter<edm::InputTag>("phosLabel"));
15 
17  consumes<reco::SuperClusterCollection>(iConfig.getParameter<edm::InputTag>("superClustersLabel"));
18 
19  minSCEt_ = iConfig.getParameter<double>("minSCEt");
20  minEleEt_ = iConfig.getParameter<double>("minEleEt");
21  minPhoEt_ = iConfig.getParameter<double>("minPhoEt");
22 
23  interestingDetIdCollection_ = iConfig.getParameter<std::string>("interestingDetIdCollection");
24 
25  //register your products
26  produces<DetIdCollection>(interestingDetIdCollection_);
27 }

References elesToken_, edm::ParameterSet::getParameter(), interestingDetIdCollection_, minEleEt_, minPhoEt_, minSCEt_, phosToken_, recHitsToken_, AlCaHLTBitMon_QueryRunRegistry::string, and superClustersToken_.

Member Function Documentation

◆ beginRun()

void EgammaIsoHcalDetIdCollectionProducer::beginRun ( edm::Run const &  run,
const edm::EventSetup iSetup 
)
final

Definition at line 43 of file EgammaIsoHcalDetIdCollectionProducer.cc.

43  {
44  hcalHitSelector_.setup(iSetup);
45 }

References hcalHitSelector_, and EGHcalRecHitSelector::setup().

◆ fillDescriptions()

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

Definition at line 29 of file EgammaIsoHcalDetIdCollectionProducer.cc.

29  {
31  desc.add<edm::InputTag>("recHitsLabel", edm::InputTag("hbhereco"));
32  desc.add<edm::InputTag>("elesLabel", edm::InputTag("gedGsfElectrons"));
33  desc.add<edm::InputTag>("phosLabel", edm::InputTag("gedPhotons"));
34  desc.add<edm::InputTag>("superClustersLabel", edm::InputTag("particleFlowEGamma"));
35  desc.add<double>("minSCEt", 20);
36  desc.add<double>("minEleEt", 20);
37  desc.add<double>("minPhoEt", 20);
38  desc.add<std::string>("interestingDetIdCollection", "");
40  descriptions.add(("interestingGedEgammaIsoHCALDetId"), desc);
41 }

References edm::ConfigurationDescriptions::add(), submitPVResolutionJobs::desc, HLT_FULL_cff::InputTag, EGHcalRecHitSelector::makePSetDescription(), and AlCaHLTBitMon_QueryRunRegistry::string.

◆ produce()

void EgammaIsoHcalDetIdCollectionProducer::produce ( edm::Event iEvent,
const edm::EventSetup iSetup 
)
override

Definition at line 48 of file EgammaIsoHcalDetIdCollectionProducer.cc.

48  {
51 
53  iEvent.getByToken(elesToken_, eles);
54 
56  iEvent.getByToken(phosToken_, phos);
57 
59  iEvent.getByToken(recHitsToken_, recHits);
60 
61  std::vector<DetId> indexToStore;
62  indexToStore.reserve(100);
63 
64  if (eles.isValid() && recHits.isValid()) {
65  for (auto& ele : *eles) {
66  float scEt = ele.superCluster()->energy() * std::sin(ele.superCluster()->position().theta());
67  if (scEt > minEleEt_ || ele.et() > minEleEt_) {
68  hcalHitSelector_.addDetIds(*ele.superCluster(), *recHits, indexToStore);
69  }
70  }
71  }
72  if (phos.isValid() && recHits.isValid()) {
73  for (auto& pho : *phos) {
74  float scEt = pho.superCluster()->energy() * std::sin(pho.superCluster()->position().theta());
75  if (scEt > minPhoEt_ || pho.et() > minPhoEt_) {
76  hcalHitSelector_.addDetIds(*pho.superCluster(), *recHits, indexToStore);
77  }
78  }
79  }
80  if (superClusters.isValid() && recHits.isValid()) {
81  for (auto& sc : *superClusters) {
82  float scEt = sc.energy() * std::sin(sc.position().theta());
83  if (scEt > minSCEt_) {
84  hcalHitSelector_.addDetIds(sc, *recHits, indexToStore);
85  }
86  }
87  }
88 
89  //unify the vector
90  std::sort(indexToStore.begin(), indexToStore.end());
91  std::unique(indexToStore.begin(), indexToStore.end());
92 
93  auto detIdCollection = std::make_unique<DetIdCollection>(indexToStore);
94 
95  iEvent.put(std::move(detIdCollection), interestingDetIdCollection_);
96 }

References EGHcalRecHitSelector::addDetIds(), elesToken_, hcalHitSelector_, iEvent, interestingDetIdCollection_, edm::HandleBase::isValid(), minEleEt_, minPhoEt_, minSCEt_, eostools::move(), phosToken_, FastTrackerRecHitMaskProducer_cfi::recHits, recHitsToken_, funct::sin(), HLT_FULL_cff::superClusters, superClustersToken_, and tier0::unique().

Member Data Documentation

◆ elesToken_

edm::EDGetTokenT<reco::GsfElectronCollection> EgammaIsoHcalDetIdCollectionProducer::elesToken_
private

◆ hcalHitSelector_

EGHcalRecHitSelector EgammaIsoHcalDetIdCollectionProducer::hcalHitSelector_
private

Definition at line 60 of file EgammaIsoHcalDetIdCollectionProducer.h.

Referenced by beginRun(), and produce().

◆ interestingDetIdCollection_

std::string EgammaIsoHcalDetIdCollectionProducer::interestingDetIdCollection_
private

◆ minEleEt_

float EgammaIsoHcalDetIdCollectionProducer::minEleEt_
private

◆ minPhoEt_

float EgammaIsoHcalDetIdCollectionProducer::minPhoEt_
private

◆ minSCEt_

float EgammaIsoHcalDetIdCollectionProducer::minSCEt_
private

◆ phosToken_

edm::EDGetTokenT<reco::PhotonCollection> EgammaIsoHcalDetIdCollectionProducer::phosToken_
private

◆ recHitsToken_

edm::EDGetTokenT<HBHERecHitCollection> EgammaIsoHcalDetIdCollectionProducer::recHitsToken_
private

◆ superClustersToken_

edm::EDGetTokenT<reco::SuperClusterCollection> EgammaIsoHcalDetIdCollectionProducer::superClustersToken_
private
EGHcalRecHitSelector::setup
void setup(const edm::EventSetup &iSetup)
Definition: EGHcalRecHitSelector.h:29
EgammaIsoHcalDetIdCollectionProducer::minPhoEt_
float minPhoEt_
Definition: EgammaIsoHcalDetIdCollectionProducer.h:58
HLT_FULL_cff.InputTag
InputTag
Definition: HLT_FULL_cff.py:89287
edm::ParameterSetDescription
Definition: ParameterSetDescription.h:52
EgammaIsoHcalDetIdCollectionProducer::minEleEt_
float minEleEt_
Definition: EgammaIsoHcalDetIdCollectionProducer.h:57
EGHcalRecHitSelector::addDetIds
void addDetIds(const reco::SuperCluster &superClus, const HBHERecHitCollection &recHits, CollType &detIdsToStore) const
Definition: EGHcalRecHitSelector.h:49
edm::Handle
Definition: AssociativeIterator.h:50
HLT_FULL_cff.superClusters
superClusters
Definition: HLT_FULL_cff.py:15171
funct::sin
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
EgammaIsoHcalDetIdCollectionProducer::minSCEt_
float minSCEt_
Definition: EgammaIsoHcalDetIdCollectionProducer.h:56
EGHcalRecHitSelector::makePSetDescription
static edm::ParameterSetDescription makePSetDescription()
Definition: EGHcalRecHitSelector.cc:13
EgammaIsoHcalDetIdCollectionProducer::interestingDetIdCollection_
std::string interestingDetIdCollection_
Definition: EgammaIsoHcalDetIdCollectionProducer.h:54
edm::ConfigurationDescriptions::add
void add(std::string const &label, ParameterSetDescription const &psetDescription)
Definition: ConfigurationDescriptions.cc:57
EgammaIsoHcalDetIdCollectionProducer::phosToken_
edm::EDGetTokenT< reco::PhotonCollection > phosToken_
Definition: EgammaIsoHcalDetIdCollectionProducer.h:52
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
FastTrackerRecHitMaskProducer_cfi.recHits
recHits
Definition: FastTrackerRecHitMaskProducer_cfi.py:8
edm::ParameterSet
Definition: ParameterSet.h:47
EgammaIsoHcalDetIdCollectionProducer::hcalHitSelector_
EGHcalRecHitSelector hcalHitSelector_
Definition: EgammaIsoHcalDetIdCollectionProducer.h:60
EgammaIsoHcalDetIdCollectionProducer::recHitsToken_
edm::EDGetTokenT< HBHERecHitCollection > recHitsToken_
Definition: EgammaIsoHcalDetIdCollectionProducer.h:49
iEvent
int iEvent
Definition: GenABIO.cc:224
EgammaIsoHcalDetIdCollectionProducer::superClustersToken_
edm::EDGetTokenT< reco::SuperClusterCollection > superClustersToken_
Definition: EgammaIsoHcalDetIdCollectionProducer.h:50
submitPVResolutionJobs.desc
string desc
Definition: submitPVResolutionJobs.py:251
eostools.move
def move(src, dest)
Definition: eostools.py:511
tier0.unique
def unique(seq, keepstr=True)
Definition: tier0.py:24
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
edm::HandleBase::isValid
bool isValid() const
Definition: HandleBase.h:70
edm::InputTag
Definition: InputTag.h:15
EgammaIsoHcalDetIdCollectionProducer::elesToken_
edm::EDGetTokenT< reco::GsfElectronCollection > elesToken_
Definition: EgammaIsoHcalDetIdCollectionProducer.h:51