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("") {}
std::string theVersion
Definition: GEMeMap.h:53

◆ GEMeMap() [2/2]

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

Definition at line 8 of file GEMeMap.cc.

std::string theVersion
Definition: GEMeMap.h:53
const std::string & version() const
Definition: GEMeMap.cc:12

◆ ~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.

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.

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 }
std::vector< GEMChamberMap > theChamberMap_
Definition: GEMeMap.h:48
unsigned int fedId
Definition: GEMROMapping.h:26
std::vector< GEMStripMap > theStripMap_
Definition: GEMeMap.h:50
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
void add(sectorEC e)
Definition: GEMROMapping.h:106
std::vector< GEMVFatMap > theVFatMap_
Definition: GEMeMap.h:49
static const int chipIdMask_
Definition: GEMeMap.h:61
constexpr GEMDetId chamberId() const
Definition: GEMDetId.h:204
bool isValidAMC(const sectorEC &r) const
Definition: GEMROMapping.h:104

◆ convertDummy()

void GEMeMap::convertDummy ( GEMROMapping romap)

Definition at line 74 of file GEMeMap.cc.

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, hcalRecHitTable_cff::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_.

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 }
static const int maxVFatGE0_
Definition: GEMeMap.h:66
static const int vfatVerV3_
Definition: GEMeMap.h:59
static const int maxiEtaIdGE0_
Definition: GEMeMap.h:69
unsigned int fedId
Definition: GEMROMapping.h:26
static const int maxChan_
Definition: GEMeMap.h:72
static constexpr int32_t maxLayerId0
Definition: GEMDetId.h:31
static constexpr int32_t minStationId0
Definition: GEMDetId.h:24
static const int maxiEtaIdGE21_
Definition: GEMeMap.h:71
static constexpr int32_t maxStationId
Definition: GEMDetId.h:27
void add(sectorEC e)
Definition: GEMROMapping.h:106
static const int maxGEBs_
Definition: GEMeMap.h:62
static constexpr int32_t maxLayerId
Definition: GEMDetId.h:32
static const int maxGEB1_
Definition: GEMeMap.h:63
static constexpr int32_t maxChamberId
Definition: GEMDetId.h:29
static const int maxiEtaIdGE11_
Definition: GEMeMap.h:70
static const int maxVFatGE21_
Definition: GEMeMap.h:68
static const int vfatTypeV3_
Definition: GEMeMap.h:60
bool isValidAMC(const sectorEC &r) const
Definition: GEMROMapping.h:104
static const int maxVFatGE11_
Definition: GEMeMap.h:67

◆ 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.

References theVersion.

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

12 { return theVersion; }
std::string theVersion
Definition: GEMeMap.h:53

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.

◆ 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().

◆ maxiEtaIdGE0_

const int GEMeMap::maxiEtaIdGE0_ = 8
static

Definition at line 69 of file GEMeMap.h.

Referenced by convertDummy(), and GEMDQMBase::getIEtaFromVFATGE0().

◆ maxiEtaIdGE11_

const int GEMeMap::maxiEtaIdGE11_ = 8
static

◆ maxiEtaIdGE21_

const int GEMeMap::maxiEtaIdGE21_ = 16
static

Definition at line 71 of file GEMeMap.h.

Referenced by convertDummy(), and GEMDQMBase::getIEtaFromVFATGE21().

◆ maxVFatGE0_

const int GEMeMap::maxVFatGE0_ = 12
static

Definition at line 66 of file GEMeMap.h.

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

◆ maxVFatGE11_

const int GEMeMap::maxVFatGE11_ = 3
static

Definition at line 67 of file GEMeMap.h.

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

◆ maxVFatGE21_

const int GEMeMap::maxVFatGE21_ = 6
static

Definition at line 68 of file GEMeMap.h.

Referenced by convertDummy(), 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().