CMS 3D CMS Logo

List of all members | Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes
L1RegionData< T1 > Class Template Reference
Inheritance diagram for L1RegionData< T1 >:
L1RegionDataBase

Public Member Functions

void getEtaPhiRegions (const edm::Event &, const edm::EventSetup &, std::vector< RectangularEtaPhiRegion > &) const override
 
template<>
void getEtaPhiRegions (const edm::Event &event, const edm::EventSetup &setup, std::vector< RectangularEtaPhiRegion > &regions) const
 
template<>
void getEtaPhiRegions (const edm::Event &event, const edm::EventSetup &setup, std::vector< RectangularEtaPhiRegion > &regions) const
 
 L1RegionData (const edm::ParameterSet &para, edm::ConsumesCollector &consumesColl)
 
- Public Member Functions inherited from L1RegionDataBase
virtual ~L1RegionDataBase ()
 

Static Public Member Functions

template<typename T2 >
static T2::const_iterator beginIt (const T2 &coll)
 
template<typename T2 >
static BXVector< T2 >::const_iterator beginIt (const BXVector< T2 > &coll)
 
template<typename T2 >
static T2::const_iterator endIt (const T2 &coll)
 
template<typename T2 >
static BXVector< T2 >::const_iterator endIt (const BXVector< T2 > &coll)
 

Private Member Functions

void eventSetupConsumes (edm::ConsumesCollector &consumesColl)
 
template<>
void eventSetupConsumes (edm::ConsumesCollector &consumesColl)
 
template<>
void eventSetupConsumes (edm::ConsumesCollector &consumesColl)
 

Private Attributes

edm::ESGetToken< L1CaloGeometry, L1CaloGeometryRecordl1CaloGeometryToken_
 
double const maxEt_
 
double const minEt_
 
double const regionEtaMargin_
 
double const regionPhiMargin_
 
edm::EDGetTokenT< T1 > const token_
 

Detailed Description

template<typename T1>
class L1RegionData< T1 >

Definition at line 58 of file HLTRecHitInAllL1RegionsProducer.cc.

Constructor & Destructor Documentation

◆ L1RegionData()

template<typename T1>
L1RegionData< T1 >::L1RegionData ( const edm::ParameterSet para,
edm::ConsumesCollector consumesColl 
)
inline

Definition at line 70 of file HLTRecHitInAllL1RegionsProducer.cc.

References L1RegionData< T1 >::eventSetupConsumes().

71  : minEt_(para.getParameter<double>("minEt")),
72  maxEt_(para.getParameter<double>("maxEt")),
73  regionEtaMargin_(para.getParameter<double>("regionEtaMargin")),
74  regionPhiMargin_(para.getParameter<double>("regionPhiMargin")),
75  token_(consumesColl.consumes<T1>(para.getParameter<edm::InputTag>("inputColl"))) {
76  eventSetupConsumes(consumesColl);
77  }
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
void eventSetupConsumes(edm::ConsumesCollector &consumesColl)
edm::EDGetTokenT< T1 > const token_

Member Function Documentation

◆ beginIt() [1/2]

template<typename T1>
template<typename T2 >
static T2::const_iterator L1RegionData< T1 >::beginIt ( const T2 &  coll)
inlinestatic

Definition at line 83 of file HLTRecHitInAllL1RegionsProducer.cc.

83  {
84  return coll.begin();
85  }

◆ beginIt() [2/2]

template<typename T1>
template<typename T2 >
static BXVector<T2>::const_iterator L1RegionData< T1 >::beginIt ( const BXVector< T2 > &  coll)
inlinestatic

Definition at line 91 of file HLTRecHitInAllL1RegionsProducer.cc.

References BXVector< T >::begin().

91  {
92  return coll.begin(0);
93  }
const_iterator begin(int bx) const

◆ endIt() [1/2]

template<typename T1>
template<typename T2 >
static T2::const_iterator L1RegionData< T1 >::endIt ( const T2 &  coll)
inlinestatic

Definition at line 87 of file HLTRecHitInAllL1RegionsProducer.cc.

87  {
88  return coll.end();
89  }

◆ endIt() [2/2]

