CMS 3D CMS Logo

LMap.h
Go to the documentation of this file.
1 #ifndef HCALConfigDBTools_XMLTools_LMap_h
2 #define HCALConfigDBTools_XMLTools_LMap_h
3 // -*- C++ -*-
4 //
5 // Package: XMLTools
6 // Class : LMap
7 //
17 //
18 // Original Author: Gena Kukartsev, kukarzev@fnal.gov
19 // Created: Tue Nov 06 14:30:33 CDT 2007
20 //
21 
22 // system include files
23 #include <vector>
24 #include <cstring>
25 #include <fstream>
26 #include <memory>
27 #include "CaloOnlineTools/HcalOnlineDb/interface/ConfigurationDatabase.hh"
30 
31 class LMapRow {
32 public:
33  LMapRow(){};
34  ~LMapRow(){};
35 
36  int side;
37  int eta, phi, dphi, depth;
38  //string det;
42  int crate, htr; // crate-slot
43  std::string fpga; // top-bottom
44  int htr_fi; // fiber
45  int dcc_sl, spigo, dcc, slb;
49  int fedid;
50 
51  std::string let_code; // specific to HO
52 
53 private:
54 };
55 
56 class LMapDetId {
57 public:
58  LMapDetId(){};
60 
61  int side;
62  int eta, phi, depth;
64 };
65 
66 class LMap {
67 public:
68  LMap();
69  ~LMap();
70 
71  // type = "HNEF" or "HO", matters for
72  int read(std::string accessor, std::string type = "HBEF");
73  std::map<int, LMapRow>& get_map(void);
74 
75 private:
76  class impl;
77  std::shared_ptr<impl> p_impl;
78 };
79 
80 class EMap {
81 public:
82  EMap() {}
84  EMap(const HcalElectronicsMap* map);
85  ~EMap() {}
86 
87  class EMapRow {
88  public:
91  // ZDC channels:
92  // section: ZDC EM, ZDC HAD, ZDC LUM(?)
95 
96  EMapRow() {
97  rawId = 0;
98  crate = 0;
99  slot = 0;
100  dcc = 0;
101  spigot = 0;
102  fiber = 0;
103  fiberchan = 0;
104  ieta = 0;
105  iphi = 0;
106  idepth = 0;
107  topbottom = "";
108  subdet = "";
109  zdc_zside = 0;
110  zdc_channel = 0;
111  zdc_section = "UNKNOWN";
112  }
113  ~EMapRow(){};
114 
115  bool operator<(const EMapRow& other) const;
116 
117  }; // end of class EMapRow
118 
120 
121  std::vector<EMap::EMapRow>& get_map(void);
122 
123 protected:
124  std::vector<EMapRow> map;
125 }; // end of class EMap
126 
127 class LMap_test {
128 public:
129  LMap_test();
131 
132  int test_read(std::string accessor, std::string type = "HBEF");
133 
134 private:
135  std::shared_ptr<LMap> _lmap;
136 };
137 
138 class EMap_test {
139 public:
142 
144 }; // end of class EMap_test
145 
146 #endif
std::vector< EMapRow > map
Definition: LMap.h:124
~EMapRow()
Definition: LMap.h:113
int slot
Definition: LMap.h:89
int rctcra
Definition: LMap.h:47
int read_map(std::string filename)
Definition: LMap.cc:268
int dphi
Definition: LMap.h:37
int zdc_channel
Definition: LMap.h:93
int phi
Definition: LMap.h:37
int pixel
Definition: LMap.h:41
~LMap()
Definition: LMap.cc:45
int eta
Definition: LMap.h:62
std::string zdc_section
Definition: LMap.h:94
int qie
Definition: LMap.h:41
int zdc_zside
Definition: LMap.h:93
~EMap_test()
Definition: LMap.h:141
int iphi
Definition: LMap.h:89
LMapDetId()
Definition: LMap.h:58
int fedid
Definition: LMap.h:49
std::shared_ptr< impl > p_impl
Definition: LMap.h:76
int ieta
Definition: LMap.h:89
int rawId
Definition: LMap.h:89
int fiber
Definition: LMap.h:89
int spigot
Definition: LMap.h:89
EMap_test()
Definition: LMap.h:140
int slb
Definition: LMap.h:45
int htr
Definition: LMap.h:42
std::string subdet
Definition: LMap.h:90
std::map< int, LMapRow > & get_map(void)
Definition: LMap.cc:49
int depth
Definition: LMap.h:37
int spigo
Definition: LMap.h:45
int side
Definition: LMap.h:59
int test_read(std::string accessor, std::string type="HBEF")
Definition: LMap.cc:329
std::string slbin
Definition: LMap.h:46
std::string subdetector
Definition: LMap.h:63
int dcc_sl
Definition: LMap.h:45
int fi_ch
Definition: LMap.h:41
int adc
Definition: LMap.h:41
int read(std::string accessor, std::string type="HBEF")
Definition: LMap.cc:47
EMap(std::string filename)
Definition: LMap.h:83
~LMapDetId()
Definition: LMap.h:59
~LMapRow()
Definition: LMap.h:34
~EMap()
Definition: LMap.h:85
HcalSubdetector
Definition: HcalAssistant.h:31
std::string slnam
Definition: LMap.h:46
int crate
Definition: LMap.h:42
LMapRow()
Definition: LMap.h:33
std::string rbx
Definition: LMap.h:40
std::string rctnam
Definition: LMap.h:48
int fiberchan
Definition: LMap.h:89
int dcc
Definition: LMap.h:89
int side
Definition: LMap.h:34
std::shared_ptr< LMap > _lmap
Definition: LMap.h:135
bool operator<(const EMapRow &other) const
Definition: LMap.cc:318
int depth
Definition: LMap.h:62
int phi
Definition: LMap.h:62
int crate
Definition: LMap.h:89
std::string fpga
Definition: LMap.h:43
EMapRow()
Definition: LMap.h:96
int rm_fi
Definition: LMap.h:41
LMap_test()
Definition: LMap.cc:327
int dcc
Definition: LMap.h:45
std::string slbin2
Definition: LMap.h:46
std::string topbottom
Definition: LMap.h:90
int wedge
Definition: LMap.h:41
int rctcon
Definition: LMap.h:47
LMap()
Definition: LMap.cc:43
int rctcar
Definition: LMap.h:47
int test_read_map(std::string filename)
Definition: LMap.cc:321
std::vector< EMap::EMapRow > & get_map(void)
Definition: LMap.cc:316
Definition: LMap.h:80
int idepth
Definition: LMap.h:89
int htr_fi
Definition: LMap.h:44
std::string let_code
Definition: LMap.h:51
Definition: LMap.h:56
HcalSubdetector det
Definition: LMap.h:39
Definition: LMap.h:31
Definition: LMap.h:66
EMap()
Definition: LMap.h:82
int eta
Definition: LMap.h:37
int rm
Definition: LMap.h:41
~LMap_test()
Definition: LMap.h:130