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 
8  public:
9 
10  struct chamEC{
11  unsigned int fedId;
12  uint8_t amcNum;
13  uint8_t gebId;
14  bool operator < (const chamEC& r) const{
15  if (fedId == r.fedId){
16  if ( amcNum == r.amcNum){
17  return gebId < r.gebId;
18  }
19  else{
20  return amcNum < r.amcNum;
21  }
22  }
23  else{
24  return fedId < r.fedId;
25  }
26  }
27  };
28 
29  struct chamDC{
31  int vfatVer;
32  bool operator < (const chamDC& r) const{
33  return detId < r.detId;
34  }
35  };
36 
37  struct vfatEC{
38  uint16_t vfatAdd;
40  bool operator < (const vfatEC& r) const{
41  if (vfatAdd == r.vfatAdd){
42  return detId < r.detId;
43  }
44  else{
45  return vfatAdd < r.vfatAdd;
46  }
47  }
48  };
49 
50  struct vfatDC{
51  int vfatType;
53  int localPhi;
54  bool operator < (const vfatDC& r) const{
55  if (vfatType == r.vfatType){
56  if (detId == r.detId){
57  return localPhi < r.localPhi;
58  }
59  else{
60  return detId < r.detId;
61  }
62  }
63  else{
64  return vfatType < r.vfatType;
65  }
66  }
67  };
68 
69  struct channelNum{
70  int vfatType;
71  int chNum;
72  bool operator < (const channelNum& c) const{
73  if (vfatType == c.vfatType)
74  return chNum < c.chNum;
75  else
76  return vfatType < c.vfatType;
77  }
78  };
79 
80  struct stripNum{
81  int vfatType;
82  int stNum;
83  bool operator < (const stripNum& s) const{
84  if (vfatType == s.vfatType)
85  return stNum < s.stNum;
86  else
87  return vfatType < s.vfatType;
88  }
89  };
90 
92 
93  bool isValidChipID(const vfatEC& r) const {
94  return vMapED_.find(r) != vMapED_.end();
95  }
96  bool isValidChamber(const chamEC& r) const {
97  return chamED_.find(r) != chamED_.end();
98  }
99 
100  const chamDC& chamberPos(const chamEC& r) const {return chamED_.at(r);}
101  void add(chamEC e,chamDC d) {chamED_[e]=d;}
102 
103  const std::vector<vfatEC> getVfats(const GEMDetId& r) const {return chamVfats_.at(r);}
104  void add(GEMDetId e,vfatEC d) {chamVfats_[e].push_back(d);}
105 
106  const vfatDC& vfatPos(const vfatEC& r) const {return vMapED_.at(r);}
107  void add(vfatEC e,vfatDC d) {vMapED_[e]=d;}
108 
109  const channelNum& hitPos(const stripNum& s) const {return stChMap_.at(s);}
110  const stripNum& hitPos(const channelNum& c) const {return chStMap_.at(c);}
111 
114 
115  private:
116  std::map<chamEC,chamDC> chamED_;
117 
118  std::map<GEMDetId,std::vector<vfatEC>> chamVfats_;
119 
120  std::map<vfatEC, vfatDC> vMapED_;
121 
122  std::map<channelNum, stripNum> chStMap_;
123  std::map<stripNum, channelNum> stChMap_;
124 
125 };
126 #endif
void add(channelNum c, stripNum s)
Definition: GEMROMapping.h:112
void add(stripNum s, channelNum c)
Definition: GEMROMapping.h:113
std::map< chamEC, chamDC > chamED_
Definition: GEMROMapping.h:116
std::map< stripNum, channelNum > stChMap_
Definition: GEMROMapping.h:123
const channelNum & hitPos(const stripNum &s) const
Definition: GEMROMapping.h:109
void add(chamEC e, chamDC d)
Definition: GEMROMapping.h:101
std::map< vfatEC, vfatDC > vMapED_
Definition: GEMROMapping.h:120
unsigned int fedId
Definition: GEMROMapping.h:11
const vfatDC & vfatPos(const vfatEC &r) const
Definition: GEMROMapping.h:106
std::map< GEMDetId, std::vector< vfatEC > > chamVfats_
Definition: GEMROMapping.h:118
void add(GEMDetId e, vfatEC d)
Definition: GEMROMapping.h:104
const chamDC & chamberPos(const chamEC &r) const
Definition: GEMROMapping.h:100
bool isValidChamber(const chamEC &r) const
Definition: GEMROMapping.h:96
bool isValidChipID(const vfatEC &r) const
Definition: GEMROMapping.h:93
const std::vector< vfatEC > getVfats(const GEMDetId &r) const
Definition: GEMROMapping.h:103
const stripNum & hitPos(const channelNum &c) const
Definition: GEMROMapping.h:110
std::map< channelNum, stripNum > chStMap_
Definition: GEMROMapping.h:122
bool operator<(const chamEC &r) const
Definition: GEMROMapping.h:14
void add(vfatEC e, vfatDC d)
Definition: GEMROMapping.h:107