CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
EcalRegionCabling.h
Go to the documentation of this file.
1 #ifndef EventFilter_EcalRawToDigi_interface_EcalRegionCabling_h
2 #define EventFilter_EcalRawToDigi_interface_EcalRegionCabling_h
3 
9 
11 public:
13  const edm::ParameterSet esMap = conf.getParameter<edm::ParameterSet>("esMapping");
14  es_mapping_ = new ESElectronicsMapper(esMap);
15  }
16 
18  // this pointer is own by this object.
19  delete es_mapping_;
20  }
21  const EcalElectronicsMapping* mapping() const { return mapping_; }
22  const ESElectronicsMapper* es_mapping() const { return es_mapping_; }
23 
25  static uint32_t maxESElementIndex() {
27  }
28 
29  static uint32_t elementIndex(const int FEDindex) {
30  //do a test for the time being
31  if (FEDindex > FEDNumbering::MAXECALFEDID || FEDindex < FEDNumbering::MINECALFEDID) {
32  edm::LogError("IncorrectMapping") << "FEDindex: " << FEDindex
33  << " is not between: " << (int)FEDNumbering::MINECALFEDID << " and "
35  return 0;
36  }
37  uint32_t eI = FEDindex - FEDNumbering::MINECALFEDID;
38  return eI;
39  }
40 
41  static uint32_t esElementIndex(const int FEDindex) {
42  //do a test for the time being
44  edm::LogError("IncorrectMapping") << "FEDindex: " << FEDindex
45  << " is not between: " << (int)FEDNumbering::MINPreShowerFEDID << " and "
47  return 0;
48  }
49  uint32_t eI = FEDindex - FEDNumbering::MINPreShowerFEDID;
50  return eI;
51  }
52 
53  static int fedIndex(const uint32_t index) {
54  int fI = index + FEDNumbering::MINECALFEDID;
55  return fI;
56  }
57 
58  static int esFedIndex(const uint32_t index) {
59  int fI = index + FEDNumbering::MINPreShowerFEDID;
60  return fI;
61  }
62 
63  uint32_t elementIndex(const double eta, const double phi) const {
64  int FEDindex = mapping()->GetFED(eta, phi);
65  return elementIndex(FEDindex);
66  }
67 
68 private:
71 };
72 
73 #endif // EventFilter_EcalRawToDigi_interface_EcalRegionCabling_h
int GetFED(double eta, double phi) const
const ESElectronicsMapper * es_mapping_
Log< level::Error, false > LogError
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
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
static uint32_t maxElementIndex()
static int esFedIndex(const uint32_t index)
const ESElectronicsMapper * es_mapping() const
static uint32_t maxESElementIndex()