CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Static Public Member Functions | Private Attributes
L1RegionData< T1 > Class Template Reference

#include <HLTRecHitInAllL1RegionsProducer.h>

Inheritance diagram for L1RegionData< T1 >:
L1RegionDataBase

Public Member Functions

void getEtaPhiRegions (const edm::Event &, std::vector< EcalEtaPhiRegion > &, const L1CaloGeometry &) const override
 
template<>
void getEtaPhiRegions (const edm::Event &event, std::vector< EcalEtaPhiRegion > &regions, const L1CaloGeometry &l1CaloGeom) const
 
template<>
void getEtaPhiRegions (const edm::Event &event, std::vector< EcalEtaPhiRegion > &regions, const L1CaloGeometry &l1CaloGeom) 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 Attributes

double maxEt_
 
double minEt_
 
double regionEtaMargin_
 
double regionPhiMargin_
 
edm::EDGetTokenT< T1 > token_
 

Detailed Description

template<typename T1>
class L1RegionData< T1 >

Definition at line 58 of file HLTRecHitInAllL1RegionsProducer.h.

Constructor & Destructor Documentation

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

Definition at line 66 of file HLTRecHitInAllL1RegionsProducer.h.

66  :
67  minEt_(para.getParameter<double>("minEt")),
68  maxEt_(para.getParameter<double>("maxEt")),
69  regionEtaMargin_(para.getParameter<double>("regionEtaMargin")),
70  regionPhiMargin_(para.getParameter<double>("regionPhiMargin")),
71  token_(consumesColl.consumes<T1>(para.getParameter<edm::InputTag>("inputColl"))){}
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
T getParameter(std::string const &) const
edm::EDGetTokenT< T1 > token_

Member Function Documentation

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

Definition at line 74 of file HLTRecHitInAllL1RegionsProducer.h.

74 {return coll.begin();}
JetCorrectorParametersCollection coll
Definition: classes.h:10
template<typename T1>
template<typename T2 >
static BXVector<T2>::const_iterator L1RegionData< T1 >::beginIt ( const BXVector< T2 > &  coll)
inlinestatic

Definition at line 76 of file HLTRecHitInAllL1RegionsProducer.h.

References BXVector< T >::begin().

76 {return coll.begin(0);}
const_iterator begin(int bx) const
template<typename T1>
template<typename T2 >
static T2::const_iterator L1RegionData< T1 >::endIt ( const T2 &  coll)
inlinestatic

Definition at line 75 of file HLTRecHitInAllL1RegionsProducer.h.

75 {return coll.end();}
JetCorrectorParametersCollection coll
Definition: classes.h:10
template<typename T1>
template<typename T2 >
static BXVector<T2>::const_iterator L1RegionData< T1 >::endIt ( const BXVector< T2 > &  coll)
inlinestatic

Definition at line 77 of file HLTRecHitInAllL1RegionsProducer.h.

References BXVector< T >::end().

77 {return coll.end(0);}
const_iterator end(int bx) const
template<typename L1CollType >
void L1RegionData< L1CollType >::getEtaPhiRegions ( const edm::Event event,
std::vector< EcalEtaPhiRegion > &  regions,
const L1CaloGeometry  
) const
overridevirtual

Implements L1RegionDataBase.

Definition at line 274 of file HLTRecHitInAllL1RegionsProducer.h.

275 {
276  edm::Handle<L1CollType> l1Cands;
277  event.getByToken(token_,l1Cands);
278 
279  for(auto l1CandIt = beginIt(*l1Cands);l1CandIt!=endIt(*l1Cands);++l1CandIt){
280  if(l1CandIt->et() >= minEt_ && l1CandIt->et() < maxEt_){
281 
282  double etaLow = l1CandIt->eta() - regionEtaMargin_;
283  double etaHigh = l1CandIt->eta() + regionEtaMargin_;
284  double phiLow = l1CandIt->phi() - regionPhiMargin_;
285  double phiHigh = l1CandIt->phi() + regionPhiMargin_;
286 
287  regions.push_back(EcalEtaPhiRegion(etaLow,etaHigh,phiLow,phiHigh));
288  }
289  }
290 }
edm::EDGetTokenT< T1 > token_
static T2::const_iterator endIt(const T2 &coll)
static T2::const_iterator beginIt(const T2 &coll)
template<>
void L1RegionData< l1extra::L1JetParticleCollection >::getEtaPhiRegions ( const edm::Event event,
std::vector< EcalEtaPhiRegion > &  regions,
const L1CaloGeometry l1CaloGeom 
) const
virtual

Implements L1RegionDataBase.

