All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
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 
15 
16 #include "art/Framework/Services/Registry/ServiceHandle.h"
17 
18 #include "Api/PandoraApi.h"
19 
20 namespace lar_pandora {
21 
22  class LArDriftVolume;
24  typedef std::vector<LArDetectorGap> LArDetectorGapList;
25 
26  /**
27  * @brief Empty interface to map pandora to specifics in the LArSoft geometry
28  */
30  public:
31  /**
32  * @brief Map a LArSoft view to Pandora's U view
33  *
34  * @param tpc the LArSoft TPC ID
35  * @param cstat the LArSoft cryostat ID
36  * @result The mapped LArSoft view
37  */
39  const geo::CryostatID::CryostatID_t cstat) const = 0;
40 
41  /**
42  * @brief Map a LArSoft view to Pandora's V view
43  *
44  * @param tpc the LArSoft TPC ID
45  * @param cstat the LArSoft cryostat ID
46  * @result The mapped LArSoft view
47  */
49  const geo::CryostatID::CryostatID_t cstat) const = 0;
50 
51  /**
52  * @brief Map a LArSoft view to Pandora's W view
53  *
54  * @param tpc the LArSoft TPC ID
55  * @param cstat the LArSoft cryostat ID
56  * @result The mapped LArSoft view
57  */
59  const geo::CryostatID::CryostatID_t cstat) const = 0;
60 
61  /**
62  * @brief The wire pitch of the mapped U view
63  *
64  * @result The mapped wire pitch
65  */
66  virtual float WirePitchU() const = 0;
67 
68  /**
69  * @brief The wire pitch of the mapped V view
70  *
71  * @result The mapped wire pitch
72  */
73  virtual float WirePitchV() const = 0;
74 
75  /**
76  * @brief The wire pitch of the mapped W view
77  *
78  * @result The mapped wire pitch
79  */
80  virtual float WirePitchW() const = 0;
81 
82  /**
83  * @brief The angle of the wires in the mapped U view
84  *
85  * @result The mapped wire angle
86  */
87  virtual float WireAngleU(const geo::TPCID::TPCID_t tpc,
88  const geo::CryostatID::CryostatID_t cstat) const = 0;
89 
90  /**
91  * @brief The angle of the wires in the mapped V view
92  *
93  * @result The mapped wire angle
94  */
95  virtual float WireAngleV(const geo::TPCID::TPCID_t tpc,
96  const geo::CryostatID::CryostatID_t cstat) const = 0;
97 
98  /**
99  * @brief The angle of the wires in the mapped V view
100  *
101  * @result The mapped wire angle
102  */
103  virtual float WireAngleW(const geo::TPCID::TPCID_t tpc,
104  const geo::CryostatID::CryostatID_t cstat) const = 0;
105 
106  /**
107  * @brief Check whether a gap size is small enough to be registered as a detector gap
108  *
109  * @param gaps a cartesean vector holding gap sizes between adjacent TPCs
110  * @param deltas a cartesean vector holding distances between adjacent TPCs
111  * @param maxDisplacement the gap size threshold
112  * @result logic bool
113  */
114  virtual bool CheckDetectorGapSize(const geo::Vector_t& gaps,
115  const geo::Vector_t& deltas,
116  const float maxDisplacement) const = 0;
117 
118  /**
119  * @brief Create a detector gap
120  *
121  * @param point1 a point on TPC1 that are closest to TPC2
122  * @param point2 a point on TPC2 that are closest to TPC1
123  * @param width the gap sizes
124  * @result the detector gap object
125  */
126  virtual LArDetectorGap CreateDetectorGap(const geo::Point_t& point1,
127  const geo::Point_t& point2,
128  const geo::Vector_t& widths) const = 0;
129 
130  /**
131  * @brief Create detector gaps for all daughter volumes in a logical TPC volume
132  *
133  * @param driftVolume the parent drift volume
134  * @param maxDisplacement the gap size threshold
135  * @param listOfGaps the gaps vector to be filled
136  */
137  virtual void LoadDaughterDetectorGaps(const LArDriftVolume& driftVolume,
138  const float maxDisplacement,
139  LArDetectorGapList& listOfGaps) const = 0;
140 
141  /**
142  * @brief Create the line gap parameters to give to the pandora API
143  *
144  * @param gap the input detector gap
145  * @return the pandora API's line gap parameters object
146  */
148  const LArDetectorGap& gap) const = 0;
149 
150  /**
151  * @brief Create the line gap parameters to give to the pandora API
152  *
153  * @param view the LArSoft view
154  * @param tpc the LArSoft TPC ID
155  * @param cstat the LArSoft cryostat ID
156  * @param firstXYZ the first 3D coordinate
157  * @param lastXYZ the last 3D coordinate
158  * @param halfWirePitch the half wire pitch
159  * @param pPandora the pandora instance
160  * @param xFirst the min X of the gap
161  * @param xLast the max X of the gap
162  * @return the pandora API's line gap parameters object
163  */
165  const geo::View_t view,
166  const geo::TPCID::TPCID_t tpc,
167  const geo::CryostatID::CryostatID_t cstat,
168  const double firstXYZ[3],
169  const double lastXYZ[3],
170  const float halfWirePitch,
171  const float xFirst,
172  const float xLast,
173  const pandora::Pandora* pPandora) const = 0;
174  };
175 
176  namespace detector_functions {
177 
178  /**
179  * @brief Calculate the wire angle of a LArTPC view in a given TPC/cryostat
180  *
181  * @param view the LArSoft view
182  * @param tpc the LArSoft TPC ID
183  * @param cstat the LArSoft cryostat ID
184  * @param larsoftGeometry the LArSoft geometry service handle
185  * @return the wire angle
186  */
187  float WireAngle(const geo::View_t view,
188  const geo::TPCID::TPCID_t tpc,
189  const geo::CryostatID::CryostatID_t cstat,
190  const art::ServiceHandle<geo::Geometry>& larsoftGeometry);
191 
192  /**
193  * @brief Make the drift gap parameters for the Pandora API
194  *
195  * @param gap the detector gap object
196  * @return the line gap parameters for the Pandora API
197  */
199 
200  /**
201  * @brief Make the readout gap parameters for the Pandora API
202  *
203  * @param firstPoint the first point in the gap
204  * @param lastPoint the last point ih the gap
205  * @param xFirst the min X of the gap
206  * @param xLast the max X of the gap
207  * @param halfWirePitch the half wire pitch
208  * @param gapType the pandora gap type
209  * @return the line gap parameters for the Pandora API
210  */
212  const float firstPoint,
213  const float lastPoint,
214  const float xFirst,
215  const float xLast,
216  const float halfWirePitch,
217  const pandora::LineGapType gapType);
218 
219  } // namespace detector_functions
220 
221 } // namespace lar_pandora
222 #endif // #ifndef LAR_PANDORA_DETECTOR_TYPE_H
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 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 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.
enum geo::_plane_proj View_t
Enumerate the possible plane projections.
Empty interface to map pandora to specifics in the LArSoft geometry.
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 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 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.
virtual float WirePitchU() const =0
The wire pitch of the mapped U view.
Definitions of geometry vector data types.
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 float WirePitchW() const =0
The wire pitch of the mapped W view.
Definition of data types for geometry description.
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 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.
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.
virtual float WirePitchV() const =0
The wire pitch of the mapped V view.
fhicl::Table< sbnd::crt::CRTDetSimParams > Parameters
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.
virtual LArDetectorGap CreateDetectorGap(const geo::Point_t &point1, const geo::Point_t &point2, const geo::Vector_t &widths) const =0
Create a detector gap.
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
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
art framework interface to geometry description
virtual PandoraApi::Geometry::LineGap::Parameters CreateLineGapParametersFromDetectorGaps(const LArDetectorGap &gap) const =0
Create the line gap parameters to give to the pandora API.
drift volume class to hold properties of drift volume