CMS 3D CMS Logo

EcalRegionCabling.h
Go to the documentation of this file.
1 #ifndef EcalRegionCabling_H
2 #define EcalRegionCabling_H
3 
6 
10 
12 
14 public:
16  const edm::ParameterSet esMap = conf.getParameter<edm::ParameterSet>("esMapping");
17  es_mapping_ = new ESElectronicsMapper(esMap);
18  }
19 
21  // this pointer is own by this object.
22  delete es_mapping_;
23  }
24  const EcalElectronicsMapping* mapping() const { return mapping_; }
25  const ESElectronicsMapper* es_mapping() const { return es_mapping_; }
26 
28  static uint32_t maxESElementIndex() {
30  }
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 << " and "
38  return 0;
39  }
40  uint32_t eI = FEDindex - FEDNumbering::MINECALFEDID;
41  return eI;
42  }
43 
44  static uint32_t esElementIndex(const int FEDindex) {
45  //do a test for the time being
47  edm::LogError("IncorrectMapping") << "FEDindex: " << FEDindex
48  << " is not between: " << (int)FEDNumbering::MINPreShowerFEDID << " and "
50  return 0;
51  }
52  uint32_t eI = FEDindex - FEDNumbering::MINPreShowerFEDID;
53  return eI;
54  }
55 
56  static int fedIndex(const uint32_t index) {
57  int fI = index + FEDNumbering::MINECALFEDID;
58  return fI;
59  }
60 
61  static int esFedIndex(const uint32_t index) {
62  int fI = index + FEDNumbering::MINPreShowerFEDID;
63  return fI;
64  }
65 
66  uint32_t elementIndex(const double eta, const double phi) const {
67  int FEDindex = mapping()->GetFED(eta, phi);
68  return elementIndex(FEDindex);
69  }
70 
71 private:
74 };
75 
76 #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()