template<typename T1>
template<typename T2 >
static BXVector<T2>::const_iterator L1RegionData< T1 >::endIt ( const BXVector< T2 > &  coll)
inlinestatic

Definition at line 95 of file HLTRecHitInAllL1RegionsProducer.cc.

References BXVector< T >::end().

95  {
96  return coll.end(0);
97  }
const_iterator end(int bx) const

◆ eventSetupConsumes() [1/3]

template<typename L1CollType >
void L1RegionData< L1CollType >::eventSetupConsumes ( edm::ConsumesCollector consumesColl)
private

Definition at line 280 of file HLTRecHitInAllL1RegionsProducer.cc.

Referenced by L1RegionData< T1 >::L1RegionData().

280 {}

◆ eventSetupConsumes() [2/3]

template<>
void L1RegionData< l1extra::L1JetParticleCollection >::eventSetupConsumes ( edm::ConsumesCollector consumesColl)
private

Definition at line 302 of file HLTRecHitInAllL1RegionsProducer.cc.

References edm::ConsumesCollector::esConsumes().

302  {
303  l1CaloGeometryToken_ = consumesColl.esConsumes();
304 }
edm::ESGetToken< L1CaloGeometry, L1CaloGeometryRecord > l1CaloGeometryToken_

◆ eventSetupConsumes() [3/3]

template<>
void L1RegionData< l1extra::L1EmParticleCollection >::eventSetupConsumes ( edm::ConsumesCollector consumesColl)
private

Definition at line 337 of file HLTRecHitInAllL1RegionsProducer.cc.

References edm::ConsumesCollector::esConsumes().

337  {
338  l1CaloGeometryToken_ = consumesColl.esConsumes();
339 }
edm::ESGetToken< L1CaloGeometry, L1CaloGeometryRecord > l1CaloGeometryToken_

◆ getEtaPhiRegions() [1/3]

template<typename L1CollType >
void L1RegionData< L1CollType >::getEtaPhiRegions ( const edm::Event event,
const edm::EventSetup ,
std::vector< RectangularEtaPhiRegion > &  regions 
) const
overridevirtual

Implements L1RegionDataBase.

Definition at line 283 of file HLTRecHitInAllL1RegionsProducer.cc.

References l1tSlwPFPuppiJets_cfi::phiLow.

285  {
286  edm::Handle<L1CollType> l1Cands;
287  event.getByToken(token_, l1Cands);
288 
289  for (auto l1CandIt = beginIt(*l1Cands); l1CandIt != endIt(*l1Cands); ++l1CandIt) {
290  if (l1CandIt->et() >= minEt_ && l1CandIt->et() < maxEt_) {
291  double etaLow = l1CandIt->eta() - regionEtaMargin_;
292  double etaHigh = l1CandIt->eta() + regionEtaMargin_;
293  double phiLow = l1CandIt->phi() - regionPhiMargin_;
294  double phiHigh = l1CandIt->phi() + regionPhiMargin_;
295 
296  regions.push_back(RectangularEtaPhiRegion(etaLow, etaHigh, phiLow, phiHigh));
297  }
298  }
299 }
static T2::const_iterator endIt(const T2 &coll)
edm::EDGetTokenT< T1 > const token_
static T2::const_iterator beginIt(const T2 &coll)

◆ getEtaPhiRegions() [2/3]

template<>
void L1RegionData< l1extra::L1JetParticleCollection >::getEtaPhiRegions ( const edm::Event event,
const edm::EventSetup setup,
std::vector< RectangularEtaPhiRegion > &  regions 
) const
virtual

Implements L1RegionDataBase.

Definition at line 307 of file HLTRecHitInAllL1RegionsProducer.cc.

References l1tSlwPFPuppiJets_cfi::phiLow, and singleTopDQM_cfi::setup.

