ProtoDUNEDualPhase.h
Go to the documentation of this file.
1 /**
2  * @file larpandora/LArPandoraInterface/Detectors/ProtoDUNEDualPhase.h
3  *
4  * @brief Detector interface for ProtoDUNE dual phase
5  *
6  * $Log: $
7  */
8 
11 
13 
14 namespace lar_pandora {
15 
16  /**
17  * @brief Detector interface for ProtoDUNE dual phase
18  */
20  public:
22  const geo::CryostatID::CryostatID_t cstat) const override;
23 
25  const geo::CryostatID::CryostatID_t cstat) const override;
26 
28  const geo::CryostatID::CryostatID_t cstat) const override;
29 
30  float WirePitchW() const override;
31 
32  float WireAngleW(const geo::TPCID::TPCID_t tpc,
33  const geo::CryostatID::CryostatID_t cstat) const override;
34 
35  bool CheckDetectorGapSize(const geo::Vector_t& gaps,
36  const geo::Vector_t& deltas,
37  const float maxDisplacement) const override;
38 
40  const geo::Point_t& point2,
41  const geo::Vector_t& widths) const override;
42 
43  void LoadDaughterDetectorGaps(const LArDriftVolume& driftVolume,
44  const float maxDisplacement,
45  LArDetectorGapList& listOfGaps) const override;
46 
47  PandoraApi::Geometry::LineGap::Parameters CreateLineGapParametersFromDetectorGaps(
48  const LArDetectorGap& gap) const override;
49 
50  PandoraApi::Geometry::LineGap::Parameters CreateLineGapParametersFromReadoutGaps(
51  const geo::View_t view,
52  const geo::TPCID::TPCID_t tpc,
54  const double firstXYZ[3],
55  const double lastXYZ[3],
56  const float halfWirePitch,
57  const float xFirst,
58  const float xLast,
59  const pandora::Pandora* pPandora) const override;
60  };
61 
62  //------------------------------------------------------------------------------------------------------------------------------------------
63 
64  inline geo::View_t
66  const geo::CryostatID::CryostatID_t cstat) const
67  {
68  return this->GetLArSoftGeometry()->View(geo::PlaneID(cstat, tpc, 1));
69  }
70 
71  //------------------------------------------------------------------------------------------------------------------------------------------
72 
73  inline geo::View_t
75  const geo::CryostatID::CryostatID_t cstat) const
76  {
77  return this->GetLArSoftGeometry()->View(geo::PlaneID(cstat, tpc, 0));
78  }
79 
80  //------------------------------------------------------------------------------------------------------------------------------------------
81 
82  inline geo::View_t
84  const geo::CryostatID::CryostatID_t cstat) const
85  {
86  return geo::kUnknown;
87  }
88 
89  //------------------------------------------------------------------------------------------------------------------------------------------
90 
91  inline float
93  {
94  return 0.5f * (this->WirePitchU() + this->WirePitchV());
95  }
96 
97  //------------------------------------------------------------------------------------------------------------------------------------------
98 
99  inline float
101  const geo::CryostatID::CryostatID_t cstat) const
102  {
103  return std::numeric_limits<float>::epsilon();
104  }
105 
106  //------------------------------------------------------------------------------------------------------------------------------------------
107 
108  inline bool
110  const geo::Vector_t& deltas,
111  const float maxDisplacement) const
112  {
113  return (std::fabs(gaps.Y()) > maxDisplacement || std::fabs(gaps.Z()) > maxDisplacement);
114  }
115 
116  //------------------------------------------------------------------------------------------------------------------------------------------
117 
118  inline LArDetectorGap
120  const geo::Point_t& point2,
121  const geo::Vector_t& widths) const
122  {
123  return LArDetectorGap(point1.X(),
124  point1.Y() + widths.Y(),
125  point1.Z() + widths.Z(),
126  point2.X(),
127  point2.Y() - widths.Y(),
128  point2.Z() - widths.Z());
129  }
130 
131  //------------------------------------------------------------------------------------------------------------------------------------------
132 
133  inline PandoraApi::Geometry::LineGap::Parameters
135  {
136  const bool isGapInU((
137  std::fabs(gap.GetY2() - gap.GetY1()) >
138  gap
139  .GetMaxGapSize())); //Could have chosen Z here, resulting in switching Y<->Z and U<->V in the block below
140  PandoraApi::Geometry::LineGap::Parameters parameters;
141  parameters.m_lineGapType =
142  (isGapInU ?
143  pandora::TPC_WIRE_GAP_VIEW_U :
144  pandora::
145  TPC_WIRE_GAP_VIEW_V); //If gapSizeY is too large then the gap is in Z, therefore should be in kU (i.e. kZ)
146  parameters.m_lineStartX = gap.GetX2();
147  parameters.m_lineEndX = gap.GetX1();
148  parameters.m_lineStartZ = (isGapInU ? gap.GetZ1() : gap.GetY1());
149  parameters.m_lineEndZ = (isGapInU ? gap.GetZ2() : gap.GetY2());
150 
151  return parameters;
152  }
153 
154  //------------------------------------------------------------------------------------------------------------------------------------------
155 
156  inline PandoraApi::Geometry::LineGap::Parameters
158  const geo::View_t view,
159  const geo::TPCID::TPCID_t tpc,
160  const geo::CryostatID::CryostatID_t cstat,
161  const double firstXYZ[3],
162  const double lastXYZ[3],
163  const float halfWirePitch,
164  const float xFirst,
165  const float xLast,
166  const pandora::Pandora* pPandora) const
167  {
168  float first(0.f), last(0.f);
169  pandora::LineGapType gapType(pandora::TPC_DRIFT_GAP);
170  if (view == this->TargetViewU(tpc, cstat)) {
171  first = firstXYZ[2];
172  last = lastXYZ[2];
173  gapType = pandora::TPC_WIRE_GAP_VIEW_U;
174  }
175  else if (view == this->TargetViewV(tpc, cstat)) {
176  first = firstXYZ[1];
177  last = lastXYZ[1];
178  gapType = pandora::TPC_WIRE_GAP_VIEW_V;
179  }
181  first, last, xFirst, xLast, halfWirePitch, gapType);
182  }
183 
184 } // namespace lar_pandora
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.
Detector interface for an older-style 3view, horizontal drift, single-phase LArTPC (e...
Helper functions for extracting detector geometry for use in reconsruction.
void LoadDaughterDetectorGaps(const LArDriftVolume &driftVolume, const float maxDisplacement, LArDetectorGapList &listOfGaps) const override
Create detector gaps for all daughter volumes in a logical TPC volume.
enum geo::_plane_proj View_t
Enumerate the possible plane projections.
Unknown view.
Definition: geo_types.h:136
Detector interface for ProtoDUNE dual phase.
The data type to uniquely identify a Plane.
Definition: geo_types.h:472
float GetZ1() const
Get lower Z coordinate.
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
art framework interface to geometry description
virtual float WirePitchV() const override
The wire pitch of the mapped V view.
Detector interface for a 3view, horizontal drift, single-phase LArTPC.
PandoraApi::Geometry::LineGap::Parameters CreateLineGapParametersFromDetectorGaps(const LArDetectorGap &gap) const override
Create the line gap parameters to give to the pandora API.
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.
const art::ServiceHandle< geo::Geometry > & GetLArSoftGeometry() const
Loan the LArSoft geometry handle owned by this class.
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::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.
View_t View(geo::PlaneID const &pid) const
Returns the view (wire orientation) on the channels of specified TPC plane.
float GetX1() const
Get lower X coordinate.
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
unsigned int CryostatID_t
Type for the ID number.
Definition: geo_types.h:191
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.
unsigned int TPCID_t
Type for the ID number.
Definition: geo_types.h:387
std::vector< LArDetectorGap > LArDetectorGapList
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.
drift volume class to hold properties of drift volume
LArDetectorGap CreateDetectorGap(const geo::Point_t &point1, const geo::Point_t &point2, const geo::Vector_t &widths) const override
Create a detector gap.
float WirePitchW() const override
The wire pitch of the mapped W view.
float GetY1() const
Get lower y coordinate.
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.
float GetY2() const
Get upper Y coordinate.
drift volume class to hold properties of drift volume
float GetX2() const
Get upper X coordinate.
float GetZ2() const
Get upper Z coordinate.