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 amcBX_ = 25
 
static const int chipIdBits_ = 12
 
static const int chipIdMask_ = 0xfff
 
static const int gebIdBits_ = 5
 
static const int maxAMCs_ = 16
 
static const int maxChan_ = 128
 
static const int maxEtaPartition_ = 8
 
static const int maxGEBs_ = 32
 
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::GEMeMap ( )

Definition at line 6 of file GEMeMap.cc.

6  :
7  theVersion("") {}
std::string theVersion
Definition: GEMeMap.h:53
GEMeMap::GEMeMap ( const std::string &  version)
explicit

Definition at line 9 of file GEMeMap.cc.

9  :
std::string theVersion
Definition: GEMeMap.h:53
const std::string & version() const
Definition: GEMeMap.cc:14
GEMeMap::~GEMeMap ( )
virtual

Definition at line 12 of file GEMeMap.cc.

12 {}

Member Function Documentation

void GEMeMap::convert ( GEMROMapping romap)

Definition at line 18 of file GEMeMap.cc.

References funct::abs(), GEMROMapping::add(), GEMROMapping::chamEC::amcNum, GEMDetId::chamberId(), chipIdMask_, GEMROMapping::channelNum::chNum, GEMROMapping::chamDC::detId, GEMROMapping::vfatEC::detId, GEMROMapping::vfatDC::detId, RecoEcal_EventContent_cff::ec, 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.

18  {
19  // fed->amc->geb mapping to GEMDetId
20  for (auto imap : theChamberMap_) {
21  for (unsigned int ix=0;ix<imap.fedId.size();ix++) {
23  ec.fedId = imap.fedId[ix];
24  ec.amcNum = imap.amcNum[ix];
25  ec.gebId = imap.gebId[ix];
26 
28  dc.detId = GEMDetId((imap.gemNum[ix] > 0) ? 1:-1, 1, abs(imap.gemNum[ix]/1000), abs(imap.gemNum[ix]/100%10), abs(imap.gemNum[ix]%100), 0);
29  dc.vfatVer = imap.vfatVer[ix];
30 
31  romap.add(ec, dc);
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, 1, abs(imap.gemNum[ix]/1000), abs(imap.gemNum[ix]/100%10), abs(imap.gemNum[ix]%100), imap.iEta[ix]);
38 
40  ec.detId = gemId.chamberId();
41  ec.vfatAdd = imap.vfatAdd[ix] & chipIdMask_;
42 
44  dc.vfatType = imap.vfatType[ix];
45  dc.detId = gemId;
46  dc.localPhi = imap.localPhi[ix];
47 
48  romap.add(ec, dc);
49  romap.add(gemId.chamberId(),ec);
50 
51  }
52  }
53  // channel mapping
54  for (auto imap : theStripMap_) {
55  for (unsigned int ix=0;ix<imap.vfatType.size();ix++) {
57  cMap.vfatType = imap.vfatType[ix];
58  cMap.chNum = imap.vfatCh[ix];
59 
61  sMap.vfatType = imap.vfatType[ix];
62  sMap.stNum = imap.vfatStrip[ix];
63 
64  romap.add(cMap, sMap);
65  romap.add(sMap, cMap);
66  }
67  }
68 
69 }
std::vector< GEMChamberMap > theChamberMap_
Definition: GEMeMap.h:48
void add(chamEC e, chamDC d)
Definition: GEMROMapping.h:101
unsigned int fedId
Definition: GEMROMapping.h:11
std::vector< GEMStripMap > theStripMap_
Definition: GEMeMap.h:50
GEMDetId chamberId() const
Return the corresponding ChamberId.
Definition: GEMDetId.h:85
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
std::vector< GEMVFatMap > theVFatMap_
Definition: GEMeMap.h:49
static const int chipIdMask_
Definition: GEMeMap.h:62
void GEMeMap::convertDummy ( GEMROMapping romap)

Definition at line 71 of file GEMeMap.cc.

References GEMROMapping::add(), GEMROMapping::chamEC::amcNum, GEMDetId::chamberId(), GEMROMapping::channelNum::chNum, GEMROMapping::chamDC::detId, GEMROMapping::vfatEC::detId, GEMROMapping::vfatDC::detId, RecoEcal_EventContent_cff::ec, l1t::stage2::layer2::fedId, GEMROMapping::chamEC::fedId, GEMROMapping::chamEC::gebId, mps_fire::i, GEMROMapping::vfatDC::localPhi, maxAMCs_, GEMDetId::maxChamberId, maxChan_, maxEtaPartition_, maxGEBs_, GEMDetId::maxLayerId, GEMDetId::maxStationId, maxVFatGE0_, maxVFatGE11_, maxVFatGE21_, FEDNumbering::MINGEMFEDID, GEMDetId::minStationId, GEMROMapping::stripNum::stNum, GEMROMapping::vfatEC::vfatAdd, GEMROMapping::vfatDC::vfatType, GEMROMapping::channelNum::vfatType, GEMROMapping::stripNum::vfatType, vfatTypeV3_, GEMROMapping::chamDC::vfatVer, and vfatVerV3_.

