All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
LArPandoraGeometryComponents.h
Go to the documentation of this file.
1 /**
2  * @file larpandora/LArPandoraInterface/LArPandoraGeometry.h
3  *
4  * @brief Helper functions for extracting detector geometry for use in reconsruction
5  */
6 
7 #ifndef LAR_PANDORA_GEOMETRY_COMPONENTS_H
8 #define LAR_PANDORA_GEOMETRY_COMPONENTS_H 1
9 
11 
12 #include <map>
13 #include <vector>
14 
15 namespace lar_pandora {
16 
17  /**
18  * @brief drift volume class to hold properties of drift volume
19  */
21  public:
22  /**
23  * @brief Constructor
24  *
25  * @param x1 lower X coordinate
26  * @param y1 lower Y coordinate
27  * @param z1 lower Z coordinate
28  * @param x2 upper X coordinate
29  * @param y2 upper Y coordinate
30  * @param z2 upper Z coordinate
31  */
32  LArDetectorGap(const float x1,
33  const float y1,
34  const float z1,
35  const float x2,
36  const float y2,
37  const float z2);
38 
39  /**
40  * @brief Get lower X coordinate
41  */
42  float GetX1() const;
43 
44  /**
45  * @brief Get lower y coordinate
46  */
47  float GetY1() const;
48 
49  /**
50  * @brief Get lower Z coordinate
51  */
52  float GetZ1() const;
53 
54  /**
55  * @brief Get upper X coordinate
56  */
57  float GetX2() const;
58 
59  /**
60  * @brief Get upper Y coordinate
61  */
62  float GetY2() const;
63 
64  /**
65  * @brief Get upper Z coordinate
66  */
67  float GetZ2() const;
68 
69  /**
70  * @brief Get maximum gap size
71  */
72  static float GetMaxGapSize() noexcept;
73 
74  private:
75  float m_x1;
76  float m_y1;
77  float m_z1;
78  float m_x2;
79  float m_y2;
80  float m_z2;
81  };
82 
83  typedef std::vector<LArDetectorGap> LArDetectorGapList;
84 
85  //------------------------------------------------------------------------------------------------------------------------------------------
86  //------------------------------------------------------------------------------------------------------------------------------------------
87 
88  /**
89  * @brief daughter drift volume class to hold properties of daughter drift volumes
90  */
92  public:
93  /**
94  * @brief Constructor
95  *
96  * @param cryostat the cryostat ID
97  * @param tpc the tpc ID
98  * @param centerX centre of tpc volume (X)
99  * @param centerY centre of tpc volume (Y)
100  * @param centerZ centre of tpc volume (Z)
101  * @param widthX width of tpc volume (X)
102  * @param widthY width of tpc volume (Y)
103  * @param widthZ width of tpc volume (Z)
104  */
105  LArDaughterDriftVolume(const unsigned int cryostat,
106  const unsigned int tpc,
107  const float centerX,
108  const float centerY,
109  const float centerZ,
110  const float widthX,
111  const float widthY,
112  const float widthZ);
113 
114  /**
115  * @brief Return cryostat ID
116  */
117  unsigned int GetCryostat() const;
118 
119  /**
120  * @brief Return tpc ID
121  */
122  unsigned int GetTpc() const;
123 
124  /**
125  * @brief Return X position at centre of tpc volume
126  */
127  float GetCenterX() const;
128 
129  /**
130  * @brief Return Y position at centre of tpc volume
131  */
132  float GetCenterY() const;
133 
134  /**
135  * @brief Return Z position at centre of tpc volume
136  */
137  float GetCenterZ() const;
138 
139  /**
140  * @brief Return X span of tpc volume
141  */
142  float GetWidthX() const;
143 
144  /**
145  * @brief Return Y span of tpc volume
146  */
147  float GetWidthY() const;
148 
149  /**
150  * @brief Return Z span of tpc volume
151  */
152  float GetWidthZ() const;
153 
154  private:
155  unsigned int m_cryostat;
156  unsigned int m_tpc;
157  float m_centerX;
158  float m_centerY;
159  float m_centerZ;
160  float m_widthX;
161  float m_widthY;
162  float m_widthZ;
163  };
164 
165  typedef std::vector<LArDaughterDriftVolume> LArDaughterDriftVolumeList;
166 
167  //------------------------------------------------------------------------------------------------------------------------------------------
168  //------------------------------------------------------------------------------------------------------------------------------------------
169 
170  /**
171  * @brief drift volume class to hold properties of drift volume
172  */
174  public:
175  /**
176  * @brief Constructor
177  *
178  * @param volumeID unique ID number
179  * @param isPositiveDrift direction of drift
180  * @param wirePitchU wire pitch (U view)
181  * @param wirePitchV wire pitch (V view)
182  * @param wirePitchW wire pitch (W view)
183  * @param wireAngleU wire angle (U view)
184  * @param wireAngleV wire angle (V view)
185  * @param wireAngleW wire angle (W view)
186  * @param centerX centre of volume (X)
187  * @param centerY centre of volume (Y)
188  * @param centerZ centre of volume (Z)
189  * @param widthX width of volume (X)
190  * @param widthY width of volume (Y)
191  * @param widthZ width of volume (Z)
192  * @param thetaU wire angle to vertical (U)
193  * @param thetaV wire angle to vertical (V)
194  * @param sigmaUVZ matching between views
195  * @param tpcVolumeList input list of TPC volumes
196  */
197  LArDriftVolume(const unsigned int volumeID,
198  const bool isPositiveDrift,
199  const float wirePitchU,
200  const float wirePitchV,
201  const float wirePitchW,
202  const float wireAngleU,
203  const float wireAngleV,
204  const float wireAngleW,
205  const float centerX,
206  const float centerY,
207  const float centerZ,
208  const float widthX,
209  const float widthY,
210  const float widthZ,
211  const float sigmaUVZ,
212  const LArDaughterDriftVolumeList& tpcVolumeList);
213 
214  /**
215  * @brief Return unique ID
216  */
217  unsigned int GetVolumeID() const;
218 
219  /**
220  * @brief Return drift direction (true if positive)
221  */
222  bool IsPositiveDrift() const;
223 
224  /**
225  * @brief Return wire pitch in U view
226  */
227  float GetWirePitchU() const;
228 
229  /**
230  * @brief Return wire pictch in V view
231  */
232  float GetWirePitchV() const;
233 
234  /**
235  * @brief Return wire pitch in W view
236  */
237  float GetWirePitchW() const;
238 
239  /**
240  * @brief Return wire angle in U view (Pandora convention)
241  */
242  float GetWireAngleU() const;
243 
244  /**
245  * @brief Return wire angle in V view (Pandora convention)
246  */
247  float GetWireAngleV() const;
248 
249  /**
250  * @brief Return wire angle in W view (Pandora convention)
251  */
252  float GetWireAngleW() const;
253 
254  /**
255  * @brief Return X position at centre of drift volume
256  */
257  float GetCenterX() const;
258 
259  /**
260  * @brief Return Y position at centre of drift volume
261  */
262  float GetCenterY() const;
263 
264  /**
265  * @brief Return Z position at centre of drift volume
266  */
267  float GetCenterZ() const;
268 
269  /**
270  * @brief Return X span of drift volume
271  */
272  float GetWidthX() const;
273 
274  /**
275  * @brief Return Y span of drift volume
276  */
277  float GetWidthY() const;
278 
279  /**
280  * @brief Return Z span of drift volume
281  */
282  float GetWidthZ() const;
283 
284  /**
285  * @brief Return sigmaUVZ parameter (used for matching views)
286  */
287  float GetSigmaUVZ() const;
288 
289  /**
290  * @brief Return list of daughter drift volumes associated with this drift volume
291  */
293 
294  private:
295  unsigned int m_volumeID;
303  float m_centerX;
304  float m_centerY;
305  float m_centerZ;
306  float m_widthX;
307  float m_widthY;
308  float m_widthZ;
309  float m_sigmaUVZ;
310 
312  };
313 
314  typedef std::vector<LArDriftVolume> LArDriftVolumeList;
315  typedef std::map<unsigned int, LArDriftVolume> LArDriftVolumeMap;
316 
317  //------------------------------------------------------------------------------------------------------------------------------------------
318  //------------------------------------------------------------------------------------------------------------------------------------------
319 
320  inline LArDetectorGap::LArDetectorGap(const float x1,
321  const float y1,
322  const float z1,
323  const float x2,
324  const float y2,
325  const float z2)
326  : m_x1(x1), m_y1(y1), m_z1(z1), m_x2(x2), m_y2(y2), m_z2(z2)
327  {}
328 
329  //------------------------------------------------------------------------------------------------------------------------------------------
330 
331  inline float
333  {
334  return m_x1;
335  }
336 
337  //------------------------------------------------------------------------------------------------------------------------------------------
338 
339  inline float
341  {
342  return m_y1;
343  }
344 
345  //------------------------------------------------------------------------------------------------------------------------------------------
346 
347  inline float
349  {
350  return m_z1;
351  }
352 
353  //------------------------------------------------------------------------------------------------------------------------------------------
354 
355  inline float
357  {
358  return m_x2;
359  }
360 
361  //------------------------------------------------------------------------------------------------------------------------------------------
362 
363  inline float
365  {
366  return m_y2;
367  }
368 
369  //------------------------------------------------------------------------------------------------------------------------------------------
370 
371  inline float
373  {
374  return m_z2;
375  }
376 
377  //------------------------------------------------------------------------------------------------------------------------------------------
378 
379  inline float
381  {
382  return 30.f; // TODO: 30cm should be fine but can we do better than a hard-coded number here?
383  }
384 
385  //------------------------------------------------------------------------------------------------------------------------------------------
386  //------------------------------------------------------------------------------------------------------------------------------------------
387 
388  inline LArDaughterDriftVolume::LArDaughterDriftVolume(const unsigned int cryostat,
389  const unsigned int tpc,
390  const float centerX,
391  const float centerY,
392  const float centerZ,
393  const float widthX,
394  const float widthY,
395  const float widthZ)
396  : m_cryostat(cryostat)
397  , m_tpc(tpc)
398  , m_centerX(centerX)
399  , m_centerY(centerY)
400  , m_centerZ(centerZ)
401  , m_widthX(widthX)
402  , m_widthY(widthY)
403  , m_widthZ(widthZ)
404  {}
405 
406  //------------------------------------------------------------------------------------------------------------------------------------------
407 
408  inline unsigned int
410  {
411  return m_cryostat;
412  }
413 
414  //------------------------------------------------------------------------------------------------------------------------------------------
415 
416  inline unsigned int
418  {
419  return m_tpc;
420  }
421 
422  //------------------------------------------------------------------------------------------------------------------------------------------
423 
424  inline float
426  {
427  return m_centerX;
428  }
429 
430  //------------------------------------------------------------------------------------------------------------------------------------------
431 
432  inline float
434  {
435  return m_centerY;
436  }
437 
438  //------------------------------------------------------------------------------------------------------------------------------------------
439 
440  inline float
442  {
443  return m_centerZ;
444  }
445 
446  //------------------------------------------------------------------------------------------------------------------------------------------
447 
448  inline float
450  {
451  return m_widthX;
452  }
453 
454  //------------------------------------------------------------------------------------------------------------------------------------------
455 
456  inline float
458  {
459  return m_widthY;
460  }
461 
462  //------------------------------------------------------------------------------------------------------------------------------------------
463 
464  inline float
466  {
467  return m_widthZ;
468  }
469 
470  //------------------------------------------------------------------------------------------------------------------------------------------
471  //------------------------------------------------------------------------------------------------------------------------------------------
472 
473  inline unsigned int
475  {
476  return m_volumeID;
477  }
478 
479  //------------------------------------------------------------------------------------------------------------------------------------------
480 
481  inline bool
483  {
484  return m_isPositiveDrift;
485  }
486 
487  //------------------------------------------------------------------------------------------------------------------------------------------
488 
489  inline float
491  {
492  return m_wirePitchU;
493  }
494 
495  //------------------------------------------------------------------------------------------------------------------------------------------
496 
497  inline float
499  {
500  return m_wirePitchV;
501  }
502 
503  //------------------------------------------------------------------------------------------------------------------------------------------
504 
505  inline float
507  {
508  return m_wirePitchW;
509  }
510 
511  //------------------------------------------------------------------------------------------------------------------------------------------
512 
513  inline float
515  {
516  return m_wireAngleU;
517  }
518 
519  //------------------------------------------------------------------------------------------------------------------------------------------
520 
521  inline float
523  {
524  return m_wireAngleV;
525  }
526 
527  //------------------------------------------------------------------------------------------------------------------------------------------
528 
529  inline float
531  {
532  return m_wireAngleW;
533  }
534 
535  //------------------------------------------------------------------------------------------------------------------------------------------
536 
537  inline float
539  {
540  return m_centerX;
541  }
542 
543  //------------------------------------------------------------------------------------------------------------------------------------------
544 
545  inline float
547  {
548  return m_centerY;
549  }
550 
551  //------------------------------------------------------------------------------------------------------------------------------------------
552 
553  inline float
555  {
556  return m_centerZ;
557  }
558 
559  //------------------------------------------------------------------------------------------------------------------------------------------
560 
561  inline float
563  {
564  return m_widthX;
565  }
566 
567  //------------------------------------------------------------------------------------------------------------------------------------------
568 
569  inline float
571  {
572  return m_widthY;
573  }
574 
575  //------------------------------------------------------------------------------------------------------------------------------------------
576 
577  inline float
579  {
580  return m_widthZ;
581  }
582 
583  //------------------------------------------------------------------------------------------------------------------------------------------
584 
585  inline float
587  {
588  return m_sigmaUVZ;
589  }
590 
591  //------------------------------------------------------------------------------------------------------------------------------------------
592 
593  inline const LArDaughterDriftVolumeList&
595  {
596  return m_tpcVolumeList;
597  }
598 
599 } // namespace lar_pandora
600 
601 #endif // #ifndef LAR_PANDORA_GEOMETRY_H
float GetCenterZ() const
Return Z position at centre of tpc volume.
float GetWidthZ() const
Return Z span of drift volume.
float GetWidthY() const
Return Y span of tpc volume.
daughter drift volume class to hold properties of daughter drift volumes
float GetWidthZ() const
Return Z span of tpc volume.
float GetWidthX() const
Return X span of tpc volume.
LArDriftVolume(const unsigned int volumeID, const bool isPositiveDrift, const float wirePitchU, const float wirePitchV, const float wirePitchW, const float wireAngleU, const float wireAngleV, const float wireAngleW, const float centerX, const float centerY, const float centerZ, const float widthX, const float widthY, const float widthZ, const float sigmaUVZ, const LArDaughterDriftVolumeList &tpcVolumeList)
Constructor.
std::map< unsigned int, LArDriftVolume > LArDriftVolumeMap
LArDetectorGap(const float x1, const float y1, const float z1, const float x2, const float y2, const float z2)
Constructor.
unsigned int GetCryostat() const
Return cryostat ID.
LArDaughterDriftVolumeList m_tpcVolumeList
std::vector< LArDriftVolume > LArDriftVolumeList
float GetZ1() const
Get lower Z coordinate.
LArDaughterDriftVolume(const unsigned int cryostat, const unsigned int tpc, const float centerX, const float centerY, const float centerZ, const float widthX, const float widthY, const float widthZ)
Constructor.
float GetWireAngleW() const
Return wire angle in W view (Pandora convention)
float GetCenterZ() const
Return Z position at centre of drift volume.
float GetWirePitchW() const
Return wire pitch in W view.
const LArDaughterDriftVolumeList & GetTpcVolumeList() const
Return list of daughter drift volumes associated with this drift volume.
float GetCenterX() const
Return X position at centre of drift volume.
unsigned int GetVolumeID() const
Return unique ID.
float GetCenterX() const
Return X position at centre of tpc volume.
bool IsPositiveDrift() const
Return drift direction (true if positive)
float GetCenterY() const
Return Y position at centre of tpc volume.
Definition of data types for geometry description.
float GetX1() const
Get lower X coordinate.
float GetWireAngleV() const
Return wire angle in V view (Pandora convention)
std::vector< LArDaughterDriftVolume > LArDaughterDriftVolumeList
static float GetMaxGapSize() noexcept
Get maximum gap size.
std::vector< LArDetectorGap > LArDetectorGapList
float GetWidthY() const
Return Y span of drift volume.
float GetCenterY() const
Return Y position at centre of drift volume.
float GetWirePitchU() const
Return wire pitch in U view.
float GetSigmaUVZ() const
Return sigmaUVZ parameter (used for matching views)
drift volume class to hold properties of drift volume
float GetWirePitchV() const
Return wire pictch in V view.
float GetWidthX() const
Return X span of drift volume.
float GetY1() const
Get lower y coordinate.
float GetY2() const
Get upper Y coordinate.
drift volume class to hold properties of drift volume
float GetX2() const
Get upper X coordinate.
float GetZ2() const
Get upper Z coordinate.
float GetWireAngleU() const
Return wire angle in U view (Pandora convention)
unsigned int GetTpc() const
Return tpc ID.