CMS 3D CMS Logo

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

#include <GEMChMap.h>

Classes

struct  chamDC
 
struct  chamEC
 
struct  channelNum
 
struct  sectorEC
 
struct  stripNum
 
struct  vfatEC
 

Public Member Functions

void add (sectorEC e)
 
void add (chamEC e, chamDC d)
 
void add (int type, uint16_t d)
 
void add (vfatEC d, int iEta)
 
void add (channelNum c, stripNum s)
 
void add (stripNum s, channelNum c)
 
std::map< chamEC, chamDCchamberMap ()
 
const chamDCchamberPos (unsigned int fedId, uint8_t amcNum, uint16_t gebId) const
 
 GEMChMap ()
 
 GEMChMap (const std::string &version)
 
const channelNumgetChannel (int chamberType, int iEta, int strip) const
 
const std::vector< int > getIEtas (int chamberType, uint16_t vfatAdd) const
 
const stripNumgetStrip (int chamberType, int vfatAdd, int channel) const
 
const std::vector< uint16_t > getVfats (const int type) const
 
bool isValidAMC (unsigned int fedId, uint8_t amcNum) const
 
bool isValidChamber (unsigned int fedId, uint8_t amcNum, uint16_t gebId) const
 
bool isValidStrip (int chamberType, int iEta, int strip) const
 
bool isValidVFAT (int chamberType, uint16_t vfatAdd) const
 
void setDummy ()
 
const std::string & version () const
 
 ~GEMChMap ()
 

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
 

Private Member Functions

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

Private Attributes

std::vector< sectorECamcVec_
 
std::map< chamEC, chamDCchamberMap_
 
std::map< vfatEC, std::vector< int > > chamIEtas_
 
std::map< int, std::vector< uint16_t > > chamVfats_
 
std::map< channelNum, stripNumchStMap_
 
std::map< stripNum, channelNumstChMap_
 
std::string theVersion
 

Friends

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

Detailed Description

Definition at line 11 of file GEMChMap.h.

Constructor & Destructor Documentation

◆ GEMChMap() [1/2]

GEMChMap::GEMChMap ( )

Definition at line 5 of file GEMChMap.cc.

5 : theVersion("") {}
std::string theVersion
Definition: GEMChMap.h:165

◆ GEMChMap() [2/2]

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

Definition at line 7 of file GEMChMap.cc.

const std::string & version() const
Definition: GEMChMap.cc:11
std::string theVersion
Definition: GEMChMap.h:165

◆ ~GEMChMap()

GEMChMap::~GEMChMap ( )

Definition at line 9 of file GEMChMap.cc.

9 {}

Member Function Documentation

◆ add() [1/6]

void GEMChMap::add ( sectorEC  e)
inline

◆ add() [2/6]

void GEMChMap::add ( chamEC  e,
chamDC  d 
)
inline

◆ add() [3/6]

void GEMChMap::add ( int  type,
uint16_t  d 
)
inline

Definition at line 141 of file GEMChMap.h.

References chamVfats_, ztail::d, mps_fire::end, and spr::find().

Referenced by counter.Counter::register(), SequenceTypes._TaskBase::remove(), and SequenceTypes._TaskBase::replace().

141  {
143  chamVfats_[type].push_back(d);
144  }
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:19
std::map< int, std::vector< uint16_t > > chamVfats_
Definition: GEMChMap.h:172
d
Definition: ztail.py:151

◆ add() [4/6]

void GEMChMap::add ( vfatEC  d,
int  iEta 
)
inline

Definition at line 149 of file GEMChMap.h.

References chamIEtas_, ztail::d, mps_fire::end, spr::find(), and l1tTowerCalibrationProducer_cfi::iEta.

Referenced by counter.Counter::register(), SequenceTypes._TaskBase::remove(), and SequenceTypes._TaskBase::replace().

149  {
151  chamIEtas_[d].push_back(iEta);
152  }
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:19
d
Definition: ztail.py:151
std::map< vfatEC, std::vector< int > > chamIEtas_
Definition: GEMChMap.h:173

◆ add() [5/6]

void GEMChMap::add ( channelNum  c,
stripNum  s 
)
inline

◆ add() [6/6]

void GEMChMap::add ( stripNum  s,
channelNum  c 
)
inline

◆ chamberMap()

std::map<chamEC, chamDC> GEMChMap::chamberMap ( )
inline

Definition at line 115 of file GEMChMap.h.

References chamberMap_.

115 { return chamberMap_; };
std::map< chamEC, chamDC > chamberMap_
Definition: GEMChMap.h:170

◆ chamberPos()

const chamDC& GEMChMap::chamberPos ( unsigned int  fedId,
uint8_t  amcNum,
uint16_t  gebId 
) const
inline

Definition at line 135 of file GEMChMap.h.

