CMS 3D CMS Logo

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

#include <RPCNumberingScheme.h>

Inheritance diagram for RPCNumberingScheme:
MuonNumberingScheme

Public Member Functions

int baseNumberToUnitNumber (const MuonBaseNumber &) const override
 
 RPCNumberingScheme (const MuonGeometryConstants &muonConstants)
 
 ~RPCNumberingScheme () override
 
- Public Member Functions inherited from MuonNumberingScheme
 MuonNumberingScheme ()
 
virtual ~MuonNumberingScheme ()
 

Private Member Functions

void initMe (const MuonGeometryConstants &muonConstants)
 

Private Attributes

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

Detailed Description

implementation of MuonNumberingScheme for muon rpc, converts the MuonBaseNumber to a unit id

Author
Arno Straessner, CERN arno..nosp@m.stra.nosp@m.essne.nosp@m.r@ce.nosp@m.rn.ch

Definition at line 18 of file RPCNumberingScheme.h.

Constructor & Destructor Documentation

◆ RPCNumberingScheme()

RPCNumberingScheme::RPCNumberingScheme ( const MuonGeometryConstants muonConstants)

Definition at line 9 of file RPCNumberingScheme.cc.

References initMe().

9 { initMe(muonConstants); }
void initMe(const MuonGeometryConstants &muonConstants)

◆ ~RPCNumberingScheme()

RPCNumberingScheme::~RPCNumberingScheme ( )
inlineoverride

Definition at line 22 of file RPCNumberingScheme.h.

22 {};

Member Function Documentation

◆ baseNumberToUnitNumber()

int RPCNumberingScheme::baseNumberToUnitNumber ( const MuonBaseNumber num) const
overridevirtual

Reimplemented from MuonNumberingScheme.

Definition at line 30 of file RPCNumberingScheme.cc.

References Reference_intrackfit_cff::barrel, l1ctLayer2EG_cff::id, personalPlayback::level, EgammaValidation_cff::num, theBChamberLevel, theBPlaneLevel, theBStationLevel, theBWheelLevel, theEPlaneLevel, theERollLevel, theESectorLevel, and theRegionLevel.

Referenced by RPCGeometryBuilder::buildGeometry(), and RPCGeometryParsFromDD::buildGeometry().

