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
EcalRegionCabling Class Reference

#include <EcalRegionCabling.h>

Public Member Functions

 EcalRegionCabling (edm::ParameterSet &conf, const EcalElectronicsMapping *m)
 
uint32_t elementIndex (const double eta, const double phi) const
 
const ESElectronicsMapperes_mapping () const
 
const EcalElectronicsMappingmapping () const
 
template<class T >
void updateEcalRefGetterWithElementIndex (edm::RefGetter< T > &refgetter, const edm::Handle< edm::LazyGetter< T > > &lazygetter, const uint32_t index) const
 
template<class T >
void updateEcalRefGetterWithEtaPhi (edm::RefGetter< T > &refgetter, const edm::Handle< edm::LazyGetter< T > > &lazygetter, const double eta, const double phi) const
 
template<class T >
void updateEcalRefGetterWithFedIndex (edm::RefGetter< T > &refgetter, const edm::Handle< edm::LazyGetter< T > > &lazygetter, const int index) const
 
 ~EcalRegionCabling ()
 

Static Public Member Functions

static uint32_t elementIndex (const int FEDindex)
 
static uint32_t esElementIndex (const int FEDindex)
 
static int esFedIndex (const uint32_t index)
 
static int fedIndex (const uint32_t index)
 
static uint32_t maxElementIndex ()
 
static uint32_t maxESElementIndex ()
 

Private Attributes

const ESElectronicsMapperes_mapping_
 
const EcalElectronicsMappingmapping_
 

Detailed Description

Definition at line 15 of file EcalRegionCabling.h.

Constructor & Destructor Documentation

EcalRegionCabling::EcalRegionCabling ( edm::ParameterSet conf,
const EcalElectronicsMapping m 
)
inline

Definition at line 17 of file EcalRegionCabling.h.

References es_mapping_, and edm::ParameterSet::getParameter().

18  : mapping_(m)
19  {
20  const edm::ParameterSet esMap = conf.getParameter<edm::ParameterSet>("esMapping");
21  es_mapping_ = new ESElectronicsMapper(esMap);
22  }
T getParameter(std::string const &) const
const ESElectronicsMapper * es_mapping_
const EcalElectronicsMapping * mapping_
EcalRegionCabling::~EcalRegionCabling ( )
inline

Definition at line 24 of file EcalRegionCabling.h.

References es_mapping_.

24  {
25  // this pointer is own by this object.
26  delete es_mapping_;
27  }
const ESElectronicsMapper * es_mapping_

Member Function Documentation

static uint32_t EcalRegionCabling::elementIndex ( const int  FEDindex)
inlinestatic

Definition at line 47 of file EcalRegionCabling.h.

References FEDNumbering::MAXECALFEDID, and FEDNumbering::MINECALFEDID.

Referenced by elementIndex(), and updateEcalRefGetterWithFedIndex().

47  {
48  //do a test for the time being
49  if (FEDindex > FEDNumbering::MAXECALFEDID || FEDindex < FEDNumbering::MINECALFEDID) {
50  edm::LogError("IncorrectMapping")<<"FEDindex: "<< FEDindex
51  <<" is not between: "<<(int) FEDNumbering::MINECALFEDID
52  <<" and "<<(int)FEDNumbering::MAXECALFEDID;
53  return 0;}
54  uint32_t eI = FEDindex - FEDNumbering::MINECALFEDID;
55  return eI; }
return((rh^lh)&mask)
uint32_t EcalRegionCabling::elementIndex ( const double  eta,
const double  phi 
) const
inline

Definition at line 76 of file EcalRegionCabling.h.

References elementIndex(), EcalElectronicsMapping::GetFED(), and mapping().

76  {
77  int FEDindex = mapping()->GetFED(eta,phi);
78  return elementIndex(FEDindex); }
int GetFED(double eta, double phi) const
const EcalElectronicsMapping * mapping() const
static uint32_t elementIndex(const int FEDindex)
const ESElectronicsMapper* EcalRegionCabling::es_mapping ( ) const
inline

Definition at line 29 of file EcalRegionCabling.h.

References es_mapping_.

29 { return es_mapping_;}
const ESElectronicsMapper * es_mapping_
static uint32_t EcalRegionCabling::esElementIndex ( const int  FEDindex)
inlinestatic

Definition at line 57 of file EcalRegionCabling.h.

References FEDNumbering::MAXPreShowerFEDID, and FEDNumbering::MINPreShowerFEDID.

