CMS 3D CMS Logo

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
EcalRegionCabling.h
Go to the documentation of this file.
1 #ifndef EcalRegionCabling_H
2 #define EcalRegionCabling_H
3 
6 
10 
12 
14  public:
16  : mapping_(m)
17  {
18  const edm::ParameterSet esMap = conf.getParameter<edm::ParameterSet>("esMapping");
19  es_mapping_ = new ESElectronicsMapper(esMap);
20  }
21 
23  // this pointer is own by this object.
24  delete es_mapping_;
25  }
26  const EcalElectronicsMapping * mapping() const { return mapping_;}
27  const ESElectronicsMapper * es_mapping() const { return es_mapping_;}
28 
31 
32  static uint32_t elementIndex(const int FEDindex) {
33  //do a test for the time being
34  if (FEDindex > FEDNumbering::MAXECALFEDID || FEDindex < FEDNumbering::MINECALFEDID) {
35  edm::LogError("IncorrectMapping")<<"FEDindex: "<< FEDindex
36  <<" is not between: "<<(int) FEDNumbering::MINECALFEDID
37  <<" and "<<(int)FEDNumbering::MAXECALFEDID;
38  return 0;}
39  uint32_t eI = FEDindex - FEDNumbering::MINECALFEDID;
40  return eI; }
41 
42  static uint32_t esElementIndex(const int FEDindex) {
43  //do a test for the time being
45  edm::LogError("IncorrectMapping")<<"FEDindex: "<< FEDindex
46  <<" is not between: "<<(int) FEDNumbering::MINPreShowerFEDID
47  <<" and "<<(int)FEDNumbering::MAXPreShowerFEDID;
48  return 0;}
49  uint32_t eI = FEDindex - FEDNumbering::MINPreShowerFEDID;
50  return eI; }
51 
52  static int fedIndex(const uint32_t index){
53  int fI = index+FEDNumbering::MINECALFEDID;
54  return fI;}
55 
56  static int esFedIndex(const uint32_t index){
57  int fI = index+FEDNumbering::MINPreShowerFEDID;
58  return fI;}
59 
60 
61  uint32_t elementIndex(const double eta, const double phi) const{
62  int FEDindex = mapping()->GetFED(eta,phi);
63  return elementIndex(FEDindex); }
64 
65  private:
68 };
69 
70 #endif
T getParameter(std::string const &) const
int GetFED(double eta, double phi) const
const ESElectronicsMapper * es_mapping_
const EcalElectronicsMapping * mapping() const
static int fedIndex(const uint32_t index)
static uint32_t esElementIndex(const int FEDindex)
EcalRegionCabling(edm::ParameterSet &conf, const EcalElectronicsMapping *m)
const EcalElectronicsMapping * mapping_
static uint32_t elementIndex(const int FEDindex)
uint32_t elementIndex(const double eta, const double phi) const
static uint32_t maxElementIndex()
static int esFedIndex(const uint32_t index)
const ESElectronicsMapper * es_mapping() const
static uint32_t maxESElementIndex()