CMS 3D CMS Logo

GEMROmap.h
Go to the documentation of this file.
1 #ifndef CondFormats_GEMObjects_GEMROmap_h
2 #define CondFormats_GEMObjects_GEMROmap_h
4 #include <map>
5 
6 class GEMROmap{
7  public:
8 
9  struct eCoord{
10  uint32_t vfatId;
11  int channelId;
12  bool operator < (const eCoord& r) const{
13  if ( vfatId == r.vfatId)
14  return channelId < r.channelId;
15  else
16  return vfatId < r.vfatId;
17  }
18  };
19 
20  struct dCoord{
21  int stripId;
23  bool operator < (const dCoord& r) const{
24  if ( gemDetId == r.gemDetId)
25  return stripId < r.stripId;
26  else
27  return gemDetId < r.gemDetId;
28  }
29  };
30 
31  GEMROmap(){};
32 
33  bool isValidChipID(const eCoord& r){
34  return roMapED_.find(r) != roMapED_.end();
35  }
36  const dCoord& hitPosition(const eCoord& r){return roMapED_[r];}
37  const eCoord& hitPosition(const dCoord& r){return roMapDE_[r];}
38 
39  void add(eCoord e,dCoord d) {roMapED_[e]=d;}
40  void add(dCoord d,eCoord e) {roMapDE_[d]=e;}
41 
42  const uint32_t& gebPosition(const GEMDetId& r){return roMapDet2Geb_[r];}
43  const GEMDetId& gebPosition(const uint32_t& r){return roMapGeb2Det_[r];}
44 
45  void add(GEMDetId d,uint32_t e) {roMapDet2Geb_[d]=e;}
46  void add(uint32_t d,GEMDetId e) {roMapGeb2Det_[d]=e;}
47 
48  std::map<GEMDetId,uint32_t> getRoMap(){return roMapDet2Geb_;}
49 
50  void addAMC(uint16_t d) {amcs_.push_back(d);}
51  std::vector<uint16_t> getAMCs(){return amcs_;}
52 
53  void addAMC2GEB(uint16_t d, uint16_t c) {amc2Gebs_[d].push_back(c);}
54  std::vector<uint16_t> getAMC2GEBs(uint16_t d){return amc2Gebs_[d];}
55 
56  private:
57  std::vector<uint16_t> amcs_;
58  std::map<uint16_t,std::vector<uint16_t>> amc2Gebs_;
59 
60  std::map<eCoord,dCoord> roMapED_;
61  std::map<dCoord,eCoord> roMapDE_;
62 
63  std::map<GEMDetId,uint32_t> roMapDet2Geb_;
64  std::map<uint32_t,GEMDetId> roMapGeb2Det_;
65 
66 };
67 #endif
GEMROmap()
Definition: GEMROmap.h:31
std::map< GEMDetId, uint32_t > roMapDet2Geb_
Definition: GEMROmap.h:63
std::map< GEMDetId, uint32_t > getRoMap()
Definition: GEMROmap.h:48
std::map< uint16_t, std::vector< uint16_t > > amc2Gebs_
Definition: GEMROmap.h:58
std::vector< uint16_t > getAMCs()
Definition: GEMROmap.h:51
const dCoord & hitPosition(const eCoord &r)
Definition: GEMROmap.h:36
void add(GEMDetId d, uint32_t e)
Definition: GEMROmap.h:45
std::vector< uint16_t > amcs_
Definition: GEMROmap.h:57
std::map< dCoord, eCoord > roMapDE_
Definition: GEMROmap.h:61
void add(eCoord e, dCoord d)
Definition: GEMROmap.h:39
std::vector< uint16_t > getAMC2GEBs(uint16_t d)
Definition: GEMROmap.h:54
void addAMC(uint16_t d)
Definition: GEMROmap.h:50
std::map< eCoord, dCoord > roMapED_
Definition: GEMROmap.h:60
void add(uint32_t d, GEMDetId e)
Definition: GEMROmap.h:46
void add(dCoord d, eCoord e)
Definition: GEMROmap.h:40
const uint32_t & gebPosition(const GEMDetId &r)
Definition: GEMROmap.h:42
GEMDetId gemDetId
Definition: GEMROmap.h:22
uint32_t vfatId
Definition: GEMROmap.h:10
std::map< uint32_t, GEMDetId > roMapGeb2Det_
Definition: GEMROmap.h:64
bool operator<(const eCoord &r) const
Definition: GEMROmap.h:12
void addAMC2GEB(uint16_t d, uint16_t c)
Definition: GEMROmap.h:53
bool isValidChipID(const eCoord &r)
Definition: GEMROmap.h:33
const eCoord & hitPosition(const dCoord &r)
Definition: GEMROmap.h:37
const GEMDetId & gebPosition(const uint32_t &r)
Definition: GEMROmap.h:43