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 maxiEtaIdGE0_ = 8
 
static const int maxiEtaIdGE11_ = 8
 
static const int maxiEtaIdGE21_ = 16
 
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++) {
18  GEMROMapping::chamEC ec{imap.fedId[ix], imap.amcNum[ix], imap.gebId[ix]};
20  dc.detId = GEMDetId((imap.gemNum[ix] > 0) ? 1 : -1,
21  1,
22  abs(imap.gemNum[ix] / 1000),
23  abs(imap.gemNum[ix] / 100 % 10),
24  abs(imap.gemNum[ix] % 100),
25  0);
26  dc.vfatVer = imap.vfatVer[ix];
27  romap.add(ec, dc);
28  GEMROMapping::sectorEC amcEC = {imap.fedId[ix], imap.amcNum[ix]};
29  if (!romap.isValidAMC(amcEC))
30  romap.add(amcEC);
31  }
32  }
33 
34  // chamberType to vfatType
35  for (auto imap : theVFatMap_) {
36  for (unsigned int ix = 0; ix < imap.vfatAdd.size(); ix++) {
37  GEMDetId gemId((imap.gemNum[ix] > 0) ? 1 : -1,
38  1,
39  abs(imap.gemNum[ix] / 1000),
40  abs(imap.gemNum[ix] / 100 % 10),
41  abs(imap.gemNum[ix] % 100),
42  imap.iEta[ix]);
43 
45  ec.detId = gemId.chamberId();
46  ec.vfatAdd = imap.vfatAdd[ix] & chipIdMask_;
47 
49  dc.vfatType = imap.vfatType[ix];
50  dc.detId = gemId;
51  dc.localPhi = imap.localPhi[ix];
52 
53  romap.add(ec, dc);
54  romap.add(gemId.chamberId(), ec);
55  }
56  }
57  // channel mapping
58  for (auto imap : theStripMap_) {
59  for (unsigned int ix = 0; ix < imap.vfatType.size(); ix++) {
61  cMap.vfatType = imap.vfatType[ix];
62  cMap.chNum = imap.vfatCh[ix];
63 
65  sMap.vfatType = imap.vfatType[ix];
66  sMap.stNum = imap.vfatStrip[ix];
67 
68  romap.add(cMap, sMap);
69  romap.add(sMap, cMap);
70  }
71  }
72 }

References funct::abs(), GEMROMapping::add(), GEMDetId::chamberId(), chipIdMask_, GEMROMapping::channelNum::chNum, GEMROMapping::chamDC::detId, GEMROMapping::vfatEC::detId, GEMROMapping::vfatDC::detId, GEMROMapping::sectorEC::fedId, GEMROMapping::chamEC::fedId, GEMROMapping::isValidAMC(), 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 74 of file GEMeMap.cc.

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

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, LEDCalibrationChannels::ieta, GEMROMapping::isValidAMC(), GEMROMapping::vfatDC::localPhi, GEMDetId::maxChamberId, maxChan_, maxGEB1_, maxGEBs_, maxiEtaIdGE0_, maxiEtaIdGE11_, maxiEtaIdGE21_, GEMDetId::maxLayerId, GEMDetId::maxLayerId0, 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().

◆ maxiEtaIdGE0_

const int GEMeMap::maxiEtaIdGE0_ = 8
static

Definition at line 69 of file GEMeMap.h.

Referenced by convertDummy().

◆ maxiEtaIdGE11_

const int GEMeMap::maxiEtaIdGE11_ = 8
static

Definition at line 70 of file GEMeMap.h.

Referenced by convertDummy().

◆ maxiEtaIdGE21_

const int GEMeMap::maxiEtaIdGE21_ = 16
static

Definition at line 71 of file GEMeMap.h.

Referenced by convertDummy().

