CMS 3D CMS Logo

ME0EMap.cc
Go to the documentation of this file.
4 
6  theVersion("") {}
7 
9  theVersion(version) {}
10 
12 
13 const std::string & ME0EMap::version() const{
14  return theVersion;
15 }
16 
18  ME0ROmap* romap=new ME0ROmap();
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];
26  dc.stripId = 1 + imap.strip_number[ix]+(imap.iPhi[ix]-1)%maxVFat_*maxChan_;
27  dc.me0DetId = ME0DetId(imap.z_direction[ix], imap.depth[ix], imap.sec[ix], imap.iEta[ix]);
28  romap->add(ec,dc);
29  romap->add(dc,ec);
30  }
31  }
32  return romap;
33 }
34 
36  ME0ROmap* romap=new ME0ROmap();
37  uint16_t amcId = 1; //amc
38  uint16_t gebId = 1;
39  romap->addAMC(amcId);
40 
41  for (int re = -1; re <= 1; re = re+2) {
42  for (int ch = ME0DetId::minChamberId; ch<=ME0DetId::maxChamberId; ++ch) {
43  for (int ly = 1; ly<=ME0DetId::maxLayerId; ++ly) {
44 
45  // 1 geb per chamber
46  // 24 gebs per amc
47  // make new amcId once 24 gebs are used up
48  if (gebId > maxGEBs_){
49  gebId = 1;
50  amcId++;
51  romap->addAMC(amcId);
52  }
53 
54  romap->addAMC2GEB(amcId, gebId);
55 
56  ME0DetId chamDetId(re, ly, ch, 0);
57  uint32_t chamberId = (amcId << gebIdBits_) | gebId;
58  romap->add(chamDetId,chamberId);
59  romap->add(chamberId,chamDetId);
60 
61  uint16_t chipId = 0;
62  for (int roll = 1; roll<=ME0DetId::maxRollId; ++roll) {
63  int stripId = 0;
64  ME0DetId me0Id(re, ly, ch, roll);
65 
66  for (int nVfat = 0; nVfat < maxVFat_; ++nVfat){
67  chipId++;
68 
69  for (unsigned chan = 0; chan < maxChan_; ++chan){
71  dc.stripId = ++stripId;
72  dc.me0DetId = me0Id;
73 
74  // make 1 full vfat ID from amc + geb + chip Ids
75  uint32_t vfatId = (amcId << (gebIdBits_+chipIdBits_)) | (gebId << chipIdBits_) | chipId;
76 
78  ec.vfatId = vfatId;
79  ec.channelId = chan;
80  romap->add(ec,dc);
81  romap->add(dc,ec);
82 
83  }
84  }
85  }
86  gebId++;
87 
88  }
89  }
90  }
91 
92  return romap;
93 }
static const int minChamberId
Definition: ME0DetId.h:89
static const int maxChamberId
Definition: ME0DetId.h:90
static const int maxRollId
Definition: ME0DetId.h:96
static const int chipIdBits_
Definition: ME0EMap.h:59
ME0ROmap * convert() const
Definition: ME0EMap.cc:17
ME0ROmap * convertDummy() const
Definition: ME0EMap.cc:35
void addAMC(uint16_t d)
Definition: ME0ROmap.h:50
static const int maxChan_
Definition: ME0EMap.h:64
std::vector< ME0VFatMaptype > theVFatMaptype
Definition: ME0EMap.h:50
static const int maxVFat_
Definition: ME0EMap.h:63
virtual ~ME0EMap()
Definition: ME0EMap.cc:11
void add(eCoord e, dCoord d)
Definition: ME0ROmap.h:39
ME0DetId me0DetId
Definition: ME0ROmap.h:22
const std::string & version() const
Definition: ME0EMap.cc:13
std::string theVersion
Definition: ME0EMap.h:54
ME0EMap()
Definition: ME0EMap.cc:5
static const int chipIdMask_
Definition: ME0EMap.h:60
static const int gebIdBits_
Definition: ME0EMap.h:61
chan
lumi = TPaveText(lowX+0.38, lowY+0.061, lowX+0.45, lowY+0.161, "NDC") lumi.SetBorderSize( 0 ) lumi...
static const int maxGEBs_
Definition: ME0EMap.h:62
static const int maxLayerId
Definition: ME0DetId.h:93
uint32_t vfatId
Definition: ME0ROmap.h:10
void addAMC2GEB(uint16_t d, uint16_t c)
Definition: ME0ROmap.h:53