CMS 3D CMS Logo

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

#include <GEMELMap.h>

Classes

struct  GEMStripMap
 
struct  GEMVFatMap
 

Public Member Functions

void convert (GEMROmap &romap)
 
void convertDummy (GEMROmap &romap)
 
 GEMELMap ()
 
 GEMELMap (const std::string &version)
 
const std::string & version () const
 
virtual ~GEMELMap ()
 

Public Attributes

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 maxChan_ = 128
 
static const int maxGEBs_ = 24
 
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::string theVersion
 

Friends

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

Detailed Description

Definition at line 10 of file GEMELMap.h.

Constructor & Destructor Documentation

GEMELMap::GEMELMap ( )

Definition at line 5 of file GEMELMap.cc.

5  :
6  theVersion("") {}
std::string theVersion
Definition: GEMELMap.h:48
GEMELMap::GEMELMap ( const std::string &  version)
explicit

Definition at line 8 of file GEMELMap.cc.

8  :
const std::string & version() const
Definition: GEMELMap.cc:13
std::string theVersion
Definition: GEMELMap.h:48
GEMELMap::~GEMELMap ( )
virtual

Definition at line 11 of file GEMELMap.cc.

11 {}

Member Function Documentation

void GEMELMap::convert ( GEMROmap romap)

Definition at line 17 of file GEMELMap.cc.

References funct::abs(), GEMROmap::add(), GEMROmap::eCoord::amcId, chipIdMask_, GEMROmap::channelNum::chNum, RecoEcal_EventContent_cff::ec, GEMROmap::eCoord::gebId, GEMROmap::dCoord::gemDetId, GEMROmap::dCoord::iPhi, GEMROmap::stripNum::stNum, theStripMap_, theVFatMap_, GEMROmap::eCoord::vfatId, GEMROmap::dCoord::vfatType, GEMROmap::channelNum::vfatType, and GEMROmap::stripNum::vfatType.

17  {
18 
19  for (auto imap : theVFatMap_){
20  for (unsigned int ix=0;ix<imap.vfatId.size();ix++){
22  ec.vfatId = imap.vfatId[ix] & chipIdMask_;
23  ec.gebId = imap.gebId[ix];
24  ec.amcId = imap.amcId[ix];
25 
26  int st = std::abs(imap.z_direction[ix]);
28  dc.gemDetId = GEMDetId(imap.z_direction[ix], 1, st, imap.depth[ix], imap.sec[ix], imap.iEta[ix]);
29  dc.vfatType = imap.vfatType[ix];
30  dc.iPhi = imap.iPhi[ix];
31 
32  romap.add(ec,dc);
33  romap.add(dc,ec);
34  }
35  }
36 
37  for (auto imap : theStripMap_){
38  for (unsigned int ix=0;ix<imap.vfatType.size();ix++){
40  cMap.vfatType = imap.vfatType[ix];
41  cMap.chNum = imap.vfatCh[ix];
42 
43  GEMROmap::stripNum sMap;
44  sMap.vfatType = imap.vfatType[ix];
45  sMap.stNum = imap.vfatStrip[ix];
46 
47  romap.add(cMap, sMap);
48  romap.add(sMap, cMap);
49  }
50  }
51 }
void add(eCoord e, dCoord d)
Definition: GEMROmap.h:77
uint16_t gebId
Definition: GEMROmap.h:11
static const int chipIdMask_
Definition: GEMELMap.h:55
std::vector< GEMVFatMap > theVFatMap_
Definition: GEMELMap.h:44
GEMDetId gemDetId
Definition: GEMROmap.h:30
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
uint16_t vfatId
Definition: GEMROmap.h:12
uint16_t amcId
Definition: GEMROmap.h:10
std::vector< GEMStripMap > theStripMap_
Definition: GEMELMap.h:45
void GEMELMap::convertDummy ( GEMROmap romap)

Definition at line 53 of file GEMELMap.cc.

References GEMROmap::add(), GEMROmap::eCoord::amcId, GEMROmap::channelNum::chNum, RecoEcal_EventContent_cff::ec, GEMROmap::eCoord::gebId, GEMROmap::dCoord::gemDetId, mps_fire::i, GEMROmap::dCoord::iPhi, GEMDetId::maxChamberId, maxChan_, maxGEBs_, GEMDetId::maxLayerId, GEMDetId::maxRollId, GEMDetId::maxStationId, maxVFatGE0_, maxVFatGE11_, maxVFatGE21_, GEMDetId::minStationId, GEMROmap::stripNum::stNum, GEMROmap::eCoord::vfatId, GEMROmap::dCoord::vfatType, GEMROmap::channelNum::vfatType, and GEMROmap::stripNum::vfatType.

