CMS 3D CMS Logo

GEMeMap.cc
Go to the documentation of this file.
5 
6 GEMeMap::GEMeMap() : theVersion("") {}
7 
8 GEMeMap::GEMeMap(const std::string& version) : theVersion(version) {}
9 
11 
12 const std::string& GEMeMap::version() const { return theVersion; }
13 
15  // fed->amc->geb mapping to GEMDetId
16  for (auto imap : theChamberMap_) {
17  for (unsigned int ix = 0; ix < imap.fedId.size(); ix++) {
19  ec.fedId = imap.fedId[ix];
20  ec.amcNum = imap.amcNum[ix];
21  ec.gebId = imap.gebId[ix];
22 
24  dc.detId = GEMDetId((imap.gemNum[ix] > 0) ? 1 : -1,
25  1,
26  abs(imap.gemNum[ix] / 1000),
27  abs(imap.gemNum[ix] / 100 % 10),
28  abs(imap.gemNum[ix] % 100),
29  0);
30  dc.vfatVer = imap.vfatVer[ix];
31 
32  romap.add(ec, dc);
33  }
34  }
35  // chamberType to vfatType
36  for (auto imap : theVFatMap_) {
37  for (unsigned int ix = 0; ix < imap.vfatAdd.size(); ix++) {
38  GEMDetId gemId((imap.gemNum[ix] > 0) ? 1 : -1,
39  1,
40  abs(imap.gemNum[ix] / 1000),
41  abs(imap.gemNum[ix] / 100 % 10),
42  abs(imap.gemNum[ix] % 100),
43  imap.iEta[ix]);
44 
46  ec.detId = gemId.chamberId();
47  ec.vfatAdd = imap.vfatAdd[ix] & chipIdMask_;
48 
50  dc.vfatType = imap.vfatType[ix];
51  dc.detId = gemId;
52  dc.localPhi = imap.localPhi[ix];
53 
54  romap.add(ec, dc);
55  romap.add(gemId.chamberId(), ec);
56  }
57  }
58  // channel mapping
59  for (auto imap : theStripMap_) {
60  for (unsigned int ix = 0; ix < imap.vfatType.size(); ix++) {
62  cMap.vfatType = imap.vfatType[ix];
63  cMap.chNum = imap.vfatCh[ix];
64 
66  sMap.vfatType = imap.vfatType[ix];
67  sMap.stNum = imap.vfatStrip[ix];
68 
69  romap.add(cMap, sMap);
70  romap.add(sMap, cMap);
71  }
72  }
73 }
74 
76  // 12 bits for vfat, 5 bits for geb, 8 bit long GLIB serial number
77  unsigned int fedId = FEDNumbering::MINGEMFEDID;
78  uint8_t amcNum = 0; //amc
79  uint8_t gebId = 0;
80 
81  for (int re = -1; re <= 1; re = re + 2) {
82  for (int st = GEMDetId::minStationId; st <= GEMDetId::maxStationId; ++st) {
83  int maxVFat = maxVFatGE11_;
84  if (st == 2)
85  maxVFat = maxVFatGE21_;
86  if (st == 0)
87  maxVFat = maxVFatGE0_;
88 
89  for (int ch = 1; ch <= GEMDetId::maxChamberId; ++ch) {
90  for (int ly = 1; ly <= GEMDetId::maxLayerId; ++ly) {
91  GEMDetId gemId(re, 1, st, ly, ch, 0);
92 
94  ec.fedId = fedId;
95  ec.gebId = gebId;
96  ec.amcNum = amcNum;
97 
99  dc.detId = gemId;
100  dc.vfatVer = vfatVerV3_;
101 
102  romap.add(ec, dc);
103 
104  uint16_t chipPos = 0;
105  for (int lphi = 0; lphi < maxVFat; ++lphi) {
106  for (int roll = 1; roll <= maxEtaPartition_; ++roll) {
108  vec.vfatAdd = chipPos;
109  vec.detId = gemId;
110 
112  vdc.vfatType = vfatTypeV3_; // > 10 is vfat v3
113  vdc.detId = GEMDetId(re, 1, st, ly, ch, roll);
114  vdc.localPhi = lphi;
115 
116  romap.add(vec, vdc);
117  romap.add(gemId.chamberId(), vec);
118 
119  chipPos++;
120  }
121  }
122 
123  // 1 geb per chamber
124  gebId++;
125  // 5 bits for gebId
126  if (gebId == maxGEBs_) {
127  // 24 gebs per amc
128  gebId = 0;
129  amcNum++;
130  }
131  if (amcNum == maxAMCs_) {
132  gebId = 0;
133  amcNum = 0;
134  fedId++;
135  }
136  }
137  }
138  }
139  }
140 
141  for (int i = 0; i < maxChan_; ++i) {
142  // only 1 vfat type for dummy map
144  cMap.vfatType = vfatTypeV3_;
145  cMap.chNum = i;
146 
148  sMap.vfatType = vfatTypeV3_;
149  sMap.stNum = i;
150 
151  romap.add(cMap, sMap);
152  romap.add(sMap, cMap);
153  }
154 }
GEMROMapping::vfatEC::detId
GEMDetId detId
Definition: GEMROMapping.h:34
FEDNumbering.h
GEMROMapping::channelNum::vfatType
int vfatType
Definition: GEMROMapping.h:62
mps_fire.i
i
Definition: mps_fire.py:355
GEMROMapping::vfatDC::vfatType
int vfatType
Definition: GEMROMapping.h:45
GEMeMap::GEMeMap
GEMeMap()
Definition: GEMeMap.cc:6
GEMROMapping::chamEC::fedId
unsigned int fedId
Definition: GEMROMapping.h:10
GEMeMap::chipIdMask_
static const int chipIdMask_
Definition: GEMeMap.h:62
GEMROMapping::chamEC::gebId
uint8_t gebId
Definition: GEMROMapping.h:12
GEMeMap::vfatVerV3_
static const int vfatVerV3_
Definition: GEMeMap.h:59
GEMeMap::theVersion
std::string theVersion
Definition: GEMeMap.h:53
GEMROMapping::chamDC
Definition: GEMROMapping.h:26
GEMDetId::maxStationId
static constexpr int32_t maxStationId
Definition: GEMDetId.h:26
GEMROMapping
Definition: GEMROMapping.h:7
GEMROMapping::stripNum
Definition: GEMROMapping.h:72
GEMeMap::theVFatMap_
std::vector< GEMVFatMap > theVFatMap_
Definition: GEMeMap.h:49
FEDNumbering::MINGEMFEDID
Definition: FEDNumbering.h:123
GEMROMapping::chamDC::vfatVer
int vfatVer
Definition: GEMROMapping.h:28
GEMeMap::maxVFatGE21_
static const int maxVFatGE21_
Definition: GEMeMap.h:68
GEMROMapping::vfatDC::detId
GEMDetId detId
Definition: GEMROMapping.h:46
GEMROMapping::vfatDC::localPhi
int localPhi
Definition: GEMROMapping.h:47
GEMeMap::maxGEBs_
static const int maxGEBs_
Definition: GEMeMap.h:64
GEMeMap.h
GEMDetId::maxChamberId
static constexpr int32_t maxChamberId
Definition: GEMDetId.h:28
GEMROMapping.h
GEMeMap::maxVFatGE11_
static const int maxVFatGE11_
Definition: GEMeMap.h:67
GEMROMapping::stripNum::vfatType
int vfatType
Definition: GEMROMapping.h:73
GEMROMapping::vfatDC
Definition: GEMROMapping.h:44
GEMROMapping::channelNum::chNum
int chNum
Definition: GEMROMapping.h:63
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
GEMeMap::theChamberMap_
std::vector< GEMChamberMap > theChamberMap_
Definition: GEMeMap.h:48
GEMDetId
Definition: GEMDetId.h:17
GEMROMapping::vfatEC::vfatAdd
uint16_t vfatAdd
Definition: GEMROMapping.h:33
GEMROMapping::chamEC
Definition: GEMROMapping.h:9
l1tstage2_dqm_sourceclient-live_cfg.fedId
fedId
Definition: l1tstage2_dqm_sourceclient-live_cfg.py:82
GEMeMap::maxVFatGE0_
static const int maxVFatGE0_
Definition: GEMeMap.h:66
GEMROMapping::stripNum::stNum
int stNum
Definition: GEMROMapping.h:74
GEMeMap::maxAMCs_
static const int maxAMCs_
Definition: GEMeMap.h:65
GEMeMap::convert
void convert(GEMROMapping &romap)
Definition: GEMeMap.cc:14
GEMDetId.h
GEMROMapping::chamEC::amcNum
uint8_t amcNum
Definition: GEMROMapping.h:11
GEMROMapping::add
void add(chamEC e, chamDC d)
Definition: GEMROMapping.h:89
GEMROMapping::channelNum
Definition: GEMROMapping.h:61
GEMDetId::maxLayerId
static constexpr int32_t maxLayerId
Definition: GEMDetId.h:31
GEMDetId::chamberId
constexpr GEMDetId chamberId() const
Definition: GEMDetId.h:193
GEMeMap::maxEtaPartition_
static const int maxEtaPartition_
Definition: GEMeMap.h:71
GEMeMap::convertDummy
void convertDummy(GEMROMapping &romap)
Definition: GEMeMap.cc:75
GEMeMap::theStripMap_
std::vector< GEMStripMap > theStripMap_
Definition: GEMeMap.h:50
GEMDetId::minStationId
static constexpr int32_t minStationId
Definition: GEMDetId.h:24
funct::abs
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
GEMeMap::~GEMeMap
virtual ~GEMeMap()
Definition: GEMeMap.cc:10
GEMROMapping::chamDC::detId
GEMDetId detId
Definition: GEMROMapping.h:27
BeamSplash_cfg.version
version
Definition: BeamSplash_cfg.py:45
GEMROMapping::vfatEC
Definition: GEMROMapping.h:32
GEMeMap::maxChan_
static const int maxChan_
Definition: GEMeMap.h:69
GEMeMap::vfatTypeV3_
static const int vfatTypeV3_
Definition: GEMeMap.h:60
GEMeMap::version
const std::string & version() const
Definition: GEMeMap.cc:12