CMS 3D CMS Logo

GEMEMap.cc
Go to the documentation of this file.
4 
6  theVersion("") {}
7 
9  theVersion(version) {}
10 
12 
13 const std::string & GEMEMap::version() const{
14  return theVersion;
15 }
16 
18  GEMROmap* romap=new GEMROmap();
19 
20  for (auto imap : theVFatMaptype){
21  for (unsigned int ix=0;ix<imap.strip_number.size();ix++){
23  ec.vfatId= imap.vfatId[ix] & chipIdMask_;// chip ID is 12 bits
24  ec.channelId=imap.vfat_chnnel_number[ix];
25 
26  int st = std::abs(imap.z_direction[ix]);
27  int maxVFat = maxVFatGE11_;
28  if (st == 2) maxVFat = maxVFatGE21_;
29 
31  dc.stripId = 1 + imap.strip_number[ix]+(imap.iPhi[ix]-1)%maxVFat*maxChan_;
32  dc.gemDetId = GEMDetId(imap.z_direction[ix], 1, st, imap.depth[ix], imap.sec[ix], imap.iEta[ix]);
33 
34  romap->add(ec,dc);
35  romap->add(dc,ec);
36  }
37  }
38  return romap;
39 }
40 
42  GEMROmap* romap=new GEMROmap();
43  uint16_t amcId = 1; //amc
44  uint16_t gebId = 1;
45  romap->addAMC(amcId);
46 
47  for (int re = -1; re <= 1; re = re+2) {
48  for (int st = GEMDetId::minStationId; st<=GEMDetId::maxStationId; ++st) {
49  int maxVFat = maxVFatGE11_;
50  if (st == 2) maxVFat = maxVFatGE21_;
51 
52  for (int ch = 1; ch<=GEMDetId::maxChamberId; ++ch) {
53  for (int ly = 1; ly<=GEMDetId::maxLayerId; ++ly) {
54 
55  // 1 geb per chamber
56  // 24 gebs per amc
57  // make new amcId once 24 gebs are used up
58  if (gebId > maxGEBs_){
59  gebId = 1;
60  amcId++;
61  romap->addAMC(amcId);
62  }
63 
64  romap->addAMC2GEB(amcId, gebId);
65 
66  GEMDetId chamDetId(re, 1, st, ly, ch, 0);
67  uint32_t chamberId = (amcId << gebIdBits_) | gebId;
68  romap->add(chamDetId,chamberId);
69  romap->add(chamberId,chamDetId);
70 
71  uint16_t chipId = 0;
72  for (int roll = 1; roll<=GEMDetId::maxRollId; ++roll) {
73 
74  int stripId = 0;
75  GEMDetId gemId(re, 1, st, ly, ch, roll);
76 
77  for (int nVfat = 0; nVfat < maxVFat; ++nVfat){
78  chipId++;
79 
80  for (unsigned chan = 0; chan < maxChan_; ++chan){
82  dc.stripId = ++stripId;
83  dc.gemDetId = gemId;
84 
85  // make 1 full vfat ID from amc + geb + chip Ids
86  uint32_t vfatId = (amcId << (gebIdBits_+chipIdBits_)) | (gebId << chipIdBits_) | chipId;
87 
89  ec.vfatId = vfatId;
90  ec.channelId = chan;
91  romap->add(ec,dc);
92  romap->add(dc,ec);
93 
94  }
95  }
96  }
97 
98  gebId++;
99 
100  }
101  }
102  }
103  }
104 
105  return romap;
106 }
std::vector< GEMVFatMaptype > theVFatMaptype
Definition: GEMEMap.h:50
virtual ~GEMEMap()
Definition: GEMEMap.cc:11
static const int chipIdBits_
Definition: GEMEMap.h:59
static const int chipIdMask_
Definition: GEMEMap.h:60
static const int maxVFatGE21_
Definition: GEMEMap.h:64
static const int maxRollId
Definition: GEMDetId.h:111
static const int maxChamberId
Definition: GEMDetId.h:104
void add(eCoord e, dCoord d)
Definition: GEMROmap.h:39
static const int maxLayerId
Definition: GEMDetId.h:108
void addAMC(uint16_t d)
Definition: GEMROmap.h:50
static const int maxGEBs_
Definition: GEMEMap.h:62
GEMDetId gemDetId
Definition: GEMROmap.h:22
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
uint32_t vfatId
Definition: GEMROmap.h:10
static const int maxStationId
Definition: GEMDetId.h:101
GEMROmap * convert() const
Definition: GEMEMap.cc:17
static const int minStationId
Definition: GEMDetId.h:100
static const int maxChan_
Definition: GEMEMap.h:65
static const int maxVFatGE11_
Definition: GEMEMap.h:63
chan
lumi = TPaveText(lowX+0.38, lowY+0.061, lowX+0.45, lowY+0.161, "NDC") lumi.SetBorderSize( 0 ) lumi...
void addAMC2GEB(uint16_t d, uint16_t c)
Definition: GEMROmap.h:53
std::string theVersion
Definition: GEMEMap.h:54
GEMEMap()
Definition: GEMEMap.cc:5
GEMROmap * convertDummy() const
Definition: GEMEMap.cc:41
const std::string & version() const
Definition: GEMEMap.cc:13
static const int gebIdBits_
Definition: GEMEMap.h:61