CMS 3D CMS Logo

List of all members | Public Member Functions | Static Public Member Functions | Private Attributes
EgammaIsoHcalDetIdCollectionProducer Class Reference
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
 
 EDProducer (const EDProducer &)=delete
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginProcessBlocks () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndProcessBlocks () const final
 
bool hasAbilityToProduceInEndRuns () const final
 
const EDProduceroperator= (const EDProducer &)=delete
 

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &descriptions)
 

Private Attributes

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

Additional Inherited Members

- Public Types inherited from edm::stream::EDProducer<>
using CacheTypes = CacheContexts< T... >
 
using GlobalCache = typename CacheTypes::GlobalCache
 
using HasAbility = AbilityChecker< T... >
 
using InputProcessBlockCache = typename CacheTypes::InputProcessBlockCache
 
using LuminosityBlockCache = typename CacheTypes::LuminosityBlockCache
 
using LuminosityBlockContext = LuminosityBlockContextT< LuminosityBlockCache, RunCache, GlobalCache >
 
using LuminosityBlockSummaryCache = typename CacheTypes::LuminosityBlockSummaryCache
 
using RunCache = typename CacheTypes::RunCache
 
using RunContext = RunContextT< RunCache, GlobalCache >
 
using RunSummaryCache = typename CacheTypes::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 30 of file EgammaIsoHcalDetIdCollectionProducer.cc.

Constructor & Destructor Documentation

◆ EgammaIsoHcalDetIdCollectionProducer()

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

Definition at line 57 of file EgammaIsoHcalDetIdCollectionProducer.cc.

58  : recHitsToken_{consumes(iConfig.getParameter<edm::InputTag>("recHitsLabel"))},
59  superClustersToken_{consumes(iConfig.getParameter<edm::InputTag>("superClustersLabel"))},
60  elesToken_{consumes(iConfig.getParameter<edm::InputTag>("elesLabel"))},
61  phosToken_{consumes(iConfig.getParameter<edm::InputTag>("phosLabel"))},
62  hcalHitSelector_(iConfig.getParameter<edm::ParameterSet>("hitSelection"), consumesCollector()) {
63  minSCEt_ = iConfig.getParameter<double>("minSCEt");
64  minEleEt_ = iConfig.getParameter<double>("minEleEt");
65  minPhoEt_ = iConfig.getParameter<double>("minPhoEt");
66 
67  interestingDetIdCollection_ = iConfig.getParameter<std::string>("interestingDetIdCollection");
68 
69  //register your products
70  produces<DetIdCollection>(interestingDetIdCollection_);
71 }

References edm::ParameterSet::getParameter().

Member Function Documentation

◆ beginRun()

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

Definition at line 87 of file EgammaIsoHcalDetIdCollectionProducer.cc.

87  {
88  hcalHitSelector_.setup(iSetup);
89 }

References hcalHitSelector_, and EGHcalRecHitSelector::setup().

◆ fillDescriptions()

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

Definition at line 73 of file EgammaIsoHcalDetIdCollectionProducer.cc.

73  {
75  desc.add<edm::InputTag>("recHitsLabel", edm::InputTag("hbhereco"));
76  desc.add<edm::InputTag>("elesLabel", edm::InputTag("gedGsfElectrons"));
77  desc.add<edm::InputTag>("phosLabel", edm::InputTag("gedPhotons"));
78  desc.add<edm::InputTag>("superClustersLabel", edm::InputTag("particleFlowEGamma"));
79  desc.add<double>("minSCEt", 20);
80  desc.add<double>("minEleEt", 20);
81  desc.add<double>("minPhoEt", 20);
82  desc.add<std::string>("interestingDetIdCollection", "");
84  descriptions.add(("interestingGedEgammaIsoHCALDetId"), desc);
85 }

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 92 of file EgammaIsoHcalDetIdCollectionProducer.cc.

92  {
93  auto superClusters = iEvent.getHandle(superClustersToken_);
94  auto eles = iEvent.getHandle(elesToken_);
95  auto phos = iEvent.getHandle(phosToken_);
96  auto recHits = iEvent.getHandle(recHitsToken_);
97 
98  std::vector<DetId> indexToStore;
99  indexToStore.reserve(100);
100 
101  if (eles.isValid() && recHits.isValid()) {
102  for (auto& ele : *eles) {
103  float scEt = ele.superCluster()->energy() * std::sin(ele.superCluster()->position().theta());
104  if (scEt > minEleEt_ || ele.et() > minEleEt_) {
105  hcalHitSelector_.addDetIds(*ele.superCluster(), *recHits, indexToStore);
106  }
107  }
108  }
109  if (phos.isValid() && recHits.isValid()) {
110  for (auto& pho : *phos) {
111  float scEt = pho.superCluster()->energy() * std::sin(pho.superCluster()->position().theta());
112  if (scEt > minPhoEt_ || pho.et() > minPhoEt_) {
113  hcalHitSelector_.addDetIds(*pho.superCluster(), *recHits, indexToStore);
114  }
115  }
116  }
117  if (superClusters.isValid() && recHits.isValid()) {
118  for (auto& sc : *superClusters) {
119  float scEt = sc.energy() * std::sin(sc.position().theta());
120  if (scEt > minSCEt_) {
121  hcalHitSelector_.addDetIds(sc, *recHits, indexToStore);
122  }
123  }
124  }
125 
126  //unify the vector
127  std::sort(indexToStore.begin(), indexToStore.end());
128  std::unique(indexToStore.begin(), indexToStore.end());
129 
130  auto detIdCollection = std::make_unique<DetIdCollection>(indexToStore);
131 
132  iEvent.put(std::move(detIdCollection), interestingDetIdCollection_);
133 }

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

