VintageLArTPCThreeView.h
Go to the documentation of this file.
1 /**
2  * @file larpandora/LArPandoraInterface/Detectors/VintageLArTPCThreeView.h
3  *
4  * @brief Detector interface for an older-style 3view, horizontal drift, single-phase LArTPC (e.g. MicroBooNE, DUNEFD-HD, PDSP etc)
5  *
6  * $Log: $
7  */
8 
9 #ifndef LAR_PANDORA_DETECTOR_VINTAGE_LAR_TPC_THREE_VIEW_H
10 #define LAR_PANDORA_DETECTOR_VINTAGE_LAR_TPC_THREE_VIEW_H 1
11 
14 
15 #include "Api/PandoraApi.h"
16 #include "Managers/PluginManager.h"
17 #include "Pandora/Pandora.h"
18 #include "Plugins/LArTransformationPlugin.h"
19 
21 
22 namespace lar_pandora {
23 
24  /**
25  * @brief Detector interface for a 3view, horizontal drift, single-phase LArTPC
26  */
28  public:
30  const geo::CryostatID::CryostatID_t cstat) const override;
31 
33  const geo::CryostatID::CryostatID_t cstat) const override;
34 
36  const geo::CryostatID::CryostatID_t cstat) const override;
37 
38  virtual float WirePitchU() const override;
39 
40  virtual float WirePitchV() const override;
41 
42  virtual float WirePitchW() const override;
43 
44  virtual float WireAngleU(const geo::TPCID::TPCID_t tpc,
45  const geo::CryostatID::CryostatID_t cstat) const override;
46 
47  virtual float WireAngleV(const geo::TPCID::TPCID_t tpc,
48  const geo::CryostatID::CryostatID_t cstat) const override;
49 
50  virtual float WireAngleW(const geo::TPCID::TPCID_t tpc,
51  const geo::CryostatID::CryostatID_t cstat) const override;
52 
53  virtual bool CheckDetectorGapSize(const geo::Vector_t& gaps,
54  const geo::Vector_t& deltas,
55  const float maxDisplacement) const override;
56 
57  virtual LArDetectorGap CreateDetectorGap(const geo::Point_t& point1,
58  const geo::Point_t& point2,
59  const geo::Vector_t& widths) const override;
60 
61  virtual void LoadDaughterDetectorGaps(const LArDriftVolume& driftVolume,
62  const float maxDisplacement,
63  LArDetectorGapList& listOfGaps) const override;
64 
65  virtual PandoraApi::Geometry::LineGap::Parameters CreateLineGapParametersFromDetectorGaps(
66  const LArDetectorGap& gap) const override;
67 
68  virtual PandoraApi::Geometry::LineGap::Parameters CreateLineGapParametersFromReadoutGaps(
69  const geo::View_t view,
70  const geo::TPCID::TPCID_t tpc,
72  const double firstXYZ[3],
73  const double lastXYZ[3],
74  const float halfWirePitch,
75  const float xFirst,
76  const float xLast,
77  const pandora::Pandora* pPandora) const override;
78 
79  /**
80  * @brief Loan the LArSoft geometry handle owned by this class
81  *
82  * @result The LArSoft geometry handle
83  */
85 
86  private:
87  art::ServiceHandle<geo::Geometry> m_LArSoftGeometry; ///< the LArSoft geometry handle
88  };
89 
90  //------------------------------------------------------------------------------------------------------------------------------------------
91 
92  inline geo::View_t
94  const geo::CryostatID::CryostatID_t cstat) const
95  {
96  return (m_LArSoftGeometry->TPC(tpc, cstat).DriftDirection() == geo::kPosX ?
97  m_LArSoftGeometry->View(geo::PlaneID(cstat, tpc, 1)) :
98  m_LArSoftGeometry->View(geo::PlaneID(cstat, tpc, 0)));
99  }
100 
101  inline geo::View_t
103  const geo::CryostatID::CryostatID_t cstat) const
104  {
105  return (m_LArSoftGeometry->TPC(tpc, cstat).DriftDirection() == geo::kPosX ?
106  m_LArSoftGeometry->View(geo::PlaneID(cstat, tpc, 0)) :
107  m_LArSoftGeometry->View(geo::PlaneID(cstat, tpc, 1)));
108  }
109 
110  //------------------------------------------------------------------------------------------------------------------------------------------
111 
112  inline geo::View_t
114  const geo::CryostatID::CryostatID_t cstat) const
115  {
116  return m_LArSoftGeometry->View(geo::PlaneID(cstat, tpc, 2));
117  }
118 
119  //------------------------------------------------------------------------------------------------------------------------------------------
120 
121  inline float
123  {
124  return m_LArSoftGeometry->WirePitch(this->TargetViewU(0, 0));
125  }
126 
127  //------------------------------------------------------------------------------------------------------------------------------------------
128 
129  inline float
131  {
132  return m_LArSoftGeometry->WirePitch(this->TargetViewV(0, 0));
133  }
134 
135  //------------------------------------------------------------------------------------------------------------------------------------------
136 
137  inline float
139  {
140  return m_LArSoftGeometry->WirePitch(this->TargetViewW(0, 0));
141  }
142 
143  //------------------------------------------------------------------------------------------------------------------------------------------
144 
145  inline float
147  const geo::CryostatID::CryostatID_t cstat) const
148  {
150  this->TargetViewU(tpc, cstat), tpc, cstat, m_LArSoftGeometry);
151  }
152 
153  //------------------------------------------------------------------------------------------------------------------------------------------
154 
155  inline float
157  const geo::CryostatID::CryostatID_t cstat) const
158  {
160  this->TargetViewV(tpc, cstat), tpc, cstat, m_LArSoftGeometry);
161  }
162 
163  //------------------------------------------------------------------------------------------------------------------------------------------
164 
165  inline float
167  const geo::CryostatID::CryostatID_t cstat) const
168  {
170  this->TargetViewW(tpc, cstat), tpc, cstat, m_LArSoftGeometry);
171  }
172 
173  //------------------------------------------------------------------------------------------------------------------------------------------
174 
175  inline bool
177  const geo::Vector_t& deltas,
178  const float maxDisplacement) const
179  {
180  if (gaps.X() < 0.f || gaps.X() > maxDisplacement || deltas.Y() > maxDisplacement ||
181  deltas.Z() > maxDisplacement)
182  return false;
183  return true;
184  }
185 
186  //------------------------------------------------------------------------------------------------------------------------------------------
187 
188  inline LArDetectorGap
190  const geo::Point_t& point2,
191  const geo::Vector_t& widths) const
192  {
193  return LArDetectorGap(point1.X(), point1.Y(), point1.Z(), point2.X(), point2.Y(), point2.Z());
194  }
195 
196  //------------------------------------------------------------------------------------------------------------------------------------------
197 
198  inline void
200  const float maxDisplacement,
201  LArDetectorGapList& listOfGaps) const
202  {
203  return;
204  }
205 
206  //------------------------------------------------------------------------------------------------------------------------------------------
207 
208  inline PandoraApi::Geometry::LineGap::Parameters
210  {
212  }
213 
214  //------------------------------------------------------------------------------------------------------------------------------------------
215 
216  inline PandoraApi::Geometry::LineGap::Parameters
218  const geo::View_t view,
219  const geo::TPCID::TPCID_t tpc,
220  const geo::CryostatID::CryostatID_t cstat,
221  const double firstXYZ[3],
222  const double lastXYZ[3],
223  const float halfWirePitch,
224  const float xFirst,
225  const float xLast,
226  const pandora::Pandora* pPandora) const
227  {
228  float first(0.f), last(0.f);
229  pandora::LineGapType gapType(pandora::TPC_DRIFT_GAP);
230  if (view == this->TargetViewW(tpc, cstat)) {
231  first = firstXYZ[2];
232  last = lastXYZ[2];
233  gapType = pandora::TPC_WIRE_GAP_VIEW_W;
234  }
235  else if (view == this->TargetViewU(tpc, cstat)) {
236  first = pPandora->GetPlugins()->GetLArTransformationPlugin()->YZtoU(firstXYZ[1], firstXYZ[2]);
237  last = pPandora->GetPlugins()->GetLArTransformationPlugin()->YZtoU(lastXYZ[1], lastXYZ[2]);
238  gapType = pandora::TPC_WIRE_GAP_VIEW_U;
239  }
240  else if (view == this->TargetViewV(tpc, cstat)) {
241  first = pPandora->GetPlugins()->GetLArTransformationPlugin()->YZtoV(firstXYZ[1], firstXYZ[2]);
242  last = pPandora->GetPlugins()->GetLArTransformationPlugin()->YZtoV(lastXYZ[1], lastXYZ[2]);
243  gapType = pandora::TPC_WIRE_GAP_VIEW_V;
244  }
246  first, last, xFirst, xLast, halfWirePitch, gapType);
247  }
248 
249  //------------------------------------------------------------------------------------------------------------------------------------------
250 
253  {
254  return m_LArSoftGeometry;
255  }
256 
257 } // namespace lar_pandora
258 #endif // #ifndef LAR_PANDORA_DETECTOR_VINTAGE_LAR_TPC_THREE_VIEW_H
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 override
Create the line gap parameters to give to the pandora API.
Helper functions for extracting detector geometry for use in reconsruction.
virtual bool CheckDetectorGapSize(const geo::Vector_t &gaps, const geo::Vector_t &deltas, const float maxDisplacement) const override
Check whether a gap size is small enough to be registered as a detector gap.
enum geo::_plane_proj View_t
Enumerate the possible plane projections.
virtual geo::View_t TargetViewV(const geo::TPCID::TPCID_t tpc, const geo::CryostatID::CryostatID_t cstat) const override
Map a LArSoft view to Pandora&#39;s V view.
Empty interface to map pandora to specifics in the LArSoft geometry.
The data type to uniquely identify a Plane.
Definition: geo_types.h:472
virtual float WirePitchW() const override
The wire pitch of the mapped W view.
virtual LArDetectorGap CreateDetectorGap(const geo::Point_t &point1, const geo::Point_t &point2, const geo::Vector_t &widths) const override
Create a detector gap.
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 TargetViewU(const geo::TPCID::TPCID_t tpc, const geo::CryostatID::CryostatID_t cstat) const override
Map a LArSoft view to Pandora&#39;s U view.
virtual geo::View_t TargetViewW(const geo::TPCID::TPCID_t tpc, const geo::CryostatID::CryostatID_t cstat) const override
Map a LArSoft view to Pandora&#39;s W view.
geo::Length_t WirePitch(geo::PlaneID const &planeid) const
Returns the distance between two consecutive wires.
virtual float WireAngleW(const geo::TPCID::TPCID_t tpc, const geo::CryostatID::CryostatID_t cstat) const override
The angle of the wires in the mapped V view.
art framework interface to geometry description
virtual float WireAngleU(const geo::TPCID::TPCID_t tpc, const geo::CryostatID::CryostatID_t cstat) const override
The angle of the wires in the mapped U view.
virtual float WirePitchV() const override
The wire pitch of the mapped V view.
Detector interface for a 3view, horizontal drift, single-phase LArTPC.
virtual float WireAngleV(const geo::TPCID::TPCID_t tpc, const geo::CryostatID::CryostatID_t cstat) const override
The angle of the wires in the mapped V view.
virtual void LoadDaughterDetectorGaps(const LArDriftVolume &driftVolume, const float maxDisplacement, LArDetectorGapList &listOfGaps) const override
Create detector gaps for all daughter volumes in a logical TPC volume.
const art::ServiceHandle< geo::Geometry > & GetLArSoftGeometry() const
Loan the LArSoft geometry handle owned by this class.
art::ServiceHandle< geo::Geometry > m_LArSoftGeometry
the LArSoft geometry handle
View_t View(geo::PlaneID const &pid) const
Returns the view (wire orientation) on the channels of specified TPC plane.
DriftDirection_t DriftDirection() const
Returns an enumerator value describing the drift direction.
Definition: TPCGeo.h:144
virtual float WirePitchU() const override
The wire pitch of the mapped U 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.
virtual PandoraApi::Geometry::LineGap::Parameters CreateLineGapParametersFromDetectorGaps(const LArDetectorGap &gap) const override
Create the line gap parameters to give to the pandora API.
unsigned int TPCID_t
Type for the ID number.
Definition: geo_types.h:387
Drift towards positive X values.
Definition: geo_types.h:161
std::vector< LArDetectorGap > LArDetectorGapList
TPCGeo const & TPC(unsigned int const tpc=0, unsigned int const cstat=0) const
Returns the specified TPC.
drift volume class to hold properties of drift volume
Helper functions for extracting detector geometry for use in reconsruction.
drift volume class to hold properties of drift volume