Definition at line 293 of file HLTRecHitInAllL1RegionsProducer.h.

References L1CaloGeometry::emJetPhiBinHighEdge(), L1CaloGeometry::emJetPhiBinLowEdge(), L1CaloGeometry::etaBinHighEdge(), and L1CaloGeometry::etaBinLowEdge().

294 {
296  event.getByToken(token_,l1Cands);
297 
298  for(const auto& l1Cand : *l1Cands){
299  if(l1Cand.et() >= minEt_ && l1Cand.et() < maxEt_){
300 
301  // Access the GCT hardware object corresponding to the L1Extra EM object.
302  int etaIndex = l1Cand.gctJetCand()->etaIndex();
303  int phiIndex = l1Cand.gctJetCand()->phiIndex();
304 
305  // Use the L1CaloGeometry to find the eta, phi bin boundaries.
306  double etaLow = l1CaloGeom.etaBinLowEdge(etaIndex);
307  double etaHigh = l1CaloGeom.etaBinHighEdge(etaIndex);
308  double phiLow = l1CaloGeom.emJetPhiBinLowEdge( phiIndex ) ;
309  double phiHigh = l1CaloGeom.emJetPhiBinHighEdge( phiIndex ) ;
310 
311  etaLow -= regionEtaMargin_;
312  etaHigh += regionEtaMargin_;
313  phiLow -= regionPhiMargin_;
314  phiHigh += regionPhiMargin_;
315 
316 
317  regions.push_back(EcalEtaPhiRegion(etaLow,etaHigh,phiLow,phiHigh));
318  }
319  }
320 }
double etaBinHighEdge(unsigned int etaIndex, bool central=true) const
double etaBinLowEdge(unsigned int etaIndex, bool central=true) const
edm::EDGetTokenT< T1 > token_
double emJetPhiBinLowEdge(unsigned int phiIndex) const
double emJetPhiBinHighEdge(unsigned int phiIndex) const
template<>
void L1RegionData< l1extra::L1EmParticleCollection >::getEtaPhiRegions ( const edm::Event event,
std::vector< EcalEtaPhiRegion > &  regions,
const L1CaloGeometry l1CaloGeom 
) const
virtual

Implements L1RegionDataBase.

Definition at line 323 of file HLTRecHitInAllL1RegionsProducer.h.

References L1CaloGeometry::emJetPhiBinHighEdge(), L1CaloGeometry::emJetPhiBinLowEdge(), L1CaloGeometry::etaBinHighEdge(), and L1CaloGeometry::etaBinLowEdge().

324 {
326  event.getByToken(token_,l1Cands);
327 
328  for(const auto& l1Cand : *l1Cands){
329  if(l1Cand.et() >= minEt_ && l1Cand.et() < maxEt_){
330 
331  // Access the GCT hardware object corresponding to the L1Extra EM object.
332  int etaIndex = l1Cand.gctEmCand()->etaIndex();
333  int phiIndex = l1Cand.gctEmCand()->phiIndex();
334 
335  // Use the L1CaloGeometry to find the eta, phi bin boundaries.
336  double etaLow = l1CaloGeom.etaBinLowEdge(etaIndex);
337  double etaHigh = l1CaloGeom.etaBinHighEdge(etaIndex);
338  double phiLow = l1CaloGeom.emJetPhiBinLowEdge( phiIndex ) ;
339  double phiHigh = l1CaloGeom.emJetPhiBinHighEdge( phiIndex ) ;
340 
341  etaLow -= regionEtaMargin_;
342  etaHigh += regionEtaMargin_;
343  phiLow -= regionPhiMargin_;
344  phiHigh += regionPhiMargin_;
345 
346  regions.push_back(EcalEtaPhiRegion(etaLow,etaHigh,phiLow,phiHigh));
347  }
348  }
349 }
double etaBinHighEdge(unsigned int etaIndex, bool central=true) const
double etaBinLowEdge(unsigned int etaIndex, bool central=true) const
edm::EDGetTokenT< T1 > token_
double emJetPhiBinLowEdge(unsigned int phiIndex) const
double emJetPhiBinHighEdge(unsigned int phiIndex) const

Member Data Documentation

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

Definition at line 61 of file HLTRecHitInAllL1RegionsProducer.h.

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

Definition at line 60 of file HLTRecHitInAllL1RegionsProducer.h.

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

Definition at line 62 of file HLTRecHitInAllL1RegionsProducer.h.

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

Definition at line 63 of file HLTRecHitInAllL1RegionsProducer.h.

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

Definition at line 64 of file HLTRecHitInAllL1RegionsProducer.h.