References chamberMap_, and l1tstage2_dqm_sourceclient-live_cfg::fedId.

135  {
136  return chamberMap_.at({fedId, amcNum, gebId});
137  }
std::map< chamEC, chamDC > chamberMap_
Definition: GEMChMap.h:170

◆ getChannel()

const channelNum& GEMChMap::getChannel ( int  chamberType,
int  iEta,
int  strip 
) const
inline

Definition at line 154 of file GEMChMap.h.

References l1tTowerCalibrationProducer_cfi::iEta, stChMap_, and digitizers_cfi::strip.

154  {
155  return stChMap_.at({chamberType, iEta, strip});
156  }
std::map< stripNum, channelNum > stChMap_
Definition: GEMChMap.h:176

◆ getIEtas()

const std::vector<int> GEMChMap::getIEtas ( int  chamberType,
uint16_t  vfatAdd 
) const
inline

Definition at line 146 of file GEMChMap.h.

References chamIEtas_.

146  {
147  return chamIEtas_.at({chamberType, vfatAdd});
148  }
std::map< vfatEC, std::vector< int > > chamIEtas_
Definition: GEMChMap.h:173

◆ getStrip()

const stripNum& GEMChMap::getStrip ( int  chamberType,
int  vfatAdd,
int  channel 
) const
inline

Definition at line 157 of file GEMChMap.h.

References chStMap_.

157  {
158  return chStMap_.at({chamberType, vfatAdd, channel});
159  }
std::map< channelNum, stripNum > chStMap_
Definition: GEMChMap.h:175

◆ getVfats()

const std::vector<uint16_t> GEMChMap::getVfats ( const int  type) const
inline

Definition at line 140 of file GEMChMap.h.

References chamVfats_.

140 { return chamVfats_.at(type); }
std::map< int, std::vector< uint16_t > > chamVfats_
Definition: GEMChMap.h:172

◆ isValidAMC()

bool GEMChMap::isValidAMC ( unsigned int  fedId,
uint8_t  amcNum 
) const
inline

Definition at line 117 of file GEMChMap.h.

References amcVec_, l1tstage2_dqm_sourceclient-live_cfg::fedId, and spr::find().

Referenced by setDummy().

117  {
118  return std::find(amcVec_.begin(), amcVec_.end(), sectorEC({fedId, amcNum})) != amcVec_.end();
119  }
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:19
std::vector< sectorEC > amcVec_
Definition: GEMChMap.h:167

◆ isValidChamber()

bool GEMChMap::isValidChamber ( unsigned int  fedId,
uint8_t  amcNum,
uint16_t  gebId 
) const
inline

Definition at line 121 of file GEMChMap.h.

References chamberMap_, and l1tstage2_dqm_sourceclient-live_cfg::fedId.

121  {
122  return chamberMap_.find({fedId, amcNum, gebId}) != chamberMap_.end();
123  }
std::map< chamEC, chamDC > chamberMap_
Definition: GEMChMap.h:170

◆ isValidStrip()

bool GEMChMap::isValidStrip ( int  chamberType,
int  iEta,
int  strip 
) const
inline

Definition at line 129 of file GEMChMap.h.

References l1tTowerCalibrationProducer_cfi::iEta, stChMap_, and digitizers_cfi::strip.

129  {
130  return stChMap_.find({chamberType, iEta, strip}) != stChMap_.end();
131  }
std::map< stripNum, channelNum > stChMap_
Definition: GEMChMap.h:176

◆ isValidVFAT()

bool GEMChMap::isValidVFAT ( int  chamberType,
uint16_t  vfatAdd 
) const
inline

Definition at line 125 of file GEMChMap.h.

References chamIEtas_.

125  {
126  return chamIEtas_.find({chamberType, vfatAdd}) != chamIEtas_.end();
127  }
std::map< vfatEC, std::vector< int > > chamIEtas_
Definition: GEMChMap.h:173

◆ serialize()

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

◆ setDummy()

void GEMChMap::setDummy ( )

Definition at line 13 of file GEMChMap.cc.

References add(), GEMChMap::chamEC::amcNum, amcVec_, chamberMap_, GEMChMap::chamDC::chamberType, GEMChMap::vfatEC::chamberType, GEMChMap::channelNum::chamberType, GEMChMap::stripNum::chamberType, chamIEtas_, chamVfats_, GEMChMap::channelNum::chNum, chStMap_, GEMChMap::chamDC::detId, GEMChMap::chamEC::fedId, l1tstage2_dqm_sourceclient-live_cfg::fedId, GEMChMap::chamEC::gebId, mps_fire::i, LEDCalibrationChannels::ieta, GEMChMap::stripNum::iEta, isValidAMC(), 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, stChMap_, GEMChMap::stripNum::stNum, GEMChMap::vfatEC::vfatAdd, and GEMChMap::channelNum::vfatAdd.

