CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions | Private Attributes
cms::RPCNumberingScheme Class Reference

#include <DD4hep_RPCNumberingScheme.h>

Public Member Functions

void baseNumberToUnitNumber (const MuonBaseNumber &)
 
int getDetId () const
 
 RPCNumberingScheme (const MuonConstants &muonConstants)
 

Private Member Functions

const int get (const char *, const MuonConstants &) const
 
void initMe (const MuonConstants &muonConstants)
 
void setDetId (int idnew)
 

Private Attributes

int detId
 
int theBChamberLevel
 
int theBPlaneLevel
 
int theBStationLevel
 
int theBWheelLevel
 
int theEPlaneLevel
 
int theERollLevel
 
int theESectorLevel
 
int theRegionLevel
 

Detailed Description

Definition at line 20 of file DD4hep_RPCNumberingScheme.h.

Constructor & Destructor Documentation

RPCNumberingScheme::RPCNumberingScheme ( const MuonConstants muonConstants)

Definition at line 11 of file DD4hep_RPCNumberingScheme.cc.

References initMe().

11 { initMe(muonConstants); }
void initMe(const MuonConstants &muonConstants)

Member Function Documentation

void RPCNumberingScheme::baseNumberToUnitNumber ( const MuonBaseNumber num)

Definition at line 27 of file DD4hep_RPCNumberingScheme.cc.

References Reference_intrackfit_cff::barrel, Exception, MuonBaseNumber::getBaseNo(), MuonBaseNumber::getLevels(), MuonBaseNumber::getSuperNo(), triggerObjects_cff::id, personalPlayback::level, setDetId(), theBChamberLevel, theBPlaneLevel, theBStationLevel, theBWheelLevel, theEPlaneLevel, theERollLevel, theESectorLevel, and theRegionLevel.

Referenced by RPCGeometryBuilderFromDDD::buildGeometry().

27  {
28  const int barrel = num.getSuperNo(theRegionLevel);
29 
30  bool barrel_muon = (barrel == 1);
31  int maxLevel;
32  if (barrel_muon) {
33  maxLevel = theBChamberLevel;
34  } else {
35  maxLevel = theERollLevel;
36  }
37  if (num.getLevels() != maxLevel) {
38  throw cms::Exception("DD4hep_RPCNumberingScheme", "num.getLevels() != maxLevel");
39  }
40 
41  int plane_id = 0;
42  int sector_id = 0;
43  int copy_id = 0;
44  int roll_id = 0;
45  int eta_id = 0;
46  int rr12_id = 0;
47  bool forward = false;
48  int sector_copy = 0;
49 
50  for (int level = 1; level <= maxLevel; level++) {
51  if (level == theRegionLevel) {
52  if (barrel_muon) {
53  roll_id = 0;
54  } else {
55  copy_id = 1;
56  }
57  }
58  if (barrel_muon) {
59  if (level == theBWheelLevel) {
60  const int copyno = num.getBaseNo(level);
61  eta_id = 4 + copyno;
62  } else if (level == theBStationLevel) {
63  const int copyno = num.getBaseNo(level);
64  sector_id = copyno + 1;
65  if (sector_id == 13) {
66  sector_id = 4;
67  sector_copy = 1;
68  } else if (sector_id == 14) {
69  sector_id = 10;
70  sector_copy = 1;
71  }
72  sector_id *= 3;
73  } else if (level == theBPlaneLevel) {
74  const int plane_tag = num.getSuperNo(level);
75  if (plane_tag == 1) {
76  plane_id = 1;
77  } else if (plane_tag == 2) {
78  plane_id = 5;
79  } else if (plane_tag == 3) {
80  plane_id = 2;
81  } else if (plane_tag == 4) {
82  plane_id = 6;
83  } else if (plane_tag == 5) {
84  plane_id = 3;
85  } else {
86  plane_id = 4;
87  }
88  } else if (level == theBChamberLevel) {
89  const int copyno = num.getBaseNo(level);
90  if ((plane_id == 4) && (sector_id == 4 * 3)) {
91  copy_id = sector_copy * 2 + copyno + 1;
92  } else if ((plane_id == 4) && (sector_id == 10 * 3)) {
93  copy_id = sector_copy + 1;
94  } else {
95  copy_id = copyno + 1;
96  }
97  const int rollno = num.getSuperNo(level);
98  roll_id = rollno;
99  }
100  } else {
101  if (level == theRegionLevel) {
102  const int copyno = num.getBaseNo(level);
103  forward = (copyno == 0);
104  } else if (level == theEPlaneLevel) {
105  const int plane_tag = num.getSuperNo(level);
106  const int rr12_tag = num.getBaseNo(level);
107  plane_id = plane_tag;
108  rr12_id = rr12_tag;
109  } else if (level == theESectorLevel) {
110  const int copyno = num.getBaseNo(level);
111  sector_id = copyno + 1;
112  if (rr12_id == 1) {
113  sector_id = sector_id * 2 - 1;
114  } else if (rr12_id == 2) {
115  sector_id = sector_id * 2;
116  }
117  } else if (level == theERollLevel) {
118  const int copyno = num.getBaseNo(level);
119  const int eta_tag = num.getSuperNo(level);
120  if ((eta_tag == 1) || (eta_tag == 4) || (eta_tag == 7) || (eta_tag == 8)) {
121  eta_id = 1;
122  } else if ((eta_tag == 2) || (eta_tag == 5)) {
123  eta_id = 2;
124  } else if ((eta_tag == 3) || (eta_tag == 6)) {
125  eta_id = 3;
126  }
127  if (forward)
128  eta_id = 12 - eta_id;
129  if ((eta_tag == 4) || (eta_tag == 7) || (eta_tag == 8)) {
130  sector_id *= 2;
131  }
132  roll_id = copyno + 1;
133  }
134  }
135  }
136  int trIndex = (eta_id * 10000 + plane_id * 1000 + sector_id * 10 + copy_id) * 10 + roll_id;
137  RPCDetId id;
138  id.buildfromTrIndex(trIndex);
139  setDetId(id.rawId());
140 }
int getBaseNo(int level) const
int getLevels() const
int getSuperNo(int level) const
const int RPCNumberingScheme::get ( const char *  key,
const MuonConstants muonConstants 
) const
private
int cms::RPCNumberingScheme::getDetId ( void  ) const
inline