53  {
54  // 12 bits for vfat, 5 bits for geb, 8 bit long GLIB serial number
55  uint16_t amcId = 1; //amc
56  uint16_t gebId = 0;
57 
58  for (int re = -1; re <= 1; re = re+2) {
59  for (int st = GEMDetId::minStationId; st<=GEMDetId::maxStationId; ++st) {
60  int maxVFat = maxVFatGE11_;
61  if (st == 2) maxVFat = maxVFatGE21_;
62  if (st == 0) maxVFat = maxVFatGE0_;
63 
64  for (int ch = 1; ch<=GEMDetId::maxChamberId; ++ch) {
65  for (int ly = 1; ly<=GEMDetId::maxLayerId; ++ly) {
66  // 1 geb per chamber
67  gebId++;
68  uint16_t chipId = 0;
69  for (int roll = 1; roll<=GEMDetId::maxRollId; ++roll) {
70 
71  GEMDetId gemId(re, 1, st, ly, ch, roll);
72 
73  for (int nphi = 1; nphi <= maxVFat; ++nphi){
74  chipId++;
75 
77  ec.vfatId = chipId;
78  ec.gebId = gebId;
79  ec.amcId = amcId;
80 
82  dc.gemDetId = gemId;
83  dc.vfatType = 1;
84  dc.iPhi = nphi;
85 
86  romap.add(ec,dc);
87  romap.add(dc,ec);
88  }
89  }
90  // 5 bits for geb
91  if (gebId == maxGEBs_){
92  // 24 gebs per amc
93  gebId = 0;
94  amcId++;
95  }
96  }
97  }
98  }
99  }
100 
101  for (int i = 0; i < maxChan_; ++i){
102  // only 1 vfat type for dummy map
104  cMap.vfatType = 1;
105  cMap.chNum = i;
106 
107  GEMROmap::stripNum sMap;
108  sMap.vfatType = 1;
109  sMap.stNum = i+1;
110 
111  romap.add(cMap, sMap);
112  romap.add(sMap, cMap);
113  }
114 }
static const int maxRollId
Definition: GEMDetId.h:111
static const int maxChamberId
Definition: GEMDetId.h:104
static const int maxVFatGE0_
Definition: GEMELMap.h:58
void add(eCoord e, dCoord d)
Definition: GEMROmap.h:77
static const int maxVFatGE21_
Definition: GEMELMap.h:60
uint16_t gebId
Definition: GEMROmap.h:11
static const int maxLayerId
Definition: GEMDetId.h:108
static const int maxChan_
Definition: GEMELMap.h:61
GEMDetId gemDetId
Definition: GEMROmap.h:30
static const int maxStationId
Definition: GEMDetId.h:101
static const int maxGEBs_
Definition: GEMELMap.h:57
static const int minStationId
Definition: GEMDetId.h:100
static const int maxVFatGE11_
Definition: GEMELMap.h:59
uint16_t vfatId
Definition: GEMROmap.h:12
uint16_t amcId
Definition: GEMROmap.h:10
template<class Archive >
void GEMELMap::serialize ( Archive &  ar,
const unsigned int  version 
)
private
const std::string & GEMELMap::version ( ) const

Definition at line 13 of file GEMELMap.cc.

References theVersion.

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

13  {
14  return theVersion;
15 }
std::string theVersion
Definition: GEMELMap.h:48

Friends And Related Function Documentation

friend class boost::serialization::access
friend

Definition at line 50 of file GEMELMap.h.

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

Definition at line 50 of file GEMELMap.h.

Member Data Documentation

const int GEMELMap::amcBX_ = 25
static

Definition at line 62 of file GEMELMap.h.

Referenced by GEMDigiToRawModule::produce().

const int GEMELMap::chipIdBits_ = 12
static

Definition at line 54 of file GEMELMap.h.

const int GEMELMap::chipIdMask_ = 0xfff
static

Definition at line 55 of file GEMELMap.h.

Referenced by convert().

const int GEMELMap::gebIdBits_ = 5
static

Definition at line 56 of file GEMELMap.h.

const int GEMELMap::maxChan_ = 128
static
const int GEMELMap::maxGEBs_ = 24
static

Definition at line 57 of file GEMELMap.h.

Referenced by convertDummy().

const int GEMELMap::maxVFatGE0_ = 12
static

Definition at line 58 of file GEMELMap.h.

Referenced by convertDummy().

const int GEMELMap::maxVFatGE11_ = 3
static
const int GEMELMap::maxVFatGE21_ = 6
static
std::vector<GEMStripMap> GEMELMap::theStripMap_

Definition at line 45 of file GEMELMap.h.

Referenced by convert().

std::string GEMELMap::theVersion
private

Definition at line 48 of file GEMELMap.h.

Referenced by version().

std::vector<GEMVFatMap> GEMELMap::theVFatMap_

Definition at line 44 of file GEMELMap.h.

Referenced by convert().