CMS 3D CMS Logo

GEMROMapping.h
Go to the documentation of this file.
1 #ifndef CondFormats_GEMObjects_GEMROMapping_h
2 #define CondFormats_GEMObjects_GEMROMapping_h
4 #include <map>
5 #include <vector>
6 
7 class GEMROMapping {
8 public:
9  struct chamEC {
10  unsigned int fedId;
11  uint8_t amcNum;
12  uint8_t gebId;
13  bool operator<(const chamEC& r) const {
14  if (fedId == r.fedId) {
15  if (amcNum == r.amcNum) {
16  return gebId < r.gebId;
17  } else {
18  return amcNum < r.amcNum;
19  }
20  } else {
21  return fedId < r.fedId;
22  }
23  }
24  };
25 
26  struct chamDC {
28  int vfatVer;
29  bool operator<(const chamDC& r) const { return detId < r.detId; }
30  };
31 
32  struct vfatEC {
33  uint16_t vfatAdd;
35  bool operator<(const vfatEC& r) const {
36  if (vfatAdd == r.vfatAdd) {
37  return detId < r.detId;
38  } else {
39  return vfatAdd < r.vfatAdd;
40  }
41  }
42  };
43 
44  struct vfatDC {
45  int vfatType;
47  int localPhi;
48  bool operator<(const vfatDC& r) const {
49  if (vfatType == r.vfatType) {
50  if (detId == r.detId) {
51  return localPhi < r.localPhi;
52  } else {
53  return detId < r.detId;
54  }
55  } else {
56  return vfatType < r.vfatType;
57  }
58  }
59  };
60 
61  struct channelNum {
62  int vfatType;
63  int chNum;
64  bool operator<(const channelNum& c) const {
65  if (vfatType == c.vfatType)
66  return chNum < c.chNum;
67  else
68  return vfatType < c.vfatType;
69  }
70  };
71 
72  struct stripNum {
73  int vfatType;
74  int stNum;
75  bool operator<(const stripNum& s) const {
76  if (vfatType == s.vfatType)
77  return stNum < s.stNum;
78  else
79  return vfatType < s.vfatType;
80  }
81  };
82 
84 
85  bool isValidChipID(const vfatEC& r) const { return vMapED_.find(r) != vMapED_.end(); }
86  bool isValidChamber(const chamEC& r) const { return chamED_.find(r) != chamED_.end(); }
87 
88  const chamDC& chamberPos(const chamEC& r) const { return chamED_.at(r); }
89  void add(chamEC e, chamDC d) { chamED_[e] = d; }
90 
91  const std::vector<vfatEC> getVfats(const GEMDetId& r) const { return chamVfats_.at(r); }
92  void add(GEMDetId e, vfatEC d) { chamVfats_[e].push_back(d); }
93 
94  const vfatDC& vfatPos(const vfatEC& r) const { return vMapED_.at(r); }
95  void add(vfatEC e, vfatDC d) { vMapED_[e] = d; }
96 
97  const channelNum& hitPos(const stripNum& s) const { return stChMap_.at(s); }
98  const stripNum& hitPos(const channelNum& c) const { return chStMap_.at(c); }
99 
100  void add(channelNum c, stripNum s) { chStMap_[c] = s; }
101  void add(stripNum s, channelNum c) { stChMap_[s] = c; }
102 
103 private:
104  std::map<chamEC, chamDC> chamED_;
105 
106  std::map<GEMDetId, std::vector<vfatEC>> chamVfats_;
107 
108  std::map<vfatEC, vfatDC> vMapED_;
109 
110  std::map<channelNum, stripNum> chStMap_;
111  std::map<stripNum, channelNum> stChMap_;
112 };
113 #endif
GEMROMapping::vfatEC::detId
GEMDetId detId
Definition: GEMROMapping.h:34
GEMROMapping::chamberPos
const chamDC & chamberPos(const chamEC &r) const
Definition: GEMROMapping.h:88
GEMROMapping::channelNum::vfatType
int vfatType
Definition: GEMROMapping.h:62
GEMROMapping::vfatDC::vfatType
int vfatType
Definition: GEMROMapping.h:45
GEMROMapping::chStMap_
std::map< channelNum, stripNum > chStMap_
Definition: GEMROMapping.h:110
GEMROMapping::chamEC::fedId
unsigned int fedId
Definition: GEMROMapping.h:10
GEMROMapping::chamDC::operator<
bool operator<(const chamDC &r) const
Definition: GEMROMapping.h:29
GEMROMapping::chamEC::gebId
uint8_t gebId
Definition: GEMROMapping.h:12
GEMROMapping::stripNum::operator<
bool operator<(const stripNum &s) const
Definition: GEMROMapping.h:75
GEMROMapping::isValidChamber
bool isValidChamber(const chamEC &r) const
Definition: GEMROMapping.h:86
GEMROMapping::chamDC
Definition: GEMROMapping.h:26
GEMROMapping::getVfats
const std::vector< vfatEC > getVfats(const GEMDetId &r) const
Definition: GEMROMapping.h:91
GEMROMapping::chamEC::operator<
bool operator<(const chamEC &r) const
Definition: GEMROMapping.h:13
GEMROMapping
Definition: GEMROMapping.h:7
GEMROMapping::stripNum
Definition: GEMROMapping.h:72
GEMROMapping::vfatPos
const vfatDC & vfatPos(const vfatEC &r) const
Definition: GEMROMapping.h:94
GEMROMapping::chamDC::vfatVer
int vfatVer
Definition: GEMROMapping.h:28
GEMROMapping::isValidChipID
bool isValidChipID(const vfatEC &r) const
Definition: GEMROMapping.h:85
GEMROMapping::vfatDC::detId
GEMDetId detId
Definition: GEMROMapping.h:46
GEMROMapping::vfatDC::localPhi
int localPhi
Definition: GEMROMapping.h:47
alignCSCRings.s
s
Definition: alignCSCRings.py:92
GEMROMapping::add
void add(GEMDetId e, vfatEC d)
Definition: GEMROMapping.h:92
GEMROMapping::GEMROMapping
GEMROMapping()
Definition: GEMROMapping.h:83
GEMROMapping::stripNum::vfatType
int vfatType
Definition: GEMROMapping.h:73
GEMROMapping::vfatDC
Definition: GEMROMapping.h:44
GEMROMapping::channelNum::chNum
int chNum
Definition: GEMROMapping.h:63
GEMROMapping::add
void add(stripNum s, channelNum c)
Definition: GEMROMapping.h:101
GEMROMapping::add
void add(channelNum c, stripNum s)
Definition: GEMROMapping.h:100
GEMDetId
Definition: GEMDetId.h:17
GEMROMapping::chamED_
std::map< chamEC, chamDC > chamED_
Definition: GEMROMapping.h:104
GEMROMapping::vfatEC::vfatAdd
uint16_t vfatAdd
Definition: GEMROMapping.h:33
GEMROMapping::chamEC
Definition: GEMROMapping.h:9
GEMROMapping::stChMap_
std::map< stripNum, channelNum > stChMap_
Definition: GEMROMapping.h:111
HltBtagPostValidation_cff.c
c
Definition: HltBtagPostValidation_cff.py:31
GEMROMapping::stripNum::stNum
int stNum
Definition: GEMROMapping.h:74
alignCSCRings.r
r
Definition: alignCSCRings.py:93
GEMROMapping::channelNum::operator<
bool operator<(const channelNum &c) const
Definition: GEMROMapping.h:64
GEMROMapping::vMapED_
std::map< vfatEC, vfatDC > vMapED_
Definition: GEMROMapping.h:108
GEMDetId.h
GEMROMapping::chamEC::amcNum
uint8_t amcNum
Definition: GEMROMapping.h:11
GEMROMapping::add
void add(vfatEC e, vfatDC d)
Definition: GEMROMapping.h:95
GEMROMapping::add
void add(chamEC e, chamDC d)
Definition: GEMROMapping.h:89
GEMROMapping::channelNum
Definition: GEMROMapping.h:61
GEMROMapping::hitPos
const channelNum & hitPos(const stripNum &s) const
Definition: GEMROMapping.h:97
GEMROMapping::chamVfats_
std::map< GEMDetId, std::vector< vfatEC > > chamVfats_
Definition: GEMROMapping.h:106
ztail.d
d
Definition: ztail.py:151
GEMROMapping::vfatEC::operator<
bool operator<(const vfatEC &r) const
Definition: GEMROMapping.h:35
GEMROMapping::chamDC::detId
GEMDetId detId
Definition: GEMROMapping.h:27
GEMROMapping::vfatEC
Definition: GEMROMapping.h:32
GEMROMapping::vfatDC::operator<
bool operator<(const vfatDC &r) const
Definition: GEMROMapping.h:48
GEMROMapping::hitPos
const stripNum & hitPos(const channelNum &c) const
Definition: GEMROMapping.h:98
MillePedeFileConverter_cfg.e
e
Definition: MillePedeFileConverter_cfg.py:37