LArPandoraDetectorType.h
Go to the documentation of this file.
1 /**
2  * @file larpandora/LArPandoraInterface/Detectors/LArPandoraDetectorType.h
3  *
4  * @brief Helper functions for extracting detector geometry for use in reconsruction
5  *
6  * $Log: $
7  */
8 
9 #ifndef LAR_PANDORA_DETECTOR_TYPE_H
10 #define LAR_PANDORA_DETECTOR_TYPE_H 1
11 
13 
14 #include "Api/PandoraApi.h"
15 
16 namespace lar_pandora {
17 
18  class LArDriftVolume;
20  typedef std::vector<LArDetectorGap> LArDetectorGapList;
21 
22  /**
23  * @brief Empty interface to map pandora to specifics in the LArSoft geometry
24  */
26  public:
27  /**
28  * @brief Map a LArSoft view to Pandora's U view
29  *
30  * @param tpc the LArSoft TPC ID
31  * @param cstat the LArSoft cryostat ID
32  * @result The mapped LArSoft view
33  */
35  const geo::CryostatID::CryostatID_t cstat) const = 0;
36 
37  /**
38  * @brief Map a LArSoft view to Pandora's V view
39  *
40  * @param tpc the LArSoft TPC ID
41  * @param cstat the LArSoft cryostat ID
42  * @result The mapped LArSoft view
43  */
45  const geo::CryostatID::CryostatID_t cstat) const = 0;
46 
47  /**
48  * @brief Map a LArSoft view to Pandora's W view
49  *
50  * @param tpc the LArSoft TPC ID
51  * @param cstat the LArSoft cryostat ID
52  * @result The mapped LArSoft view
53  */
55  const geo::CryostatID::CryostatID_t cstat) const = 0;
56 
57  /**
58  * @brief The wire pitch of the mapped U view
59  *
60  * @result The mapped wire pitch
61  */
62  virtual float WirePitchU() const = 0;
63 
64  /**
65  * @brief The wire pitch of the mapped V view
66  *
67  * @result The mapped wire pitch
68  */
69  virtual float WirePitchV() const = 0;
70 
71  /**
72  * @brief The wire pitch of the mapped W view
73  *
74  * @result The mapped wire pitch
75  */
76  virtual float WirePitchW() const = 0;
77 
78  /**
79  * @brief The angle of the wires in the mapped U view
80  *
81  * @result The mapped wire angle
82  */
83  virtual float WireAngleU(const geo::TPCID::TPCID_t tpc,
84  const geo::CryostatID::CryostatID_t cstat) const = 0;
85 
86  /**
87  * @brief The angle of the wires in the mapped V view
88  *
89  * @result The mapped wire angle
90  */
91  virtual float WireAngleV(const geo::TPCID::TPCID_t tpc,
92  const geo::CryostatID::CryostatID_t cstat) const = 0;
93 
94  /**
95  * @brief The angle of the wires in the mapped V view
96  *
97  * @result The mapped wire angle
98  */
99  virtual float WireAngleW(const geo::TPCID::TPCID_t tpc,
100  const geo::CryostatID::CryostatID_t cstat) const = 0;
101 
102  /**
103  * @brief Check whether a gap size is small enough to be registered as a detector gap
104  *
105  * @param gaps a cartesean vector holding gap sizes between adjacent TPCs
106  * @param deltas a cartesean vector holding distances between adjacent TPCs
107  * @param maxDisplacement the gap size threshold
108  * @result logic bool
109  */
110  virtual bool CheckDetectorGapSize(const geo::Vector_t& gaps,
111  const geo::Vector_t& deltas,
112  const float maxDisplacement) const = 0;
113 
114  /**
115  * @brief Create a detector gap
116  *
117  * @param point1 a point on TPC1 that are closest to TPC2
118  * @param point2 a point on TPC2 that are closest to TPC1
119  * @param width the gap sizes
120  * @result the detector gap object
121  */
122  virtual LArDetectorGap CreateDetectorGap(const geo::Point_t& point1,
123  const geo::Point_t& point2,
124  const geo::Vector_t& widths) const = 0;
125 
126  /**
127  * @brief Create detector gaps for all daughter volumes in a logical TPC volume
128  *
129  * @param driftVolume the parent drift volume
130  * @param maxDisplacement the gap size threshold
131  * @param listOfGaps the gaps vector to be filled
132  */
133  virtual void LoadDaughterDetectorGaps(const LArDriftVolume& driftVolume,
134  const float maxDisplacement,
135  LArDetectorGapList& listOfGaps) const = 0;
136 
137  /**
138  * @brief Create the line gap parameters to give to the pandora API
139  *
140  * @param gap the input detector gap
141  * @return the pandora API's line gap parameters object
142  */
143  virtual PandoraApi::Geometry::LineGap::Parameters CreateLineGapParametersFromDetectorGaps(
144  const LArDetectorGap& gap) const = 0;
145 
146  /**
147  * @brief Create the line gap parameters to give to the pandora API
148  *
149  * @param view the LArSoft view
150  * @param tpc the LArSoft TPC ID
151  * @param cstat the LArSoft cryostat ID
152  * @param firstXYZ the first 3D coordinate
153  * @param lastXYZ the last 3D coordinate
154  * @param halfWirePitch the half wire pitch
155  * @param pPandora the pandora instance
156  * @param xFirst the min X of the gap
157  * @param xLast the max X of the gap
158  * @return the pandora API's line gap parameters object
159  */
160  virtual PandoraApi::Geometry::LineGap::Parameters CreateLineGapParametersFromReadoutGaps(
161  const geo::View_t view,
162  const geo::TPCID::TPCID_t tpc,
163  const geo::CryostatID::CryostatID_t cstat,
164  const double firstXYZ[3],
165  const double lastXYZ[3],
166  const float halfWirePitch,
167  const float xFirst,
168  const float xLast,
169  const pandora::Pandora* pPandora) const = 0;
170  };
171 
172  namespace detector_functions {
173 
174  /**
175  * @brief Factory class that returns the correct detector type interface
176  *
177  * @result The detector type interface
178  */
180 
181  /**
182  * @brief Calculate the wire angle of a LArTPC view in a given TPC/cryostat
183  *
184  * @param view the LArSoft view
185  * @param tpc the LArSoft TPC ID
186  * @param cstat the LArSoft cryostat ID
187  * @param larsoftGeometry the LArSoft geometry service handle
188  * @return the wire angle
189  */
190  float WireAngle(const geo::View_t view,
191  const geo::TPCID::TPCID_t tpc,
192  const geo::CryostatID::CryostatID_t cstat,
193  const art::ServiceHandle<geo::Geometry>& larsoftGeometry);
194 
195  /**
196  * @brief Make the drift gap parameters for the Pandora API
197  *
198  * @param gap the detector gap object
199  * @return the line gap parameters for the Pandora API
200  */
201  PandoraApi::Geometry::LineGap::Parameters CreateDriftGapParameters(const LArDetectorGap& gap);
202 
203  /**
204  * @brief Make the readout gap parameters for the Pandora API
205  *
206  * @param firstPoint the first point in the gap
207  * @param lastPoint the last point ih the gap
208  * @param xFirst the min X of the gap
209  * @param xLast the max X of the gap
210  * @param halfWirePitch the half wire pitch
211  * @param gapType the pandora gap type
212  * @return the line gap parameters for the Pandora API
213  */
214  PandoraApi::Geometry::LineGap::Parameters CreateReadoutGapParameters(
215  const float firstPoint,
216  const float lastPoint,
217  const float xFirst,
218  const float xLast,
219  const float halfWirePitch,
220  const pandora::LineGapType gapType);
221 
222  } // namespace detector_functions
223 
224 } // namespace lar_pandora
225 #endif // #ifndef LAR_PANDORA_DETECTOR_TYPE_H
virtual float WireAngleV(const geo::TPCID::TPCID_t tpc, const geo::CryostatID::CryostatID_t cstat) const =0
The angle of the wires in the mapped V view.
enum geo::_plane_proj View_t
Enumerate the possible plane projections.
virtual geo::View_t TargetViewW(const geo::TPCID::TPCID_t tpc, const geo::CryostatID::CryostatID_t cstat) const =0
Map a LArSoft view to Pandora&#39;s W view.
virtual PandoraApi::Geometry::LineGap::Parameters CreateLineGapParametersFromReadoutGaps(const geo::View_t view, const geo::TPCID::TPCID_t tpc, const geo::CryostatID::CryostatID_t cstat, const double firstXYZ[3], const double lastXYZ[3], const float halfWirePitch, const float xFirst, const float xLast, const pandora::Pandora *pPandora) const =0
Create the line gap parameters to give to the pandora API.
Empty interface to map pandora to specifics in the LArSoft geometry.
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double >, ROOT::Math::GlobalCoordinateSystemTag > Vector_t
Type for representation of momenta in 3D space.
Definition: geo_vectors.h:164
virtual float WirePitchV() const =0
The wire pitch of the mapped V view.
virtual geo::View_t TargetViewV(const geo::TPCID::TPCID_t tpc, const geo::CryostatID::CryostatID_t cstat) const =0
Map a LArSoft view to Pandora&#39;s V view.
art framework interface to geometry description
virtual geo::View_t TargetViewU(const geo::TPCID::TPCID_t tpc, const geo::CryostatID::CryostatID_t cstat) const =0
Map a LArSoft view to Pandora&#39;s U view.
virtual float WireAngleU(const geo::TPCID::TPCID_t tpc, const geo::CryostatID::CryostatID_t cstat) const =0
The angle of the wires in the mapped U view.
virtual float WirePitchU() const =0
The wire pitch of the mapped U view.
virtual PandoraApi::Geometry::LineGap::Parameters CreateLineGapParametersFromDetectorGaps(const LArDetectorGap &gap) const =0
Create the line gap parameters to give to the pandora API.
virtual bool CheckDetectorGapSize(const geo::Vector_t &gaps, const geo::Vector_t &deltas, const float maxDisplacement) const =0
Check whether a gap size is small enough to be registered as a detector gap.
virtual void LoadDaughterDetectorGaps(const LArDriftVolume &driftVolume, const float maxDisplacement, LArDetectorGapList &listOfGaps) const =0
Create detector gaps for all daughter volumes in a logical TPC volume.
virtual float WireAngleW(const geo::TPCID::TPCID_t tpc, const geo::CryostatID::CryostatID_t cstat) const =0
The angle of the wires in the mapped V view.
virtual LArDetectorGap CreateDetectorGap(const geo::Point_t &point1, const geo::Point_t &point2, const geo::Vector_t &widths) const =0
Create a detector gap.
virtual float WirePitchW() const =0
The wire pitch of the mapped W view.
ROOT::Math::PositionVector3D< ROOT::Math::Cartesian3D< double >, ROOT::Math::GlobalCoordinateSystemTag > Point_t
Type for representation of position in physical 3D space.
Definition: geo_vectors.h:184
PandoraApi::Geometry::LineGap::Parameters CreateDriftGapParameters(const LArDetectorGap &gap)
Make the drift gap parameters for the Pandora API.
unsigned int CryostatID_t
Type for the ID number.
Definition: geo_types.h:191
float WireAngle(const geo::View_t view, const geo::TPCID::TPCID_t tpc, const geo::CryostatID::CryostatID_t cstat, const art::ServiceHandle< geo::Geometry > &larsoftGeometry)
Calculate the wire angle of a LArTPC view in a given TPC/cryostat.
PandoraApi::Geometry::LineGap::Parameters CreateReadoutGapParameters(const float firstPoint, const float lastPoint, const float xFirst, const float xLast, const float halfWirePitch, const pandora::LineGapType gapType)
Make the readout gap parameters for the Pandora API.
LArPandoraDetectorType * GetDetectorType()
Factory class that returns the correct detector type interface.
unsigned int TPCID_t
Type for the ID number.
Definition: geo_types.h:387
std::vector< LArDetectorGap > LArDetectorGapList
drift volume class to hold properties of drift volume
drift volume class to hold properties of drift volume