HighLAND
ND280GeomIdDef.hxx
1 #ifndef ND280GeomIdDef_hxx_seen
2 #define ND280GeomIdDef_hxx_seen
3 
4 namespace ND {
5  namespace GeomId {
6  /// Define the fields used to create a unique identifier for elements
7  /// in the ND280 geometry. This is a 32 bit field with the bits
8  /// number from 0 (least significant bit or LSB) to 31 (most
9  /// significant bit or MSB). The bit fields are defined as follows
10  ///
11  /// \code
12  /// r dddddd sssssssssssssssssssssssss
13  /// r(1) -- Reserved
14  /// d(6) -- The sub-detector identifier
15  /// s(25) -- The sub-detector specific field
16  /// \endcode
17  ///
18  /// The value of all constants and order of all enumerations defined
19  /// below is significant and must not be changed.
20  namespace Def {
21 #define MAKE_MASK(msb,lsb) (((1<<(((msb)-(lsb))+1))-1)<<(lsb))
22 
23  /// A bitwise mask for a field;
24  typedef unsigned long GeomIdMask;
25 
26  /// Bit number. The bits are counted 0 (LSB) to 31 (MSB)
27  typedef unsigned long GeomIdBit;
28 
29  /// A value that can be used to initialize an empty geometry
30  /// identifier.
31  const GeomIdMask kEmptyId = 0;
32 
33  /// The most significant bit of the reserved guard bit.
34  const GeomIdBit kReserved1MSB = 31;
35  /// The least significant bit of the reserved guard bit. This bit
36  /// must be zero for a geometry Id. The value of 1 is reserved
37  /// for future use to indicate an electronics channel number.
38  const GeomIdBit kReserved1LSB = 31;
39 
40  /// The mask to select the first reserved field. The value in the
41  /// first reserved field must be zero.
42  const GeomIdMask kReserved1Mask
43  = MAKE_MASK(kReserved1MSB,kReserved1LSB);
44 
45  /// The most significant bit of the detector identifier. This is
46  /// a 6 bit field.
47  const GeomIdBit kDetectorIdMSB = kReserved1LSB-1;
48 
49  /// The least significant bit of the detector identifier.
50  const GeomIdBit kDetectorIdLSB = kDetectorIdMSB-5;
51 
52  /// The mask to select the detector identifier
53  const GeomIdMask kDetectorIdMask
54  = MAKE_MASK(kDetectorIdMSB,kDetectorIdLSB);
55 
56  /// Enumeration defining the detector identifiers. The detector
57  /// identifiers are used to uniquely define which sub-detector
58  /// containes a geometry element. All geometry elements are by
59  /// definition within a single sub-detector. The identifiers are
60  /// held in the bit field defined by DetectorMask. The conversion
61  /// from a sub-detector identifier to a field value is
62  /// (value<<DetectorLSB). The conversion from a field value to a
63  /// sub-detector identifier is ((field&DetectorMask)>>DetectorLSB)
64  enum DetectorId {
65  kROOTGeoNodeId = 0,
66  kP0D,
67  kTPC,
68  kFGD,
69  kDSECal,
70  kTECal,
71  kPECal,
72  kSMRD,
73  kINGRID
74  };
75 
76  /// The most significant bit in the field reserved to the
77  /// sub-detector.
78  const GeomIdBit kSubDetectorMSB = kDetectorIdLSB-1;
79  /// The least significant bit in the field reserved to the
80  /// sub-detector.
81  const GeomIdBit kSubDetectorLSB = 0;
82 
83  /// The mask to select the sub-detector detector fields.
84  const GeomIdMask kSubDetectorMask = MAKE_MASK(kSubDetectorMSB,
85  kSubDetectorLSB);
86 
87  /// Define the p0d specific constants used to decode a geometry
88  /// identifier. The P0D field is 25 bits divided into a sequence
89  /// identifier, and a field value.
90  ///
91  /// \code
92  /// sssss ffffffffffffffffffff
93  /// s(4) -- The sequence identifier (0 to 15)
94  /// f(21) -- The field value associated with a sequence id.
95  /// \endcode
96  ///
97  /// Depending on the particular sequence, the field values may be
98  /// further sub-divided.
99  namespace P0D {
100  /// Define the sequences required in the P0D.
101  enum P0DSeqId {
102  /// A global volume. This is used for identifiers that
103  /// refer to volumes which contain other geometry
104  /// identifiers.
105  kGlobal = 0,
106  /// A scintillator bar.
108  };
109 
110  /// The most significant bit of the sequence identifier field.
111  /// The sequence id field can have values between 0-15.
112  const GeomIdBit kSeqIdMSB = Def::kSubDetectorMSB;
113  const GeomIdBit kSeqIdLSB = kSeqIdMSB - 3;
114  const GeomIdMask kSeqIdMask = MAKE_MASK(kSeqIdMSB,kSeqIdLSB);
115 
116  /// A field that is unique to each global volume. A global
117  /// volume is any volume (with a geometry identifier) that
118  /// contains other volumes with geometry identifiers.
119  /// Examples are the super-P0Dules, and the P0Dules. The bits
120  /// are defined as
121  ///
122  /// \code
123  /// gggggggg fffffffffff
124  /// g(8) -- The type of global volume.
125  /// f(13) -- The field value.
126  /// \endcode
127  namespace Global {
128  /// @{ Define a field to hold the type of global volume
129  /// being identified.
130  const GeomIdBit kSeqIdMSB = Def::P0D::kSeqIdLSB-1;
131  const GeomIdBit kSeqIdLSB = kSeqIdMSB-7;
132  const GeomIdMask kSeqIdMask=MAKE_MASK(kSeqIdMSB,kSeqIdLSB);
133  /// @}
134 
135  enum GlobalSeqId {
136  /// A special case for one of a kind global volumes
138  /// One of the super-P0Dules
140  /// One of the P0Dules
142  /// One of the water target modules
144  /// One of the ECal Radiators
146  /// One of the brass target radiators
148  };
149 
150  /// @{ The sequence value for this type of global volume.
151  const GeomIdBit kFieldMSB = kSeqIdLSB-1;
152  const GeomIdBit kFieldLSB = 0;
153  const GeomIdMask kFieldMask=MAKE_MASK(kFieldMSB,kFieldLSB);
154  /// @}
155  };
156 
157  /// A field that is unique for each scintillator bar.
158  /// \code
159  /// sss x pppppp bbbbbbbbbbb
160  /// s(3) -- The super-P0Dule (0 to 3)
161  /// x(1) -- The layer in the super P0Dule (0=x, 1=y)
162  /// p(6) -- The P0Dule (0 to 40)
163  /// b(11) -- The bar number (0 to 125 or 0 to 133)
164  /// \endcode
165  namespace Bar {
166  /// @{ The super-P0Dule number within the detector. The
167  /// numbering starts at the upstream end and starts from
168  /// zero. 0) USECal, 1) USWT, 2) CWT, 3) CECal
169  const GeomIdBit kSP0DuleMSB = Def::P0D::kSeqIdLSB-1;
170  const GeomIdBit kSP0DuleLSB = kSP0DuleMSB-2;
171  const GeomIdMask kSP0DuleMask = MAKE_MASK(kSP0DuleMSB,
172  kSP0DuleLSB);
173  /// @}
174 
175  /// @{ The layer within the P0Dule. Layer zero is X, and
176  /// layer one is Y.
177  const GeomIdBit kLayerMSB = kSP0DuleLSB-1;
178  const GeomIdBit kLayerLSB = kLayerMSB;
179  const GeomIdMask kLayerMask=MAKE_MASK(kLayerMSB,kLayerLSB);
180  /// @}
181 
182  /// @{ The P0Dule number within the super-P0Dule. The
183  /// P0Dule numbering starts from zero.
184  const GeomIdBit kP0DuleMSB = kLayerLSB-1;
185  const GeomIdBit kP0DuleLSB = kP0DuleMSB-5;
186  const GeomIdMask kP0DuleMask = MAKE_MASK(kP0DuleMSB,
187  kP0DuleLSB);
188  /// @}
189 
190  /// @{ Define the field to hold the bar number within a
191  /// layer. The bars are numbered 0 to 125 (or 133) with
192  /// Bar 0 at the most negative coordinate.
193  const GeomIdBit kBarMSB = kP0DuleLSB-1;
194  const GeomIdBit kBarLSB = kBarMSB-10;
195  const GeomIdMask kBarMask = MAKE_MASK(kBarMSB,kBarLSB);
196  /// @}
197  };
198  };
199 
200  /// Define the TPC specific constants used to decode a geometry
201  /// identifier.
202  namespace TPC {
203  /// Define the sequences required in the TPC.
204  enum TPCSeqId {
205  /// A global volume. This is used for identifiers that
206  /// refer to volumes which contain other geometry
207  /// identifiers.
208  kGlobal = 0,
209  /// A micromega pad.
211  };
212 
213  /// The most significant bit of the sequence identifier field.
214  /// The sequence id field can have values between 0-15.
215  const GeomIdBit kSeqIdMSB = Def::kSubDetectorMSB;
216  const GeomIdBit kSeqIdLSB = kSeqIdMSB - 3;
217  const GeomIdMask kSeqIdMask = MAKE_MASK(kSeqIdMSB,kSeqIdLSB);
218 
219  namespace Global {
220  /// @{ Define a field to hold the type of global volume
221  /// being identified.
222  const GeomIdBit kSeqIdMSB = Def::TPC::kSeqIdLSB-1;
223  const GeomIdBit kSeqIdLSB = kSeqIdMSB-7;
224  const GeomIdMask kSeqIdMask=MAKE_MASK(kSeqIdMSB,kSeqIdLSB);
225  /// @}
226 
227  enum GlobalSeqId {
228  /// One of the TPC overall volumes (TPC1, TPC2, or TPC3)
229  kTPC,
230  };
231 
232  /// @{ The sequence value for this type of global volume.
233  const GeomIdBit kFieldMSB = kSeqIdLSB-1;
234  const GeomIdBit kFieldLSB = 0;
235  const GeomIdMask kFieldMask=MAKE_MASK(kFieldMSB,kFieldLSB);
236  /// @}
237  };
238 
239  /// A field that is unique for each TPC micromega pad.
240  ///
241  /// \code
242  /// sss x f ppppp bbbbbbbbbbb
243  /// s(3) -- The tpc (0 to 2)
244  /// x(1) -- The half of the drift volume (0=-x, 1=+x)
245  /// f(1) -- The pad flag. This is 1 if the id is for a pad.
246  /// p(5) -- The micro mega (0 to 16)
247  /// b(11) -- The pad number (0 to 1727)
248  /// \endcode
249  namespace Pad {
250  /// @{ The TPC withing the tracker. 0) TPC1 1) TPC2 2) TPC3
251  const GeomIdBit kTPCMSB = Def::TPC::kSeqIdLSB-1;
252  const GeomIdBit kTPCLSB = kTPCMSB-2;
253  const GeomIdMask kTPCMask = MAKE_MASK(kTPCMSB, kTPCLSB);
254  /// @}
255 
256  /// @{ The half of the drift volume.
257  const GeomIdBit kHalfMSB = kTPCLSB-1;
258  const GeomIdBit kHalfLSB = kHalfMSB;
259  const GeomIdMask kHalfMask = MAKE_MASK(kHalfMSB, kHalfLSB);
260  /// @}
261 
262  /// @{ A flag for if this geometry identifier is for a Pad
263  /// within a micro mega.
264  const GeomIdBit kPadFlagMSB = kHalfLSB-1;
265  const GeomIdBit kPadFlagLSB = kPadFlagMSB;
266  const GeomIdMask kPadFlagMask =
267  MAKE_MASK(kPadFlagMSB,kPadFlagLSB);
268  /// @}
269 
270  /// @{ The micromega within the TPC half. There are 12
271  /// micromegas in each half.
272  const GeomIdBit kMMegaMSB = kPadFlagLSB-1;
273  const GeomIdBit kMMegaLSB = kMMegaMSB-4;
274  const GeomIdMask kMMegaMask=MAKE_MASK(kMMegaMSB,kMMegaLSB);
275  /// @}
276 
277  /// @{ Define the field to hold the pad number within a
278  /// micromega.
279  const GeomIdBit kPadMSB = kMMegaLSB-1;
280  const GeomIdBit kPadLSB = kPadMSB-10;
281  const GeomIdMask kPadMask = MAKE_MASK(kPadMSB,kPadLSB);
282  /// @}
283  };
284  };
285 
286  /// Define the FGD specific constants used to decode a geometry
287  /// identifier.
288  namespace FGD {
289  /// Define the sequences required in the FGD.
290  enum FGDSeqId {
291  /// A global volume. This is used for identifiers that
292  /// refer to volumes which contain other geometry
293  /// identifiers.
294  kGlobal = 0,
295  /// A scintillator bar.
297  };
298 
299  /// The most significant bit of the sequence identifier field.
300  /// The sequence id field can have values between 0-15.
301  const GeomIdBit kSeqIdMSB = Def::kSubDetectorMSB;
302  const GeomIdBit kSeqIdLSB = kSeqIdMSB - 3;
303  const GeomIdMask kSeqIdMask = MAKE_MASK(kSeqIdMSB,kSeqIdLSB);
304 
305  /// A field that is unique to each global volume. A global
306  /// volume is any volume (with a geometry identifier) that
307  /// contains other volumes with geometry identifiers.
308  /// Examples are the individual FGDs and the water targets.
309  /// The bits are defined as
310  ///
311  /// \code
312  /// gggggggg fffffffffff
313  /// g(8) -- The type of global volume.
314  /// f(13) -- The field value.
315  /// \endcode
316  namespace Global {
317  /// @{ Define a field to hold the type of global volume
318  /// being identified.
319  const GeomIdBit kSeqIdMSB = Def::FGD::kSeqIdLSB-1;
320  const GeomIdBit kSeqIdLSB = kSeqIdMSB-7;
321  const GeomIdMask kSeqIdMask=MAKE_MASK(kSeqIdMSB,kSeqIdLSB);
322  /// @}
323 
324  enum GlobalSeqId {
325  /// The two FGD modules.
327  /// One of the water targets
329  /// A scintillator layer.
331  };
332 
333  /// @{ The sequence value for this type of global volume.
334  const GeomIdBit kFieldMSB = kSeqIdLSB-1;
335  const GeomIdBit kFieldLSB = 0;
336  const GeomIdMask kFieldMask=MAKE_MASK(kFieldMSB,kFieldLSB);
337  /// @}
338 
339  /// A field definitions for the FGD layers
340  /// \code
341  /// sss x ppppppppp
342  /// s(3) -- The FGD (FGD1 or FGD2) (0 to 1)
343  /// x(1) -- The type of layer in the module (0=x, 1=y)
344  /// p(9) -- The module within the FGD.
345  /// \endcode
346  namespace Layer {
347  /// @{ The number of the FGD within the detector. The
348  /// numbering starts at the upstream end and starts
349  /// from zero: 0) FGD1, 1) FGD2. The FGD2 contains
350  /// the water target.
351  const GeomIdBit kFGDMSB =
353  const GeomIdBit kFGDLSB = kFGDMSB-2;
354  const GeomIdMask kFGDMask = MAKE_MASK(kFGDMSB,
355  kFGDLSB);
356  /// @}
357 
358  /// @{ The layer within the module. Layer zero is X,
359  /// and layer one is Y.
360  const GeomIdBit kLayerMSB = kFGDLSB-1;
361  const GeomIdBit kLayerLSB = kLayerMSB;
362  const GeomIdMask kLayerMask=MAKE_MASK(kLayerMSB,
363  kLayerLSB);
364  /// @}
365 
366  /// @{ The module within the the FGD. The
367  /// numbering starts from zero. A module consists of
368  /// an X and a Y layer.
369  const GeomIdBit kModuleMSB = kLayerLSB-1;
370  const GeomIdBit kModuleLSB = kModuleMSB-8;
371  const GeomIdMask kModuleMask = MAKE_MASK(kModuleMSB,
372  kModuleLSB);
373  /// @}
374  };
375 
376  };
377 
378 
379  /// A field that is unique for each scintillator bar.
380  /// \code
381  /// sss x pppppp bbbbbbbbbbb
382  /// s(3) -- The FGD (FGD1 or FGD2) (0 to 1)
383  /// x(1) -- The type of layer in the module (0=x, 1=y)
384  /// p(6) -- The module in the FGD
385  /// b(11) -- The bar number
386  /// \endcode
387  namespace Bar {
388  /// @{ The FGD number.. The
389  /// numbering starts at the upstream end and starts from
390  /// zero: 0) FGD1, 1) FGD2 The FGD2 module contains the
391  /// water target.
392  const GeomIdBit kModuleMSB = Def::FGD::kSeqIdLSB-1;
393  const GeomIdBit kModuleLSB = kModuleMSB-2;
394  const GeomIdMask kModuleMask = MAKE_MASK(kModuleMSB,
395  kModuleLSB);
396  /// @}
397 
398  /// @{ The layer within the module. Layer zero is X, and
399  /// layer one is Y.
400  const GeomIdBit kLayerMSB = kModuleLSB-1;
401  const GeomIdBit kLayerLSB = kLayerMSB;
402  const GeomIdMask kLayerMask=MAKE_MASK(kLayerMSB,kLayerLSB);
403  /// @}
404 
405  /// @{ The module number within the FGD. The
406  /// numbering starts from zero.
407  const GeomIdBit kPlaneMSB = kLayerLSB-1;
408  const GeomIdBit kPlaneLSB = kPlaneMSB-5;
409  const GeomIdMask kPlaneMask = MAKE_MASK(kPlaneMSB,
410  kPlaneLSB);
411  /// @}
412 
413  /// @{ Define the field to hold the bar number within a
414  /// plane.
415  const GeomIdBit kBarMSB = kPlaneLSB-1;
416  const GeomIdBit kBarLSB = kBarMSB-10;
417  const GeomIdMask kBarMask = MAKE_MASK(kBarMSB,kBarLSB);
418  /// @}
419  };
420  };
421 
422  /// Define the ECal specific constants used to decode a geometry
423  /// identifier. The ECal field is 25 bits divided into a
424  /// sequence identifier, and a field value.
425  ///
426  /// \code
427  /// ssss mmm fffffffffffffffffff
428  /// s(4) -- The sequence identifier (0 to 15)
429  /// m(3) -- The ecal module number
430  /// f(18) -- The field value associated with a sequence id.
431  /// \endcode
432  ///
433  /// Depending on the particular sequence, the field values may be
434  /// further sub-divided.
435  namespace ECal {
436  /// Define the sequences required in the ECal.
437  enum ECalSeqId {
438  /// A global volume. This is used for identifiers that
439  /// refer to volumes which contain other geometry
440  /// identifiers.
441  kGlobal = 0,
442  /// A scintillator bar.
444  };
445 
446  /// @{The most significant bit of the sequence identifier
447  /// field. The sequence id field can have values between
448  /// 0-15.
449  const GeomIdBit kSeqIdMSB = Def::kSubDetectorMSB;
450  const GeomIdBit kSeqIdLSB = kSeqIdMSB - 3;
451  const GeomIdMask kSeqIdMask = MAKE_MASK(kSeqIdMSB,kSeqIdLSB);
452  /// @}
453 
454  /// Define the module names.
455  enum ECalModules {
456  kBottomModule,
457  kSideModule,
458  kTopModule
459  };
460  const int kNoModule = kBottomModule;
461 
462  /// Define the magnet clam names
463  enum MagnetClams {
464  kNegXClam,
465  kPosXClam,
466  };
467  const int kNoClam = kNegXClam;
468 
469  /// @{The module id field. This is always zero for the down
470  /// stream ecal. For the P0D and Tracker ECals, the is 0) -x
471  /// bottom 1) +x bottom 2) -x side 3) +x side 4) -x top 5) +x
472  /// top
473  const GeomIdBit kModuleMSB = kSeqIdLSB-1;
474  const GeomIdBit kModuleLSB = kModuleMSB-2;
475  const GeomIdMask kModuleMask = MAKE_MASK(kModuleMSB,
476  kModuleLSB);
477  /// @}
478 
479  /// A field that is unique to each global volume. A global
480  /// volume is any volume (with a geometry identifier) that
481  /// contains other volumes with geometry identifiers.
482  /// Examples are the super-ECalules, and the ECalules.
483  /// The bits are defined as
484  ///
485  /// \code
486  /// gggg ffffffffffffff
487  /// g(4) -- The type of global volume.
488  /// f(14) -- The field value.
489  /// \endcode
490  namespace Global {
491  /// @{ Define a field to hold the type of global volume
492  /// being identified.
493  const GeomIdBit kSeqIdMSB = Def::ECal::kModuleLSB-1;
494  const GeomIdBit kSeqIdLSB = kSeqIdMSB-3;
495  const GeomIdMask kSeqIdMask=MAKE_MASK(kSeqIdMSB,kSeqIdLSB);
496  /// @}
497 
498  enum GlobalSeqId {
499  /// A special case for one of a kind global volumes
501  /// One of the ECal scintillator layers.
502  kLayer,
503  /// One of the Radiators
505  /// A special case for one of a kind container volumes used to reposition the P0D
506  /// and barrel ECal modules. In the geometry, modules are eg.
507  /// .../BrlECal_0/Top_0/...
508  /// BrlECal_0 is the kContainer, Top_0 is the kECal
510  };
511 
512  /// @{ The sequence value for this type of global volume.
513  const GeomIdBit kFieldMSB = kSeqIdLSB-1;
514  const GeomIdBit kFieldLSB = 0;
515  const GeomIdMask kFieldMask=MAKE_MASK(kFieldMSB,kFieldLSB);
516  /// @}
517  };
518 
519  /// A field that is unique for each scintillator bar.
520  ///
521  /// \code
522  /// pppppp bbbbbbbbbbb
523  /// p(6) -- The layer in the ECal
524  /// b(12) -- The bar number
525  /// \endcode
526  namespace Bar {
527  /// @{ The layer within the ECal module. Layer numbering
528  /// starts from zero.
529  const GeomIdBit kLayerMSB = Def::ECal::kModuleLSB-1;
530  const GeomIdBit kLayerLSB = kLayerMSB-5;
531  const GeomIdMask kLayerMask = MAKE_MASK(kLayerMSB,
532  kLayerLSB);
533  /// @}
534 
535  /// @{ Define the field to hold the bar number within a
536  /// layer.
537  const GeomIdBit kBarMSB = kLayerLSB-1;
538  const GeomIdBit kBarLSB = kBarMSB-11;
539  const GeomIdMask kBarMask = MAKE_MASK(kBarMSB,kBarLSB);
540  /// @}
541  };
542  };
543 
544  /// Define the SMRD specific constants used to decode a geometry
545  /// identifier. The SMRD field is 25 bits divided into a sequence
546  /// identifier, and a field value.
547  ///
548  /// \code
549  /// sssss ffffffffffffffffffff
550  /// s(4) -- The sequence identifier (0 to 15)
551  /// f(21) -- The field value associated with a sequence id.
552  /// \endcode
553  ///
554  /// Depending on the particular sequence, the field values may be
555  /// further sub-divided.
556  namespace SMRD {
557  /// Define the sequences required in the SRMD.
558  enum SRMDSeqId {
559  /// A global volume. This is used for identifiers that
560  /// refer to volumes which contain other geometry
561  /// identifiers.
562  kGlobal = 0,
563  /// A scintillator bar.
565  };
566 
567  /// The most significant bit of the sequence identifier field.
568  /// The sequence id field can have values between 0-15.
569  const GeomIdBit kSeqIdMSB = Def::kSubDetectorMSB;
570  const GeomIdBit kSeqIdLSB = kSeqIdMSB - 3;
571  const GeomIdMask kSeqIdMask = MAKE_MASK(kSeqIdMSB,kSeqIdLSB);
572 
573  /// A field that is unique to each global volume. A global
574  /// volume is any volume (with a geometry identifier) that
575  /// contains other volumes with geometry identifiers.
576  /// Examples are the SMRD modules. The bits are defined as
577  ///
578  /// \code
579  /// gggggggg fffffffffff
580  /// g(8) -- The type of global volume.
581  /// f(13) -- The field value.
582  /// \endcode
583  namespace Global {
584  /// @{ Define a field to hold the type of global volume
585  /// being identified.
586  const GeomIdBit kSeqIdMSB = Def::SMRD::kSeqIdLSB-1;
587  const GeomIdBit kSeqIdLSB = kSeqIdMSB-7;
588  const GeomIdMask kSeqIdMask=MAKE_MASK(kSeqIdMSB,kSeqIdLSB);
589  /// @}
590 
591  enum GlobalSeqId {
592  /// The sequence for all of the modules in the SMRD.
593  kModule = 1,
594  };
595 
596  /// @{ The sequence value for this type of global volume.
597  const GeomIdBit kFieldMSB = kSeqIdLSB-1;
598  const GeomIdBit kFieldLSB = 0;
599  const GeomIdMask kFieldMask=MAKE_MASK(kFieldMSB,kFieldLSB);
600  /// @}
601 
602  /// A field definitions for the SMRD modules
603  /// \code
604  /// c yyyy mmmm ssss
605  /// c(1) -- The magnet clam (0 left, 1 right).
606  /// y(4) -- The yoke in the magnet (0 to 7)
607  /// m(4) -- The layer in the magnet. (0 to 15)
608  /// s(4) -- The slot in the layer (0 to 7)
609  /// \endcode
610  namespace Module {
611  /// @{The clam within the magnet. 0) Left Clam
612  /// (positive X), 1) Right clam (negative X).
613  const GeomIdBit kClamMSB =
615  const GeomIdBit kClamLSB = kClamMSB;
616  const GeomIdMask kClamMask = MAKE_MASK(kClamMSB,
617  kClamLSB);
618  /// @}
619 
620  /// @{ The yoke of the particular clam. The numbering
621  /// starts on the upstream end.
622  const GeomIdBit kYokeMSB = kClamLSB-1;
623  const GeomIdBit kYokeLSB = kYokeMSB-3;
624  const GeomIdMask kYokeMask=MAKE_MASK(kYokeMSB,kYokeLSB);
625  /// @}
626 
627  /// @{ The layer within a yoke. The numbering starts
628  /// at the inner most side of the yoke.
629  const GeomIdBit kLayerMSB = kYokeLSB-1;
630  const GeomIdBit kLayerLSB = kLayerMSB-3;
631  const GeomIdMask kLayerMask = MAKE_MASK(kLayerMSB,
632  kLayerLSB);
633  /// @}
634 
635 
636  /// @{ The slot within a layer.
637  const GeomIdBit kSlotMSB = kLayerLSB-1;
638  const GeomIdBit kSlotLSB = kSlotMSB-3;
639  const GeomIdMask kSlotMask = MAKE_MASK(kSlotMSB,
640  kSlotLSB);
641  /// @}
642  };
643  };
644 
645  /// A field that is unique for each scintillator bar.
646  /// \code
647  /// c yyyy mmmm ssss bbbbbbbb
648  /// c(1) -- The magnet clam (0 left, 1 right).
649  /// y(4) -- The yoke in the magnet (0 to 7)
650  /// m(4) -- The layer in the magnet. (0 to 15)
651  /// s(4) -- The slot in the layer (0 to 7)
652  /// b(8) -- The bar number in the module
653  /// \endcode
654  namespace Bar {
655  /// @{The clam within the magnet. 0) Left Clam (positive
656  /// X), 1) Right clam (negative X).
657  const GeomIdBit kClamMSB = Def::SMRD::kSeqIdLSB-1;
658  const GeomIdBit kClamLSB = kClamMSB;
659  const GeomIdMask kClamMask = MAKE_MASK(kClamMSB,kClamLSB);
660  /// @}
661 
662  /// @{ The yoke of the particular clam. The numbering
663  /// starts on the upstream end.
664  const GeomIdBit kYokeMSB = kClamLSB-1;
665  const GeomIdBit kYokeLSB = kYokeMSB-3;
666  const GeomIdMask kYokeMask=MAKE_MASK(kYokeMSB,kYokeLSB);
667  /// @}
668 
669  /// @{ The layer within a yoke. The numbering starts at
670  /// the inner most side of the yoke.
671  const GeomIdBit kLayerMSB = kYokeLSB-1;
672  const GeomIdBit kLayerLSB = kLayerMSB-3;
673  const GeomIdMask kLayerMask = MAKE_MASK(kLayerMSB,
674  kLayerLSB);
675  /// @}
676 
677 
678  /// @{ The slot within a layer.
679  const GeomIdBit kSlotMSB = kLayerLSB-1;
680  const GeomIdBit kSlotLSB = kSlotMSB-3;
681  const GeomIdMask kSlotMask = MAKE_MASK(kSlotMSB,kSlotLSB);
682  /// @}
683 
684  /// @{ Define the field to hold the bar number within a
685  /// slot.
686  const GeomIdBit kBarMSB = kSlotLSB-1;
687  const GeomIdBit kBarLSB = kBarMSB-7;
688  const GeomIdMask kBarMask = MAKE_MASK(kBarMSB,kBarLSB);
689  /// @}
690  };
691  };
692 
693  /// Define the INGRID specific constants used to decode a geometry
694  /// identifier. The Ingrid field is 25 bits divided into an
695  /// identifier the numbering of module, tracker and scintillator
696  /// and a flag that indicates in which projection is the
697  /// scintillator plane.
698  ///
699  /// \code
700  /// ii mmmmmmmm ttttttt p sssssss
701  /// i(2) [23:24] -- Identifies the object type: Veto/Module.
702  /// m(8) [15:22] -- Number of the module/veto plane.
703  /// t(7) [ 8:14] -- Identifies the tracker on the module.
704 
705  /// p(1) [ 7: 7] -- Projection of the scintillator: Hori./Vert/
706 
707  /// s(7) [ 0: 6] -- Identifies scintillator in the plane/tracker.
708  /// \endcode
709  ///
710  /// On the case of the Veto planes the tracker number is always
711  /// the same (there is no concept of trackers on the vetos).
712  namespace INGRID {
713  /// Define the identifiers for the object
714  enum INGRIDObjID {
715  /// A module.
717  /// A veto plane.
719  };
720 
721  /// The most significant bit of the object identifier field.
722  /// The object identifier can have values between 0-3.
724  const GeomIdBit kIngridObjIDLSB = kIngridObjIDMSB - 1;
725  const GeomIdMask kIngridObjIDMask = MAKE_MASK(kIngridObjIDMSB,
726  kIngridObjIDLSB);
727 
728  /// The most significant bit of module number field.
729  /// The module number can have values between 0-255.
730  const GeomIdBit kIngridModNumMSB = kIngridObjIDLSB - 1;
731  const GeomIdBit kIngridModNumLSB = kIngridModNumMSB - 7;
732  const GeomIdMask kIngridModNumMask =MAKE_MASK(kIngridModNumMSB,
733  kIngridModNumLSB);
734 
735  /// The most significant bit of tracker number field.
736  /// The tracker number can have values between 0-127.
737  const GeomIdBit kIngridTrkNumMSB = kIngridModNumLSB - 1;
738  const GeomIdBit kIngridTrkNumLSB = kIngridTrkNumMSB - 6;
739  const GeomIdMask kIngridTrkNumMask =MAKE_MASK(kIngridTrkNumMSB,
740  kIngridTrkNumLSB);
741 
742  /// Define the scintillators directions
744  /// Vertical scintillator.
746  /// Horizontal scintillator.
748  };
749 
750  /// The most significant bit of projection field.
751  /// The projection can have values between 0-1.
752  const GeomIdBit kIngridProjMSB = kIngridTrkNumLSB - 1;
753  const GeomIdBit kIngridProjLSB = kIngridProjMSB;
754  const GeomIdMask kIngridProjMask = MAKE_MASK(kIngridProjMSB,
755  kIngridProjLSB);
756 
757  /// The most significant bit of scintillator number field.
758  /// The scintillator number can have values between 0-127.
759  const GeomIdBit kIngridSciNumMSB = kIngridProjLSB - 1;
760  const GeomIdBit kIngridSciNumLSB = kIngridSciNumMSB - 6;
761  const GeomIdMask kIngridSciNumMask =MAKE_MASK(kIngridSciNumMSB,
762  kIngridSciNumLSB);
763  };
764 #undef MAKE_FIELD_MASK
765  };
766  };
767 };
768 #endif
const GeomIdBit kFieldMSB
The sequence value for this type of global volume.
const GeomIdMask kReserved1Mask
TPCSeqId
Define the sequences required in the TPC.
const GeomIdBit kDetectorIdLSB
The least significant bit of the detector identifier.
const GeomIdBit kIngridSciNumMSB
const GeomIdBit kIngridObjIDMSB
IngridScintillatorDirectionID
Define the scintillators directions.
const GeomIdBit kSubDetectorMSB
const GeomIdBit kFieldMSB
The sequence value for this type of global volume.
P0DSeqId
Define the sequences required in the P0D.
const GeomIdBit kIngridTrkNumMSB
const GeomIdBit kHalfMSB
The half of the drift volume.
ECalModules
Define the module names.
INGRIDObjID
Define the identifiers for the object.
SRMDSeqId
Define the sequences required in the SRMD.
const GeomIdMask kEmptyId
const GeomIdBit kDetectorIdMSB
A special case for one of a kind global volumes.
One of the brass target radiators.
const GeomIdMask kDetectorIdMask
The mask to select the detector identifier.
One of the water target modules.
unsigned long GeomIdMask
A bitwise mask for a field;.
ECalSeqId
Define the sequences required in the ECal.
const GeomIdBit kFieldMSB
The sequence value for this type of global volume.
unsigned long GeomIdBit
Bit number. The bits are counted 0 (LSB) to 31 (MSB)
const GeomIdMask kSubDetectorMask
The mask to select the sub-detector detector fields.
const GeomIdBit kReserved1LSB
const GeomIdBit kSubDetectorLSB
const GeomIdBit kIngridProjMSB
const GeomIdBit kReserved1MSB
The most significant bit of the reserved guard bit.
FGDSeqId
Define the sequences required in the FGD.
const GeomIdBit kIngridModNumMSB
The sequence for all of the modules in the SMRD.
MagnetClams
Define the magnet clam names.
A special case for one of a kind global volumes.
const GeomIdBit kTPCMSB
The TPC withing the tracker. 0) TPC1 1) TPC2 2) TPC3.
const GeomIdBit kSlotMSB
The slot within a layer.
const GeomIdBit kSeqIdMSB