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 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 Types

using RecHitCollectionType = edm::SortedCollection< RecHitType >
 

Private Member Functions

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

Private Attributes

const edm::ESGetToken< CaloGeometry, CaloGeometryRecordcaloGeometryToken_
 
const edm::ESGetToken< L1CaloGeometry, L1CaloGeometryRecordl1CaloGeometryToken_
 
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 121 of file HLTRecHitInAllL1RegionsProducer.cc.

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

◆ ~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 251 of file HLTRecHitInAllL1RegionsProducer.cc.

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

References Exception.

◆ fillDescriptions()

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

Definition at line 141 of file HLTRecHitInAllL1RegionsProducer.cc.

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

References edm::ConfigurationDescriptions::add(), edm::ParameterSetDescription::add(), edm::ParameterSet::addParameter(), defaultModuleLabel(), submitPVResolutionJobs::desc, HLT_FULL_cff::InputTag, JetMonitor_cfi::jetPSet, HLT_FULL_cff::l1InputRegions, HLT_FULL_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 205 of file HLTRecHitInAllL1RegionsProducer.cc.

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

References edmPickEvents::event, input, eostools::move(), Skims_PA_cff::name, rpcPointValidation_cfi::recHit, FastTrackerRecHitMaskProducer_cfi::recHits, HLT_FULL_cff::region, singleTopDQM_cfi::setup, and GeomDetEnumerators::subDetGeom.

Member Data Documentation

◆ caloGeometryToken_

template<typename RecHitType >
const edm::ESGetToken<CaloGeometry, CaloGeometryRecord> HLTRecHitInAllL1RegionsProducer< RecHitType >::caloGeometryToken_
private

Definition at line 116 of file HLTRecHitInAllL1RegionsProducer.cc.

◆ l1CaloGeometryToken_

template<typename RecHitType >
const edm::ESGetToken<L1CaloGeometry, L1CaloGeometryRecord> HLTRecHitInAllL1RegionsProducer< RecHitType >::l1CaloGeometryToken_
private

Definition at line 117 of file HLTRecHitInAllL1RegionsProducer.cc.

◆ 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
HLTRecHitInAllL1RegionsProducer::l1CaloGeometryToken_
const edm::ESGetToken< L1CaloGeometry, L1CaloGeometryRecord > l1CaloGeometryToken_
Definition: HLTRecHitInAllL1RegionsProducer.cc:117
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
HLT_FULL_cff.l1InputRegions
l1InputRegions
Definition: HLT_FULL_cff.py:14592
JetMonitor_cfi.jetPSet
jetPSet
Definition: JetMonitor_cfi.py:12
HLT_FULL_cff.InputTag
InputTag
Definition: HLT_FULL_cff.py:89287
edm::ParameterSetDescription
Definition: ParameterSetDescription.h:52
HLT_FULL_cff.recHitLabels
recHitLabels
Definition: HLT_FULL_cff.py:14615
edm::Handle
Definition: AssociativeIterator.h:50
HLTRecHitInAllL1RegionsProducer::createL1RegionData
L1RegionDataBase * createL1RegionData(const std::string &, const edm::ParameterSet &, edm::ConsumesCollector &&)
Definition: HLTRecHitInAllL1RegionsProducer.cc:251
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
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
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
FastTrackerRecHitMaskProducer_cfi.recHits
recHits
Definition: FastTrackerRecHitMaskProducer_cfi.py:8
edm::ParameterSet
Definition: ParameterSet.h:47
defaultModuleLabel
std::string defaultModuleLabel()
Definition: defaultModuleLabel.h:16
type
type
Definition: SiPixelVCal_PayloadInspector.cc:37
edmPickEvents.event
event
Definition: edmPickEvents.py:273
edm::ParameterSet::addParameter
void addParameter(std::string const &name, T const &value)
Definition: ParameterSet.h:135
HLT_FULL_cff.region
region
Definition: HLT_FULL_cff.py:88272
HLTRecHitInAllL1RegionsProducer::productLabels_
std::vector< std::string > productLabels_
Definition: HLTRecHitInAllL1RegionsProducer.cc:112
edm::LogError
Log< level::Error, false > LogError
Definition: MessageLogger.h:123
HLTRecHitInAllL1RegionsProducer::caloGeometryToken_
const edm::ESGetToken< CaloGeometry, CaloGeometryRecord > caloGeometryToken_
Definition: HLTRecHitInAllL1RegionsProducer.cc:116
L1RegionData
Definition: HLTRecHitInAllL1RegionsProducer.cc:58
submitPVResolutionJobs.desc
string desc
Definition: submitPVResolutionJobs.py:251
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
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
edm::InputTag
Definition: InputTag.h:15
muonDTDigis_cfi.pset
pset
Definition: muonDTDigis_cfi.py:27
HLTRecHitInAllL1RegionsProducer
Definition: HLTRecHitInAllL1RegionsProducer.cc:94