All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
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 #include "art/Framework/Services/Registry/ServiceHandle.h"
22 
23 namespace lar_pandora {
24 
25  /**
26  * @brief Detector interface for a 3view, horizontal drift, single-phase LArTPC
27  */
29  public:
31  const geo::CryostatID::CryostatID_t cstat) const override;
32 
34  const geo::CryostatID::CryostatID_t cstat) const override;
35 
37  const geo::CryostatID::CryostatID_t cstat) const override;
38 
39  virtual float WirePitchU() const override;
40 
41  virtual float WirePitchV() const override;
42 
43  virtual float WirePitchW() const override;
44 
45  virtual float WireAngleU(const geo::TPCID::TPCID_t tpc,
46  const geo::CryostatID::CryostatID_t cstat) const override;
47 
48  virtual float WireAngleV(const geo::TPCID::TPCID_t tpc,
49  const geo::CryostatID::CryostatID_t cstat) const override;
50 
51  virtual float WireAngleW(const geo::TPCID::TPCID_t tpc,
52  const geo::CryostatID::CryostatID_t cstat) const override;
53 
54  virtual bool CheckDetectorGapSize(const geo::Vector_t& gaps,
55  const geo::Vector_t& deltas,
56  const float maxDisplacement) const override;
57 
58  virtual LArDetectorGap CreateDetectorGap(const geo::Point_t& point1,
59  const geo::Point_t& point2,
60  const geo::Vector_t& widths) const override;
61 
62  virtual void LoadDaughterDetectorGaps(const LArDriftVolume& driftVolume,
63  const float maxDisplacement,
64  LArDetectorGapList& listOfGaps) const override;
65 
67  const LArDetectorGap& gap) const override;
68 
70  const geo::View_t view,
71  const geo::TPCID::TPCID_t tpc,
73  const double firstXYZ[3],
74  const double lastXYZ[3],
75  const float halfWirePitch,
76  const float xFirst,
77  const float xLast,
78  const pandora::Pandora* pPandora) const override;
79 
80  /**
81  * @brief Loan the LArSoft geometry handle owned by this class
82  *
83  * @result The LArSoft geometry handle
84  */
85  const art::ServiceHandle<geo::Geometry>& GetLArSoftGeometry() const;
86 
87  private:
88  art::ServiceHandle<geo::Geometry> m_LArSoftGeometry; ///< the LArSoft geometry handle
89  };
90 
91  //------------------------------------------------------------------------------------------------------------------------------------------
92 
93  inline geo::View_t
95  const geo::CryostatID::CryostatID_t cstat) const
96  {
97  return (m_LArSoftGeometry->TPC(tpc, cstat).DriftDirection() == geo::kPosX ?
98  m_LArSoftGeometry->View(geo::PlaneID(cstat, tpc, 1)) :
99  m_LArSoftGeometry->View(geo::PlaneID(cstat, tpc, 0)));
100  }
101 
102  inline geo::View_t
104  const geo::CryostatID::CryostatID_t cstat) const
105  {
106  return (m_LArSoftGeometry->TPC(tpc, cstat).DriftDirection() == geo::kPosX ?
107  m_LArSoftGeometry->View(geo::PlaneID(cstat, tpc, 0)) :
108  m_LArSoftGeometry->View(geo::PlaneID(cstat, tpc, 1)));
109  }
110 
111  //------------------------------------------------------------------------------------------------------------------------------------------
112 
113  inline geo::View_t
115  const geo::CryostatID::CryostatID_t cstat) const
116  {
117  return m_LArSoftGeometry->View(geo::PlaneID(cstat, tpc, 2));
118  }
119 
120  //------------------------------------------------------------------------------------------------------------------------------------------
121 
122  inline float
124  {
125  return m_LArSoftGeometry->WirePitch(this->TargetViewU(0, 0));
126  }
127 
128  //------------------------------------------------------------------------------------------------------------------------------------------
129 
130  inline float
132  {
133  return m_LArSoftGeometry->WirePitch(this->TargetViewV(0, 0));
134  }
135 
136  //------------------------------------------------------------------------------------------------------------------------------------------
137 
138  inline float
140  {
141  return m_LArSoftGeometry->WirePitch(this->TargetViewW(0, 0));
142  }
143 
144  //------------------------------------------------------------------------------------------------------------------------------------------
145 
146  inline float
148  const geo::CryostatID::CryostatID_t cstat) const
149  {
151  this->TargetViewU(tpc, cstat), tpc, cstat, m_LArSoftGeometry);
152  }
153 
154  //------------------------------------------------------------------------------------------------------------------------------------------
155 
156  inline float
158  const geo::CryostatID::CryostatID_t cstat) const
159  {
161  this->TargetViewV(tpc, cstat), tpc, cstat, m_LArSoftGeometry);
162  }
163 
164  //------------------------------------------------------------------------------------------------------------------------------------------
165 
166  inline float
168  const geo::CryostatID::CryostatID_t cstat) const
169  {
171  this->TargetViewW(tpc, cstat), tpc, cstat, m_LArSoftGeometry);
172  }
173 
174  //------------------------------------------------------------------------------------------------------------------------------------------
175 
176  inline bool
178  const geo::Vector_t& deltas,
179  const float maxDisplacement) const
180  {
181  if (gaps.X() < 0.f || gaps.X() > maxDisplacement || deltas.Y() > maxDisplacement ||
182  deltas.Z() > maxDisplacement)
183  return false;
184  return true;
185  }
186 
187  //------------------------------------------------------------------------------------------------------------------------------------------
188 
189  inline LArDetectorGap
191  const geo::Point_t& point2,
192  const geo::Vector_t& widths) const
193  {
194  return LArDetectorGap(point1.X(), point1.Y(), point1.Z(), point2.X(), point2.Y(), point2.Z());
195  }
196 
197  //------------------------------------------------------------------------------------------------------------------------------------------
198 
199  inline void
201  const float maxDisplacement,
202  LArDetectorGapList& listOfGaps) const
203  {
204  return;
205  }
206 
207  //------------------------------------------------------------------------------------------------------------------------------------------
208 
211  {
213  }
214 
215  //------------------------------------------------------------------------------------------------------------------------------------------
216 
219  const geo::View_t view,
220  const geo::TPCID::TPCID_t tpc,
221  const geo::CryostatID::CryostatID_t cstat,
222  const double firstXYZ[3],
223  const double lastXYZ[3],
224  const float halfWirePitch,
225  const float xFirst,
226  const float xLast,
227  const pandora::Pandora* pPandora) const
228  {
229  float first(0.f), last(0.f);
230  pandora::LineGapType gapType(pandora::TPC_DRIFT_GAP);
231  if (view == this->TargetViewW(tpc, cstat)) {
232  first = firstXYZ[2];
233  last = lastXYZ[2];
234  gapType = pandora::TPC_WIRE_GAP_VIEW_W;
235  }
236  else if (view == this->TargetViewU(tpc, cstat)) {
237  first = pPandora->GetPlugins()->GetLArTransformationPlugin()->YZtoU(firstXYZ[1], firstXYZ[2]);
238  last = pPandora->GetPlugins()->GetLArTransformationPlugin()->YZtoU(lastXYZ[1], lastXYZ[2]);
239  gapType = pandora::TPC_WIRE_GAP_VIEW_U;
240  }
241  else if (view == this->TargetViewV(tpc, cstat)) {
242  first = pPandora->GetPlugins()->GetLArTransformationPlugin()->YZtoV(firstXYZ[1], firstXYZ[2]);
243  last = pPandora->GetPlugins()->GetLArTransformationPlugin()->YZtoV(lastXYZ[1], lastXYZ[2]);
244  gapType = pandora::TPC_WIRE_GAP_VIEW_V;
245  }
247  first, last, xFirst, xLast, halfWirePitch, gapType);
248  }
249 
250  //------------------------------------------------------------------------------------------------------------------------------------------
251 
252  inline const art::ServiceHandle<geo::Geometry>&
254  {
255  return m_LArSoftGeometry;
256  }
257 
258 } // namespace lar_pandora
259 #endif // #ifndef LAR_PANDORA_DETECTOR_VINTAGE_LAR_TPC_THREE_VIEW_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 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 float WirePitchU() const override
The wire pitch of 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.
The data type to uniquely identify a Plane.
Definition: geo_types.h:472
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.
virtual float WirePitchV() const override
The wire pitch of the mapped V 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.
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.
Detector interface for a 3view, horizontal drift, single-phase LArTPC.
virtual PandoraApi::Geometry::LineGap::Parameters CreateLineGapParametersFromDetectorGaps(const LArDetectorGap &gap) const override
Create the line gap parameters to give to the pandora API.
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
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.
fhicl::Table< sbnd::crt::CRTDetSimParams > Parameters
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.
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 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.
unsigned int TPCID_t
Type for the ID number.
Definition: geo_types.h:387
Drift towards positive X values.
Definition: geo_types.h:161
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.
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.
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
Helper functions for extracting detector geometry for use in reconsruction.
virtual LArDetectorGap CreateDetectorGap(const geo::Point_t &point1, const geo::Point_t &point2, const geo::Vector_t &widths) const override
Create a detector gap.
art framework interface to geometry description
drift volume class to hold properties of drift volume
virtual float WirePitchW() const override
The wire pitch of the mapped W view.