CMS 3D CMS Logo

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Classes | Public Member Functions | Public Attributes | Private Member Functions | Private Attributes | Static Private Attributes | Friends
GEMEMap Class Reference

#include <GEMEMap.h>

Classes

struct  GEMEMapItem
 
struct  GEMVFatMapInPos
 
struct  GEMVFatMaptype
 

Public Member Functions

GEMROmapconvert () const
 
GEMROmapconvertDummy () const
 
 GEMEMap ()
 
 GEMEMap (const std::string &version)
 
const std::string & version () const
 
virtual ~GEMEMap ()
 

Public Attributes

std::vector< GEMEMapItemtheEMapItem
 
std::vector< GEMVFatMapInPostheVFatMapInPos
 
std::vector< GEMVFatMaptypetheVFatMaptype
 

Private Member Functions

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

Private Attributes

std::string theVersion
 

Static Private Attributes

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 maxVFatGE11_ = 3
 
static const int maxVFatGE21_ = 6
 

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 5 of file GEMEMap.cc.

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

Definition at line 8 of file GEMEMap.cc.

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

Definition at line 11 of file GEMEMap.cc.

11 {}

Member Function Documentation

GEMROmap * GEMEMap::convert ( ) const

Definition at line 17 of file GEMEMap.cc.

References funct::abs(), GEMROmap::add(), GEMROmap::eCoord::channelId, chipIdMask_, RecoEcal_EventContent_cff::ec, GEMROmap::dCoord::gemDetId, maxChan_, maxVFatGE11_, maxVFatGE21_, GEMROmap::dCoord::stripId, theVFatMaptype, and GEMROmap::eCoord::vfatId.

17  {
18  GEMROmap* romap=new GEMROmap();
19 
20  for (auto imap : theVFatMaptype){
21  for (unsigned int ix=0;ix<imap.strip_number.size();ix++){
23  ec.vfatId= imap.vfatId[ix] & chipIdMask_;// chip ID is 12 bits
24  ec.channelId=imap.vfat_chnnel_number[ix];
25 
26  int st = std::abs(imap.z_direction[ix]);
27  int maxVFat = maxVFatGE11_;
28  if (st == 2) maxVFat = maxVFatGE21_;
29 
31  dc.stripId = 1 + imap.strip_number[ix]+(imap.iPhi[ix]-1)%maxVFat*maxChan_;
32  dc.gemDetId = GEMDetId(imap.z_direction[ix], 1, st, imap.depth[ix], imap.sec[ix], imap.iEta[ix]);
33 
34  romap->add(ec,dc);
35  romap->add(dc,ec);
36  }
37  }
38  return romap;
39 }
std::vector< GEMVFatMaptype > theVFatMaptype
Definition: GEMEMap.h:50
static const int chipIdMask_
Definition: GEMEMap.h:60
static const int maxVFatGE21_
Definition: GEMEMap.h:64
void add(eCoord e, dCoord d)
Definition: GEMROmap.h:39
GEMDetId gemDetId
Definition: GEMROmap.h:22
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
uint32_t vfatId
Definition: GEMROmap.h:10
static const int maxChan_
Definition: GEMEMap.h:65
static const int maxVFatGE11_
Definition: GEMEMap.h:63
GEMROmap * GEMEMap::convertDummy ( ) const

Definition at line 41 of file GEMEMap.cc.

References GEMROmap::add(), GEMROmap::addAMC(), GEMROmap::addAMC2GEB(), officialStyle::chan, GEMROmap::eCoord::channelId, chipIdBits_, RecoEcal_EventContent_cff::ec, gebIdBits_, GEMROmap::dCoord::gemDetId, GEMDetId::maxChamberId, maxChan_, maxGEBs_, GEMDetId::maxLayerId, GEMDetId::maxRollId, GEMDetId::maxStationId, maxVFatGE11_, maxVFatGE21_, GEMDetId::minStationId, GEMROmap::dCoord::stripId, and GEMROmap::eCoord::vfatId.

