HighLAND
ND280GeomId.cxx
1 //#include "TND280Log.hxx"
2 //#include "TGeometryId.hxx"
3 #include "ND280GeomId.hxx"
4 #include "ND280GeomIdDef.hxx"
5 #include <iostream>
6 
7 #define ND280Warn(v) do {std::cout << "WARNING:" << v << std::endl;} while(0)
8 #define ND280Error(v) do {std::cout << "ERROR:" << v << std::endl;} while(0)
9 
10 /*
11  This file is an exact copy of the file in oaEvent except:
12  - The two commented includes
13  - The definition of ND280Warm and ND280Error
14  - a simplification of the class TSettableGeometryId to avoid using TGeometryId
15 */
16 
17 /*
18 namespace {
19  // Provide access to the protected setter and getter methods.
20  class TSettableGeometryId: public ND::TGeometryId {
21  public:
22  TSettableGeometryId() {}
23  explicit TSettableGeometryId(const ND::TGeometryId& id)
24  : ND::TGeometryId(id) {}
25  void SetField(int v, int m, int b) {
26  ND::TGeometryId::SetFieldSafe(v,m,b);
27  }
28  int GetField(int m, int b) {
29  return ND::TGeometryId::GetFieldSafe(m,b);
30  }
31  };
32 }
33 */
34 
35 namespace {
36  // Provide access to the protected setter and getter methods.
37  class TSettableGeometryId {
38  ND::TGeometryId fGeometryId;
39  public:
40  TSettableGeometryId() : fGeometryId(0) {}
41  explicit TSettableGeometryId(ND::TGeometryId id) : fGeometryId(id) {}
42  void SetField(int val, int msb, int lsb) {
43  // Build a mask for this field
44  long mask = ((1<<(msb-lsb+1))-1) << lsb;
45  // Clear the bit field.
46  fGeometryId &= ~mask;
47  // Shift the value and set the field.
48  fGeometryId |= ((val << lsb)&mask);
49  }
50 
51  int GetField(int msb, int lsb) const {
52  int field = fGeometryId >> lsb;
53  int mask = (1<<(msb-lsb+1))-1;
54  return (field & mask);
55  }
56 
57  operator ND::TGeometryId() {
58  return fGeometryId;
59  }
60  };
61 }
62 
63 ND::TGeometryId ND::GeomId::Empty() {
64  return TGeometryId();
65 }
66 
67 int ND::GeomId::GetSubSystem(TGeometryId i) {
68  TSettableGeometryId id(i);
69  return id.GetField(ND::GeomId::Def::kDetectorIdMSB,
71 }
72 
73 ////////////////////////////////////////////////////////////
74 // P0D Geometry Identifiers.
75 ////////////////////////////////////////////////////////////
76 
77 bool ND::GeomId::P0D::IsP0D(TGeometryId i) {
78  TSettableGeometryId id(i);
79  return (ND::GeomId::Def::kP0D
80  == id.GetField(ND::GeomId::Def::kDetectorIdMSB,
82 }
83 
84 ND::TGeometryId ND::GeomId::P0D::Detector() {
85  TSettableGeometryId id;
86  id.SetField(ND::GeomId::Def::kP0D,
91  ND::GeomId::Def::P0D::kSeqIdLSB);
94  ND::GeomId::Def::P0D::Global::kSeqIdLSB);
95  id.SetField(0,
97  ND::GeomId::Def::P0D::Global::kFieldLSB);
98  return id;
99 }
100 
101 ND::TGeometryId ND::GeomId::P0D::SuperP0Dule(int sP0Dule) {
102  TSettableGeometryId id;
103  id.SetField(ND::GeomId::Def::kP0D,
106  id.SetField(ND::GeomId::Def::P0D::kGlobal,
108  ND::GeomId::Def::P0D::kSeqIdLSB);
111  ND::GeomId::Def::P0D::Global::kSeqIdLSB);
112  id.SetField(sP0Dule,
114  ND::GeomId::Def::P0D::Global::kFieldLSB);
115  return id;
116 }
117 
119  TSettableGeometryId id(i);
120  if (ND::GeomId::Def::kP0D
121  != id.GetField(ND::GeomId::Def::kDetectorIdMSB,
124  != id.GetField(ND::GeomId::Def::P0D::kSeqIdMSB,
125  ND::GeomId::Def::P0D::kSeqIdLSB)) return -1;
128  ND::GeomId::Def::P0D::Global::kSeqIdLSB)) return -1;
129  return id.GetField(ND::GeomId::Def::P0D::Global::kFieldMSB,
130  ND::GeomId::Def::P0D::Global::kFieldLSB);
131 }
132 
133 
134 ND::TGeometryId ND::GeomId::P0D::P0Dule(int p0dule) {
135  TSettableGeometryId id;
136  id.SetField(ND::GeomId::Def::kP0D,
139  id.SetField(ND::GeomId::Def::P0D::kGlobal,
141  ND::GeomId::Def::P0D::kSeqIdLSB);
144  ND::GeomId::Def::P0D::Global::kSeqIdLSB);
145  id.SetField(p0dule,
147  ND::GeomId::Def::P0D::Global::kFieldLSB);
148  return id;
149 }
150 
151 int ND::GeomId::P0D::GetP0Dule(TGeometryId i) {
152  TSettableGeometryId id(i);
153  if (ND::GeomId::Def::kP0D
154  != id.GetField(ND::GeomId::Def::kDetectorIdMSB,
157  != id.GetField(ND::GeomId::Def::P0D::kSeqIdMSB,
158  ND::GeomId::Def::P0D::kSeqIdLSB)) return -1;
161  ND::GeomId::Def::P0D::Global::kSeqIdLSB)) return -1;
162  return id.GetField(ND::GeomId::Def::P0D::Global::kFieldMSB,
163  ND::GeomId::Def::P0D::Global::kFieldLSB);
164 }
165 
166 ND::TGeometryId ND::GeomId::P0D::Target(int target) {
167  TSettableGeometryId id;
168  id.SetField(ND::GeomId::Def::kP0D,
171  id.SetField(ND::GeomId::Def::P0D::kGlobal,
173  ND::GeomId::Def::P0D::kSeqIdLSB);
176  ND::GeomId::Def::P0D::Global::kSeqIdLSB);
177  id.SetField(target,
179  ND::GeomId::Def::P0D::Global::kFieldLSB);
180  return id;
181 }
182 
183 int ND::GeomId::P0D::GetTarget(TGeometryId i) {
184  TSettableGeometryId id(i);
185  if (ND::GeomId::Def::kP0D
186  != id.GetField(ND::GeomId::Def::kDetectorIdMSB,
189  != id.GetField(ND::GeomId::Def::P0D::kSeqIdMSB,
190  ND::GeomId::Def::P0D::kSeqIdLSB)) return -1;
193  ND::GeomId::Def::P0D::Global::kSeqIdLSB)) return -1;
194  return id.GetField(ND::GeomId::Def::P0D::Global::kFieldMSB,
195  ND::GeomId::Def::P0D::Global::kFieldLSB);
196 }
197 
198 ND::TGeometryId ND::GeomId::P0D::ECalRadiator(int radiator) {
199  TSettableGeometryId id;
200  id.SetField(ND::GeomId::Def::kP0D,
203  id.SetField(ND::GeomId::Def::P0D::kGlobal,
205  ND::GeomId::Def::P0D::kSeqIdLSB);
208  ND::GeomId::Def::P0D::Global::kSeqIdLSB);
209  id.SetField(radiator,
211  ND::GeomId::Def::P0D::Global::kFieldLSB);
212  return id;
213 }
214 
216  TSettableGeometryId id(i);
217  if (ND::GeomId::Def::kP0D
218  != id.GetField(ND::GeomId::Def::kDetectorIdMSB,
221  != id.GetField(ND::GeomId::Def::P0D::kSeqIdMSB,
222  ND::GeomId::Def::P0D::kSeqIdLSB)) return -1;
225  ND::GeomId::Def::P0D::Global::kSeqIdLSB)) return -1;
226  return id.GetField(ND::GeomId::Def::P0D::Global::kFieldMSB,
227  ND::GeomId::Def::P0D::Global::kFieldLSB);
228 }
229 
230 ND::TGeometryId ND::GeomId::P0D::TargetRadiator(int targetRadiator) {
231  TSettableGeometryId id;
232  id.SetField(ND::GeomId::Def::kP0D,
235  id.SetField(ND::GeomId::Def::P0D::kGlobal,
237  ND::GeomId::Def::P0D::kSeqIdLSB);
240  ND::GeomId::Def::P0D::Global::kSeqIdLSB);
241  id.SetField(targetRadiator,
243  ND::GeomId::Def::P0D::Global::kFieldLSB);
244  return id;
245 }
246 
248  TSettableGeometryId id(i);
249  if (ND::GeomId::Def::kP0D
250  != id.GetField(ND::GeomId::Def::kDetectorIdMSB,
253  != id.GetField(ND::GeomId::Def::P0D::kSeqIdMSB,
254  ND::GeomId::Def::P0D::kSeqIdLSB)) return -1;
257  ND::GeomId::Def::P0D::Global::kSeqIdLSB)) return -1;
258  return id.GetField(ND::GeomId::Def::P0D::Global::kFieldMSB,
259  ND::GeomId::Def::P0D::Global::kFieldLSB);
260 }
261 
262 ND::TGeometryId ND::GeomId::P0D::Bar(int P0Dule,
263  int layer,
264  int bar) {
265  TSettableGeometryId id;
266  id.SetField(ND::GeomId::Def::kP0D,
271  ND::GeomId::Def::P0D::kSeqIdLSB);
272  id.SetField(0,
274  ND::GeomId::Def::P0D::Bar::kSP0DuleLSB);
275  id.SetField(P0Dule,
277  ND::GeomId::Def::P0D::Bar::kP0DuleLSB);
278  id.SetField(layer,
280  ND::GeomId::Def::P0D::Bar::kLayerLSB);
281  id.SetField(bar,
283  ND::GeomId::Def::P0D::Bar::kBarLSB);
284  return id;
285 }
286 
287 int ND::GeomId::P0D::GetBarP0Dule(TGeometryId i) {
288  TSettableGeometryId id(i);
289  if (ND::GeomId::Def::kP0D
290  != id.GetField(ND::GeomId::Def::kDetectorIdMSB,
293  != id.GetField(ND::GeomId::Def::P0D::kSeqIdMSB,
294  ND::GeomId::Def::P0D::kSeqIdLSB)) return -1;
295  return id.GetField(ND::GeomId::Def::P0D::Bar::kP0DuleMSB,
296  ND::GeomId::Def::P0D::Bar::kP0DuleLSB);
297 }
298 
299 int ND::GeomId::P0D::GetBarLayer(TGeometryId i) {
300  TSettableGeometryId id(i);
301  if (ND::GeomId::Def::kP0D
302  != id.GetField(ND::GeomId::Def::kDetectorIdMSB,
305  != id.GetField(ND::GeomId::Def::P0D::kSeqIdMSB,
306  ND::GeomId::Def::P0D::kSeqIdLSB)) return -1;
307  return id.GetField(ND::GeomId::Def::P0D::Bar::kLayerMSB,
308  ND::GeomId::Def::P0D::Bar::kLayerLSB);
309 }
310 
311 int ND::GeomId::P0D::GetBarNumber(TGeometryId i) {
312  TSettableGeometryId id(i);
313  if (ND::GeomId::Def::kP0D
314  != id.GetField(ND::GeomId::Def::kDetectorIdMSB,
317  != id.GetField(ND::GeomId::Def::P0D::kSeqIdMSB,
318  ND::GeomId::Def::P0D::kSeqIdLSB)) return -1;
319  return id.GetField(ND::GeomId::Def::P0D::Bar::kBarMSB,
320  ND::GeomId::Def::P0D::Bar::kBarLSB);
321 }
322 
323 ////////////////////////////////////////////////////////////
324 // TPC Geometry Identifiers
325 ////////////////////////////////////////////////////////////
326 
327 bool ND::GeomId::TPC::IsTPC(TGeometryId i) {
328  TSettableGeometryId id(i);
329  return (ND::GeomId::Def::kTPC
330  == id.GetField(ND::GeomId::Def::kDetectorIdMSB,
332 }
333 
334 ND::TGeometryId ND::GeomId::TPC::Module(int tpc) {
335  TSettableGeometryId id;
336  if (tpc<0 || tpc>2) {
337  ND280Warn("TPC module out of range [0,2]: " << tpc);
338  return id;
339  }
340  id.SetField(ND::GeomId::Def::kTPC,
343  id.SetField(ND::GeomId::Def::TPC::kGlobal,
345  ND::GeomId::Def::TPC::kSeqIdLSB);
346  id.SetField(ND::GeomId::Def::TPC::Global::kTPC,
347  ND::GeomId::Def::TPC::Global::kSeqIdMSB,
348  ND::GeomId::Def::TPC::Global::kSeqIdLSB);
349  id.SetField(tpc,
350  ND::GeomId::Def::TPC::Global::kFieldMSB,
351  ND::GeomId::Def::TPC::Global::kFieldLSB);
352  return id;
353 }
354 
355 int ND::GeomId::TPC::GetModule(TGeometryId i) {
356  TSettableGeometryId id(i);
357  if (ND::GeomId::Def::kTPC
358  != id.GetField(ND::GeomId::Def::kDetectorIdMSB,
361  != id.GetField(ND::GeomId::Def::TPC::kSeqIdMSB,
362  ND::GeomId::Def::TPC::kSeqIdLSB)) return -1;
363  if (ND::GeomId::Def::TPC::Global::kTPC
364  != id.GetField(ND::GeomId::Def::TPC::Global::kSeqIdMSB,
365  ND::GeomId::Def::TPC::Global::kSeqIdLSB)) return -1;
366  return id.GetField(ND::GeomId::Def::TPC::Global::kFieldMSB,
367  ND::GeomId::Def::TPC::Global::kFieldLSB);
368 }
369 
370 ND::TGeometryId ND::GeomId::TPC::TPC1() {return Module(0);}
371 ND::TGeometryId ND::GeomId::TPC::TPC2() {return Module(1);}
372 ND::TGeometryId ND::GeomId::TPC::TPC3() {return Module(2);}
373 
374 bool ND::GeomId::TPC::IsTPC1(TGeometryId i) {
375  return (ND::GeomId::TPC::GetModule(i) == 0);
376 }
377 
378 bool ND::GeomId::TPC::IsTPC2(TGeometryId i) {
379  return (ND::GeomId::TPC::GetModule(i) == 1);
380 }
381 
382 bool ND::GeomId::TPC::IsTPC3(TGeometryId i) {
383  return (ND::GeomId::TPC::GetModule(i) == 2);
384 }
385 
386 ND::TGeometryId ND::GeomId::TPC::MicroMega(int tpc, int half, int mm) {
387  TSettableGeometryId id;
388  if (tpc<0 || tpc>2) {
389  ND280Warn("TPC module out of range [0,2]: " << tpc);
390  return id;
391  }
392  if (half<0 || half>1) {
393  ND280Warn("TPC half out of range [0,1]: " << half);
394  return id;
395  }
396  if (mm<0 || mm>11) {
397  ND280Warn("TPC micromega out of range [0,11]: " << mm);
398  return id;
399  }
400  id.SetField(ND::GeomId::Def::kTPC,
403  id.SetField(ND::GeomId::Def::TPC::kPad,
405  ND::GeomId::Def::TPC::kSeqIdLSB);
406  id.SetField(tpc,
408  ND::GeomId::Def::TPC::Pad::kTPCLSB);
409  id.SetField(half,
411  ND::GeomId::Def::TPC::Pad::kHalfLSB);
412  id.SetField(mm,
414  ND::GeomId::Def::TPC::Pad::kMMegaLSB);
415  id.SetField(0,
417  ND::GeomId::Def::TPC::Pad::kPadFlagLSB);
418  id.SetField(0,
420  ND::GeomId::Def::TPC::Pad::kPadLSB);
421  return id;
422 }
423 
424 bool ND::GeomId::TPC::IsMicroMega(ND::TGeometryId i) {
425  TSettableGeometryId id(i);
426  int detector = id.GetField(ND::GeomId::Def::kDetectorIdMSB,
428  if (detector != ND::GeomId::Def::kTPC) return false;
429  /// This may be a pad.
430  int seqId = id.GetField(ND::GeomId::Def::TPC::kSeqIdMSB,
431  ND::GeomId::Def::TPC::kSeqIdLSB);
432  if (seqId != ND::GeomId::Def::TPC::kPad) return false;
433  int padFlag = id.GetField(ND::GeomId::Def::TPC::Pad::kPadFlagMSB,
434  ND::GeomId::Def::TPC::Pad::kPadFlagLSB);
435  if (padFlag) return false;
436  return true;
437 }
438 
439 ND::TGeometryId ND::GeomId::TPC::Pad(int tpc, int half, int mm, int pad) {
440  TSettableGeometryId id;
441  if (tpc<0 || tpc>2) {
442  ND280Warn("TPC module out of range [0,2]: " << tpc);
443  return id;
444  }
445  if (half<0 || half>1) {
446  ND280Warn("TPC half out of range [0,1]: " << half);
447  return id;
448  }
449  if (mm<0 || mm>11) {
450  ND280Warn("TPC micromega out of range [0,11]: " << mm);
451  return id;
452  }
453  if (pad<0 || pad>1727) {
454  ND280Warn("TPC pad out of range [0,1727]: " << pad);
455  return id;
456  }
457  id.SetField(ND::GeomId::Def::kTPC,
460  id.SetField(ND::GeomId::Def::TPC::kPad,
462  ND::GeomId::Def::TPC::kSeqIdLSB);
463  id.SetField(tpc,
465  ND::GeomId::Def::TPC::Pad::kTPCLSB);
466  id.SetField(half,
468  ND::GeomId::Def::TPC::Pad::kHalfLSB);
469  id.SetField(mm,
471  ND::GeomId::Def::TPC::Pad::kMMegaLSB);
472  id.SetField(1,
474  ND::GeomId::Def::TPC::Pad::kPadFlagLSB);
475  id.SetField(pad,
477  ND::GeomId::Def::TPC::Pad::kPadLSB);
478  return id;
479 }
480 
482  return ND::GeomId::TPC::GetPadTPC(i);
483 }
484 
485 int ND::GeomId::TPC::GetPadTPC(TGeometryId i) {
486  TSettableGeometryId id(i);
487  if (ND::GeomId::Def::kTPC
488  != id.GetField(ND::GeomId::Def::kDetectorIdMSB,
491  != id.GetField(ND::GeomId::Def::TPC::kSeqIdMSB,
492  ND::GeomId::Def::TPC::kSeqIdLSB)) return -1;
493  return id.GetField(ND::GeomId::Def::TPC::Pad::kTPCMSB,
494  ND::GeomId::Def::TPC::Pad::kTPCLSB);
495 }
496 
497 int ND::GeomId::TPC::GetMicroMegaHalf(TGeometryId i) {
498  return ND::GeomId::TPC::GetPadHalf(i);
499 }
500 
501 int ND::GeomId::TPC::GetPadHalf(TGeometryId i) {
502  TSettableGeometryId id(i);
503  if (ND::GeomId::Def::kTPC
504  != id.GetField(ND::GeomId::Def::kDetectorIdMSB,
507  != id.GetField(ND::GeomId::Def::TPC::kSeqIdMSB,
508  ND::GeomId::Def::TPC::kSeqIdLSB)) return -1;
509  return id.GetField(ND::GeomId::Def::TPC::Pad::kHalfMSB,
510  ND::GeomId::Def::TPC::Pad::kHalfLSB);
511 }
512 
513 int ND::GeomId::TPC::GetMicroMegaNumber(TGeometryId i) {
514  return ND::GeomId::TPC::GetPadMicroMega(i);
515 }
516 
517 int ND::GeomId::TPC::GetPadMicroMega(TGeometryId i) {
518  TSettableGeometryId id(i);
519  if (ND::GeomId::Def::kTPC
520  != id.GetField(ND::GeomId::Def::kDetectorIdMSB,
523  != id.GetField(ND::GeomId::Def::TPC::kSeqIdMSB,
524  ND::GeomId::Def::TPC::kSeqIdLSB)) return -1;
525  return id.GetField(ND::GeomId::Def::TPC::Pad::kMMegaMSB,
526  ND::GeomId::Def::TPC::Pad::kMMegaLSB);
527 }
528 
529 int ND::GeomId::TPC::GetPadNumber(TGeometryId i) {
530  TSettableGeometryId id(i);
531  if (ND::GeomId::Def::kTPC
532  != id.GetField(ND::GeomId::Def::kDetectorIdMSB,
535  != id.GetField(ND::GeomId::Def::TPC::kSeqIdMSB,
536  ND::GeomId::Def::TPC::kSeqIdLSB)) return -1;
537  if (1 != id.GetField(ND::GeomId::Def::TPC::Pad::kPadFlagMSB,
538  ND::GeomId::Def::TPC::Pad::kPadFlagLSB)) return -1;
539  return id.GetField(ND::GeomId::Def::TPC::Pad::kPadMSB,
540  ND::GeomId::Def::TPC::Pad::kPadLSB);
541 }
542 
543 bool ND::GeomId::TPC::IsPad(ND::TGeometryId i) {
544  TSettableGeometryId id(i);
545  int detector = id.GetField(ND::GeomId::Def::kDetectorIdMSB,
547  if (detector != ND::GeomId::Def::kTPC) return false;
548  /// This may be a pad.
549  int seqId = id.GetField(ND::GeomId::Def::TPC::kSeqIdMSB,
550  ND::GeomId::Def::TPC::kSeqIdLSB);
551  if (seqId != ND::GeomId::Def::TPC::kPad) return false;
552  int padFlag = id.GetField(ND::GeomId::Def::TPC::Pad::kPadFlagMSB,
553  ND::GeomId::Def::TPC::Pad::kPadFlagLSB);
554  if (!padFlag) return false;
555  return true;
556 }
557 
558 ////////////////////////////////////////////////////////////
559 // FGD Geometry Identifiers.
560 ////////////////////////////////////////////////////////////
561 bool ND::GeomId::FGD::IsFGD(TGeometryId i) {
562  TSettableGeometryId id(i);
563  return (ND::GeomId::Def::kFGD
564  == id.GetField(ND::GeomId::Def::kDetectorIdMSB,
566 }
567 
568 ND::TGeometryId ND::GeomId::FGD::FGD(int fgd) {
569  TSettableGeometryId id;
570  if (fgd<0 || fgd>1) {
571  ND280Warn("FGD out of range [0,1]: " << fgd);
572  return id;
573  }
574  id.SetField(ND::GeomId::Def::kFGD,
577  id.SetField(ND::GeomId::Def::FGD::kGlobal,
579  ND::GeomId::Def::FGD::kSeqIdLSB);
582  ND::GeomId::Def::FGD::Global::kSeqIdLSB);
583  id.SetField(fgd,
585  ND::GeomId::Def::FGD::Global::kFieldLSB);
586  return id;
587 }
588 
589 ND::TGeometryId ND::GeomId::FGD::FGD1() {return FGD(0);}
590 ND::TGeometryId ND::GeomId::FGD::FGD2() {return FGD(1);}
591 
592 int ND::GeomId::FGD::GetFGD(TGeometryId i) {
593  TSettableGeometryId id(i);
594  if (ND::GeomId::Def::kFGD
595  != id.GetField(ND::GeomId::Def::kDetectorIdMSB,
598  != id.GetField(ND::GeomId::Def::FGD::kSeqIdMSB,
599  ND::GeomId::Def::FGD::kSeqIdLSB)) return -1;
602  ND::GeomId::Def::FGD::Global::kSeqIdLSB)) return -1;
603  return id.GetField(ND::GeomId::Def::FGD::Global::kFieldMSB,
604  ND::GeomId::Def::FGD::Global::kFieldLSB);
605 }
606 
607 bool ND::GeomId::FGD::IsFGD1(TGeometryId id) {
608  return (ND::GeomId::FGD::GetFGD(id) == 0);
609 }
610 
611 bool ND::GeomId::FGD::IsFGD2(TGeometryId id) {
612  return (ND::GeomId::FGD::GetFGD(id) == 1);
613 }
614 
615 ND::TGeometryId ND::GeomId::FGD::Bar(int fgd,
616  int module,
617  int layer,
618  int bar) {
619  TSettableGeometryId id;
620  if (fgd<0 || fgd>1) {
621  ND280Warn("FGD out of range [0,1]: " << fgd);
622  return id;
623  }
624  id.SetField(ND::GeomId::Def::kFGD,
629  ND::GeomId::Def::FGD::kSeqIdLSB);
630  id.SetField(fgd,
632  ND::GeomId::Def::FGD::Bar::kModuleLSB);
633  id.SetField(module,
635  ND::GeomId::Def::FGD::Bar::kPlaneLSB);
636  id.SetField(layer,
638  ND::GeomId::Def::FGD::Bar::kLayerLSB);
639  id.SetField(bar,
641  ND::GeomId::Def::FGD::Bar::kBarLSB);
642  return id;
643 }
644 
645 int ND::GeomId::FGD::GetBarFGD(TGeometryId i) {
646  TSettableGeometryId id(i);
647  if (ND::GeomId::Def::kFGD
648  != id.GetField(ND::GeomId::Def::kDetectorIdMSB,
651  != id.GetField(ND::GeomId::Def::FGD::kSeqIdMSB,
652  ND::GeomId::Def::FGD::kSeqIdLSB)) return -1;
653  return id.GetField(ND::GeomId::Def::FGD::Bar::kModuleMSB,
654  ND::GeomId::Def::FGD::Bar::kModuleLSB);
655 }
656 
657 int ND::GeomId::FGD::GetBarModule(TGeometryId i) {
658  TSettableGeometryId id(i);
659  if (ND::GeomId::Def::kFGD
660  != id.GetField(ND::GeomId::Def::kDetectorIdMSB,
663  != id.GetField(ND::GeomId::Def::FGD::kSeqIdMSB,
664  ND::GeomId::Def::FGD::kSeqIdLSB)) return -1;
665  return id.GetField(ND::GeomId::Def::FGD::Bar::kPlaneMSB,
666  ND::GeomId::Def::FGD::Bar::kPlaneLSB);
667 }
668 
669 int ND::GeomId::FGD::GetBarLayer(TGeometryId i) {
670  TSettableGeometryId id(i);
671  if (ND::GeomId::Def::kFGD
672  != id.GetField(ND::GeomId::Def::kDetectorIdMSB,
675  != id.GetField(ND::GeomId::Def::FGD::kSeqIdMSB,
676  ND::GeomId::Def::FGD::kSeqIdLSB)) return -1;
677  return id.GetField(ND::GeomId::Def::FGD::Bar::kLayerMSB,
678  ND::GeomId::Def::FGD::Bar::kLayerLSB);
679 }
680 
681 int ND::GeomId::FGD::GetBarNumber(TGeometryId i) {
682  TSettableGeometryId id(i);
683  if (ND::GeomId::Def::kFGD
684  != id.GetField(ND::GeomId::Def::kDetectorIdMSB,
687  != id.GetField(ND::GeomId::Def::FGD::kSeqIdMSB,
688  ND::GeomId::Def::FGD::kSeqIdLSB)) return -1;
689  return id.GetField(ND::GeomId::Def::FGD::Bar::kBarMSB,
690  ND::GeomId::Def::FGD::Bar::kBarLSB);
691 }
692 
693 ND::TGeometryId ND::GeomId::FGD::Target(int target) {
694  TSettableGeometryId id;
695  id.SetField(ND::GeomId::Def::kFGD,
698  id.SetField(ND::GeomId::Def::FGD::kGlobal,
700  ND::GeomId::Def::FGD::kSeqIdLSB);
703  ND::GeomId::Def::FGD::Global::kSeqIdLSB);
704  id.SetField(target,
706  ND::GeomId::Def::FGD::Global::kFieldLSB);
707  return id;
708 }
709 
710 int ND::GeomId::FGD::GetTarget(TGeometryId i) {
711  TSettableGeometryId id(i);
712  if (ND::GeomId::Def::kFGD
713  != id.GetField(ND::GeomId::Def::kDetectorIdMSB,
716  != id.GetField(ND::GeomId::Def::FGD::kSeqIdMSB,
717  ND::GeomId::Def::FGD::kSeqIdLSB)) return -1;
720  ND::GeomId::Def::FGD::Global::kSeqIdLSB)) return -1;
721  return id.GetField(ND::GeomId::Def::FGD::Global::kFieldMSB,
722  ND::GeomId::Def::FGD::Global::kFieldLSB);
723 }
724 
725 ND::TGeometryId ND::GeomId::FGD::Layer(int fgd,
726  int module,
727  int layer) {
728  TSettableGeometryId id;
729  if (fgd<0 || fgd>1) {
730  ND280Warn("FGD out of range [0,1]: " << fgd);
731  return id;
732  }
733  id.SetField(ND::GeomId::Def::kFGD,
736  id.SetField(ND::GeomId::Def::FGD::kGlobal,
738  ND::GeomId::Def::FGD::kSeqIdLSB);
741  ND::GeomId::Def::FGD::Global::kSeqIdLSB);
742  id.SetField(fgd,
744  ND::GeomId::Def::FGD::Global::Layer::kFGDLSB);
745  id.SetField(layer,
747  ND::GeomId::Def::FGD::Global::Layer::kLayerLSB);
748  id.SetField(module,
750  ND::GeomId::Def::FGD::Global::Layer::kModuleLSB);
751  return id;
752 }
753 
754 int ND::GeomId::FGD::GetLayerFGD(TGeometryId i) {
755  TSettableGeometryId id(i);
756  if (ND::GeomId::Def::kFGD
757  != id.GetField(ND::GeomId::Def::kDetectorIdMSB,
760  != id.GetField(ND::GeomId::Def::FGD::kSeqIdMSB,
761  ND::GeomId::Def::FGD::kSeqIdLSB)) return -1;
764  ND::GeomId::Def::FGD::Global::kSeqIdLSB)) return -1;
766  ND::GeomId::Def::FGD::Global::Layer::kFGDLSB);
767 }
768 
769 int ND::GeomId::FGD::GetLayerModule(TGeometryId i) {
770  TSettableGeometryId id(i);
771  if (ND::GeomId::Def::kFGD
772  != id.GetField(ND::GeomId::Def::kDetectorIdMSB,
775  != id.GetField(ND::GeomId::Def::FGD::kSeqIdMSB,
776  ND::GeomId::Def::FGD::kSeqIdLSB)) return -1;
779  ND::GeomId::Def::FGD::Global::kSeqIdLSB)) return -1;
781  ND::GeomId::Def::FGD::Global::Layer::kModuleLSB);
782 }
783 
784 int ND::GeomId::FGD::GetLayerNumber(TGeometryId i) {
785  TSettableGeometryId id(i);
786  if (ND::GeomId::Def::kFGD
787  != id.GetField(ND::GeomId::Def::kDetectorIdMSB,
790  != id.GetField(ND::GeomId::Def::FGD::kSeqIdMSB,
791  ND::GeomId::Def::FGD::kSeqIdLSB)) return -1;
794  ND::GeomId::Def::FGD::Global::kSeqIdLSB)) return -1;
796  ND::GeomId::Def::FGD::Global::Layer::kLayerLSB);
797 }
798 
799 ////////////////////////////////////////////////////////////
800 // ECal Geometry Identifiers.
801 ////////////////////////////////////////////////////////////
802 
803 ND::TGeometryId ND::GeomId::ECal::Module(int ecal, int clam, int module) {
804  TSettableGeometryId id;
805  if (ecal == ND::GeomId::Def::kDSECal) {
806  if (clam != 0) {
807  ND280Error("Downstream ECal with invalid clam: " << clam);
808  return id;
809  }
810  if (module != 0) {
811  ND280Error("Downstream ECal with invalid module: " << module);
812  return id;
813  }
814  }
815  else if (ecal == ND::GeomId::Def::kTECal) {
816  if (clam != 0 && clam != 1) {
817  ND280Error("Tracker ECal with invalid clam: " << clam);
818  return id;
819  }
820  if (module<0 || 2<module) {
821  ND280Error("Tracker ECal with invalid module: " << module);
822  return id;
823  }
824  }
825  else if (ecal == ND::GeomId::Def::kPECal) {
826  if (clam != 0 && clam != 1) {
827  ND280Error("P0D ECal with invalid clam: " << clam);
828  return id;
829  }
830  if (module<0 || 2<module) {
831  ND280Error("P0D ECal with invalid module: " << module);
832  return id;
833  }
834  }
835  id.SetField(ecal,
838  id.SetField(ND::GeomId::Def::ECal::kGlobal,
840  ND::GeomId::Def::ECal::kSeqIdLSB);
841  id.SetField(module*2+clam,
843  ND::GeomId::Def::ECal::kModuleLSB);
844 
847  ND::GeomId::Def::ECal::Global::kSeqIdLSB);
848  id.SetField(0,
850  ND::GeomId::Def::ECal::Global::kFieldLSB);
851 
852  return id;
853 }
854 
855 ND::TGeometryId ND::GeomId::ECal::Container(int ecal, int clam, int module) {
856  TSettableGeometryId id;
857  if (ecal == ND::GeomId::Def::kTECal) {
858  if (clam != 0 && clam != 1) {
859  ND280Error("Tracker ECal container with invalid clam: " << clam);
860  return id;
861  }
862  if (module<0 || 2<module) {
863  ND280Error("Tracker ECal container with invalid module: " << module);
864  return id;
865  }
866  }
867  else if (ecal == ND::GeomId::Def::kPECal) {
868  if (clam != 0 && clam != 1) {
869  ND280Error("P0D ECal container with invalid clam: " << clam);
870  return id;
871  }
872  if (module<0 || 2<module) {
873  ND280Error("P0D ECal container with invalid module: " << module);
874  return id;
875  }
876  }
877  else {
878  ND280Error("Container for non-contained ECal: " << ecal);
879  return id;
880  }
881 
882  id.SetField(ecal,
885  id.SetField(ND::GeomId::Def::ECal::kGlobal,
887  ND::GeomId::Def::ECal::kSeqIdLSB);
888  id.SetField(module*2+clam,
890  ND::GeomId::Def::ECal::kModuleLSB);
891 
894  ND::GeomId::Def::ECal::Global::kSeqIdLSB);
895  id.SetField(0,
897  ND::GeomId::Def::ECal::Global::kFieldLSB);
898 
899  return id;
900 }
901 
902 
904  TSettableGeometryId id(i);
905  int det = ND::GeomId::GetSubSystem(id);
906  if (det == ND::GeomId::Def::kDSECal) return det;
907  else if (det == ND::GeomId::Def::kTECal) return det;
908  else if (det == ND::GeomId::Def::kPECal) return det;
909  else return -1;
910 }
911 
912 int ND::GeomId::ECal::GetModuleNumber(TGeometryId i) {
913  TSettableGeometryId id(i);
914  if (ND::GeomId::ECal::GetModuleECal(i)<0) return -1;
916  != id.GetField(ND::GeomId::Def::ECal::kSeqIdMSB,
917  ND::GeomId::Def::ECal::kSeqIdLSB)) return -1;
920  ND::GeomId::Def::ECal::Global::kSeqIdLSB)) return -1;
921 
922  return id.GetField(ND::GeomId::Def::ECal::kModuleMSB,
923  ND::GeomId::Def::ECal::kModuleLSB) / 2;
924 }
925 
926 int ND::GeomId::ECal::GetModuleClam(TGeometryId i) {
927  TSettableGeometryId id(i);
928  if (ND::GeomId::ECal::GetModuleECal(i)<0) return -1;
930  != id.GetField(ND::GeomId::Def::ECal::kSeqIdMSB,
931  ND::GeomId::Def::ECal::kSeqIdLSB)) return -1;
934  ND::GeomId::Def::ECal::Global::kSeqIdLSB)) return -1;
935 
936  return id.GetField(ND::GeomId::Def::ECal::kModuleMSB,
937  ND::GeomId::Def::ECal::kModuleLSB) % 2;
938 }
939 
940 ND::TGeometryId ND::GeomId::ECal::Layer(int ecal, int clam,
941  int module, int layer) {
942  TSettableGeometryId id;
943  if (ecal == ND::GeomId::Def::kDSECal) {
944  if (clam != 0) {
945  ND280Error("Downstream ECal with invalid clam: " << clam);
946  return id;
947  }
948  if (module != 0) {
949  ND280Error("Downstream ECal with invalid module: " << module);
950  return id;
951  }
952  }
953  else if (ecal == ND::GeomId::Def::kTECal) {
954  if (clam != 0 && clam != 1) {
955  ND280Error("Tracker ECal with invalid clam: " << clam);
956  return id;
957  }
958  if (module<0 || 2<module) {
959  ND280Error("Tracker ECal with invalid module: " << module);
960  return id;
961  }
962  }
963  else if (ecal == ND::GeomId::Def::kPECal) {
964  if (clam != 0 && clam != 1) {
965  ND280Error("P0D ECal with invalid clam: " << clam);
966  return id;
967  }
968  if (module<0 || 2<module) {
969  ND280Error("P0D ECal with invalid module: " << module);
970  return id;
971  }
972  }
973  id.SetField(ecal,
976  id.SetField(ND::GeomId::Def::ECal::kGlobal,
978  ND::GeomId::Def::ECal::kSeqIdLSB);
979  id.SetField(module*2+clam,
981  ND::GeomId::Def::ECal::kModuleLSB);
984  ND::GeomId::Def::ECal::Global::kSeqIdLSB);
985  id.SetField(layer,
987  ND::GeomId::Def::ECal::Global::kFieldLSB);
988  return id;
989 }
990 
991 int ND::GeomId::ECal::GetLayerECal(TGeometryId i) {
992  TSettableGeometryId id(i);
993  int det = ND::GeomId::GetSubSystem(id);
994  if (det == ND::GeomId::Def::kDSECal) return det;
995  else if (det == ND::GeomId::Def::kTECal) return det;
996  else if (det == ND::GeomId::Def::kPECal) return det;
997  else return -1;
998 }
999 
1000 int ND::GeomId::ECal::GetLayerClam(TGeometryId i) {
1001  TSettableGeometryId id(i);
1002  if (ND::GeomId::ECal::GetLayerECal(i)<0) return -1;
1004  != id.GetField(ND::GeomId::Def::ECal::kSeqIdMSB,
1005  ND::GeomId::Def::ECal::kSeqIdLSB)) return -1;
1008  ND::GeomId::Def::ECal::Global::kSeqIdLSB)) return -1;
1009 
1010  return id.GetField(ND::GeomId::Def::ECal::kModuleMSB,
1011  ND::GeomId::Def::ECal::kModuleLSB) % 2;
1012 }
1013 
1014 int ND::GeomId::ECal::GetLayerModule(TGeometryId i) {
1015  TSettableGeometryId id(i);
1016  if (ND::GeomId::ECal::GetLayerECal(i)<0) return -1;
1018  != id.GetField(ND::GeomId::Def::ECal::kSeqIdMSB,
1019  ND::GeomId::Def::ECal::kSeqIdLSB)) return -1;
1022  ND::GeomId::Def::ECal::Global::kSeqIdLSB)) return -1;
1023 
1024  return id.GetField(ND::GeomId::Def::ECal::kModuleMSB,
1025  ND::GeomId::Def::ECal::kModuleLSB) / 2;
1026 }
1027 
1028 int ND::GeomId::ECal::GetLayerNumber(TGeometryId i) {
1029  TSettableGeometryId id(i);
1030  if (ND::GeomId::ECal::GetLayerECal(i)<0) return -1;
1032  != id.GetField(ND::GeomId::Def::ECal::kSeqIdMSB,
1033  ND::GeomId::Def::ECal::kSeqIdLSB)) return -1;
1036  ND::GeomId::Def::ECal::Global::kSeqIdLSB)) return -1;
1037 
1038  return id.GetField(ND::GeomId::Def::ECal::Global::kFieldMSB,
1039  ND::GeomId::Def::ECal::Global::kFieldLSB);
1040 }
1041 
1042 ND::TGeometryId ND::GeomId::ECal::Radiator(int ecal, int clam,
1043  int module, int rad) {
1044  TSettableGeometryId id;
1045  if (ecal == ND::GeomId::Def::kDSECal) {
1046  if (clam != 0) {
1047  ND280Error("Downstream ECal with invalid clam: " << clam);
1048  return id;
1049  }
1050  if (module != 0) {
1051  ND280Error("Downstream ECal with invalid module: " << module);
1052  return id;
1053  }
1054  }
1055  else if (ecal == ND::GeomId::Def::kTECal) {
1056  if (clam != 0 && clam != 1) {
1057  ND280Error("Tracker ECal with invalid clam: " << clam);
1058  return id;
1059  }
1060  if (module<0 || 2<module) {
1061  ND280Error("Tracker ECal with invalid module: " << module);
1062  return id;
1063  }
1064  }
1065  else if (ecal == ND::GeomId::Def::kPECal) {
1066  if (clam != 0 && clam != 1) {
1067  ND280Error("P0D ECal with invalid clam: " << clam);
1068  return id;
1069  }
1070  if (module<0 || 2<module) {
1071  ND280Error("P0D ECal with invalid module: " << module);
1072  return id;
1073  }
1074  }
1075  id.SetField(ecal,
1078  id.SetField(ND::GeomId::Def::ECal::kGlobal,
1080  ND::GeomId::Def::ECal::kSeqIdLSB);
1081  id.SetField(module*2+clam,
1083  ND::GeomId::Def::ECal::kModuleLSB);
1086  ND::GeomId::Def::ECal::Global::kSeqIdLSB);
1087  id.SetField(rad,
1089  ND::GeomId::Def::ECal::Global::kFieldLSB);
1090  return id;
1091 }
1092 
1094  TSettableGeometryId id(i);
1095  int det = ND::GeomId::GetSubSystem(id);
1096  if (det == ND::GeomId::Def::kDSECal) return det;
1097  else if (det == ND::GeomId::Def::kTECal) return det;
1098  else if (det == ND::GeomId::Def::kPECal) return det;
1099  else return -1;
1100 }
1101 
1102 int ND::GeomId::ECal::GetRadiatorClam(TGeometryId i) {
1103  TSettableGeometryId id(i);
1104  if (ND::GeomId::ECal::GetRadiatorECal(i)<0) return -1;
1106  != id.GetField(ND::GeomId::Def::ECal::kSeqIdMSB,
1107  ND::GeomId::Def::ECal::kSeqIdLSB)) return -1;
1110  ND::GeomId::Def::ECal::Global::kSeqIdLSB)) return -1;
1111 
1112  return id.GetField(ND::GeomId::Def::ECal::kModuleMSB,
1113  ND::GeomId::Def::ECal::kModuleLSB) % 2;
1114 }
1115 
1116 int ND::GeomId::ECal::GetRadiatorModule(TGeometryId i) {
1117  TSettableGeometryId id(i);
1118  if (ND::GeomId::ECal::GetRadiatorECal(i)<0) return -1;
1120  != id.GetField(ND::GeomId::Def::ECal::kSeqIdMSB,
1121  ND::GeomId::Def::ECal::kSeqIdLSB)) return -1;
1124  ND::GeomId::Def::ECal::Global::kSeqIdLSB)) return -1;
1125 
1126  return id.GetField(ND::GeomId::Def::ECal::kModuleMSB,
1127  ND::GeomId::Def::ECal::kModuleLSB) / 2;
1128 }
1129 
1130 int ND::GeomId::ECal::GetRadiatorNumber(TGeometryId i) {
1131  TSettableGeometryId id(i);
1132  if (ND::GeomId::ECal::GetRadiatorECal(i)<0) return -1;
1134  != id.GetField(ND::GeomId::Def::ECal::kSeqIdMSB,
1135  ND::GeomId::Def::ECal::kSeqIdLSB)) return -1;
1138  ND::GeomId::Def::ECal::Global::kSeqIdLSB)) return -1;
1139 
1140  return id.GetField(ND::GeomId::Def::ECal::Global::kFieldMSB,
1141  ND::GeomId::Def::ECal::Global::kFieldLSB);
1142 }
1143 
1144 ND::TGeometryId ND::GeomId::ECal::Bar(int ecal, int clam,
1145  int module, int layer, int bar) {
1146  TSettableGeometryId id;
1147  if (ecal == ND::GeomId::Def::kDSECal) {
1148  if (clam != 0) {
1149  ND280Error("Downstream ECal with invalid clam: " << clam);
1150  return id;
1151  }
1152  if (module != 0) {
1153  ND280Error("Downstream ECal with invalid module: " << module);
1154  return id;
1155  }
1156  }
1157  else if (ecal == ND::GeomId::Def::kTECal) {
1158  if (clam != 0 && clam != 1) {
1159  ND280Error("Tracker ECal with invalid clam: " << clam);
1160  return id;
1161  }
1162  if (module<0 || 2<module) {
1163  ND280Error("Tracker ECal with invalid module: " << module);
1164  return id;
1165  }
1166  }
1167  else if (ecal == ND::GeomId::Def::kPECal) {
1168  if (clam != 0 && clam != 1) {
1169  ND280Error("P0D ECal with invalid clam: " << clam);
1170  return id;
1171  }
1172  if (module<0 || 2<module) {
1173  ND280Error("P0D ECal with invalid module: " << module);
1174  return id;
1175  }
1176  }
1177  id.SetField(ecal,
1182  ND::GeomId::Def::ECal::kSeqIdLSB);
1183  id.SetField(module*2+clam,
1185  ND::GeomId::Def::ECal::kModuleLSB);
1186  id.SetField(layer,
1188  ND::GeomId::Def::ECal::Bar::kLayerLSB);
1189  id.SetField(bar,
1191  ND::GeomId::Def::ECal::Bar::kBarLSB);
1192  return id;
1193 }
1194 
1195 int ND::GeomId::ECal::GetBarECal(TGeometryId i) {
1196  TSettableGeometryId id(i);
1197  int det = ND::GeomId::GetSubSystem(id);
1198  if (det == ND::GeomId::Def::kDSECal) return det;
1199  else if (det == ND::GeomId::Def::kTECal) return det;
1200  else if (det == ND::GeomId::Def::kPECal) return det;
1201  else return -1;
1202 }
1203 
1204 int ND::GeomId::ECal::GetBarClam(TGeometryId i) {
1205  TSettableGeometryId id(i);
1206  if (ND::GeomId::ECal::GetBarECal(i)<0) return -1;
1208  != id.GetField(ND::GeomId::Def::ECal::kSeqIdMSB,
1209  ND::GeomId::Def::ECal::kSeqIdLSB)) return -1;
1210 
1211  return id.GetField(ND::GeomId::Def::ECal::kModuleMSB,
1212  ND::GeomId::Def::ECal::kModuleLSB) % 2;
1213 }
1214 
1215 int ND::GeomId::ECal::GetBarModule(TGeometryId i) {
1216  TSettableGeometryId id(i);
1217  if (ND::GeomId::ECal::GetBarECal(i)<0) return -1;
1219  != id.GetField(ND::GeomId::Def::ECal::kSeqIdMSB,
1220  ND::GeomId::Def::ECal::kSeqIdLSB)) return -1;
1221 
1222  return id.GetField(ND::GeomId::Def::ECal::kModuleMSB,
1223  ND::GeomId::Def::ECal::kModuleLSB) / 2;
1224 }
1225 
1226 int ND::GeomId::ECal::GetBarLayer(TGeometryId i) {
1227  TSettableGeometryId id(i);
1228  if (ND::GeomId::ECal::GetBarECal(i)<0) return -1;
1230  != id.GetField(ND::GeomId::Def::ECal::kSeqIdMSB,
1231  ND::GeomId::Def::ECal::kSeqIdLSB)) return -1;
1232 
1233  return id.GetField(ND::GeomId::Def::ECal::Bar::kLayerMSB,
1234  ND::GeomId::Def::ECal::Bar::kLayerLSB);
1235 }
1236 
1237 int ND::GeomId::ECal::GetBarNumber(TGeometryId i) {
1238  TSettableGeometryId id(i);
1239  if (ND::GeomId::ECal::GetBarECal(i)<0) return -1;
1241  != id.GetField(ND::GeomId::Def::ECal::kSeqIdMSB,
1242  ND::GeomId::Def::ECal::kSeqIdLSB)) return -1;
1243 
1244  return id.GetField(ND::GeomId::Def::ECal::Bar::kBarMSB,
1245  ND::GeomId::Def::ECal::Bar::kBarLSB);
1246 }
1247 
1248 ////////////////////////////////////////////////////////////
1249 // Downstream ECal Geometry Identifiers.
1250 ////////////////////////////////////////////////////////////
1251 bool ND::GeomId::DSECal::IsDSECal(TGeometryId i) {
1252  TSettableGeometryId id(i);
1253  return (ND::GeomId::Def::kDSECal
1254  == id.GetField(ND::GeomId::Def::kDetectorIdMSB,
1256 }
1257 
1258 ND::TGeometryId ND::GeomId::DSECal::Detector() {
1259  return ND::GeomId::ECal::Module(ND::GeomId::Def::kDSECal,0,0);
1260 }
1261 
1262 ND::TGeometryId ND::GeomId::DSECal::Layer(int layer) {
1263  return ND::GeomId::ECal::Layer(ND::GeomId::Def::kDSECal,0,0,layer);
1264 }
1265 
1266 int ND::GeomId::DSECal::GetLayer(TGeometryId i) {
1267  if (!ND::GeomId::DSECal::IsDSECal(i)) return -1;
1268  return ND::GeomId::ECal::GetLayerNumber(i);
1269 }
1270 
1271 ND::TGeometryId ND::GeomId::DSECal::Radiator(int rad) {
1272  return ND::GeomId::ECal::Radiator(ND::GeomId::Def::kDSECal,0,0,rad);
1273 }
1274 
1276  if (!ND::GeomId::DSECal::IsDSECal(i)) return -1;
1277  return ND::GeomId::ECal::GetRadiatorNumber(i);
1278 }
1279 
1280 ND::TGeometryId ND::GeomId::DSECal::Bar(int layer, int bar) {
1281  return ND::GeomId::ECal::Bar(ND::GeomId::Def::kDSECal,
1282  0,0,layer,bar);
1283 }
1284 
1286  if (!ND::GeomId::DSECal::IsDSECal(i)) return -1;
1287  return ND::GeomId::ECal::GetBarLayer(i);
1288 }
1289 
1290 int ND::GeomId::DSECal::GetBarNumber(TGeometryId i) {
1291  if (!ND::GeomId::DSECal::IsDSECal(i)) return -1;
1292  return ND::GeomId::ECal::GetBarNumber(i);
1293 }
1294 
1295 ////////////////////////////////////////////////////////////
1296 // Tracker ECal Geometry Identifiers.
1297 ////////////////////////////////////////////////////////////
1298 bool ND::GeomId::TECal::IsTECal(TGeometryId i) {
1299  TSettableGeometryId id(i);
1300  return (ND::GeomId::Def::kTECal
1301  == id.GetField(ND::GeomId::Def::kDetectorIdMSB,
1303 }
1304 
1305 ND::TGeometryId ND::GeomId::TECal::Module(int clam, int module) {
1306  return ND::GeomId::ECal::Module(ND::GeomId::Def::kTECal,
1307  clam,module);
1308 }
1309 
1310 ND::TGeometryId ND::GeomId::TECal::Layer(int clam, int module, int layer) {
1311  return ND::GeomId::ECal::Layer(ND::GeomId::Def::kTECal,
1312  clam,module,layer);
1313 }
1314 
1315 ND::TGeometryId ND::GeomId::TECal::Radiator(int clam, int module, int rad) {
1316  return ND::GeomId::ECal::Radiator(ND::GeomId::Def::kTECal,
1317  clam,module,rad);
1318 }
1319 
1320 ND::TGeometryId ND::GeomId::TECal::Bar(int clam, int mod, int layer, int bar) {
1321  return ND::GeomId::ECal::Bar(ND::GeomId::Def::kTECal,
1322  clam,mod,layer,bar);
1323 }
1324 
1325 int ND::GeomId::TECal::GetModuleNumber(TGeometryId i) {
1326  if (!ND::GeomId::TECal::IsTECal(i)) return -1;
1327  return ND::GeomId::ECal::GetModuleNumber(i);
1328 }
1329 
1331  if (!ND::GeomId::TECal::IsTECal(i)) return -1;
1332  return ND::GeomId::ECal::GetModuleClam(i);
1333 }
1334 
1335 int ND::GeomId::TECal::GetLayerNumber(TGeometryId i) {
1336  if (!ND::GeomId::TECal::IsTECal(i)) return -1;
1337  return ND::GeomId::ECal::GetLayerNumber(i);
1338 }
1339 
1341  if (!ND::GeomId::TECal::IsTECal(i)) return -1;
1342  return ND::GeomId::ECal::GetLayerClam(i);
1343 }
1344 
1345 int ND::GeomId::TECal::GetLayerModule(TGeometryId i) {
1346  if (!ND::GeomId::TECal::IsTECal(i)) return -1;
1347  return ND::GeomId::ECal::GetLayerModule(i);
1348 }
1349 
1350 int ND::GeomId::TECal::GetRadiatorNumber(TGeometryId i) {
1351  if (!ND::GeomId::TECal::IsTECal(i)) return -1;
1352  return ND::GeomId::ECal::GetRadiatorNumber(i);
1353 }
1354 
1356  if (!ND::GeomId::TECal::IsTECal(i)) return -1;
1357  return ND::GeomId::ECal::GetRadiatorClam(i);
1358 }
1359 
1360 int ND::GeomId::TECal::GetRadiatorModule(TGeometryId i) {
1361  if (!ND::GeomId::TECal::IsTECal(i)) return -1;
1362  return ND::GeomId::ECal::GetRadiatorModule(i);
1363 }
1364 
1365 int ND::GeomId::TECal::GetBarNumber(TGeometryId i) {
1366  if (!ND::GeomId::TECal::IsTECal(i)) return -1;
1367  return ND::GeomId::ECal::GetBarNumber(i);
1368 }
1369 
1370 int ND::GeomId::TECal::GetBarLayer(TGeometryId i) {
1371  if (!ND::GeomId::TECal::IsTECal(i)) return -1;
1372  return ND::GeomId::ECal::GetBarLayer(i);
1373 }
1374 
1375 int ND::GeomId::TECal::GetBarClam(TGeometryId i) {
1376  if (!ND::GeomId::TECal::IsTECal(i)) return -1;
1377  return ND::GeomId::ECal::GetBarClam(i);
1378 }
1379 
1380 int ND::GeomId::TECal::GetBarModule(TGeometryId i) {
1381  if (!ND::GeomId::TECal::IsTECal(i)) return -1;
1382  return ND::GeomId::ECal::GetBarModule(i);
1383 }
1384 
1385 ////////////////////////////////////////////////////////////
1386 // P0D ECal Geometry Identifiers.
1387 ////////////////////////////////////////////////////////////
1388 bool ND::GeomId::PECal::IsPECal(TGeometryId i) {
1389  TSettableGeometryId id(i);
1390  return (ND::GeomId::Def::kPECal
1391  == id.GetField(ND::GeomId::Def::kDetectorIdMSB,
1393 }
1394 
1395 ND::TGeometryId ND::GeomId::PECal::Module(int clam, int module) {
1396  return ND::GeomId::ECal::Module(ND::GeomId::Def::kPECal,
1397  clam,module);
1398 }
1399 
1400 ND::TGeometryId ND::GeomId::PECal::Layer(int clam, int module, int layer) {
1401  return ND::GeomId::ECal::Layer(ND::GeomId::Def::kPECal,
1402  clam,module,layer);
1403 }
1404 
1405 ND::TGeometryId ND::GeomId::PECal::Radiator(int clam, int module, int rad) {
1406  return ND::GeomId::ECal::Radiator(ND::GeomId::Def::kPECal,
1407  clam,module,rad);
1408 }
1409 
1410 ND::TGeometryId ND::GeomId::PECal::Bar(int clam, int mod, int layer, int bar) {
1411  return ND::GeomId::ECal::Bar(ND::GeomId::Def::kPECal,
1412  clam,mod,layer,bar);
1413 }
1414 
1415 int ND::GeomId::PECal::GetModuleNumber(TGeometryId i) {
1416  if (!ND::GeomId::PECal::IsPECal(i)) return -1;
1417  return ND::GeomId::ECal::GetModuleNumber(i);
1418 }
1419 
1421  if (!ND::GeomId::PECal::IsPECal(i)) return -1;
1422  return ND::GeomId::ECal::GetModuleClam(i);
1423 }
1424 
1425 int ND::GeomId::PECal::GetLayerNumber(TGeometryId i) {
1426  if (!ND::GeomId::PECal::IsPECal(i)) return -1;
1427  return ND::GeomId::ECal::GetLayerNumber(i);
1428 }
1429 
1431  if (!ND::GeomId::PECal::IsPECal(i)) return -1;
1432  return ND::GeomId::ECal::GetLayerClam(i);
1433 }
1434 
1435 int ND::GeomId::PECal::GetLayerModule(TGeometryId i) {
1436  if (!ND::GeomId::PECal::IsPECal(i)) return -1;
1437  return ND::GeomId::ECal::GetLayerModule(i);
1438 }
1439 
1440 int ND::GeomId::PECal::GetRadiatorNumber(TGeometryId i) {
1441  if (!ND::GeomId::PECal::IsPECal(i)) return -1;
1442  return ND::GeomId::ECal::GetRadiatorNumber(i);
1443 }
1444 
1446  if (!ND::GeomId::PECal::IsPECal(i)) return -1;
1447  return ND::GeomId::ECal::GetRadiatorClam(i);
1448 }
1449 
1450 int ND::GeomId::PECal::GetRadiatorModule(TGeometryId i) {
1451  if (!ND::GeomId::PECal::IsPECal(i)) return -1;
1452  return ND::GeomId::ECal::GetRadiatorModule(i);
1453 }
1454 
1455 int ND::GeomId::PECal::GetBarNumber(TGeometryId i) {
1456  if (!ND::GeomId::PECal::IsPECal(i)) return -1;
1457  return ND::GeomId::ECal::GetBarNumber(i);
1458 }
1459 
1460 int ND::GeomId::PECal::GetBarLayer(TGeometryId i) {
1461  if (!ND::GeomId::PECal::IsPECal(i)) return -1;
1462  return ND::GeomId::ECal::GetBarLayer(i);
1463 }
1464 
1465 int ND::GeomId::PECal::GetBarClam(TGeometryId i) {
1466  if (!ND::GeomId::PECal::IsPECal(i)) return -1;
1467  return ND::GeomId::ECal::GetBarClam(i);
1468 }
1469 
1470 int ND::GeomId::PECal::GetBarModule(TGeometryId i) {
1471  if (!ND::GeomId::PECal::IsPECal(i)) return -1;
1472  return ND::GeomId::ECal::GetBarModule(i);
1473 }
1474 
1475 ////////////////////////////////////////////////////////////
1476 // SMRD Geometry Identifiers.
1477 ////////////////////////////////////////////////////////////
1478 bool ND::GeomId::SMRD::IsSMRD(TGeometryId i) {
1479  TSettableGeometryId id(i);
1480  return (ND::GeomId::Def::kSMRD
1481  == id.GetField(ND::GeomId::Def::kDetectorIdMSB,
1483 }
1484 
1485 ND::TGeometryId ND::GeomId::SMRD::Module(int clam, int yoke,
1486  int layer, int slot) {
1487  TSettableGeometryId id;
1488  id.SetField(ND::GeomId::Def::kSMRD,
1491  id.SetField(ND::GeomId::Def::SMRD::kGlobal,
1493  ND::GeomId::Def::SMRD::kSeqIdLSB);
1496  ND::GeomId::Def::SMRD::Global::kSeqIdLSB);
1497  id.SetField(clam,
1499  ND::GeomId::Def::SMRD::Global::Module::kClamLSB);
1500  id.SetField(yoke,
1502  ND::GeomId::Def::SMRD::Global::Module::kYokeLSB);
1503  id.SetField(layer,
1505  ND::GeomId::Def::SMRD::Global::Module::kLayerLSB);
1506  id.SetField(slot,
1508  ND::GeomId::Def::SMRD::Global::Module::kSlotLSB);
1509  return id;
1510 }
1511 
1513  TSettableGeometryId id(i);
1514  if (ND::GeomId::Def::kSMRD
1515  != id.GetField(ND::GeomId::Def::kDetectorIdMSB,
1516  ND::GeomId::Def::kDetectorIdLSB)) return -1;
1518  != id.GetField(ND::GeomId::Def::SMRD::kSeqIdMSB,
1519  ND::GeomId::Def::SMRD::kSeqIdLSB)) return -1;
1522  ND::GeomId::Def::SMRD::Global::kSeqIdLSB)) return -1;
1523 
1525  ND::GeomId::Def::SMRD::Global::Module::kClamLSB);
1526 }
1527 
1528 int ND::GeomId::SMRD::GetModuleYoke(TGeometryId i) {
1529  TSettableGeometryId id(i);
1530  if (ND::GeomId::Def::kSMRD
1531  != id.GetField(ND::GeomId::Def::kDetectorIdMSB,
1532  ND::GeomId::Def::kDetectorIdLSB)) return -1;
1534  != id.GetField(ND::GeomId::Def::SMRD::kSeqIdMSB,
1535  ND::GeomId::Def::SMRD::kSeqIdLSB)) return -1;
1538  ND::GeomId::Def::SMRD::Global::kSeqIdLSB)) return -1;
1539 
1540 
1542  ND::GeomId::Def::SMRD::Global::Module::kYokeLSB);
1543 }
1544 
1545 int ND::GeomId::SMRD::GetModuleLayer(TGeometryId i) {
1546  TSettableGeometryId id(i);
1547  if (ND::GeomId::Def::kSMRD
1548  != id.GetField(ND::GeomId::Def::kDetectorIdMSB,
1549  ND::GeomId::Def::kDetectorIdLSB)) return -1;
1551  != id.GetField(ND::GeomId::Def::SMRD::kSeqIdMSB,
1552  ND::GeomId::Def::SMRD::kSeqIdLSB)) return -1;
1555  ND::GeomId::Def::SMRD::Global::kSeqIdLSB)) return -1;
1556 
1557 
1559  ND::GeomId::Def::SMRD::Global::Module::kLayerLSB);
1560 }
1561 
1562 int ND::GeomId::SMRD::GetModuleSlot(TGeometryId i) {
1563  TSettableGeometryId id(i);
1564  if (ND::GeomId::Def::kSMRD
1565  != id.GetField(ND::GeomId::Def::kDetectorIdMSB,
1566  ND::GeomId::Def::kDetectorIdLSB)) return -1;
1568  != id.GetField(ND::GeomId::Def::SMRD::kSeqIdMSB,
1569  ND::GeomId::Def::SMRD::kSeqIdLSB)) return -1;
1572  ND::GeomId::Def::SMRD::Global::kSeqIdLSB)) return -1;
1573 
1574 
1576  ND::GeomId::Def::SMRD::Global::Module::kSlotLSB);
1577 }
1578 
1579 ND::TGeometryId ND::GeomId::SMRD::Bar(int clam, int yoke,
1580  int layer, int slot, int bar) {
1581  TSettableGeometryId id;
1582  id.SetField(ND::GeomId::Def::kSMRD,
1587  ND::GeomId::Def::SMRD::kSeqIdLSB);
1588  id.SetField(clam,
1590  ND::GeomId::Def::SMRD::Bar::kClamLSB);
1591  id.SetField(yoke,
1593  ND::GeomId::Def::SMRD::Bar::kYokeLSB);
1594  id.SetField(layer,
1596  ND::GeomId::Def::SMRD::Bar::kLayerLSB);
1597  id.SetField(slot,
1599  ND::GeomId::Def::SMRD::Bar::kSlotLSB);
1600  id.SetField(bar,
1602  ND::GeomId::Def::SMRD::Bar::kBarLSB);
1603  return id;
1604 }
1605 
1606 int ND::GeomId::SMRD::GetBarClam(TGeometryId i) {
1607  TSettableGeometryId id(i);
1608  if (ND::GeomId::Def::kSMRD
1609  != id.GetField(ND::GeomId::Def::kDetectorIdMSB,
1610  ND::GeomId::Def::kDetectorIdLSB)) return -1;
1612  != id.GetField(ND::GeomId::Def::SMRD::kSeqIdMSB,
1613  ND::GeomId::Def::SMRD::kSeqIdLSB)) return -1;
1614 
1615  return id.GetField(ND::GeomId::Def::SMRD::Bar::kClamMSB,
1616  ND::GeomId::Def::SMRD::Bar::kClamLSB);
1617 }
1618 
1619 int ND::GeomId::SMRD::GetBarYoke(TGeometryId i) {
1620  TSettableGeometryId id(i);
1621  if (ND::GeomId::Def::kSMRD
1622  != id.GetField(ND::GeomId::Def::kDetectorIdMSB,
1623  ND::GeomId::Def::kDetectorIdLSB)) return -1;
1625  != id.GetField(ND::GeomId::Def::SMRD::kSeqIdMSB,
1626  ND::GeomId::Def::SMRD::kSeqIdLSB)) return -1;
1627 
1628  return id.GetField(ND::GeomId::Def::SMRD::Bar::kYokeMSB,
1629  ND::GeomId::Def::SMRD::Bar::kYokeLSB);
1630 }
1631 
1632 int ND::GeomId::SMRD::GetBarLayer(TGeometryId i) {
1633  TSettableGeometryId id(i);
1634  if (ND::GeomId::Def::kSMRD
1635  != id.GetField(ND::GeomId::Def::kDetectorIdMSB,
1636  ND::GeomId::Def::kDetectorIdLSB)) return -1;
1638  != id.GetField(ND::GeomId::Def::SMRD::kSeqIdMSB,
1639  ND::GeomId::Def::SMRD::kSeqIdLSB)) return -1;
1640 
1641  return id.GetField(ND::GeomId::Def::SMRD::Bar::kLayerMSB,
1642  ND::GeomId::Def::SMRD::Bar::kLayerLSB);
1643 }
1644 
1645 int ND::GeomId::SMRD::GetBarSlot(TGeometryId i) {
1646  TSettableGeometryId id(i);
1647  if (ND::GeomId::Def::kSMRD
1648  != id.GetField(ND::GeomId::Def::kDetectorIdMSB,
1649  ND::GeomId::Def::kDetectorIdLSB)) return -1;
1651  != id.GetField(ND::GeomId::Def::SMRD::kSeqIdMSB,
1652  ND::GeomId::Def::SMRD::kSeqIdLSB)) return -1;
1653 
1654  return id.GetField(ND::GeomId::Def::SMRD::Bar::kSlotMSB,
1655  ND::GeomId::Def::SMRD::Bar::kSlotLSB);
1656 }
1657 
1658 int ND::GeomId::SMRD::GetBarNumber(TGeometryId i) {
1659  TSettableGeometryId id(i);
1660  if (ND::GeomId::Def::kSMRD
1661  != id.GetField(ND::GeomId::Def::kDetectorIdMSB,
1662  ND::GeomId::Def::kDetectorIdLSB)) return -1;
1664  != id.GetField(ND::GeomId::Def::SMRD::kSeqIdMSB,
1665  ND::GeomId::Def::SMRD::kSeqIdLSB)) return -1;
1666 
1667  return id.GetField(ND::GeomId::Def::SMRD::Bar::kBarMSB,
1668  ND::GeomId::Def::SMRD::Bar::kBarLSB);
1669 }
1670 
1671 ////////////////////////////////////////////////////////////
1672 // INGRID Geometry Identifiers.
1673 ////////////////////////////////////////////////////////////
1674 
1676  int objType, int obj, int trk, int proj, int scinti){
1677  TSettableGeometryId id;
1678  id.SetField(ND::GeomId::Def::kINGRID,
1681  id.SetField(objType,
1683  ND::GeomId::Def::INGRID::kIngridObjIDLSB);
1684  id.SetField(obj,
1686  ND::GeomId::Def::INGRID::kIngridModNumLSB);
1687  id.SetField(trk,
1689  ND::GeomId::Def::INGRID::kIngridTrkNumLSB);
1690  id.SetField(proj,
1692  ND::GeomId::Def::INGRID::kIngridProjLSB);
1693  id.SetField(scinti,
1695  ND::GeomId::Def::INGRID::kIngridSciNumLSB);
1696  return id;
1697 }
1698 
1700  int obj, int trk, int proj, int scinti){
1702  ND::GeomId::Def::INGRID::kIngridModule, obj, trk, proj, scinti);
1703 }
1704 
1705 ND::TGeometryId ND::GeomId::INGRID::VertVetoScintillator(int obj, int scinti){
1709 }
1710 
1711 ND::TGeometryId ND::GeomId::INGRID::HorzVetoScintillator(int obj, int scinti){
1715 }
bool IsFGD1(TGeometryId id)
TGeometryId VertVetoScintillator(int veto, int scinti)
The geometry of a vertical veto scintillator.
TGeometryId Bar(int p0dule, int layer, int bar)
TGeometryId Module(int mod)
TGeometryId Container(int ecal, int clam, int module)
int GetRadiatorClam(TGeometryId id)
TGeometryId Layer(int clam, int module, int layer)
The layer within the ecal.
TGeometryId ECalRadiator(int radiator)
int GetTargetRadiator(TGeometryId id)
int GetLayer(TGeometryId id)
int GetBarClam(TGeometryId id)
TGeometryId MicroMega(int tpc, int half, int mm)
const GeomIdBit kDetectorIdLSB
The least significant bit of the detector identifier.
TGeometryId Module(int clam, int module)
The geometry identifier for the tracker ecal modules.
const GeomIdBit kIngridSciNumMSB
TGeometryId Radiator(int clam, int module, int radiator)
The geometry identifier for the radiators.
int GetSuperP0Dule(TGeometryId id)
const GeomIdBit kIngridObjIDMSB
TGeometryId Bar(int clam, int module, int layer, int bar)
The geometry identifiers for the scintillators.
int GetP0Dule(TGeometryId id)
int GetModuleClam(TGeometryId id)
int GetTarget(TGeometryId id)
TGeometryId Bar(int clam, int yoke, int layer, int slot, int bar)
The geometry identifer for a SMRD bar.
TGeometryId Bar(int layer, int bar)
The geometry identifiers for DSECal scintillators.
int GetTarget(TGeometryId id)
const GeomIdBit kSeqIdMSB
TGeometryId Target(int i)
The geometry identifier for the targets.
TGeometryId Module(int clam, int yoke, int layer, int slot)
The geometry identifier for a SMRD module.
int GetBarLayer(TGeometryId id)
TGeometryId Radiator(int clam, int module, int radiator)
The geometry identifier for the radiators.
int GetRadiatorClam(TGeometryId id)
TGeometryId Module(int ecal, int clam, int module)
TGeometryId Layer(int fgd, int module, int layer)
int GetMicroMegaTPC(TGeometryId id)
const GeomIdBit kFieldMSB
The sequence value for this type of global volume.
int GetLayerFGD(TGeometryId id)
bool IsTPC1(TGeometryId id)
Check to see if the id is for a TPCn.
TGeometryId FGD(int mod)
const GeomIdBit kIngridTrkNumMSB
const GeomIdBit kHalfMSB
The half of the drift volume.
TGeometryId Radiator(int ecal, int clam, int module, int radiator)
The geometry identifier for the radiators.
TGeometryId FGD1()
The geometry identifier for FGD1.
TGeometryId Empty()
Return the geometry id indication None.
Definition: ND280GeomId.cxx:63
int GetBarNumber(TGeometryId id)
TGeometryId Bar(int ecal, int clam, int module, int layer, int bar)
The geometry identifiers for the scintillators.
int GetLayerClam(TGeometryId id)
const GeomIdBit kDetectorIdMSB
TGeometryId Scintillator(int objType, int obj, int trk, int proj, int scinti)
bool IsSMRD(TGeometryId id)
Test if this id is for the SMRD.
int GetModuleClam(TGeometryId id)
Access the information for an ECal Module.
A special case for one of a kind global volumes.
One of the brass target radiators.
One of the water target modules.
const GeomIdBit kModuleMSB
bool IsDSECal(TGeometryId id)
Check if the id corresponds to the DSECal.
const GeomIdBit kFieldMSB
The sequence value for this type of global volume.
bool IsPECal(TGeometryId id)
Check if the id corresponds to the PECal.
int GetPadTPC(TGeometryId id)
int GetRadiator(TGeometryId id)
int GetModuleECal(TGeometryId id)
Access the information for an ECal Module.
const TVector3 field
Constants.
TGeometryId Layer(int layer)
The layer within the ecal.
bool IsTPC(TGeometryId id)
Check to see if the id is for a TPC.
TGeometryId Target(int target)
TGeometryId Pad(int tpc, int half, int mm, int pad)
TGeometryId Module(int clam, int module)
The geometry identifier for the tracker ecal modules.
TGeometryId TargetRadiator(int radiator)
int GetBarFGD(TGeometryId id)
int GetLayerClam(TGeometryId id)
int GetBarLayer(TGeometryId id)
TGeometryId ModScintillator(int mod, int trk, int proj, int scinti)
The geometry of a module scintillator.
int GetModule(TGeometryId id)
int GetBarClam(TGeometryId id)
const GeomIdBit kIngridProjMSB
TGeometryId Detector()
The geometry identifier for the downstream ecal detector.
int GetModuleClam(TGeometryId id)
Access the information for an ECal Module.
TGeometryId HorzVetoScintillator(int veto, int scinti)
The geometry of an horizontal veto scintillator.
TGeometryId SuperP0Dule(int sP0Dule)
int GetBarClam(TGeometryId id)
int GetFGD(TGeometryId id)
Get the FGD number. This returns -1 if the id is invalid.
TGeometryId TPC2()
The geometry identifier for TPC2.
TGeometryId Detector()
Define a geometry identifier to the entire P0D detector.
Definition: ND280GeomId.cxx:84
const GeomIdBit kIngridModNumMSB
One of the ECal scintillator layers.
The sequence for all of the modules in the SMRD.
bool IsPad(TGeometryId id)
Check if a TGeometryId is a PAD.
TGeometryId Layer(int ecal, int clam, int module, int layer)
The layer within the ecal.
int GetECalRadiator(TGeometryId id)
TGeometryId Bar(int fgd, int module, int layer, int bar)
int GetRadiatorECal(TGeometryId id)
bool IsTECal(TGeometryId id)
Check if the id corresponds to the TECal.
const GeomIdBit kSeqIdMSB
TGeometryId TPC3()
The geometry identifier for TPC3.
const GeomIdBit kFieldMSB
The sequence value for this type of global volume.
bool IsMicroMega(TGeometryId id)
Check if a TGeometryId is a MicroMega.
const GeomIdBit kSeqIdMSB
int GetBarP0Dule(TGeometryId id)
const GeomIdBit kSeqIdMSB
int GetSubSystem(TGeometryId id)
Get the sub-system type.
Definition: ND280GeomId.cxx:67
int GetBarECal(TGeometryId id)
TGeometryId Radiator(int radiator)
The geometry identifier for the radiators.
int GetLayerECal(TGeometryId id)
A special case for one of a kind global volumes.
const GeomIdBit kTPCMSB
The TPC withing the tracker. 0) TPC1 1) TPC2 2) TPC3.
bool IsFGD(TGeometryId id)
Check if this is an FGD id.
const GeomIdBit kSlotMSB
The slot within a layer.
TGeometryId P0Dule(int p0dule)
TGeometryId FGD2()
The geometry identifier for FGD2. FGD2 has the water targets.
TGeometryId Layer(int clam, int module, int layer)
The layer within the ecal.
bool IsP0D(TGeometryId id)
Check if the id is for the P0D.
Definition: ND280GeomId.cxx:77
const GeomIdBit kSeqIdMSB
TGeometryId TPC1()
The geometry identifier for TPC1.
TGeometryId Bar(int clam, int module, int layer, int bar)
The geometry identifiers for the scintillators.
const GeomIdBit kSlotMSB
The slot within a layer.