308  {
310  event.getByToken(token_, l1Cands);
311 
312  auto const& l1CaloGeom = setup.getData(l1CaloGeometryToken_);
313 
314  for (const auto& l1Cand : *l1Cands) {
315  if (l1Cand.et() >= minEt_ && l1Cand.et() < maxEt_) {
316  // Access the GCT hardware object corresponding to the L1Extra EM object.
317  int etaIndex = l1Cand.gctJetCand()->etaIndex();
318  int phiIndex = l1Cand.gctJetCand()->phiIndex();
319 
320  // Use the L1CaloGeometry to find the eta, phi bin boundaries.
321  double etaLow = l1CaloGeom.etaBinLowEdge(etaIndex);
322  double etaHigh = l1CaloGeom.etaBinHighEdge(etaIndex);
323  double phiLow = l1CaloGeom.emJetPhiBinLowEdge(phiIndex);
324  double phiHigh = l1CaloGeom.emJetPhiBinHighEdge(phiIndex);
325 
326  etaLow -= regionEtaMargin_;
327  etaHigh += regionEtaMargin_;
329  phiHigh += regionPhiMargin_;
330 
331  regions.push_back(RectangularEtaPhiRegion(etaLow, etaHigh, phiLow, phiHigh));
332  }
333  }
334 }
edm::EDGetTokenT< T1 > const token_
edm::ESGetToken< L1CaloGeometry, L1CaloGeometryRecord > l1CaloGeometryToken_

◆ getEtaPhiRegions() [3/3]

template<>
void L1RegionData< l1extra::L1EmParticleCollection >::getEtaPhiRegions ( const edm::Event event,
const edm::EventSetup setup,
std::vector< RectangularEtaPhiRegion > &  regions 
) const
virtual

Implements L1RegionDataBase.

Definition at line 342 of file HLTRecHitInAllL1RegionsProducer.cc.

References l1tSlwPFPuppiJets_cfi::phiLow, and singleTopDQM_cfi::setup.

343  {
345  event.getByToken(token_, l1Cands);
346 
347  auto const& l1CaloGeom = setup.getData(l1CaloGeometryToken_);
348 
349  for (const auto& l1Cand : *l1Cands) {
350  if (l1Cand.et() >= minEt_ && l1Cand.et() < maxEt_) {
351  // Access the GCT hardware object corresponding to the L1Extra EM object.
352  int etaIndex = l1Cand.gctEmCand()->etaIndex();
353  int phiIndex = l1Cand.gctEmCand()->phiIndex();
354 
355  // Use the L1CaloGeometry to find the eta, phi bin boundaries.
356  double etaLow = l1CaloGeom.etaBinLowEdge(etaIndex);
357  double etaHigh = l1CaloGeom.etaBinHighEdge(etaIndex);
358  double phiLow = l1CaloGeom.emJetPhiBinLowEdge(phiIndex);
359  double phiHigh = l1CaloGeom.emJetPhiBinHighEdge(phiIndex);
360 
361  etaLow -= regionEtaMargin_;
362  etaHigh += regionEtaMargin_;
364  phiHigh += regionPhiMargin_;
365 
366  regions.push_back(RectangularEtaPhiRegion(etaLow, etaHigh, phiLow, phiHigh));
367  }
368  }
369 }
edm::EDGetTokenT< T1 > const token_
edm::ESGetToken< L1CaloGeometry, L1CaloGeometryRecord > l1CaloGeometryToken_

Member Data Documentation

◆ l1CaloGeometryToken_

template<typename T1>
edm::ESGetToken<L1CaloGeometry, L1CaloGeometryRecord> L1RegionData< T1 >::l1CaloGeometryToken_
private

Definition at line 65 of file HLTRecHitInAllL1RegionsProducer.cc.

◆ maxEt_

template<typename T1>
double const L1RegionData< T1 >::maxEt_
private

Definition at line 61 of file HLTRecHitInAllL1RegionsProducer.cc.

◆ minEt_

template<typename T1>
double const L1RegionData< T1 >::minEt_
private

Definition at line 60 of file HLTRecHitInAllL1RegionsProducer.cc.

◆ regionEtaMargin_

template<typename T1>
double const L1RegionData< T1 >::regionEtaMargin_
private

Definition at line 62 of file HLTRecHitInAllL1RegionsProducer.cc.

◆ regionPhiMargin_

template<typename T1>
double const L1RegionData< T1 >::regionPhiMargin_
private

Definition at line 63 of file HLTRecHitInAllL1RegionsProducer.cc.

◆ token_

template<typename T1>
edm::EDGetTokenT<T1> const L1RegionData< T1 >::token_
private

Definition at line 64 of file HLTRecHitInAllL1RegionsProducer.cc.