CMS 3D CMS Logo

List of all members | Classes | Public Member Functions | Public Attributes | Static Public Attributes | Private Member Functions | Private Attributes | Friends
GEMeMap Class Reference

#include <GEMeMap.h>

Classes

struct  GEMChamberMap
 
struct  GEMStripMap
 
struct  GEMVFatMap
 

Public Member Functions

void convert (GEMROMapping &romap)
 
void convertDummy (GEMROMapping &romap)
 
 GEMeMap ()
 
 GEMeMap (const std::string &version)
 
const std::string & version () const
 
virtual ~GEMeMap ()
 

Public Attributes

std::vector< GEMChamberMaptheChamberMap_
 
std::vector< GEMStripMaptheStripMap_
 
std::vector< GEMVFatMaptheVFatMap_
 

Static Public Attributes

static const int chipIdMask_ = 0xfff
 
static const int maxAMCs_ = 15
 
static const int maxChan_ = 128
 
static const int maxGEB1_ = 12
 
static const int maxGEB2_ = 12
 
static const int maxGEBs_ = 24
 
static const int maxVFatGE0_ = 12
 
static const int maxVFatGE11_ = 3
 
static const int maxVFatGE21_ = 6
 
static const int vfatTypeV3_ = 11
 
static const int vfatVerV3_ = 3
 

Private Member Functions

template<class Archive >
void serialize (Archive &ar, const unsigned int version)
 

Private Attributes

std::string theVersion
 

Friends

class boost::serialization::access
 
template<typename CondSerializationT , typename Enabled >
struct cond::serialization::access
 

Detailed Description

Definition at line 10 of file GEMeMap.h.

Constructor & Destructor Documentation

◆ GEMeMap() [1/2]

GEMeMap::GEMeMap ( )

Definition at line 6 of file GEMeMap.cc.

6 : theVersion("") {}

◆ GEMeMap() [2/2]

GEMeMap::GEMeMap ( const std::string &  version)
explicit

Definition at line 8 of file GEMeMap.cc.

◆ ~GEMeMap()

GEMeMap::~GEMeMap ( )
virtual

Definition at line 10 of file GEMeMap.cc.

10 {}

Member Function Documentation

◆ convert()

void GEMeMap::convert ( GEMROMapping romap)

Definition at line 14 of file GEMeMap.cc.

14  {
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  romap.add(ec, dc);
32  }
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 }

References funct::abs(), GEMROMapping::add(), GEMROMapping::chamEC::amcNum, GEMDetId::chamberId(), chipIdMask_, GEMROMapping::channelNum::chNum, GEMROMapping::chamDC::detId, GEMROMapping::vfatEC::detId, GEMROMapping::vfatDC::detId, GEMROMapping::chamEC::fedId, GEMROMapping::chamEC::gebId, GEMROMapping::vfatDC::localPhi, GEMROMapping::stripNum::stNum, theChamberMap_, theStripMap_, theVFatMap_, GEMROMapping::vfatEC::vfatAdd, GEMROMapping::vfatDC::vfatType, GEMROMapping::channelNum::vfatType, GEMROMapping::stripNum::vfatType, and GEMROMapping::chamDC::vfatVer.

◆ convertDummy()

void GEMeMap::convertDummy ( GEMROMapping romap)

Definition at line 75 of file GEMeMap.cc.

