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::RPCNumberingScheme ( const MuonConstants muonConstants)

Definition at line 11 of file DD4hep_RPCNumberingScheme.cc.

11 { initMe(muonConstants); }

References initMe().

Member Function Documentation

◆ baseNumberToUnitNumber()

void RPCNumberingScheme::baseNumberToUnitNumber ( const MuonBaseNumber num)

Definition at line 27 of file DD4hep_RPCNumberingScheme.cc.

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 }

References Reference_intrackfit_cff::barrel, Exception, triggerObjects_cff::id, personalPlayback::level, EgammaValidation_cff::num, setDetId(), theBChamberLevel, theBPlaneLevel, theBStationLevel, theBWheelLevel, theEPlaneLevel, theERollLevel, theESectorLevel, and theRegionLevel.

Referenced by RPCGeometryBuilderFromDDD::buildGeometry().

◆ get()

const int RPCNumberingScheme::get ( const char *  key,
const MuonConstants muonConstants 
) const
private

◆ getDetId()

int cms::RPCNumberingScheme::getDetId ( void  ) const
inline

Definition at line 24 of file DD4hep_RPCNumberingScheme.h.

24 { return detId; }

References detId.

◆ initMe()

void RPCNumberingScheme::initMe ( const MuonConstants muonConstants)
private

Definition at line 13 of file DD4hep_RPCNumberingScheme.cc.

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 }

References cms::cuda::assert(), get(), theBChamberLevel, theBPlaneLevel, theBStationLevel, theBWheelLevel, theEPlaneLevel, theERollLevel, theESectorLevel, and theRegionLevel.

Referenced by RPCNumberingScheme().

◆ setDetId()

void cms::RPCNumberingScheme::setDetId ( int  idnew)
inlineprivate

Definition at line 29 of file DD4hep_RPCNumberingScheme.h.

29 { detId = idnew; }

References detId.

Referenced by baseNumberToUnitNumber().

Member Data Documentation

◆ detId

int cms::RPCNumberingScheme::detId
private

Definition at line 39 of file DD4hep_RPCNumberingScheme.h.

Referenced by getDetId(), and setDetId().

◆ theBChamberLevel

int cms::RPCNumberingScheme::theBChamberLevel
private

Definition at line 34 of file DD4hep_RPCNumberingScheme.h.

Referenced by baseNumberToUnitNumber(), and initMe().

◆ theBPlaneLevel

int cms::RPCNumberingScheme::theBPlaneLevel
private

Definition at line 33 of file DD4hep_RPCNumberingScheme.h.

Referenced by baseNumberToUnitNumber(), and initMe().

◆ theBStationLevel

int cms::RPCNumberingScheme::theBStationLevel
private

Definition at line 32 of file DD4hep_RPCNumberingScheme.h.

Referenced by baseNumberToUnitNumber(), and initMe().

◆ theBWheelLevel

int cms::RPCNumberingScheme::theBWheelLevel
private

Definition at line 31 of file DD4hep_RPCNumberingScheme.h.

Referenced by baseNumberToUnitNumber(), and initMe().

◆ theEPlaneLevel

int cms::RPCNumberingScheme::theEPlaneLevel
private

Definition at line 35 of file DD4hep_RPCNumberingScheme.h.

Referenced by baseNumberToUnitNumber(), and initMe().

◆ theERollLevel

int cms::RPCNumberingScheme::theERollLevel
private

Definition at line 37 of file DD4hep_RPCNumberingScheme.h.

Referenced by baseNumberToUnitNumber(), and initMe().

◆ theESectorLevel

int cms::RPCNumberingScheme::theESectorLevel
private

Definition at line 36 of file DD4hep_RPCNumberingScheme.h.

Referenced by baseNumberToUnitNumber(), and initMe().

◆ theRegionLevel

int cms::RPCNumberingScheme::theRegionLevel
private

Definition at line 30 of file DD4hep_RPCNumberingScheme.h.

Referenced by baseNumberToUnitNumber(), and initMe().

personalPlayback.level
level
Definition: personalPlayback.py:22
cms::RPCNumberingScheme::theBWheelLevel
int theBWheelLevel
Definition: DD4hep_RPCNumberingScheme.h:31
Reference_intrackfit_cff.barrel
list barrel
Definition: Reference_intrackfit_cff.py:37
cms::RPCNumberingScheme::theBStationLevel
int theBStationLevel
Definition: DD4hep_RPCNumberingScheme.h:32
cms::RPCNumberingScheme::theERollLevel
int theERollLevel
Definition: DD4hep_RPCNumberingScheme.h:37
RPCDetId
Definition: RPCDetId.h:16
cms::cuda::assert
assert(be >=bs)
end
#define end
Definition: vmac.h:39
cms::RPCNumberingScheme::setDetId
void setDetId(int idnew)
Definition: DD4hep_RPCNumberingScheme.h:29
cms::RPCNumberingScheme::theBChamberLevel
int theBChamberLevel
Definition: DD4hep_RPCNumberingScheme.h:34
cms::RPCNumberingScheme::detId
int detId
Definition: DD4hep_RPCNumberingScheme.h:39
cms::RPCNumberingScheme::theEPlaneLevel
int theEPlaneLevel
Definition: DD4hep_RPCNumberingScheme.h:35
cms::RPCNumberingScheme::initMe
void initMe(const MuonConstants &muonConstants)
Definition: DD4hep_RPCNumberingScheme.cc:13
EgammaValidation_cff.num
num
Definition: EgammaValidation_cff.py:34
cms::RPCNumberingScheme::theBPlaneLevel
int theBPlaneLevel
Definition: DD4hep_RPCNumberingScheme.h:33
cms::RPCNumberingScheme::theESectorLevel
int theESectorLevel
Definition: DD4hep_RPCNumberingScheme.h:36
triggerObjects_cff.id
id
Definition: triggerObjects_cff.py:31
Exception
Definition: hltDiff.cc:246
cms::RPCNumberingScheme::get
const int get(const char *, const MuonConstants &) const
Definition: DD4hep_RPCNumberingScheme.cc:142
mps_fire.result
result
Definition: mps_fire.py:303
crabWrapper.key
key
Definition: crabWrapper.py:19
cms::RPCNumberingScheme::theRegionLevel
int theRegionLevel
Definition: DD4hep_RPCNumberingScheme.h:30