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.

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

24  {
25  int igor = dbIndex(id);
26  CSCMapItem::MapItem mitem = this->item(igor);
27  return mitem.crateid;
28 }
const CSCMapItem::MapItem & item(int key) const
Accessor for item according to key.
Definition: CSCChamberMap.cc:8
int dbIndex(const CSCDetId &) const

◆ 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.

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

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 }

◆ ddu()

int CSCChamberMap::ddu ( const CSCDetId id) const

ddu id for given DetId

Definition at line 36 of file CSCChamberMap.cc.

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

Referenced by CSCDCCUnpacker::produce().

36  {
37  int igor = dbIndex(id);
38  CSCMapItem::MapItem mitem = this->item(igor);
39  return mitem.ddu;
40 }
const CSCMapItem::MapItem & item(int key) const
Accessor for item according to key.
Definition: CSCChamberMap.cc:8
int dbIndex(const CSCDetId &) const

◆ dduInput()

int CSCChamberMap::dduInput ( const CSCDetId id) const

ddu input for given DetId

Definition at line 54 of file CSCChamberMap.cc.

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

54  {
55  int igor = dbIndex(id);
56  CSCMapItem::MapItem mitem = this->item(igor);
57  return mitem.ddu_input;
58 }
const CSCMapItem::MapItem & item(int key) const
Accessor for item according to key.
Definition: CSCChamberMap.cc:8
int dbIndex(const CSCDetId &) const

◆ dduSlot()

int CSCChamberMap::dduSlot ( const CSCDetId id) const

ddu slot for given DetId

Definition at line 48 of file CSCChamberMap.cc.

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

48  {
49  int igor = dbIndex(id);
50  CSCMapItem::MapItem mitem = this->item(igor);
51  return mitem.ddu_slot;
52 }
const CSCMapItem::MapItem & item(int key) const
Accessor for item according to key.
Definition: CSCChamberMap.cc:8
int dbIndex(const CSCDetId &) const

◆ dmb()

int CSCChamberMap::dmb ( const CSCDetId id) const

dmb id for given DetId

Definition at line 30 of file CSCChamberMap.cc.

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

30  {
31  int igor = dbIndex(id);
32  CSCMapItem::MapItem mitem = this->item(igor);
33  return mitem.dmb;
34 }
const CSCMapItem::MapItem & item(int key) const
Accessor for item according to key.
Definition: CSCChamberMap.cc:8
int dbIndex(const CSCDetId &) const

◆ item()

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

Accessor for item according to key.

Definition at line 8 of file CSCChamberMap.cc.

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

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

8 { return (ch_map.find(key))->second; }
U second(std::pair< T, U > const &p)

◆ 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.

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

42  {
43  int igor = dbIndex(id);
44  CSCMapItem::MapItem mitem = this->item(igor);
45  return mitem.slink;
46 }
const CSCMapItem::MapItem & item(int key) const
Accessor for item according to key.
Definition: CSCChamberMap.cc:8
int dbIndex(const CSCDetId &) const

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().