71  {
72  // 12 bits for vfat, 5 bits for geb, 8 bit long GLIB serial number
73  unsigned int fedId = FEDNumbering::MINGEMFEDID;
74  uint8_t amcNum = 0; //amc
75  uint8_t gebId = 0;
76 
77  for (int re = -1; re <= 1; re = re+2) {
78  for (int st = GEMDetId::minStationId; st<=GEMDetId::maxStationId; ++st) {
79  int maxVFat = maxVFatGE11_;
80  if (st == 2) maxVFat = maxVFatGE21_;
81  if (st == 0) maxVFat = maxVFatGE0_;
82 
83  for (int ch = 1; ch<=GEMDetId::maxChamberId; ++ch) {
84  for (int ly = 1; ly<=GEMDetId::maxLayerId; ++ly) {
85  GEMDetId gemId(re, 1, st, ly, ch, 0);
86 
88  ec.fedId = fedId;
89  ec.gebId = gebId;
90  ec.amcNum = amcNum;
91 
93  dc.detId = gemId;
94  dc.vfatVer = vfatVerV3_;
95 
96  romap.add(ec, dc);
97 
98  uint16_t chipPos = 0;
99  for (int lphi = 0; lphi < maxVFat; ++lphi) {
100  for (int roll = 1; roll<=maxEtaPartition_; ++roll) {
102  vec.vfatAdd = chipPos;
103  vec.detId = gemId;
104 
106  vdc.vfatType = vfatTypeV3_;// > 10 is vfat v3
107  vdc.detId = GEMDetId(re, 1, st, ly, ch, roll);
108  vdc.localPhi = lphi;
109 
110  romap.add(vec,vdc);
111  romap.add(gemId.chamberId(),vec);
112 
113  chipPos++;
114  }
115  }
116 
117  // 1 geb per chamber
118  gebId++;
119  // 5 bits for gebId
120  if (gebId == maxGEBs_) {
121  // 24 gebs per amc
122  gebId = 0;
123  amcNum++;
124  }
125  if (amcNum == maxAMCs_) {
126  gebId = 0;
127  amcNum = 0;
128  fedId++;
129  }
130  }
131  }
132  }
133  }
134 
135  for (int i = 0; i < maxChan_; ++i) {
136  // only 1 vfat type for dummy map
138  cMap.vfatType = vfatTypeV3_;
139  cMap.chNum = i;
140 
142  sMap.vfatType = vfatTypeV3_;
143  sMap.stNum = i;
144 
145  romap.add(cMap, sMap);
146  romap.add(sMap, cMap);
147  }
148 }
static const int maxEtaPartition_
Definition: GEMeMap.h:71
static const int maxVFatGE0_
Definition: GEMeMap.h:66
void add(chamEC e, chamDC d)
Definition: GEMROMapping.h:101
static const int vfatVerV3_
Definition: GEMeMap.h:59
unsigned int fedId
Definition: GEMROMapping.h:11
static const int maxChan_
Definition: GEMeMap.h:69
static const int maxChamberId
Definition: GEMDetId.h:104
static const int maxLayerId
Definition: GEMDetId.h:108
static const int maxStationId
Definition: GEMDetId.h:101
static const int maxAMCs_
Definition: GEMeMap.h:65
static const int maxGEBs_
Definition: GEMeMap.h:64
static const int minStationId
Definition: GEMDetId.h:100
static const int maxVFatGE21_
Definition: GEMeMap.h:68
static const int vfatTypeV3_
Definition: GEMeMap.h:60
static const int maxVFatGE11_
Definition: GEMeMap.h:67
template<class Archive >
void GEMeMap::serialize ( Archive &  ar,
const unsigned int  version 
)
private
const std::string & GEMeMap::version ( ) const

Definition at line 14 of file GEMeMap.cc.

References theVersion.

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

14  {
15  return theVersion;
16 }
std::string theVersion
Definition: GEMeMap.h:53

Friends And Related Function Documentation

friend class boost::serialization::access
friend

Definition at line 55 of file GEMeMap.h.

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

Definition at line 55 of file GEMeMap.h.

Member Data Documentation

const int GEMeMap::amcBX_ = 25
static

Definition at line 70 of file GEMeMap.h.

Referenced by GEMDigiToRawModule::produce().

const int GEMeMap::chipIdBits_ = 12
static

Definition at line 61 of file GEMeMap.h.

const int GEMeMap::chipIdMask_ = 0xfff
static

Definition at line 62 of file GEMeMap.h.

Referenced by convert().

const int GEMeMap::gebIdBits_ = 5
static

Definition at line 63 of file GEMeMap.h.

const int GEMeMap::maxAMCs_ = 16
static

Definition at line 65 of file GEMeMap.h.

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

const int GEMeMap::maxChan_ = 128
static
const int GEMeMap::maxEtaPartition_ = 8
static

Definition at line 71 of file GEMeMap.h.

Referenced by convertDummy().

const int GEMeMap::maxGEBs_ = 32
static

Definition at line 64 of file GEMeMap.h.

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

const int GEMeMap::maxVFatGE0_ = 12
static

Definition at line 66 of file GEMeMap.h.

Referenced by convertDummy().

const int GEMeMap::maxVFatGE11_ = 3
static

Definition at line 67 of file GEMeMap.h.

Referenced by convertDummy().

const int GEMeMap::maxVFatGE21_ = 6
static

Definition at line 68 of file GEMeMap.h.

Referenced by convertDummy().

std::vector<GEMChamberMap> GEMeMap::theChamberMap_

Definition at line 48 of file GEMeMap.h.

Referenced by convert().

std::vector<GEMStripMap> GEMeMap::theStripMap_

Definition at line 50 of file GEMeMap.h.

Referenced by convert().

std::string GEMeMap::theVersion
private

Definition at line 53 of file GEMeMap.h.

Referenced by version().

std::vector<GEMVFatMap> GEMeMap::theVFatMap_

Definition at line 49 of file GEMeMap.h.

Referenced by convert().

const int GEMeMap::vfatTypeV3_ = 11
static

Definition at line 60 of file GEMeMap.h.

Referenced by convertDummy().

const int GEMeMap::vfatVerV3_ = 3
static

Definition at line 59 of file GEMeMap.h.

Referenced by convertDummy().