75  {
76  // 12 bits for vfat, 5 bits for geb, 8 bit long GLIB serial number
77  unsigned int fedId = 0;
78 
79  for (int st = GEMDetId::minStationId0; st <= GEMDetId::maxStationId; ++st) {
80  for (int re = -1; re <= 1; re = re + 2) {
81  uint8_t amcNum = 1; //amc
82  uint8_t gebId = 0;
83  int maxVFat = 0;
84  int maxLayerId = GEMDetId::maxLayerId;
85  if (st == 0) {
86  maxVFat = maxVFatGE0_;
88  maxLayerId = GEMDetId::maxLayerId0;
89  } else if (st == 1) {
90  maxVFat = maxVFatGE11_;
92  } else if (st == 2) {
93  maxVFat = maxVFatGE21_;
95  }
96 
97  for (int ch = 1; ch <= GEMDetId::maxChamberId; ++ch) {
98  for (int ly = 1; ly <= maxLayerId; ++ly) {
99  GEMDetId gemId(re, 1, st, ly, ch, 0);
100 
102  ec.fedId = fedId;
103  ec.gebId = gebId;
104  ec.amcNum = amcNum;
105 
107  dc.detId = gemId;
108  dc.vfatVer = vfatVerV3_;
109  romap.add(ec, dc);
110 
111  uint16_t chipPos = 0;
112  for (int lphi = 0; lphi < maxVFat; ++lphi) {
113  for (int roll = 1; roll <= GEMDetId::maxRollId; ++roll) {
115  vec.vfatAdd = chipPos;
116  vec.detId = gemId;
117 
119  vdc.vfatType = vfatTypeV3_; // > 10 is vfat v3
120  vdc.detId = GEMDetId(re, 1, st, ly, ch, roll);
121  vdc.localPhi = lphi;
122 
123  romap.add(vec, vdc);
124  romap.add(gemId.chamberId(), vec);
125 
126  chipPos++;
127  }
128  }
129 
130  // 5 bits for gebId
131  if (st > 0 && gebId == maxGEB1_) {
132  gebId = 0;
133  amcNum += 2; // only odd amc No. is used for GE11
134  } else if (st == 0 && gebId == maxGEBs_) {
135  gebId = 0;
136  amcNum++;
137  } else {
138  // 1 geb per chamber
139  gebId++;
140  }
141  }
142  }
143  }
144  }
145 
146  for (int i = 0; i < maxChan_; ++i) {
147  // only 1 vfat type for dummy map
149  cMap.vfatType = vfatTypeV3_;
150  cMap.chNum = i;
151 
153  sMap.vfatType = vfatTypeV3_;
154  sMap.stNum = i;
155 
156  romap.add(cMap, sMap);
157  romap.add(sMap, cMap);
158  }
159 }

References GEMROMapping::add(), GEMROMapping::chamEC::amcNum, GEMDetId::chamberId(), GEMROMapping::channelNum::chNum, GEMROMapping::chamDC::detId, GEMROMapping::vfatEC::detId, GEMROMapping::vfatDC::detId, GEMROMapping::chamEC::fedId, l1tstage2_dqm_sourceclient-live_cfg::fedId, GEMROMapping::chamEC::gebId, mps_fire::i, GEMROMapping::vfatDC::localPhi, GEMDetId::maxChamberId, maxChan_, maxGEB1_, maxGEBs_, GEMDetId::maxLayerId, GEMDetId::maxLayerId0, GEMDetId::maxRollId, GEMDetId::maxStationId, maxVFatGE0_, maxVFatGE11_, maxVFatGE21_, FEDNumbering::MINGE0FEDID, FEDNumbering::MINGE21FEDID, FEDNumbering::MINGEMFEDID, GEMDetId::minStationId0, GEMROMapping::stripNum::stNum, GEMROMapping::vfatEC::vfatAdd, GEMROMapping::vfatDC::vfatType, GEMROMapping::channelNum::vfatType, GEMROMapping::stripNum::vfatType, vfatTypeV3_, GEMROMapping::chamDC::vfatVer, and vfatVerV3_.

◆ serialize()

template<class Archive >
void GEMeMap::serialize ( Archive &  ar,
const unsigned int  version 
)
private

◆ version()

const std::string & GEMeMap::version ( ) const

Definition at line 12 of file GEMeMap.cc.

12 { return theVersion; }

References theVersion.

Referenced by validation.Sample::datasetpattern(), and validation.Sample::filename().

Friends And Related Function Documentation

◆ boost::serialization::access

friend class boost::serialization::access
friend

Definition at line 55 of file GEMeMap.h.

◆ cond::serialization::access

template<typename CondSerializationT , typename Enabled >
friend struct cond::serialization::access
friend

Definition at line 55 of file GEMeMap.h.

Member Data Documentation

◆ chipIdMask_

const int GEMeMap::chipIdMask_ = 0xfff
static

Definition at line 61 of file GEMeMap.h.

Referenced by convert().

◆ maxAMCs_

const int GEMeMap::maxAMCs_ = 15
static

Definition at line 65 of file GEMeMap.h.

Referenced by GEMDigiToRawModule::produce().

◆ maxChan_

const int GEMeMap::maxChan_ = 128
static

◆ maxGEB1_

const int GEMeMap::maxGEB1_ = 12
static

Definition at line 63 of file GEMeMap.h.

Referenced by convertDummy().

◆ maxGEB2_

const int GEMeMap::maxGEB2_ = 12
static