13  {
14  // 12 bits for vfat, 5 bits for geb, 8 bit long GLIB serial number
15  amcVec_.clear();
16 
17  chamberMap_.clear();
18 
19  chamVfats_.clear();
20  chamIEtas_.clear();
21 
22  chStMap_.clear();
23  stChMap_.clear();
24 
25  unsigned int fedId = 0;
26 
27  for (int st = GEMDetId::minStationId0; st <= GEMDetId::maxStationId; ++st) {
28  int maxVFat = 0;
29  int maxLayerId = GEMDetId::maxLayerId;
30  int maxiEtaId = 0;
31  if (st == 0) {
32  maxVFat = maxVFatGE0_;
33  maxLayerId = GEMDetId::maxLayerId0;
34  maxiEtaId = maxiEtaIdGE0_;
35  } else if (st == 1) {
36  maxVFat = maxVFatGE11_;
37  maxiEtaId = maxiEtaIdGE11_;
38  } else if (st == 2) {
39  maxVFat = maxVFatGE21_;
40  maxiEtaId = maxiEtaIdGE21_;
41  }
42 
43  uint16_t chipPos = 0;
44  for (int lphi = 0; lphi < maxVFat; ++lphi) {
45  for (int ieta = 1; ieta <= maxiEtaId; ++ieta) {
46  if (st == 2 and ieta % 2 == 0)
47  continue;
48  for (int i = 0; i < maxChan_; ++i) {
49  // only 1 vfat type for dummy map
51  cMap.chamberType = st;
52  cMap.vfatAdd = chipPos;
53  cMap.chNum = i;
54 
55  GEMChMap::stripNum sMap;
56  sMap.chamberType = st;
57  if (st != 2) {
58  sMap.iEta = ieta;
59  sMap.stNum = i + lphi * maxChan_;
60  } else {
61  sMap.iEta = ieta + i % 2;
62  sMap.stNum = i / 2 + lphi * maxChan_ / 2;
63  }
64 
65  add(cMap, sMap);
66  add(sMap, cMap);
67 
69  ec.vfatAdd = cMap.vfatAdd;
70  ec.chamberType = st;
71 
72  add(cMap.chamberType, cMap.vfatAdd);
73  add(ec, sMap.iEta);
74  }
75  chipPos++;
76  }
77  }
78 
79  for (int re = -1; re <= 1; re = re + 2) {
80  uint8_t amcNum = 1; //amc
81  uint8_t gebId = 0;
82  if (st == 0)
84  else if (st == 1)
86  else if (st == 2)
88 
89  for (int ch = 1; ch <= GEMDetId::maxChamberId; ++ch) {
90  for (int ly = 1; ly <= maxLayerId; ++ly) {
91  GEMDetId gemId(re, 1, st, ly, ch, 0);
92 
94  ec.fedId = fedId;
95  ec.gebId = gebId;
96  ec.amcNum = amcNum;
97 
99  dc.detId = gemId;
100  dc.chamberType = st;
101  add(ec, dc);
102 
103  GEMChMap::sectorEC amcEC = {fedId, amcNum};
104  if (!isValidAMC(fedId, amcNum))
105  add(amcEC);
106 
107  // 5 bits for gebId
108  if (st > 0 && gebId == maxGEB1_) {
109  gebId = 0;
110  amcNum += 2; // only odd amc No. is used for GE11
111  } else if (st == 0 && gebId == maxGEBs_) {
112  gebId = 0;
113  amcNum++;
114  } else {
115  // 1 geb per chamber
116  gebId++;
117  }
118  }
119  }
120  }
121  }
122 }
unsigned int fedId
Definition: GEMChMap.h:28
uint32_t detId
Definition: GEMChMap.h:47
std::map< chamEC, chamDC > chamberMap_
Definition: GEMChMap.h:170
std::map< stripNum, channelNum > stChMap_
Definition: GEMChMap.h:176
static const int maxiEtaIdGE0_
Definition: GEMChMap.h:190
static constexpr int32_t maxLayerId0
Definition: GEMDetId.h:31
std::map< int, std::vector< uint16_t > > chamVfats_
Definition: GEMChMap.h:172
static const int maxiEtaIdGE21_
Definition: GEMChMap.h:192
static const int maxGEB1_
Definition: GEMChMap.h:184
bool isValidAMC(unsigned int fedId, uint8_t amcNum) const
Definition: GEMChMap.h:117
uint16_t gebId
Definition: GEMChMap.h:30
static constexpr int32_t minStationId0
Definition: GEMDetId.h:24
static constexpr int32_t maxStationId
Definition: GEMDetId.h:27
std::map< channelNum, stripNum > chStMap_
Definition: GEMChMap.h:175
static const int maxGEBs_
Definition: GEMChMap.h:183
std::map< vfatEC, std::vector< int > > chamIEtas_
Definition: GEMChMap.h:173
uint8_t amcNum
Definition: GEMChMap.h:29
void add(sectorEC e)
Definition: GEMChMap.h:133
static const int maxVFatGE0_
Definition: GEMChMap.h:187
static const int maxChan_
Definition: GEMChMap.h:193
static const int maxVFatGE11_
Definition: GEMChMap.h:188
static constexpr int32_t maxLayerId
Definition: GEMDetId.h:32
static constexpr int32_t maxChamberId
Definition: GEMDetId.h:29
static const int maxiEtaIdGE11_
Definition: GEMChMap.h:191
std::vector< sectorEC > amcVec_
Definition: GEMChMap.h:167
uint16_t vfatAdd
Definition: GEMChMap.h:56
static const int maxVFatGE21_
Definition: GEMChMap.h:189

