LArSoft  v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
VintageLArTPCThreeView.h
Go to the documentation of this file.
1 
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 
22 
23 namespace lar_pandora {
24 
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 
66  virtual PandoraApi::Geometry::LineGap::Parameters CreateLineGapParametersFromDetectorGaps(
67  const LArDetectorGap& gap) const override;
68 
69  virtual PandoraApi::Geometry::LineGap::Parameters CreateLineGapParametersFromReadoutGaps(
70  const geo::View_t view,
71  const geo::TPCID::TPCID_t tpc,
73  const geo::Point_t& firstXYZ,
74  const geo::Point_t& lastXYZ,
75  const float halfWirePitch,
76  const float xFirst,
77  const float xLast,
78  const pandora::Pandora* pPandora) const override;
79 
86 
87  private:
89  };
90 
91  //------------------------------------------------------------------------------------------------------------------------------------------
92 
94  const geo::TPCID::TPCID_t tpc,
95  const geo::CryostatID::CryostatID_t cstat) const
96  {
97  geo::TPCID const tpcID{cstat, tpc};
98  return (m_LArSoftGeometry->TPC(tpcID).DriftDirection() == geo::kPosX ?
99  m_LArSoftGeometry->View(geo::PlaneID(tpcID, 1)) :
100  m_LArSoftGeometry->View(geo::PlaneID(tpcID, 0)));
101  }
102 
104  const geo::TPCID::TPCID_t tpc,
105  const geo::CryostatID::CryostatID_t cstat) const
106  {
107  geo::TPCID const tpcID{cstat, tpc};
108  return (m_LArSoftGeometry->TPC(tpcID).DriftDirection() == geo::kPosX ?
109  m_LArSoftGeometry->View(geo::PlaneID(tpcID, 0)) :
110  m_LArSoftGeometry->View(geo::PlaneID(tpcID, 1)));
111  }
112 
113  //------------------------------------------------------------------------------------------------------------------------------------------
114 
116  const geo::TPCID::TPCID_t tpc,
117  const geo::CryostatID::CryostatID_t cstat) const
118  {
119  return m_LArSoftGeometry->View(geo::PlaneID(cstat, tpc, 2));
120  }
121 
122  //------------------------------------------------------------------------------------------------------------------------------------------
123 
125  {
126  return m_LArSoftGeometry->WirePitch(this->TargetViewU(0, 0));
127  }
128 
129  //------------------------------------------------------------------------------------------------------------------------------------------
130 
132  {
133  return m_LArSoftGeometry->WirePitch(this->TargetViewV(0, 0));
134  }
135 
136  //------------------------------------------------------------------------------------------------------------------------------------------
137 
139  {
140  return m_LArSoftGeometry->WirePitch(this->TargetViewW(0, 0));
141  }
142 
143  //------------------------------------------------------------------------------------------------------------------------------------------
144 
146  const geo::CryostatID::CryostatID_t cstat) const
147  {
149  this->TargetViewU(tpc, cstat), tpc, cstat, m_LArSoftGeometry);
150  }
151 
152  //------------------------------------------------------------------------------------------------------------------------------------------
153 
155  const geo::CryostatID::CryostatID_t cstat) const
156  {
158  this->TargetViewV(tpc, cstat), tpc, cstat, m_LArSoftGeometry);
159  }
160 
161  //------------------------------------------------------------------------------------------------------------------------------------------
162 
164  const geo::CryostatID::CryostatID_t cstat) const
165  {
167  this->TargetViewW(tpc, cstat), tpc, cstat, m_LArSoftGeometry);
168  }
169 
170  //------------------------------------------------------------------------------------------------------------------------------------------
171 
173  const geo::Vector_t& deltas,
174  const float maxDisplacement) const
175  {
176  if (gaps.X() < 0.f || gaps.X() > maxDisplacement || deltas.Y() > maxDisplacement ||
177  deltas.Z() > maxDisplacement)
178  return false;
179  return true;
180  }
181 
182  //------------------------------------------------------------------------------------------------------------------------------------------
183 
185  const geo::Point_t& point2,
186  const geo::Vector_t& widths) const
187  {
188  return LArDetectorGap(point1.X(), point1.Y(), point1.Z(), point2.X(), point2.Y(), point2.Z());
189  }
190 
191  //------------------------------------------------------------------------------------------------------------------------------------------
192 
194  const float maxDisplacement,
195  LArDetectorGapList& listOfGaps) const
196  {
197  return;
198  }
199 
200  //------------------------------------------------------------------------------------------------------------------------------------------
201 
202  inline PandoraApi::Geometry::LineGap::Parameters
204  {
206  }
207 
208  //------------------------------------------------------------------------------------------------------------------------------------------
209 
210  inline PandoraApi::Geometry::LineGap::Parameters
212  const geo::View_t view,
213  const geo::TPCID::TPCID_t tpc,
214  const geo::CryostatID::CryostatID_t cstat,
215  const geo::Point_t& firstXYZ,
216  const geo::Point_t& lastXYZ,
217  const float halfWirePitch,
218  const float xFirst,
219  const float xLast,
220  const pandora::Pandora* pPandora) const
221  {
222  float first(0.f), last(0.f);
223  pandora::LineGapType gapType(pandora::TPC_DRIFT_GAP);
224  if (view == this->TargetViewW(tpc, cstat)) {
225  first = firstXYZ.Z();
226  last = lastXYZ.Z();
227  gapType = pandora::TPC_WIRE_GAP_VIEW_W;
228  }
229  else if (view == this->TargetViewU(tpc, cstat)) {
230  first =
231  pPandora->GetPlugins()->GetLArTransformationPlugin()->YZtoU(firstXYZ.Y(), firstXYZ.Z());
232  last = pPandora->GetPlugins()->GetLArTransformationPlugin()->YZtoU(lastXYZ.Y(), lastXYZ.Z());
233  gapType = pandora::TPC_WIRE_GAP_VIEW_U;
234  }
235  else if (view == this->TargetViewV(tpc, cstat)) {
236  first =
237  pPandora->GetPlugins()->GetLArTransformationPlugin()->YZtoV(firstXYZ.Y(), firstXYZ.Z());
238  last = pPandora->GetPlugins()->GetLArTransformationPlugin()->YZtoV(lastXYZ.Y(), lastXYZ.Z());
239  gapType = pandora::TPC_WIRE_GAP_VIEW_V;
240  }
242  first, last, xFirst, xLast, halfWirePitch, gapType);
243  }
244 
245  //------------------------------------------------------------------------------------------------------------------------------------------
246 
248  {
249  return m_LArSoftGeometry;
250  }
251 
252 } // namespace lar_pandora
253 #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:160
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:463
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.
virtual PandoraApi::Geometry::LineGap::Parameters CreateLineGapParametersFromReadoutGaps(const geo::View_t view, const geo::TPCID::TPCID_t tpc, const geo::CryostatID::CryostatID_t cstat, const geo::Point_t &firstXYZ, const geo::Point_t &lastXYZ, 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 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.
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 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.
TPCGeo const & TPC(TPCID const &tpcid=tpc_zero) const
Returns the specified TPC.
Definition: GeometryCore.h:722
TFile f
Definition: plotHisto.C:6
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
The data type to uniquely identify a TPC.
Definition: geo_types.h:381
DriftDirection_t DriftDirection() const
Returns an enumerator value describing the drift direction.
Definition: TPCGeo.h:121
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:180
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:193
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:382
Drift towards positive X values.
Definition: geo_types.h:166
std::vector< LArDetectorGap > LArDetectorGapList
View_t View(PlaneID const &pid) const
Returns the view (wire orientation) on the channels of specified TPC plane.
drift volume class to hold properties of drift volume
Helper functions for extracting detector geometry for use in reconsruction.
Length_t WirePitch(PlaneID const &planeid=plane_zero) const
Returns the distance between two consecutive wires.
art framework interface to geometry description
drift volume class to hold properties of drift volume