CMS 3D CMS Logo

List of all members | Public Member Functions | Static Public Member Functions | Private Types | Private Member Functions | Private Attributes
HLTRecHitInAllL1RegionsProducer< RecHitType > Class Template Reference
Inheritance diagram for HLTRecHitInAllL1RegionsProducer< RecHitType >:
edm::stream::EDProducer<>

Public Member Functions

 HLTRecHitInAllL1RegionsProducer (const edm::ParameterSet &ps)
 
void produce (edm::Event &, const edm::EventSetup &) override
 
 ~HLTRecHitInAllL1RegionsProducer () override
 
- Public Member Functions inherited from edm::stream::EDProducer<>
 EDProducer ()=default
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndRuns () const final
 

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &descriptions)
 

Private Types

using RecHitCollectionType = edm::SortedCollection< RecHitType >
 

Private Member Functions

L1RegionDataBasecreateL1RegionData (const std::string &, const edm::ParameterSet &, edm::ConsumesCollector &&)
 

Private Attributes

std::vector< std::unique_ptr< L1RegionDataBase > > l1RegionData_
 
std::vector< std::string > productLabels_
 
std::vector< edm::InputTagrecHitLabels_
 
std::vector< edm::EDGetTokenT< RecHitCollectionType > > recHitTokens_
 

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

template<typename RecHitType>
class HLTRecHitInAllL1RegionsProducer< RecHitType >

Definition at line 94 of file HLTRecHitInAllL1RegionsProducer.cc.

Member Typedef Documentation

◆ RecHitCollectionType

template<typename RecHitType >
using HLTRecHitInAllL1RegionsProducer< RecHitType >::RecHitCollectionType = edm::SortedCollection<RecHitType>
private

Definition at line 95 of file HLTRecHitInAllL1RegionsProducer.cc.

Constructor & Destructor Documentation

◆ HLTRecHitInAllL1RegionsProducer()

template<typename RecHitType >
HLTRecHitInAllL1RegionsProducer< RecHitType >::HLTRecHitInAllL1RegionsProducer ( const edm::ParameterSet ps)

Definition at line 118 of file HLTRecHitInAllL1RegionsProducer.cc.

118  {
119  const std::vector<edm::ParameterSet> l1InputRegions =
120  para.getParameter<std::vector<edm::ParameterSet>>("l1InputRegions");
121  for (auto& pset : l1InputRegions) {
122  const std::string type = pset.getParameter<std::string>("type");
123  l1RegionData_.emplace_back(createL1RegionData(
124  type,
125  pset,
126  consumesCollector())); //meh I was going to use a factory but it was going to be overly complex for my needs
127  }
128  recHitLabels_ = para.getParameter<std::vector<edm::InputTag>>("recHitLabels");
129  productLabels_ = para.getParameter<std::vector<std::string>>("productLabels");
130 
131  for (unsigned int collNr = 0; collNr < recHitLabels_.size(); collNr++) {
132  recHitTokens_.push_back(consumes<RecHitCollectionType>(recHitLabels_[collNr]));
133  produces<RecHitCollectionType>(productLabels_[collNr]);
134  }
135 }

References edm::ParameterSet::getParameter(), HLT_2018_cff::l1InputRegions, muonDTDigis_cfi::pset, and AlCaHLTBitMon_QueryRunRegistry::string.

◆ ~HLTRecHitInAllL1RegionsProducer()

template<typename RecHitType >
HLTRecHitInAllL1RegionsProducer< RecHitType >::~HLTRecHitInAllL1RegionsProducer ( )
inlineoverride

Definition at line 99 of file HLTRecHitInAllL1RegionsProducer.cc.

99 {}

Member Function Documentation

◆ createL1RegionData()

template<typename RecHitType >
L1RegionDataBase * HLTRecHitInAllL1RegionsProducer< RecHitType >::createL1RegionData ( const std::string &  type,
const edm::ParameterSet para,
edm::ConsumesCollector &&  consumesColl 
)
private

