CMS 3D CMS Logo

Public Member Functions | Static Public Member Functions | Private Attributes

EcalRegionCabling Class Reference

#include <EcalRegionCabling.h>

List of all members.

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().

  : mapping_(m)
  {
    const edm::ParameterSet esMap = conf.getParameter<edm::ParameterSet>("esMapping");
    es_mapping_ = new ESElectronicsMapper(esMap);
  }
EcalRegionCabling::~EcalRegionCabling ( ) [inline]

Definition at line 24 of file EcalRegionCabling.h.

References es_mapping_.

                      {
    // this pointer is own by this object.
    delete es_mapping_;
  }

Member Function Documentation

static uint32_t EcalRegionCabling::elementIndex ( const int  FEDindex) [inline, static]

Definition at line 47 of file EcalRegionCabling.h.

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

Referenced by elementIndex(), and updateEcalRefGetterWithFedIndex().

                                                   {
    //do a test for the time being
    if (FEDindex > FEDNumbering::MAXECALFEDID || FEDindex < FEDNumbering::MINECALFEDID) {
      edm::LogError("IncorrectMapping")<<"FEDindex: "<< FEDindex
                                        <<" is not between: "<<(int) FEDNumbering::MINECALFEDID
                                        <<" and "<<(int)FEDNumbering::MAXECALFEDID;
      return 0;}
    uint32_t eI = FEDindex - FEDNumbering::MINECALFEDID;
    return eI; }
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().

                                                                 {
    int FEDindex = mapping()->GetFED(eta,phi);
    return elementIndex(FEDindex); }
const ESElectronicsMapper* EcalRegionCabling::es_mapping ( ) const [inline]

Definition at line 29 of file EcalRegionCabling.h.

References es_mapping_.

{ return es_mapping_;}
static uint32_t EcalRegionCabling::esElementIndex ( const int  FEDindex) [inline, static]

Definition at line 57 of file EcalRegionCabling.h.

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

                                                     {
    //do a test for the time being
    if (FEDindex > FEDNumbering::MAXPreShowerFEDID || FEDindex < FEDNumbering::MINPreShowerFEDID) {
      edm::LogError("IncorrectMapping")<<"FEDindex: "<< FEDindex
                                        <<" is not between: "<<(int) FEDNumbering::MINPreShowerFEDID
                                        <<" and "<<(int)FEDNumbering::MAXPreShowerFEDID;
      return 0;}
    uint32_t eI = FEDindex - FEDNumbering::MINPreShowerFEDID;
    return eI; }
static int EcalRegionCabling::esFedIndex ( const uint32_t  index) [inline, static]

Definition at line 71 of file EcalRegionCabling.h.

References FEDNumbering::MINPreShowerFEDID.

Referenced by ESUnpackerWorker::work().

                                             { 
    int fI = index+FEDNumbering::MINPreShowerFEDID; 
    return fI;}
static int EcalRegionCabling::fedIndex ( const uint32_t  index) [inline, static]

Definition at line 67 of file EcalRegionCabling.h.

References FEDNumbering::MINECALFEDID.

Referenced by ECALRegFEDSelector::produce(), and EcalUnpackerWorker::work().

                                           { 
    int fI = index+FEDNumbering::MINECALFEDID; 
    return fI;}
const EcalElectronicsMapping* EcalRegionCabling::mapping ( ) const [inline]

Definition at line 28 of file EcalRegionCabling.h.

References mapping_.

Referenced by elementIndex(), and updateEcalRefGetterWithEtaPhi().

{ return mapping_;}
static uint32_t EcalRegionCabling::maxElementIndex ( ) [inline, static]
static uint32_t EcalRegionCabling::maxESElementIndex ( ) [inline, static]
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 getHLTprescales::index, LogDebug, and edm::RefGetter< T >::push_back().

Referenced by updateEcalRefGetterWithFedIndex().

                                                                                                         {
  LogDebug("EcalRawToRecHit|Cabling")<<"updating a refgetter with element index: "<<index;
  refgetter.push_back(lazygetter, index);
}
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(), getHLTprescales::index, LogDebug, mapping(), phi, and updateEcalRefGetterWithFedIndex().

                                                                                               {
  int index = mapping()->GetFED(eta,phi);
  LogDebug("EcalRawToRecHit|Cabling")<<"updating a refgetter with eta: "<<eta<<" phi: "<<phi;
  updateEcalRefGetterWithFedIndex(refgetter, lazygetter, index);
}
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().

                                                                                                   {
  LogDebug("EcalRawToRecHit|Cabling")<<"updating a refgetter with fed index: "<<fedindex;
  updateEcalRefGetterWithElementIndex(refgetter, lazygetter, elementIndex(fedindex));
}

Member Data Documentation

Definition at line 82 of file EcalRegionCabling.h.

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

Definition at line 81 of file EcalRegionCabling.h.

Referenced by mapping().