◆ version()

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

Definition at line 11 of file GEMChMap.cc.

References theVersion.

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

11 { return theVersion; }
std::string theVersion
Definition: GEMChMap.h:165

Friends And Related Function Documentation

◆ boost::serialization::access

friend class boost::serialization::access
friend

Definition at line 178 of file GEMChMap.h.

◆ cond::serialization::access

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

Definition at line 178 of file GEMChMap.h.

Member Data Documentation

◆ amcVec_

std::vector<sectorEC> GEMChMap::amcVec_
private

Definition at line 167 of file GEMChMap.h.

Referenced by add(), isValidAMC(), and setDummy().

◆ chamberMap_

std::map<chamEC, chamDC> GEMChMap::chamberMap_
private

Definition at line 170 of file GEMChMap.h.

Referenced by add(), chamberMap(), chamberPos(), isValidChamber(), and setDummy().

◆ chamIEtas_

std::map<vfatEC, std::vector<int> > GEMChMap::chamIEtas_
private

Definition at line 173 of file GEMChMap.h.

Referenced by add(), getIEtas(), isValidVFAT(), and setDummy().

◆ chamVfats_

std::map<int, std::vector<uint16_t> > GEMChMap::chamVfats_
private

Definition at line 172 of file GEMChMap.h.

Referenced by add(), getVfats(), and setDummy().

◆ chipIdMask_

const int GEMChMap::chipIdMask_ = 0xfff
static

Definition at line 182 of file GEMChMap.h.

◆ chStMap_

std::map<channelNum, stripNum> GEMChMap::chStMap_
private

Definition at line 175 of file GEMChMap.h.

Referenced by add(), getStrip(), and setDummy().

◆ maxAMCs_

const int GEMChMap::maxAMCs_ = 15
static

Definition at line 186 of file GEMChMap.h.

Referenced by GEMDigiToRawModule::produce().

◆ maxChan_

const int GEMChMap::maxChan_ = 128
static

Definition at line 193 of file GEMChMap.h.

Referenced by setDummy().

◆ maxGEB1_

const int GEMChMap::maxGEB1_ = 12
static

Definition at line 184 of file GEMChMap.h.

Referenced by setDummy().

◆ maxGEB2_

const int GEMChMap::maxGEB2_ = 12
static

Definition at line 185 of file GEMChMap.h.

◆ maxGEBs_

const int GEMChMap::maxGEBs_ = 24
static

Definition at line 183 of file GEMChMap.h.

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

◆ maxiEtaIdGE0_

const int GEMChMap::maxiEtaIdGE0_ = 8
static

Definition at line 190 of file GEMChMap.h.

Referenced by setDummy().

◆ maxiEtaIdGE11_

const int GEMChMap::maxiEtaIdGE11_ = 8
static

Definition at line 191 of file GEMChMap.h.

Referenced by setDummy().

◆ maxiEtaIdGE21_

const int GEMChMap::maxiEtaIdGE21_ = 16
static

Definition at line 192 of file GEMChMap.h.

Referenced by setDummy().

◆ maxVFatGE0_

const int GEMChMap::maxVFatGE0_ = 12
static

Definition at line 187 of file GEMChMap.h.

Referenced by setDummy().

◆ maxVFatGE11_

const int GEMChMap::maxVFatGE11_ = 3
static

Definition at line 188 of file GEMChMap.h.

Referenced by setDummy().

◆ maxVFatGE21_

const int GEMChMap::maxVFatGE21_ = 6
static

Definition at line 189 of file GEMChMap.h.

Referenced by setDummy().

◆ stChMap_

std::map<stripNum, channelNum> GEMChMap::stChMap_
private

Definition at line 176 of file GEMChMap.h.

Referenced by add(), getChannel(), isValidStrip(), and setDummy().

◆ theVersion

std::string GEMChMap::theVersion
private

Definition at line 165 of file GEMChMap.h.

Referenced by version().