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 &) override
 
 RPCNumberingScheme (const DDCompactView &cpv)
 
 RPCNumberingScheme (const MuonDDDConstants &muonConstants)
 
 ~RPCNumberingScheme () override
 
- Public Member Functions inherited from MuonNumberingScheme
 MuonNumberingScheme ()
 
virtual ~MuonNumberingScheme ()
 

Private Member Functions

void initMe (const MuonDDDConstants &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 19 of file RPCNumberingScheme.h.

Constructor & Destructor Documentation

RPCNumberingScheme::RPCNumberingScheme ( const DDCompactView cpv)

Definition at line 11 of file RPCNumberingScheme.cc.

References initMe().

11  {
12  MuonDDDConstants muonConstants(cpv);
13  initMe(muonConstants);
14 }
void initMe(const MuonDDDConstants &muonConstants)
RPCNumberingScheme::RPCNumberingScheme ( const MuonDDDConstants muonConstants)

Definition at line 9 of file RPCNumberingScheme.cc.

References initMe().

9 { initMe(muonConstants); }
void initMe(const MuonDDDConstants &muonConstants)
RPCNumberingScheme::~RPCNumberingScheme ( )
inlineoverride

Definition at line 24 of file RPCNumberingScheme.h.

References baseNumberToUnitNumber(), and initMe().

24 {};

Member Function Documentation

int RPCNumberingScheme::baseNumberToUnitNumber ( const MuonBaseNumber num)
overridevirtual

Reimplemented from MuonNumberingScheme.

Definition at line 36 of file RPCNumberingScheme.cc.

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

Referenced by RPCGeometryParsFromDD::buildGeometry(), RPCGeometryBuilderFromDDD::buildGeometry(), and ~RPCNumberingScheme().

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

Definition at line 16 of file RPCNumberingScheme.cc.

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

Referenced by RPCNumberingScheme(), and ~RPCNumberingScheme().

16  {
17  int theLevelPart = muonConstants.getValue("level");
18  theRegionLevel = muonConstants.getValue("mr_region") / theLevelPart;
19  theBWheelLevel = muonConstants.getValue("mr_bwheel") / theLevelPart;
20  theBStationLevel = muonConstants.getValue("mr_bstation") / theLevelPart;
21  theBPlaneLevel = muonConstants.getValue("mr_bplane") / theLevelPart;
22  theBChamberLevel = muonConstants.getValue("mr_bchamber") / theLevelPart;
23  theEPlaneLevel = muonConstants.getValue("mr_eplane") / theLevelPart;
24  theESectorLevel = muonConstants.getValue("mr_esector") / theLevelPart;
25  theERollLevel = muonConstants.getValue("mr_eroll") / theLevelPart;
26 #ifdef LOCAL_DEBUG
27  edm::LogVerbatim("RPCNumberingScheme") << "RPCNumberingScheme::theRegionLevel " << theRegionLevel
28  << "\ntheBWheelLevel " << theBWheelLevel << "\ntheBStationLevel "
29  << theBStationLevel << "\ntheBPlaneLevel " << theBPlaneLevel
30  << "\ntheBChamberLevel " << theBChamberLevel << "\ntheEPlaneLevel "
31  << theEPlaneLevel << "\ntheESectorLevel " << theESectorLevel
32  << "\ntheERollLevel " << theERollLevel;
33 #endif
34 }
int getValue(const std::string &name) const

Member Data Documentation

int RPCNumberingScheme::theBChamberLevel
private

Definition at line 35 of file RPCNumberingScheme.h.

Referenced by baseNumberToUnitNumber(), and initMe().

int RPCNumberingScheme::theBPlaneLevel
private

Definition at line 34 of file RPCNumberingScheme.h.

Referenced by baseNumberToUnitNumber(), and initMe().

int RPCNumberingScheme::theBStationLevel
private

Definition at line 33 of file RPCNumberingScheme.h.

Referenced by baseNumberToUnitNumber(), and initMe().

int RPCNumberingScheme::theBWheelLevel
private

Definition at line 32 of file RPCNumberingScheme.h.

Referenced by baseNumberToUnitNumber(), and initMe().

int RPCNumberingScheme::theEPlaneLevel
private

Definition at line 36 of file RPCNumberingScheme.h.

Referenced by baseNumberToUnitNumber(), and initMe().

int RPCNumberingScheme::theERollLevel
private

Definition at line 38 of file RPCNumberingScheme.h.

Referenced by baseNumberToUnitNumber(), and initMe().

int RPCNumberingScheme::theESectorLevel
private

Definition at line 37 of file RPCNumberingScheme.h.

Referenced by baseNumberToUnitNumber(), and initMe().

int RPCNumberingScheme::theRegionLevel
private

Definition at line 31 of file RPCNumberingScheme.h.

Referenced by baseNumberToUnitNumber(), and initMe().