◆ 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:50
GEMeMap::maxiEtaIdGE21_
static const int maxiEtaIdGE21_
Definition: GEMeMap.h:71
GEMROMapping::channelNum::vfatType
int vfatType
Definition: GEMROMapping.h:78
GEMROMapping::add
void add(sectorEC e)
Definition: GEMROMapping.h:106
mps_fire.i
i
Definition: mps_fire.py:428
GEMROMapping::vfatDC::vfatType
int vfatType
Definition: GEMROMapping.h:61
FEDNumbering::MINGE0FEDID
Definition: FEDNumbering.h:124
GEMROMapping::chamEC::fedId
unsigned int fedId
Definition: GEMROMapping.h:26
GEMeMap::chipIdMask_
static const int chipIdMask_
Definition: GEMeMap.h:61
GEMROMapping::chamEC::gebId
uint8_t gebId
Definition: GEMROMapping.h:28
GEMeMap::vfatVerV3_
static const int vfatVerV3_
Definition: GEMeMap.h:59
GEMeMap::maxiEtaIdGE0_
static const int maxiEtaIdGE0_
Definition: GEMeMap.h:69
FEDNumbering::MINGE21FEDID
Definition: FEDNumbering.h:125
GEMeMap::theVersion
std::string theVersion
Definition: GEMeMap.h:53
GEMROMapping::chamDC
Definition: GEMROMapping.h:42
GEMDetId::maxStationId
static constexpr int32_t maxStationId
Definition: GEMDetId.h:27
GEMROMapping::sectorEC
Definition: GEMROMapping.h:13
GEMROMapping::stripNum
Definition: GEMROMapping.h:88
GEMeMap::theVFatMap_
std::vector< GEMVFatMap > theVFatMap_
Definition: GEMeMap.h:49
FEDNumbering::MINGEMFEDID
Definition: FEDNumbering.h:123
GEMROMapping::chamDC::vfatVer
int vfatVer
Definition: GEMROMapping.h:44
GEMeMap::maxiEtaIdGE11_
static const int maxiEtaIdGE11_
Definition: GEMeMap.h:70
GEMeMap::maxVFatGE21_
static const int maxVFatGE21_
Definition: GEMeMap.h:68
GEMROMapping::vfatDC::detId
GEMDetId detId
Definition: GEMROMapping.h:62
GEMROMapping::vfatDC::localPhi
int localPhi
Definition: GEMROMapping.h:63
GEMeMap::maxGEBs_
static const int maxGEBs_
Definition: GEMeMap.h:62
GEMDetId::minStationId0
static constexpr int32_t minStationId0
Definition: GEMDetId.h:24
GEMROMapping::isValidAMC
bool isValidAMC(const sectorEC &r) const
Definition: GEMROMapping.h:104
GEMDetId::maxChamberId
static constexpr int32_t maxChamberId
Definition: GEMDetId.h:29
GEMeMap::maxVFatGE11_
static const int maxVFatGE11_
Definition: GEMeMap.h:67
GEMROMapping::sectorEC::fedId
unsigned int fedId
Definition: GEMROMapping.h:14
GEMROMapping::stripNum::vfatType
int vfatType
Definition: GEMROMapping.h:89
GEMROMapping::vfatDC
Definition: GEMROMapping.h:60
GEMROMapping::channelNum::chNum
int chNum
Definition: GEMROMapping.h:79
GEMeMap::theChamberMap_
std::vector< GEMChamberMap > theChamberMap_
Definition: GEMeMap.h:48
LEDCalibrationChannels.ieta
ieta
Definition: LEDCalibrationChannels.py:63
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:49
GEMROMapping::chamEC
Definition: GEMROMapping.h:25
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:90
GEMROMapping::chamEC::amcNum
uint8_t amcNum
Definition: GEMROMapping.h:27
GEMROMapping::channelNum
Definition: GEMROMapping.h:77
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:43
GEMROMapping::vfatEC
Definition: GEMROMapping.h:48
GEMeMap::maxChan_
static const int maxChan_
Definition: GEMeMap.h:72
GEMeMap::vfatTypeV3_
static const int vfatTypeV3_
Definition: GEMeMap.h:60
GEMeMap::version
const std::string & version() const
Definition: GEMeMap.cc:12