41  {
42  GEMROmap* romap=new GEMROmap();
43  uint16_t amcId = 1; //amc
44  uint16_t gebId = 1;
45  romap->addAMC(amcId);
46 
47  for (int re = -1; re <= 1; re = re+2) {
48  for (int st = GEMDetId::minStationId; st<=GEMDetId::maxStationId; ++st) {
49  int maxVFat = maxVFatGE11_;
50  if (st == 2) maxVFat = maxVFatGE21_;
51 
52  for (int ch = 1; ch<=GEMDetId::maxChamberId; ++ch) {
53  for (int ly = 1; ly<=GEMDetId::maxLayerId; ++ly) {
54 
55  // 1 geb per chamber
56  // 24 gebs per amc
57  // make new amcId once 24 gebs are used up
58  if (gebId > maxGEBs_){
59  gebId = 1;
60  amcId++;
61  romap->addAMC(amcId);
62  }
63 
64  romap->addAMC2GEB(amcId, gebId);
65 
66  GEMDetId chamDetId(re, 1, st, ly, ch, 0);
67  uint32_t chamberId = (amcId << gebIdBits_) | gebId;
68  romap->add(chamDetId,chamberId);
69  romap->add(chamberId,chamDetId);
70 
71  uint16_t chipId = 0;
72  for (int roll = 1; roll<=GEMDetId::maxRollId; ++roll) {
73 
74  int stripId = 0;
75  GEMDetId gemId(re, 1, st, ly, ch, roll);
76 
77  for (int nVfat = 0; nVfat < maxVFat; ++nVfat){
78  chipId++;
79 
80  for (unsigned chan = 0; chan < maxChan_; ++chan){
82  dc.stripId = ++stripId;
83  dc.gemDetId = gemId;
84 
85  // make 1 full vfat ID from amc + geb + chip Ids
86  uint32_t vfatId = (amcId << (gebIdBits_+chipIdBits_)) | (gebId << chipIdBits_) | chipId;
87 
89  ec.vfatId = vfatId;
90  ec.channelId = chan;
91  romap->add(ec,dc);
92  romap->add(dc,ec);
93 
94  }
95  }
96  }
97 
98  gebId++;
99 
100  }
101  }
102  }
103  }
104 
105  return romap;
106 }
static const int chipIdBits_
Definition: GEMEMap.h:59
static const int maxVFatGE21_
Definition: GEMEMap.h:64
static const int maxRollId
Definition: GEMDetId.h:111
static const int maxChamberId
Definition: GEMDetId.h:104
void add(eCoord e, dCoord d)
Definition: GEMROmap.h:39
static const int maxLayerId
Definition: GEMDetId.h:108
void addAMC(uint16_t d)
Definition: GEMROmap.h:50
static const int maxGEBs_
Definition: GEMEMap.h:62
GEMDetId gemDetId
Definition: GEMROmap.h:22
uint32_t vfatId
Definition: GEMROmap.h:10
static const int maxStationId
Definition: GEMDetId.h:101
static const int minStationId
Definition: GEMDetId.h:100
static const int maxChan_
Definition: GEMEMap.h:65
static const int maxVFatGE11_
Definition: GEMEMap.h:63
chan
lumi = TPaveText(lowX+0.38, lowY+0.061, lowX+0.45, lowY+0.161, "NDC") lumi.SetBorderSize( 0 ) lumi...
void addAMC2GEB(uint16_t d, uint16_t c)
Definition: GEMROmap.h:53
static const int gebIdBits_
Definition: GEMEMap.h:61
template<class Archive >
void GEMEMap::serialize ( Archive &  ar,
const unsigned int  version 
)
private
const std::string & GEMEMap::version ( ) const

Definition at line 13 of file GEMEMap.cc.

References theVersion.

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

13  {
14  return theVersion;
15 }
std::string theVersion
Definition: GEMEMap.h:54

Friends And Related Function Documentation

friend class boost::serialization::access
friend

Definition at line 56 of file GEMEMap.h.

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

Definition at line 56 of file GEMEMap.h.

Member Data Documentation

const int GEMEMap::chipIdBits_ = 12
staticprivate

Definition at line 59 of file GEMEMap.h.

Referenced by convertDummy().

const int GEMEMap::chipIdMask_ = 0xfff
staticprivate

Definition at line 60 of file GEMEMap.h.

Referenced by convert().

const int GEMEMap::gebIdBits_ = 5
staticprivate

Definition at line 61 of file GEMEMap.h.

Referenced by convertDummy().

const int GEMEMap::maxChan_ = 128
staticprivate

Definition at line 65 of file GEMEMap.h.

Referenced by convert(), and convertDummy().

const int GEMEMap::maxGEBs_ = 24
staticprivate

Definition at line 62 of file GEMEMap.h.

Referenced by convertDummy().

const int GEMEMap::maxVFatGE11_ = 3
staticprivate

Definition at line 63 of file GEMEMap.h.

Referenced by convert(), and convertDummy().

const int GEMEMap::maxVFatGE21_ = 6
staticprivate

Definition at line 64 of file GEMEMap.h.

Referenced by convert(), and convertDummy().

std::vector<GEMEMapItem> GEMEMap::theEMapItem

Definition at line 49 of file GEMEMap.h.

std::string GEMEMap::theVersion
private

Definition at line 54 of file GEMEMap.h.

Referenced by version().

std::vector<GEMVFatMapInPos> GEMEMap::theVFatMapInPos

Definition at line 51 of file GEMEMap.h.

std::vector<GEMVFatMaptype> GEMEMap::theVFatMaptype

Definition at line 50 of file GEMEMap.h.

Referenced by convert().