Definition at line 24 of file DD4hep_RPCNumberingScheme.h.

References detId, and initMe().

void RPCNumberingScheme::initMe ( const MuonConstants muonConstants)
private

Definition at line 13 of file DD4hep_RPCNumberingScheme.cc.

References theBChamberLevel, theBPlaneLevel, theBStationLevel, theBWheelLevel, theEPlaneLevel, theERollLevel, theESectorLevel, and theRegionLevel.

Referenced by getDetId(), and RPCNumberingScheme().

13  {
14  int levelPart = get("level", muonConstants);
15 
16  assert(levelPart != 0);
17  theRegionLevel = get("mr_region", muonConstants) / levelPart;
18  theBWheelLevel = get("mr_bwheel", muonConstants) / levelPart;
19  theBStationLevel = get("mr_bstation", muonConstants) / levelPart;
20  theBPlaneLevel = get("mr_bplane", muonConstants) / levelPart;
21  theBChamberLevel = get("mr_bchamber", muonConstants) / levelPart;
22  theEPlaneLevel = get("mr_eplane", muonConstants) / levelPart;
23  theESectorLevel = get("mr_esector", muonConstants) / levelPart;
24  theERollLevel = get("mr_eroll", muonConstants) / levelPart;
25 }
void cms::RPCNumberingScheme::setDetId ( int  idnew)
inlineprivate

Definition at line 29 of file DD4hep_RPCNumberingScheme.h.

References detId.

Referenced by baseNumberToUnitNumber().

Member Data Documentation

int cms::RPCNumberingScheme::detId
private

Definition at line 39 of file DD4hep_RPCNumberingScheme.h.

Referenced by getDetId(), and setDetId().

int cms::RPCNumberingScheme::theBChamberLevel
private

Definition at line 34 of file DD4hep_RPCNumberingScheme.h.

Referenced by baseNumberToUnitNumber(), and initMe().

int cms::RPCNumberingScheme::theBPlaneLevel
private

Definition at line 33 of file DD4hep_RPCNumberingScheme.h.

Referenced by baseNumberToUnitNumber(), and initMe().

int cms::RPCNumberingScheme::theBStationLevel
private

Definition at line 32 of file DD4hep_RPCNumberingScheme.h.

Referenced by baseNumberToUnitNumber(), and initMe().

int cms::RPCNumberingScheme::theBWheelLevel
private

Definition at line 31 of file DD4hep_RPCNumberingScheme.h.

Referenced by baseNumberToUnitNumber(), and initMe().

int cms::RPCNumberingScheme::theEPlaneLevel
private

Definition at line 35 of file DD4hep_RPCNumberingScheme.h.

Referenced by baseNumberToUnitNumber(), and initMe().

int cms::RPCNumberingScheme::theERollLevel
private

Definition at line 37 of file DD4hep_RPCNumberingScheme.h.

Referenced by baseNumberToUnitNumber(), and initMe().

int cms::RPCNumberingScheme::theESectorLevel
private

Definition at line 36 of file DD4hep_RPCNumberingScheme.h.

Referenced by baseNumberToUnitNumber(), and initMe().

int cms::RPCNumberingScheme::theRegionLevel
private

Definition at line 30 of file DD4hep_RPCNumberingScheme.h.

Referenced by baseNumberToUnitNumber(), and initMe().