Definition at line 249 of file HLTRecHitInAllL1RegionsProducer.cc.

250  {
251  if (type == "L1EmParticle") {
252  return new L1RegionData<l1extra::L1EmParticleCollection>(para, consumesColl);
253  } else if (type == "L1JetParticle") {
254  return new L1RegionData<l1extra::L1JetParticleCollection>(para, consumesColl);
255  } else if (type == "L1MuonParticle") {
256  return new L1RegionData<l1extra::L1MuonParticleCollection>(para, consumesColl);
257  } else if (type == "EGamma") {
258  return new L1RegionData<l1t::EGammaBxCollection>(para, consumesColl);
259  } else if (type == "Jet") {
260  return new L1RegionData<l1t::JetBxCollection>(para, consumesColl);
261  } else if (type == "Muon") {
262  return new L1RegionData<l1t::MuonBxCollection>(para, consumesColl);
263  } else if (type == "Tau") {
264  return new L1RegionData<l1t::TauBxCollection>(para, consumesColl);
265  } else {
266  //this is a major issue and could lead to rather subtle efficiency losses, so if its incorrectly configured, we're aborting the job!
267  throw cms::Exception("InvalidConfig")
268  << " type " << type
269  << " is not recognised, this means the rec-hit you think you are keeping may not be and you should fix this "
270  "error as it can lead to hard to find efficiency loses"
271  << std::endl;
272  }
273 }

References Exception.

◆ fillDescriptions()

template<typename RecHitType >
void HLTRecHitInAllL1RegionsProducer< RecHitType >::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
static

Definition at line 137 of file HLTRecHitInAllL1RegionsProducer.cc.

137  {
139  std::vector<std::string> productTags;
140  productTags.push_back("EcalRegionalRecHitsEB");
141  productTags.push_back("EcalRegionalRecHitsEE");
142  desc.add<std::vector<std::string>>("productLabels", productTags);
143  std::vector<edm::InputTag> recHitLabels;
144  recHitLabels.push_back(edm::InputTag("hltEcalRegionalEgammaRecHit:EcalRecHitsEB"));
145  recHitLabels.push_back(edm::InputTag("hltEcalRegionalEgammaRecHit:EcalRecHitsEE"));
146  recHitLabels.push_back(edm::InputTag("hltESRegionalEgammaRecHit:EcalRecHitsES"));
147  desc.add<std::vector<edm::InputTag>>("recHitLabels", recHitLabels);
148  std::vector<edm::ParameterSet> l1InputRegions;
149 
150  edm::ParameterSet emIsoPSet;
151  emIsoPSet.addParameter<std::string>("type", "L1EmParticle");
152  emIsoPSet.addParameter<double>("minEt", 5);
153  emIsoPSet.addParameter<double>("maxEt", 999);
154  emIsoPSet.addParameter<double>("regionEtaMargin", 0.14);
155  emIsoPSet.addParameter<double>("regionPhiMargin", 0.4);
156  emIsoPSet.addParameter<edm::InputTag>("inputColl", edm::InputTag("hltL1extraParticles:NonIsolated"));
157  l1InputRegions.push_back(emIsoPSet);
158  edm::ParameterSet emNonIsoPSet;
159  emNonIsoPSet.addParameter<std::string>("type", "L1EmParticle");
160  emNonIsoPSet.addParameter<double>("minEt", 5);
161  emNonIsoPSet.addParameter<double>("maxEt", 999);
162  emNonIsoPSet.addParameter<double>("regionEtaMargin", 0.14);
163  emNonIsoPSet.addParameter<double>("regionPhiMargin", 0.4);
164  emNonIsoPSet.addParameter<edm::InputTag>("inputColl", edm::InputTag("hltL1extraParticles:Isolated"));
165  l1InputRegions.push_back(emNonIsoPSet);
166 
167  // Why no Central Jets here? They are present in the python config, e.g. OnLine_HLT_GRun.py
168  // SHarper: because these are the default parameters designed to reproduce the original (no jets) behaviour
169  //
170  edm::ParameterSet egPSet;
171  egPSet.addParameter<std::string>("type", "EGamma");
172  egPSet.addParameter<double>("minEt", 5);
173  egPSet.addParameter<double>("maxEt", 999);
174  egPSet.addParameter<double>("regionEtaMargin", 0.4);
175  egPSet.addParameter<double>("regionPhiMargin", 0.5);
176  egPSet.addParameter<edm::InputTag>("inputColl", edm::InputTag("hltCaloStage2Digis"));
177  l1InputRegions.push_back(egPSet);
178 
180  jetPSet.addParameter<std::string>("type", "EGamma");
181  jetPSet.addParameter<double>("minEt", 200);
182  jetPSet.addParameter<double>("maxEt", 999);
183  jetPSet.addParameter<double>("regionEtaMargin", 0.4);
184  jetPSet.addParameter<double>("regionPhiMargin", 0.5);
185  jetPSet.addParameter<edm::InputTag>("inputColl", edm::InputTag("hltCaloStage2Digis"));
186  l1InputRegions.push_back(jetPSet);
187 
188  edm::ParameterSetDescription l1InputRegionDesc;
189  l1InputRegionDesc.add<std::string>("type");
190  l1InputRegionDesc.add<double>("minEt");
191  l1InputRegionDesc.add<double>("maxEt");
192  l1InputRegionDesc.add<double>("regionEtaMargin");
193  l1InputRegionDesc.add<double>("regionPhiMargin");
194  l1InputRegionDesc.add<edm::InputTag>("inputColl");
195  desc.addVPSet("l1InputRegions", l1InputRegionDesc, l1InputRegions);
196 
198 }

