LArSoft  v10_04_05
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 
23 
24 namespace lar_pandora {
25 
30  public:
32  const geo::CryostatID::CryostatID_t cstat) const override;
33 
35  const geo::CryostatID::CryostatID_t cstat) const override;
36 
38  const geo::CryostatID::CryostatID_t cstat) const override;
39 
40  float WirePitchU() const override;
41 
42  float WirePitchV() const override;
43 
44  float WirePitchW() const override;
45 
46  float WireAngleU(const geo::TPCID::TPCID_t tpc,
47  const geo::CryostatID::CryostatID_t cstat) const override;
48 
49  float WireAngleV(const geo::TPCID::TPCID_t tpc,
50  const geo::CryostatID::CryostatID_t cstat) const override;
51 
52  float WireAngleW(const geo::TPCID::TPCID_t tpc,
53  const geo::CryostatID::CryostatID_t cstat) const override;
54 
55  bool CheckDetectorGapSize(const geo::Vector_t& gaps,
56  const geo::Vector_t& deltas,
57  const float maxDisplacement) const override;
58 
60  const geo::Point_t& point2,
61  const geo::Vector_t& widths) const override;
62 
63  void LoadDaughterDetectorGaps(const LArDriftVolume& driftVolume,
64  const float maxDisplacement,
65  LArDetectorGapList& listOfGaps) const override;
66 
67  PandoraApi::Geometry::LineGap::Parameters CreateLineGapParametersFromDetectorGaps(
68  const LArDetectorGap& gap) const override;
69 
70  PandoraApi::Geometry::LineGap::Parameters CreateLineGapParametersFromReadoutGaps(
71  const geo::View_t view,
72  const geo::TPCID::TPCID_t tpc,
74  const geo::Point_t& firstXYZ,
75  const geo::Point_t& lastXYZ,
76  const float halfWirePitch,
77  const float xFirst,
78  const float xLast,
79  const pandora::Pandora* pPandora) const override;
80 
87  const geo::WireReadoutGeom& GetChannelMap() const;
88 
89  private:
92  };
93 
94  //------------------------------------------------------------------------------------------------------------------------------------------
95 
97  const geo::TPCID::TPCID_t tpc,
98  const geo::CryostatID::CryostatID_t cstat) const
99  {
100  geo::TPCID const tpcID{cstat, tpc};
101  auto const [_, sign] = m_LArSoftGeometry->TPC(tpcID).DriftAxisWithSign();
102  return (sign == geo::DriftSign::Positive ?
103  m_wireReadoutGeom->Plane(geo::PlaneID(tpcID, 1)).View() :
104  m_wireReadoutGeom->Plane(geo::PlaneID(tpcID, 0)).View());
105  }
106 
108  const geo::TPCID::TPCID_t tpc,
109  const geo::CryostatID::CryostatID_t cstat) const
110  {
111  geo::TPCID const tpcID{cstat, tpc};
112  auto const [_, sign] = m_LArSoftGeometry->TPC(tpcID).DriftAxisWithSign();
113  return (sign == geo::DriftSign::Positive ?
114  m_wireReadoutGeom->Plane(geo::PlaneID(tpcID, 0)).View() :
115  m_wireReadoutGeom->Plane(geo::PlaneID(tpcID, 1)).View());
116  }
117 
118  //------------------------------------------------------------------------------------------------------------------------------------------
119 
121  const geo::TPCID::TPCID_t tpc,
122  const geo::CryostatID::CryostatID_t cstat) const
123  {
124  return m_wireReadoutGeom->Plane({cstat, tpc, 2}).View();
125  }
126 
127  //------------------------------------------------------------------------------------------------------------------------------------------
128 
130  {
131  return m_wireReadoutGeom->Plane({0, 0}, TargetViewU(0, 0)).WirePitch();
132  }
133 
134  //------------------------------------------------------------------------------------------------------------------------------------------
135 
137  {
138  return m_wireReadoutGeom->Plane({0, 0}, TargetViewV(0, 0)).WirePitch();
139  }
140 
141  //------------------------------------------------------------------------------------------------------------------------------------------
142 
144  {
145  return m_wireReadoutGeom->Plane({0, 0}, TargetViewW(0, 0)).WirePitch();
146  }
147 
148  //------------------------------------------------------------------------------------------------------------------------------------------
149 
151  const geo::CryostatID::CryostatID_t cstat) const
152  {
153  return detector_functions::WireAngle(TargetViewU(tpc, cstat), tpc, cstat, *m_wireReadoutGeom);
154  }
155 
156  //------------------------------------------------------------------------------------------------------------------------------------------
157 
159  const geo::CryostatID::CryostatID_t cstat) const
160  {
161  return detector_functions::WireAngle(TargetViewV(tpc, cstat), tpc, cstat, *m_wireReadoutGeom);
162  }
163 
164  //------------------------------------------------------------------------------------------------------------------------------------------
165 
167  const geo::CryostatID::CryostatID_t cstat) const
168  {
169  return detector_functions::WireAngle(TargetViewW(tpc, cstat), tpc, cstat, *m_wireReadoutGeom);
170  }
171 
172  //------------------------------------------------------------------------------------------------------------------------------------------
173 
175  const geo::Vector_t& deltas,
176  const float maxDisplacement) const
177  {
178  if (gaps.X() < 0.f || gaps.X() > maxDisplacement || deltas.Y() > maxDisplacement ||
179  deltas.Z() > maxDisplacement)
180  return false;
181  return true;
182  }
183 
184  //------------------------------------------------------------------------------------------------------------------------------------------
185 
187  const geo::Point_t& point2,
188  const geo::Vector_t& widths) const
189  {
190  return LArDetectorGap(point1.X(), point1.Y(), point1.Z(), point2.X(), point2.Y(), point2.Z());
191  }
192 
193  //------------------------------------------------------------------------------------------------------------------------------------------
194 
196  const float maxDisplacement,
197  LArDetectorGapList& listOfGaps) const
198  {
199  return;
200  }
201 
202  //------------------------------------------------------------------------------------------------------------------------------------------
203 
204  inline PandoraApi::Geometry::LineGap::Parameters
206  {
208  }
209 
210  //------------------------------------------------------------------------------------------------------------------------------------------
211 
212  inline PandoraApi::Geometry::LineGap::Parameters
214  const geo::View_t view,
215  const geo::TPCID::TPCID_t tpc,
216  const geo::CryostatID::CryostatID_t cstat,
217  const geo::Point_t& firstXYZ,
218  const geo::Point_t& lastXYZ,
219  const float halfWirePitch,
220  const float xFirst,
221  const float xLast,
222  const pandora::Pandora* pPandora) const
223  {
224  float first(0.f), last(0.f);
225  pandora::LineGapType gapType(pandora::TPC_DRIFT_GAP);
226  if (view == TargetViewW(tpc, cstat)) {
227  first = firstXYZ.Z();
228  last = lastXYZ.Z();
229  gapType = pandora::TPC_WIRE_GAP_VIEW_W;
230  }
231  else if (view == TargetViewU(tpc, cstat)) {
232  first =
233  pPandora->GetPlugins()->GetLArTransformationPlugin()->YZtoU(firstXYZ.Y(), firstXYZ.Z());
234  last = pPandora->GetPlugins()->GetLArTransformationPlugin()->YZtoU(lastXYZ.Y(), lastXYZ.Z());
235  gapType = pandora::TPC_WIRE_GAP_VIEW_U;
236  }
237  else if (view == TargetViewV(tpc, cstat)) {
238  first =
239  pPandora->GetPlugins()->GetLArTransformationPlugin()->YZtoV(firstXYZ.Y(), firstXYZ.Z());
240  last = pPandora->GetPlugins()->GetLArTransformationPlugin()->YZtoV(lastXYZ.Y(), lastXYZ.Z());
241  gapType = pandora::TPC_WIRE_GAP_VIEW_V;
242  }
244  first, last, xFirst, xLast, halfWirePitch, gapType);
245  }
246 
247  //------------------------------------------------------------------------------------------------------------------------------------------
248 
250  {
251  return *m_LArSoftGeometry;
252  }
253 
255  {
256  return *m_wireReadoutGeom;
257  }
258 
259 } // namespace lar_pandora
260 #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
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.
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:364
float WirePitchW() const override
The wire pitch of the mapped W view.
cout<< "Opened file "<< fin<< " ixs= "<< ixs<< endl;if(ixs==0) hhh=(TH1F *) fff-> Get("h1")
Definition: AddMC.C:8
LArDetectorGap CreateDetectorGap(const geo::Point_t &point1, const geo::Point_t &point2, const geo::Vector_t &widths) const override
Create a detector gap.
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.
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.
DriftAxis DriftAxisWithSign() const
Returns the expected drift direction based on geometry.
Definition: TPCGeo.h:78
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.
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.
const geo::GeometryCore & GetLArSoftGeometry() const
Loan the LArSoft geometry handle owned by this class.
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.
TFile f
Definition: plotHisto.C:6
float WirePitchV() const override
The wire pitch of the mapped V view.
View_t View() const
Which coordinate does this plane measure.
Definition: PlaneGeo.h:155
Detector interface for a 3view, horizontal drift, single-phase LArTPC.
Interface for a class providing readout channel mapping to geometry.
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.
void LoadDaughterDetectorGaps(const LArDriftVolume &driftVolume, const float maxDisplacement, LArDetectorGapList &listOfGaps) const override
Create detector gaps for all daughter volumes in a logical TPC volume.
art::ServiceHandle< geo::Geometry > m_LArSoftGeometry
the LArSoft geometry handle
The data type to uniquely identify a TPC.
Definition: geo_types.h:306
Description of the physical geometry of one entire detector.
Definition: GeometryCore.h:91
const geo::WireReadoutGeom & GetChannelMap() const
geo::WireReadoutGeom const * m_wireReadoutGeom
float WirePitchU() const override
The wire pitch of the mapped U view.
float WireAngle(const geo::View_t view, const geo::TPCID::TPCID_t tpc, const geo::CryostatID::CryostatID_t cstat, const geo::WireReadoutGeom &wireReadoutGeom)
Calculate the wire angle of a LArTPC view in a given TPC/cryostat.
int sign(double val)
Definition: UtilFunc.cxx:104
Drift towards positive values.
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:188
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.
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:307
std::vector< LArDetectorGap > LArDetectorGapList
drift volume class to hold properties of drift volume
PlaneGeo const & Plane(TPCID const &tpcid, View_t view) const
Returns the specified wire.
TPCGeo const & TPC(TPCID const &tpcid=details::tpc_zero) const
Returns the specified TPC.
Definition: GeometryCore.h:448
Helper functions for extracting detector geometry for use in reconsruction.
art framework interface to geometry description
drift volume class to hold properties of drift volume