57  {
58  //do a test for the time being
60  edm::LogError("IncorrectMapping")<<"FEDindex: "<< FEDindex
61  <<" is not between: "<<(int) FEDNumbering::MINPreShowerFEDID
62  <<" and "<<(int)FEDNumbering::MAXPreShowerFEDID;
63  return 0;}
64  uint32_t eI = FEDindex - FEDNumbering::MINPreShowerFEDID;
65  return eI; }
return((rh^lh)&mask)
static int EcalRegionCabling::esFedIndex ( const uint32_t  index)
inlinestatic

Definition at line 71 of file EcalRegionCabling.h.

References FEDNumbering::MINPreShowerFEDID.

static int EcalRegionCabling::fedIndex ( const uint32_t  index)
inlinestatic

Definition at line 67 of file EcalRegionCabling.h.

References FEDNumbering::MINECALFEDID.

Referenced by ECALRegFEDSelector::produce().

67  {
69  return fI;}
const EcalElectronicsMapping* EcalRegionCabling::mapping ( ) const
inline

Definition at line 28 of file EcalRegionCabling.h.

References mapping_.

Referenced by elementIndex(), and updateEcalRefGetterWithEtaPhi().

28 { return mapping_;}
const EcalElectronicsMapping * mapping_
static uint32_t EcalRegionCabling::maxElementIndex ( )
inlinestatic
static uint32_t EcalRegionCabling::maxESElementIndex ( )
inlinestatic
template<class T >
void EcalRegionCabling::updateEcalRefGetterWithElementIndex ( edm::RefGetter< T > &  refgetter,
const edm::Handle< edm::LazyGetter< T > > &  lazygetter,
const uint32_t  index 
) const

Definition at line 86 of file EcalRegionCabling.h.

References cmsHarvester::index, LogDebug, and edm::RefGetter< T >::push_back().

Referenced by updateEcalRefGetterWithFedIndex().

88  {
89  LogDebug("EcalRawToRecHit|Cabling")<<"updating a refgetter with element index: "<<index;
90  refgetter.push_back(lazygetter, index);
91 }
#define LogDebug(id)
void push_back(const edm::Handle< LazyGetter< T > > &, const uint32_t &)
Add a new region to the end of the collection.
Definition: RefGetter.h:110
template<class T >
void EcalRegionCabling::updateEcalRefGetterWithEtaPhi ( edm::RefGetter< T > &  refgetter,
const edm::Handle< edm::LazyGetter< T > > &  lazygetter,
const double  eta,
const double  phi 
) const

Definition at line 102 of file EcalRegionCabling.h.

References EcalElectronicsMapping::GetFED(), cmsHarvester::index, LogDebug, mapping(), phi, and updateEcalRefGetterWithFedIndex().

105  {
106  int index = mapping()->GetFED(eta,phi);
107  LogDebug("EcalRawToRecHit|Cabling")<<"updating a refgetter with eta: "<<eta<<" phi: "<<phi;
108  updateEcalRefGetterWithFedIndex(refgetter, lazygetter, index);
109 }
#define LogDebug(id)
int GetFED(double eta, double phi) const
const EcalElectronicsMapping * mapping() const
void updateEcalRefGetterWithFedIndex(edm::RefGetter< T > &refgetter, const edm::Handle< edm::LazyGetter< T > > &lazygetter, const int index) const
template<class T >
void EcalRegionCabling::updateEcalRefGetterWithFedIndex ( edm::RefGetter< T > &  refgetter,
const edm::Handle< edm::LazyGetter< T > > &  lazygetter,
const int  index 
) const

Definition at line 94 of file EcalRegionCabling.h.

References elementIndex(), LogDebug, and updateEcalRefGetterWithElementIndex().

Referenced by updateEcalRefGetterWithEtaPhi().

96  {
97  LogDebug("EcalRawToRecHit|Cabling")<<"updating a refgetter with fed index: "<<fedindex;
98  updateEcalRefGetterWithElementIndex(refgetter, lazygetter, elementIndex(fedindex));
99 }
#define LogDebug(id)
void updateEcalRefGetterWithElementIndex(edm::RefGetter< T > &refgetter, const edm::Handle< edm::LazyGetter< T > > &lazygetter, const uint32_t index) const
static uint32_t elementIndex(const int FEDindex)

Member Data Documentation

const ESElectronicsMapper* EcalRegionCabling::es_mapping_
private

Definition at line 82 of file EcalRegionCabling.h.

Referenced by EcalRegionCabling(), es_mapping(), and ~EcalRegionCabling().

const EcalElectronicsMapping* EcalRegionCabling::mapping_
private

Definition at line 81 of file EcalRegionCabling.h.

Referenced by mapping().