References edm::ConfigurationDescriptions::add(), edm::ParameterSetDescription::add(), edm::ParameterSet::addParameter(), edm::ParameterSetDescription::addVPSet(), defaultModuleLabel(), HLT_2018_cff::InputTag, JetMonitor_cfi::jetPSet, HLT_2018_cff::l1InputRegions, HLT_2018_cff::recHitLabels, and AlCaHLTBitMon_QueryRunRegistry::string.

◆ produce()

template<typename RecHitType >
void HLTRecHitInAllL1RegionsProducer< RecHitType >::produce ( edm::Event event,
const edm::EventSetup setup 
)
override

Definition at line 201 of file HLTRecHitInAllL1RegionsProducer.cc.

201  {
202  // get the collection geometry:
203  edm::ESHandle<CaloGeometry> caloGeomHandle;
204  setup.get<CaloGeometryRecord>().get(caloGeomHandle);
205 
206  // Get the CaloGeometry
208  setup.get<L1CaloGeometryRecord>().get(l1CaloGeom);
209 
210  std::vector<RectangularEtaPhiRegion> regions;
211  std::for_each(l1RegionData_.begin(),
212  l1RegionData_.end(),
213  [&event, &regions, l1CaloGeom](const std::unique_ptr<L1RegionDataBase>& input) {
214  input->getEtaPhiRegions(event, regions, *l1CaloGeom);
215  });
216 
217  for (size_t recHitCollNr = 0; recHitCollNr < recHitTokens_.size(); recHitCollNr++) {
219  event.getByToken(recHitTokens_[recHitCollNr], recHits);
220 
221  if (!(recHits.isValid())) {
222  edm::LogError("ProductNotFound") << "could not get a handle on the " << typeid(RecHitCollectionType).name()
223  << " named " << recHitLabels_[recHitCollNr].encode() << std::endl;
224  continue;
225  }
226 
227  auto filteredRecHits = std::make_unique<RecHitCollectionType>();
228 
229  if (!recHits->empty()) {
230  const CaloSubdetectorGeometry* subDetGeom = caloGeomHandle->getSubdetectorGeometry(recHits->front().id());
231  if (!regions.empty()) {
232  for (const RecHitType& recHit : *recHits) {
233  auto this_cell = subDetGeom->getGeometry(recHit.id());
234  for (const auto& region : regions) {
235  if (region.inRegion(this_cell->etaPos(), this_cell->phiPos())) {
236  filteredRecHits->push_back(recHit);
237  break;
238  }
239  }
240  }
241  } //end check of empty regions
242  } //end check of empty rec-hits
243  // std::cout <<"putting fileter coll in "<<filteredRecHits->size()<<std::endl;
244  event.put(std::move(filteredRecHits), productLabels_[recHitCollNr]);
245  } //end loop over all rec hit collections
246 }