30  {
31 #ifdef EDM_ML_DEBUG
32  edm::LogVerbatim("MuonGeom") << "RPCNumbering " << num.getLevels();
33  for (int level = 1; level <= num.getLevels(); level++) {
34  edm::LogVerbatim("MuonGeom") << level << " " << num.getSuperNo(level) << " " << num.getBaseNo(level);
35  }
36 #endif
37 
38  const int barrel = num.getSuperNo(theRegionLevel);
39  bool barrel_muon = (barrel == 1);
40  int maxLevel;
41  if (barrel_muon) {
42  maxLevel = theBChamberLevel;
43  } else {
44  maxLevel = theERollLevel;
45  }
46 
47  if (num.getLevels() != maxLevel) {
48  edm::LogWarning("MuonGeom") << "RPCNumberingScheme::BNToUN: BaseNumber has " << num.getLevels() << " levels, need "
49  << maxLevel;
50  return 0;
51  }
52 
53  int plane_id = 0;
54  int sector_id = 0;
55  int copy_id = 0;
56  int roll_id = 0;
57  int eta_id = 0;
58  int rr12_id = 0;
59  bool forward = false;
60 
61  int sector_copy = 0;
62 
63  //decode significant rpc levels
64 
65  for (int level = 1; level <= maxLevel; level++) {
66  //decode
67  if (level == theRegionLevel) {
68  if (barrel_muon) {
69  roll_id = 0;
70  } else {
71  copy_id = 1;
72  }
73  }
74  if (barrel_muon) {
75  if (level == theBWheelLevel) {
76  const int copyno = num.getBaseNo(level);
77  eta_id = 4 + copyno; //copyno= [0,4]
78  } else if (level == theBStationLevel) {
79  //- const int station_tag = num.getSuperNo(level);
80  const int copyno = num.getBaseNo(level);
81 
82  sector_id = copyno + 1;
83  if (sector_id == 13) {
84  sector_id = 4;
85  sector_copy = 1;
86  } else if (sector_id == 14) {
87  sector_id = 10;
88  sector_copy = 1;
89  }
90  // mltiply by 3 to merge with endcaps
91  sector_id *= 3;
92 
93  } else if (level == theBPlaneLevel) {
94  const int plane_tag = num.getSuperNo(level);
95  // const int copyno = num.getBaseNo(level);
96  if (plane_tag == 1) {
97  plane_id = 1;
98  } else if (plane_tag == 2) {
99  plane_id = 5;
100  } else if (plane_tag == 3) {
101  // if(copyno == 1) {
102  //if(eta_id == 4 || eta_id == 8) {
103  // plane_id=6;
104 
105  plane_id = 2;
106  // }
107 
108  // std::cout<<" KONTROLA w RPCNumberingScheme: eta_id: "<<eta_id<<", plane_tag: "<<plane_tag<<", plane_id: "<<plane_id<<std::endl;
109  } else if (plane_tag == 4) {
110  // if(copyno == 1) {
111  // if(eta_id == 4 || eta_id == 8) {
112  // plane_id=2;
113  //} else {
114  plane_id = 6;
115  //}
116  // std::cout<<" KONTROLA w RPCNumberingScheme: eta_id: "<<eta_id<<", plane_tag: "<<plane_tag<<", plane_id: "<<plane_id<<std::endl;
117  } else if (plane_tag == 5) {
118  plane_id = 3;
119  } else {
120  plane_id = 4;
121  }
122 
123  } else if (level == theBChamberLevel) {
124  const int copyno = num.getBaseNo(level);
125  if ((plane_id == 4) && (sector_id == 4 * 3)) {
126  copy_id = sector_copy * 2 + copyno + 1;
127  } else if ((plane_id == 4) && (sector_id == 10 * 3)) {
128  copy_id = sector_copy + 1;
129  } else {
130  copy_id = copyno + 1;
131  }
132  const int rollno = num.getSuperNo(level);
133  roll_id = rollno;
134  }
135 
136  } else {
137  if (level == theRegionLevel) {
138  const int copyno = num.getBaseNo(level);
139  forward = (copyno == 0);
140  } else if (level == theEPlaneLevel) {
141  const int plane_tag = num.getSuperNo(level);
142  const int rr12_tag = num.getBaseNo(level);
143  plane_id = plane_tag;
144  rr12_id = rr12_tag;
145  } else if (level == theESectorLevel) {
146  const int copyno = num.getBaseNo(level);
147  sector_id = copyno + 1;
148  if (rr12_id == 1) {
149  sector_id = sector_id * 2 - 1;
150  } else if (rr12_id == 2) {
151  sector_id = sector_id * 2;
152  }
153  } else if (level == theERollLevel) {
154  const int copyno = num.getBaseNo(level);
155  const int eta_tag = num.getSuperNo(level);
156 
157  if ((eta_tag == 1) || (eta_tag == 4) || (eta_tag == 7) || (eta_tag == 8)) {
158  eta_id = 1;
159  } else if ((eta_tag == 2) || (eta_tag == 5)) {
160  eta_id = 2;
161  } else if ((eta_tag == 3) || (eta_tag == 6)) {
162  eta_id = 3;
163  }
164 
165  if (forward)
166  eta_id = 12 - eta_id;
167 
168  // increase sector id for 20 degree chambers
169 
170  if ((eta_tag == 4) || (eta_tag == 7) || (eta_tag == 8)) {
171  sector_id *= 2;
172  }
173 
174  roll_id = copyno + 1;
175  }
176  }
177  }
178 
179  // collect all info
180 
181  int trIndex = (eta_id * 10000 + plane_id * 1000 + sector_id * 10 + copy_id) * 10 + roll_id;
182 
183 #ifdef EDM_ML_DEBUG
184  if (barrel_muon) {
185  edm::LogVerbatim("MuonGeom") << "RPCNumberingScheme (barrel): ";
186  } else {
187  if (forward) {
188  edm::LogVerbatim("MuonGeom") << "RPCNumberingScheme (forward): ";
189  } else {
190  edm::LogVerbatim("MuonGeom") << "RPCNumberingScheme (backward): ";
191  }
192  }
193  edm::LogVerbatim("MuonGeom") << " roll " << roll_id << " copy " << copy_id << " sector " << sector_id << " plane "
194  << plane_id << " eta " << eta_id << " rr12 " << rr12_id;
195 #endif
196 
197  // Build the actual numbering
198  RPCDetId id;
199  id.buildfromTrIndex(trIndex);
200 
201 #ifdef EDM_ML_DEBUG
202  edm::LogVerbatim("MuonGeom") << "RPCNumberingScheme:: DetId " << id;
203 #endif
204 
205  return id.rawId();
206 }
Log< level::Info, true > LogVerbatim
Log< level::Warning, false > LogWarning