Definition at line 64 of file GEMeMap.h.

◆ maxGEBs_

const int GEMeMap::maxGEBs_ = 24
static

Definition at line 62 of file GEMeMap.h.

Referenced by convertDummy(), and GEMDigiToRawModule::produce().

◆ maxVFatGE0_

const int GEMeMap::maxVFatGE0_ = 12
static

Definition at line 66 of file GEMeMap.h.

Referenced by convertDummy(), and GEMOfflineDQMBase::getMaxVFAT().

◆ maxVFatGE11_

const int GEMeMap::maxVFatGE11_ = 3
static

Definition at line 67 of file GEMeMap.h.

Referenced by convertDummy(), GEMOfflineDQMBase::getMaxVFAT(), and GEMDQMBase::getMaxVFAT().

◆ maxVFatGE21_

const int GEMeMap::maxVFatGE21_ = 6
static

Definition at line 68 of file GEMeMap.h.

Referenced by convertDummy(), GEMOfflineDQMBase::getMaxVFAT(), and GEMDQMBase::getMaxVFAT().

◆ theChamberMap_

std::vector<GEMChamberMap> GEMeMap::theChamberMap_

Definition at line 48 of file GEMeMap.h.

Referenced by convert().

◆ theStripMap_

std::vector<GEMStripMap> GEMeMap::theStripMap_

Definition at line 50 of file GEMeMap.h.

Referenced by convert().

◆ theVersion

std::string GEMeMap::theVersion
private

Definition at line 53 of file GEMeMap.h.

Referenced by version().

◆ theVFatMap_

std::vector<GEMVFatMap> GEMeMap::theVFatMap_

Definition at line 49 of file GEMeMap.h.

Referenced by convert().

◆ vfatTypeV3_

const int GEMeMap::vfatTypeV3_ = 11
static

Definition at line 60 of file GEMeMap.h.

Referenced by convertDummy().

◆ vfatVerV3_

const int GEMeMap::vfatVerV3_ = 3
static

Definition at line 59 of file GEMeMap.h.

Referenced by convertDummy().

GEMROMapping::vfatEC::detId
GEMDetId detId
Definition: GEMROMapping.h:34
GEMROMapping::channelNum::vfatType
int vfatType
Definition: GEMROMapping.h:62
mps_fire.i
i
Definition: mps_fire.py:428
GEMROMapping::vfatDC::vfatType
int vfatType
Definition: GEMROMapping.h:45
FEDNumbering::MINGE0FEDID
Definition: FEDNumbering.h:124
GEMROMapping::chamEC::fedId
unsigned int fedId
Definition: GEMROMapping.h:10
GEMeMap::chipIdMask_
static const int chipIdMask_
Definition: GEMeMap.h:61
GEMROMapping::chamEC::gebId
uint8_t gebId
Definition: GEMROMapping.h:12
GEMeMap::vfatVerV3_
static const int vfatVerV3_
Definition: GEMeMap.h:59
FEDNumbering::MINGE21FEDID
Definition: FEDNumbering.h:125
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:27
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
GEMDetId::maxRollId
static constexpr int32_t maxRollId
Definition: GEMDetId.h:36
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:62
GEMDetId::minStationId0
static constexpr int32_t minStationId0
Definition: GEMDetId.h:24
GEMDetId::maxChamberId
static constexpr int32_t maxChamberId
Definition: GEMDetId.h:29
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
GEMeMap::theChamberMap_
std::vector< GEMChamberMap > theChamberMap_
Definition: GEMeMap.h:48
GEMDetId::maxLayerId0
static constexpr int32_t maxLayerId0
Definition: GEMDetId.h:31
GEMDetId
Definition: GEMDetId.h:18
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:88
GEMeMap::maxVFatGE0_
static const int maxVFatGE0_
Definition: GEMeMap.h:66
GEMROMapping::stripNum::stNum
int stNum
Definition: GEMROMapping.h:74
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:32
GEMDetId::chamberId
constexpr GEMDetId chamberId() const
Definition: GEMDetId.h:204
GEMeMap::theStripMap_
std::vector< GEMStripMap > theStripMap_
Definition: GEMeMap.h:50
GEMeMap::maxGEB1_
static const int maxGEB1_
Definition: GEMeMap.h:63
funct::abs
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
GEMROMapping::chamDC::detId
GEMDetId detId
Definition: GEMROMapping.h:27
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