References event(), get, CaloGeometry::getSubdetectorGeometry(), input, eostools::move(), Skims_PA_cff::name, rpcPointValidation_cfi::recHit, FastTrackerRecHitMaskProducer_cfi::recHits, HLT_2018_cff::region, singleTopDQM_cfi::setup, and GeomDetEnumerators::subDetGeom.

Member Data Documentation

◆ l1RegionData_

template<typename RecHitType >
std::vector<std::unique_ptr<L1RegionDataBase> > HLTRecHitInAllL1RegionsProducer< RecHitType >::l1RegionData_
private

Definition at line 109 of file HLTRecHitInAllL1RegionsProducer.cc.

◆ productLabels_

template<typename RecHitType >
std::vector<std::string> HLTRecHitInAllL1RegionsProducer< RecHitType >::productLabels_
private

Definition at line 112 of file HLTRecHitInAllL1RegionsProducer.cc.

◆ recHitLabels_

template<typename RecHitType >
std::vector<edm::InputTag> HLTRecHitInAllL1RegionsProducer< RecHitType >::recHitLabels_
private

Definition at line 111 of file HLTRecHitInAllL1RegionsProducer.cc.

◆ recHitTokens_

template<typename RecHitType >
std::vector<edm::EDGetTokenT<RecHitCollectionType> > HLTRecHitInAllL1RegionsProducer< RecHitType >::recHitTokens_
private

Definition at line 114 of file HLTRecHitInAllL1RegionsProducer.cc.