◆ initMe()

void RPCNumberingScheme::initMe ( const MuonGeometryConstants muonConstants)
private

Definition at line 11 of file RPCNumberingScheme.cc.

References MuonGeometryConstants::getValue(), theBChamberLevel, theBPlaneLevel, theBStationLevel, theBWheelLevel, theEPlaneLevel, theERollLevel, theESectorLevel, and theRegionLevel.

Referenced by RPCNumberingScheme().

11  {
12  int theLevelPart = muonConstants.getValue("level");
13  theRegionLevel = muonConstants.getValue("mr_region") / theLevelPart;
14  theBWheelLevel = muonConstants.getValue("mr_bwheel") / theLevelPart;
15  theBStationLevel = muonConstants.getValue("mr_bstation") / theLevelPart;
16  theBPlaneLevel = muonConstants.getValue("mr_bplane") / theLevelPart;
17  theBChamberLevel = muonConstants.getValue("mr_bchamber") / theLevelPart;
18  theEPlaneLevel = muonConstants.getValue("mr_eplane") / theLevelPart;
19  theESectorLevel = muonConstants.getValue("mr_esector") / theLevelPart;
20  theERollLevel = muonConstants.getValue("mr_eroll") / theLevelPart;
21 #ifdef EDM_ML_DEBUG
22  edm::LogVerbatim("MuonGeom") << "RPCNumberingScheme::theRegionLevel " << theRegionLevel << "\ntheBWheelLevel "
23  << theBWheelLevel << "\ntheBStationLevel " << theBStationLevel << "\ntheBPlaneLevel "
24  << theBPlaneLevel << "\ntheBChamberLevel " << theBChamberLevel << "\ntheEPlaneLevel "
25  << theEPlaneLevel << "\ntheESectorLevel " << theESectorLevel << "\ntheERollLevel "
26  << theERollLevel;
27 #endif
28 }
int getValue(const std::string &name) const
Log< level::Info, true > LogVerbatim

Member Data Documentation

◆ theBChamberLevel

int RPCNumberingScheme::theBChamberLevel
private

Definition at line 33 of file RPCNumberingScheme.h.

Referenced by baseNumberToUnitNumber(), and initMe().

◆ theBPlaneLevel

int RPCNumberingScheme::theBPlaneLevel
private

Definition at line 32 of file RPCNumberingScheme.h.

Referenced by baseNumberToUnitNumber(), and initMe().

◆ theBStationLevel

int RPCNumberingScheme::theBStationLevel
private

Definition at line 31 of file RPCNumberingScheme.h.

Referenced by baseNumberToUnitNumber(), and initMe().

◆ theBWheelLevel

int RPCNumberingScheme::theBWheelLevel
private

Definition at line 30 of file RPCNumberingScheme.h.

Referenced by baseNumberToUnitNumber(), and initMe().

◆ theEPlaneLevel

int RPCNumberingScheme::theEPlaneLevel
private

Definition at line 34 of file RPCNumberingScheme.h.

Referenced by baseNumberToUnitNumber(), and initMe().

◆ theERollLevel

int RPCNumberingScheme::theERollLevel
private

Definition at line 36 of file RPCNumberingScheme.h.

Referenced by baseNumberToUnitNumber(), and initMe().

◆ theESectorLevel

int RPCNumberingScheme::theESectorLevel
private

Definition at line 35 of file RPCNumberingScheme.h.

Referenced by baseNumberToUnitNumber(), and initMe().

◆ theRegionLevel

int RPCNumberingScheme::theRegionLevel
private

Definition at line 29 of file RPCNumberingScheme.h.

Referenced by baseNumberToUnitNumber(), and initMe().