All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
LArPandoraGeometry.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_H
8 #define LAR_PANDORA_GEOMETRY_H 1
9 
11 
13 
14 #include <map>
15 #include <vector>
16 
17 namespace lar_pandora {
18 
19  /**
20  * @brief LArPandoraGeometry class
21  */
23  public:
24  /**
25  * @brief Load the 2D gaps that go with the chosen geometry
26  *
27  * @param listOfGaps the output list of 2D gaps.
28  * @param useActiveBoundingBox when true use ActiveBoundingBox instead of the default midpoint. Meant to handle offsets and things in a better way.
29  */
30  static void LoadDetectorGaps(LArDetectorGapList& listOfGaps, const bool useActiveBoundingBox);
31 
32  /**
33  * @brief Load drift volume geometry
34  *
35  * @param outputVolumeList the output list of drift volumes
36  * @param outputVolumeMap the output mapping between cryostat/tpc and drift volumes
37  * @param useActiveBoundingBox when true use ActiveBoundingBox instead of the default midpoint. Meant to handle offsets and things in a better way.
38  */
39  static void LoadGeometry(LArDriftVolumeList& outputVolumeList,
40  LArDriftVolumeMap& outputVolumeMap,
41  const bool useActiveBoundingBox);
42 
43  /**
44  * @brief Get drift volume ID from a specified cryostat/tpc pair
45  *
46  * @param driftVolumeMap the output mapping between cryostat/tpc and drift volumes
47  * @param cstat the input cryostat unique ID
48  * @param tpc the input tpc unique ID
49  */
50  static unsigned int GetVolumeID(const LArDriftVolumeMap& driftVolumeMap,
51  const unsigned int cstat,
52  const unsigned int tpc);
53 
54  /**
55  * @brief Get daughter volume ID from a specified cryostat/tpc pair
56  *
57  * @param driftVolumeMap the output mapping between cryostat/tpc and drift volumes
58  * @param cstat the input cryostat unique ID
59  * @param tpc the input tpc unique ID
60  */
61  static unsigned int GetDaughterVolumeID(const LArDriftVolumeMap& driftVolumeMap,
62  const unsigned int cstat,
63  const unsigned int tpc);
64 
65  /**
66  * @brief Convert to global coordinate system
67  *
68  * @param cstat the input cryostat
69  * @param tpc the input tpc
70  * @param hit_View the input view
71  */
72  static geo::View_t GetGlobalView(const unsigned int cstat,
73  const unsigned int tpc,
74  const geo::View_t hit_View);
75 
76  private:
77  /**
78  * @brief Generate a unique identifier for each TPC
79  *
80  * @param cstat the input cryostat
81  * @param tpc the input tpc
82  */
83  static unsigned int GetTpcID(const unsigned int cstat, const unsigned int tpc);
84 
85  /**
86  * @brief Return whether U/V should be switched in global coordinate system for this cryostat/tpc
87  *
88  * @param cstat the input cryostat
89  * @param tpc the input tpc
90  */
91  static bool ShouldSwitchUV(const unsigned int cstat, const unsigned int tpc);
92 
93  /**
94  * @brief Return whether U/V should be switched in global coordinate system for this drift direction
95  *
96  * @param isPositiveDrift the drift direction
97  */
98  static bool ShouldSwitchUV(const bool isPositiveDrift);
99 
100  /**
101  * @brief This method will group TPCs into drift volumes (these are regions of the detector that share a common drift direction,
102  * common range of X coordinates, and common detector parameters such as wire pitch and wire angle).
103  *
104  * @param driftVolumeList to receive the populated drift volume list
105  * @param useActiveBoundingBox when true use ActiveBoundingBox instead of the default midpoint. Meant to handle offsets and things in a better way.
106  */
107  static void LoadGeometry(LArDriftVolumeList& driftVolumeList, const bool useActiveBoundingBox);
108 
109  /**
110  * @brief This method will create one or more daughter volumes (these share a common drift orientation along the X-axis,
111  * have parallel or near-parallel wire angles, and similar wire pitches)
112  *
113  * @param driftVolumeList to receive the input drift volume list
114  * @param parentVolumeList to receive the output daughter drift volume list
115  */
116  static void LoadGlobalDaughterGeometry(const LArDriftVolumeList& driftVolumeList,
117  LArDriftVolumeList& daughterVolumeList);
118  };
119 
120 } // namespace lar_pandora
121 
122 #endif // #ifndef LAR_PANDORA_GEOMETRY_H
static geo::View_t GetGlobalView(const unsigned int cstat, const unsigned int tpc, const geo::View_t hit_View)
Convert to global coordinate system.
static void LoadGeometry(LArDriftVolumeList &outputVolumeList, LArDriftVolumeMap &outputVolumeMap, const bool useActiveBoundingBox)
Load drift volume geometry.
enum geo::_plane_proj View_t
Enumerate the possible plane projections.
std::map< unsigned int, LArDriftVolume > LArDriftVolumeMap
std::vector< LArDriftVolume > LArDriftVolumeList
static unsigned int GetVolumeID(const LArDriftVolumeMap &driftVolumeMap, const unsigned int cstat, const unsigned int tpc)
Get drift volume ID from a specified cryostat/tpc pair.
static unsigned int GetDaughterVolumeID(const LArDriftVolumeMap &driftVolumeMap, const unsigned int cstat, const unsigned int tpc)
Get daughter volume ID from a specified cryostat/tpc pair.
static unsigned int GetTpcID(const unsigned int cstat, const unsigned int tpc)
Generate a unique identifier for each TPC.
LArPandoraGeometry class.
static bool ShouldSwitchUV(const unsigned int cstat, const unsigned int tpc)
Return whether U/V should be switched in global coordinate system for this cryostat/tpc.
static void LoadGlobalDaughterGeometry(const LArDriftVolumeList &driftVolumeList, LArDriftVolumeList &daughterVolumeList)
This method will create one or more daughter volumes (these share a common drift orientation along th...
static void LoadDetectorGaps(LArDetectorGapList &listOfGaps, const bool useActiveBoundingBox)
Load the 2D gaps that go with the chosen geometry.
Definition of data types for geometry description.
std::vector< LArDetectorGap > LArDetectorGapList