CMS 3D CMS Logo

List of all members | Public Types | Public Member Functions | Public Attributes | Private Member Functions | Friends
CSCChamberMap Class Reference

#include <CSCChamberMap.h>

Public Types

typedef std::map< int, CSCMapItem::MapItemCSCMap
 Data are public. @Should be private? More...
 

Public Member Functions

int crate (const CSCDetId &) const
 Interface required use in digi-to-raw. More...
 
 CSCChamberMap ()
 
int ddu (const CSCDetId &) const
 ddu id for given DetId More...
 
int dduInput (const CSCDetId &) const
 ddu input for given DetId More...
 
int dduSlot (const CSCDetId &) const
 ddu slot for given DetId More...
 
int dmb (const CSCDetId &) const
 dmb id for given DetId More...
 
const CSCMapItem::MapItemitem (int key) const
 Accessor for item according to key. More...
 
int slink (const CSCDetId &) const
 slink id for given DetId More...
 
 ~CSCChamberMap ()
 

Public Attributes

CSCMap ch_map
 

Private Member Functions

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

Friends

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

Detailed Description

Definition at line 11 of file CSCChamberMap.h.

Member Typedef Documentation

◆ CSCMap

Data are public. @Should be private?

Definition at line 40 of file CSCChamberMap.h.

Constructor & Destructor Documentation

◆ CSCChamberMap()

CSCChamberMap::CSCChamberMap ( )

Definition at line 4 of file CSCChamberMap.cc.

4 {}

◆ ~CSCChamberMap()

CSCChamberMap::~CSCChamberMap ( )

Definition at line 6 of file CSCChamberMap.cc.

6 {}

Member Function Documentation

◆ crate()

int CSCChamberMap::crate ( const CSCDetId id) const

Interface required use in digi-to-raw.

vme crate id for given DetId

Definition at line 24 of file CSCChamberMap.cc.

24  {
25  int igor = dbIndex(id);
26  CSCMapItem::MapItem mitem = this->item(igor);
27  return mitem.crateid;
28 }

References CSCMapItem::MapItem::crateid, dbIndex(), and item().

◆ dbIndex()

int CSCChamberMap::dbIndex ( const CSCDetId id) const
private

Decimal-encoded index (as used inside db - the 'Igor' index)

This is the decimal integer ie*100000 + is*10000 + ir*1000 + ic*10 + il
(ie=1-2, is=1-4, ir=1-4, ic=1-36, il=1-6)
But in this case il=0 labels entire chamber.

Definition at line 10 of file CSCChamberMap.cc.

10  {
11  int ie = id.endcap();
12  int is = id.station();
13  int ir = id.ring();
14  int ic = id.chamber();
15  // int il = id.layer(); // zero for parent chamber
16 
17  // ME1a must be reset to ME11
18  if ((is == 1) && (ir == 4))
19  ir = 1;
20 
21  return ie * 100000 + is * 10000 + ir * 1000 + ic * 10;
22 }

Referenced by crate(), ddu(), dduInput(), dduSlot(), dmb(), and slink().

◆ ddu()

int CSCChamberMap::ddu ( const CSCDetId id) const

ddu id for given DetId

Definition at line 36 of file CSCChamberMap.cc.

36  {
37  int igor = dbIndex(id);
38  CSCMapItem::MapItem mitem = this->item(igor);
39  return mitem.ddu;
40 }

References dbIndex(), CSCMapItem::MapItem::ddu, and item().

Referenced by CSCDCCUnpacker::produce().

◆ dduInput()

int CSCChamberMap::dduInput ( const CSCDetId id) const

ddu input for given DetId

Definition at line 54 of file CSCChamberMap.cc.

54  {
55  int igor = dbIndex(id);
56  CSCMapItem::MapItem mitem = this->item(igor);
57  return mitem.ddu_input;
58 }

References dbIndex(), CSCMapItem::MapItem::ddu_input, and item().

◆ dduSlot()

int CSCChamberMap::dduSlot ( const CSCDetId id) const

ddu slot for given DetId

Definition at line 48 of file CSCChamberMap.cc.

48  {
49  int igor = dbIndex(id);
50  CSCMapItem::MapItem mitem = this->item(igor);
51  return mitem.ddu_slot;
52 }

References dbIndex(), CSCMapItem::MapItem::ddu_slot, and item().

◆ dmb()

int CSCChamberMap::dmb ( const CSCDetId id) const

dmb id for given DetId

Definition at line 30 of file CSCChamberMap.cc.

30  {
31  int igor = dbIndex(id);
32  CSCMapItem::MapItem mitem = this->item(igor);
33  return mitem.dmb;
34 }

References dbIndex(), CSCMapItem::MapItem::dmb, and item().

◆ item()

const CSCMapItem::MapItem & CSCChamberMap::item ( int  key) const

Accessor for item according to key.

Definition at line 8 of file CSCChamberMap.cc.

8 { return (ch_map.find(key))->second; }

References ch_map, crabWrapper::key, and edm::second().

Referenced by crate(), ddu(), dduInput(), dduSlot(), dmb(), and slink().

◆ serialize()

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

◆ slink()

int CSCChamberMap::slink ( const CSCDetId id) const

slink id for given DetId

Definition at line 42 of file CSCChamberMap.cc.

42  {
43  int igor = dbIndex(id);
44  CSCMapItem::MapItem mitem = this->item(igor);
45  return mitem.slink;
46 }

References dbIndex(), item(), and CSCMapItem::MapItem::slink.

Friends And Related Function Documentation

◆ boost::serialization::access

friend class boost::serialization::access
friend

Definition at line 53 of file CSCChamberMap.h.

◆ cond::serialization::access

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

Definition at line 53 of file CSCChamberMap.h.

Member Data Documentation

◆ ch_map

CSCMap CSCChamberMap::ch_map

Definition at line 41 of file CSCChamberMap.h.

Referenced by CSCChamberMapValues::fillChamberMap(), and item().

CSCMapItem::MapItem::ddu_input
int ddu_input
Definition: CSCMapItem.h:33
edm::second
U second(std::pair< T, U > const &p)
Definition: ParameterSet.cc:222
CSCMapItem::MapItem::crateid
int crateid
Definition: CSCMapItem.h:27
CSCMapItem::MapItem::slink
int slink
Definition: CSCMapItem.h:34
CSCMapItem::MapItem::dmb
int dmb
Definition: CSCMapItem.h:30
CSCChamberMap::dbIndex
int dbIndex(const CSCDetId &) const
Definition: CSCChamberMap.cc:10
CSCMapItem::MapItem
Definition: CSCMapItem.h:13
CSCMapItem::MapItem::ddu
int ddu
Definition: CSCMapItem.h:32
CSCChamberMap::ch_map
CSCMap ch_map
Definition: CSCChamberMap.h:41
CSCMapItem::MapItem::ddu_slot
int ddu_slot
Definition: CSCMapItem.h:36
crabWrapper.key
key
Definition: crabWrapper.py:19
CSCChamberMap::item
const CSCMapItem::MapItem & item(int key) const
Accessor for item according to key.
Definition: CSCChamberMap.cc:8