Member Data Documentation

◆ elesToken_

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

Definition at line 42 of file EgammaIsoHcalDetIdCollectionProducer.cc.

Referenced by produce().

◆ hcalHitSelector_

EGHcalRecHitSelector EgammaIsoHcalDetIdCollectionProducer::hcalHitSelector_
private

Definition at line 51 of file EgammaIsoHcalDetIdCollectionProducer.cc.

Referenced by beginRun(), and produce().

◆ interestingDetIdCollection_

std::string EgammaIsoHcalDetIdCollectionProducer::interestingDetIdCollection_
private

Definition at line 45 of file EgammaIsoHcalDetIdCollectionProducer.cc.

Referenced by produce().

◆ minEleEt_

float EgammaIsoHcalDetIdCollectionProducer::minEleEt_
private

Definition at line 48 of file EgammaIsoHcalDetIdCollectionProducer.cc.

Referenced by produce().

◆ minPhoEt_

float EgammaIsoHcalDetIdCollectionProducer::minPhoEt_
private

Definition at line 49 of file EgammaIsoHcalDetIdCollectionProducer.cc.

Referenced by produce().

◆ minSCEt_

float EgammaIsoHcalDetIdCollectionProducer::minSCEt_
private

Definition at line 47 of file EgammaIsoHcalDetIdCollectionProducer.cc.

Referenced by produce().

◆ phosToken_

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

Definition at line 43 of file EgammaIsoHcalDetIdCollectionProducer.cc.

Referenced by produce().

◆ recHitsToken_

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

Definition at line 40 of file EgammaIsoHcalDetIdCollectionProducer.cc.

Referenced by produce().

◆ superClustersToken_

const edm::EDGetTokenT<reco::SuperClusterCollection> EgammaIsoHcalDetIdCollectionProducer::superClustersToken_
private

Definition at line 41 of file EgammaIsoHcalDetIdCollectionProducer.cc.

Referenced by produce().

EGHcalRecHitSelector::setup
void setup(const edm::EventSetup &iSetup)
Definition: EGHcalRecHitSelector.h:29
EgammaIsoHcalDetIdCollectionProducer::minPhoEt_
float minPhoEt_
Definition: EgammaIsoHcalDetIdCollectionProducer.cc:49
HLT_FULL_cff.InputTag
InputTag
Definition: HLT_FULL_cff.py:89301
edm::ParameterSetDescription
Definition: ParameterSetDescription.h:52
EgammaIsoHcalDetIdCollectionProducer::minEleEt_
float minEleEt_
Definition: EgammaIsoHcalDetIdCollectionProducer.cc:48
EGHcalRecHitSelector::addDetIds
void addDetIds(const reco::SuperCluster &superClus, const HBHERecHitCollection &recHits, CollType &detIdsToStore) const
Definition: EGHcalRecHitSelector.h:49
EgammaIsoHcalDetIdCollectionProducer::recHitsToken_
const edm::EDGetTokenT< HBHERecHitCollection > recHitsToken_
Definition: EgammaIsoHcalDetIdCollectionProducer.cc:40
HLT_FULL_cff.superClusters
superClusters
Definition: HLT_FULL_cff.py:15191
funct::sin
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
EgammaIsoHcalDetIdCollectionProducer::minSCEt_
float minSCEt_
Definition: EgammaIsoHcalDetIdCollectionProducer.cc:47
EGHcalRecHitSelector::makePSetDescription
static edm::ParameterSetDescription makePSetDescription()
Definition: EGHcalRecHitSelector.cc:13
EgammaIsoHcalDetIdCollectionProducer::interestingDetIdCollection_
std::string interestingDetIdCollection_
Definition: EgammaIsoHcalDetIdCollectionProducer.cc:45
edm::ConfigurationDescriptions::add
void add(std::string const &label, ParameterSetDescription const &psetDescription)
Definition: ConfigurationDescriptions.cc:57
FastTrackerRecHitMaskProducer_cfi.recHits
recHits
Definition: FastTrackerRecHitMaskProducer_cfi.py:8
EgammaIsoHcalDetIdCollectionProducer::phosToken_
const edm::EDGetTokenT< reco::PhotonCollection > phosToken_
Definition: EgammaIsoHcalDetIdCollectionProducer.cc:43
edm::ParameterSet
Definition: ParameterSet.h:47
EgammaIsoHcalDetIdCollectionProducer::hcalHitSelector_
EGHcalRecHitSelector hcalHitSelector_
Definition: EgammaIsoHcalDetIdCollectionProducer.cc:51
jetUpdater_cfi.sort
sort
Definition: jetUpdater_cfi.py:29
iEvent
int iEvent
Definition: GenABIO.cc:224
EgammaIsoHcalDetIdCollectionProducer::superClustersToken_
const edm::EDGetTokenT< reco::SuperClusterCollection > superClustersToken_
Definition: EgammaIsoHcalDetIdCollectionProducer.cc:41
AlCaHLTBitMon_QueryRunRegistry.string
string string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
submitPVResolutionJobs.desc
string desc
Definition: submitPVResolutionJobs.py:251
EgammaIsoHcalDetIdCollectionProducer::elesToken_
const edm::EDGetTokenT< reco::GsfElectronCollection > elesToken_
Definition: EgammaIsoHcalDetIdCollectionProducer.cc:42
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::InputTag
Definition: InputTag.h:15