HLTRecHitInAllL1RegionsProducer::l1RegionData_
std::vector< std::unique_ptr< L1RegionDataBase > > l1RegionData_
Definition: HLTRecHitInAllL1RegionsProducer.cc:109
edm::ParameterSetDescription::add
ParameterDescriptionBase * add(U const &iLabel, T const &value)
Definition: ParameterSetDescription.h:95
input
static const std::string input
Definition: EdmProvDump.cc:48
CaloGeometryRecord
Definition: CaloGeometryRecord.h:30
JetMonitor_cfi.jetPSet
jetPSet
Definition: JetMonitor_cfi.py:12
edm::ParameterSetDescription
Definition: ParameterSetDescription.h:52
CaloGeometry::getSubdetectorGeometry
const CaloSubdetectorGeometry * getSubdetectorGeometry(const DetId &id) const
access the subdetector geometry for the given subdetector directly
Definition: CaloGeometry.cc:34
HLT_2018_cff.l1InputRegions
l1InputRegions
Definition: HLT_2018_cff.py:13212
edm::Handle
Definition: AssociativeIterator.h:50
HLTRecHitInAllL1RegionsProducer::createL1RegionData
L1RegionDataBase * createL1RegionData(const std::string &, const edm::ParameterSet &, edm::ConsumesCollector &&)
Definition: HLTRecHitInAllL1RegionsProducer.cc:249
rpcPointValidation_cfi.recHit
recHit
Definition: rpcPointValidation_cfi.py:7
singleTopDQM_cfi.setup
setup
Definition: singleTopDQM_cfi.py:37
reco::RecHitType
RecHitType
Definition: TrackInfoEnum.h:16
HLTRecHitInAllL1RegionsProducer::recHitTokens_
std::vector< edm::EDGetTokenT< RecHitCollectionType > > recHitTokens_
Definition: HLTRecHitInAllL1RegionsProducer.cc:114
HLTRecHitInAllL1RegionsProducer::recHitLabels_
std::vector< edm::InputTag > recHitLabels_
Definition: HLTRecHitInAllL1RegionsProducer.cc:111
HLT_2018_cff.recHitLabels
recHitLabels
Definition: HLT_2018_cff.py:13235
edm::ConfigurationDescriptions::add
void add(std::string const &label, ParameterSetDescription const &psetDescription)
Definition: ConfigurationDescriptions.cc:57
HLTRecHitInAllL1RegionsProducer::RecHitCollectionType
edm::SortedCollection< RecHitType > RecHitCollectionType
Definition: HLTRecHitInAllL1RegionsProducer.cc:95
edm::ESHandle< CaloGeometry >
L1CaloGeometryRecord
Definition: L1CaloGeometryRecord.h:30
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
FastTrackerRecHitMaskProducer_cfi.recHits
recHits
Definition: FastTrackerRecHitMaskProducer_cfi.py:8
HLT_2018_cff.InputTag
InputTag
Definition: HLT_2018_cff.py:79016
edm::ParameterSet
Definition: ParameterSet.h:36
edm::LogError
Definition: MessageLogger.h:183
defaultModuleLabel
std::string defaultModuleLabel()
Definition: defaultModuleLabel.h:16
edm::ParameterSetDescription::addVPSet
ParameterDescriptionBase * addVPSet(U const &iLabel, ParameterSetDescription const &validator, std::vector< ParameterSet > const &defaults)
Definition: ParameterSetDescription.h:149
edm::ParameterSet::addParameter
void addParameter(std::string const &name, T const &value)
Definition: ParameterSet.h:124
HLTRecHitInAllL1RegionsProducer::productLabels_
std::vector< std::string > productLabels_
Definition: HLTRecHitInAllL1RegionsProducer.cc:112
get
#define get
L1RegionData
Definition: HLTRecHitInAllL1RegionsProducer.cc:58
type
type
Definition: HCALResponse.h:21
eostools.move
def move(src, dest)
Definition: eostools.py:511
GeomDetEnumerators::subDetGeom
constexpr SubDetector subDetGeom[21]
Definition: GeomDetEnumerators.h:40
Exception
Definition: hltDiff.cc:246
HLT_2018_cff.region
region
Definition: HLT_2018_cff.py:81479
Skims_PA_cff.name
name
Definition: Skims_PA_cff.py:17
CaloSubdetectorGeometry
Definition: CaloSubdetectorGeometry.h:22
AlignmentPI::regions
regions
Definition: AlignmentPayloadInspectorHelper.h:76
event
Definition: event.py:1
event
How EventSelector::AcceptEvent() decides whether to accept an event for output otherwise it is excluding the probing of A single or multiple positive and the trigger will pass if any such matching triggers are PASS or EXCEPTION[A criterion thatmatches no triggers at all is detected and causes a throw.] A single negative with an expectation of appropriate bit checking in the decision and the trigger will pass if any such matching triggers are FAIL or EXCEPTION A wildcarded negative criterion that matches more than one trigger in the trigger but the state exists so we define the behavior If all triggers are the negative crieriion will lead to accepting the event(this again matches the behavior of "!*" before the partial wildcard feature was incorporated). The per-event "cost" of each negative criterion with multiple relevant triggers is about the same as ! *was in the past
edm::InputTag
Definition: InputTag.h:15
muonDTDigis_cfi.pset
pset
Definition: muonDTDigis_cfi.py:27
HLTRecHitInAllL1RegionsProducer
Definition: HLTRecHitInAllL1RegionsProducer.cc:94