LArSoft  v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
ProtoDUNEDualPhase.h
Go to the documentation of this file.
1 
10 
12 
13 #include <limits>
14 
15 namespace lar_pandora {
16 
21  public:
23  const geo::CryostatID::CryostatID_t cstat) const override;
24 
26  const geo::CryostatID::CryostatID_t cstat) const override;
27 
29  const geo::CryostatID::CryostatID_t cstat) const override;
30 
31  float WirePitchW() const override;
32 
33  float WireAngleW(const geo::TPCID::TPCID_t tpc,
34  const geo::CryostatID::CryostatID_t cstat) const override;
35 
36  bool CheckDetectorGapSize(const geo::Vector_t& gaps,
37  const geo::Vector_t& deltas,
38  const float maxDisplacement) const override;
39 
41  const geo::Point_t& point2,
42  const geo::Vector_t& widths) const override;
43 
44  void LoadDaughterDetectorGaps(const LArDriftVolume& driftVolume,
45  const float maxDisplacement,
46  LArDetectorGapList& listOfGaps) const override;
47 
48  PandoraApi::Geometry::LineGap::Parameters CreateLineGapParametersFromDetectorGaps(
49  const LArDetectorGap& gap) const override;
50 
51  PandoraApi::Geometry::LineGap::Parameters CreateLineGapParametersFromReadoutGaps(
52  const geo::View_t view,
53  const geo::TPCID::TPCID_t tpc,
55  const geo::Point_t& firstXYZ,
56  const geo::Point_t& lastXYZ,
57  const float halfWirePitch,
58  const float xFirst,
59  const float xLast,
60  const pandora::Pandora* pPandora) const override;
61  };
62 
63  //------------------------------------------------------------------------------------------------------------------------------------------
64 
66  const geo::TPCID::TPCID_t tpc,
67  const geo::CryostatID::CryostatID_t cstat) const
68  {
69  return this->GetLArSoftGeometry()->View(geo::PlaneID(cstat, tpc, 1));
70  }
71 
72  //------------------------------------------------------------------------------------------------------------------------------------------
73 
75  const geo::TPCID::TPCID_t tpc,
76  const geo::CryostatID::CryostatID_t cstat) const
77  {
78  return this->GetLArSoftGeometry()->View(geo::PlaneID(cstat, tpc, 0));
79  }
80 
81  //------------------------------------------------------------------------------------------------------------------------------------------
82 
84  const geo::TPCID::TPCID_t tpc,
85  const geo::CryostatID::CryostatID_t cstat) const
86  {
87  return geo::kUnknown;
88  }
89 
90  //------------------------------------------------------------------------------------------------------------------------------------------
91 
92  inline float ProtoDUNEDualPhase::WirePitchW() const
93  {
94  return 0.5f * (this->WirePitchU() + this->WirePitchV());
95  }
96 
97  //------------------------------------------------------------------------------------------------------------------------------------------
98 
100  const geo::CryostatID::CryostatID_t cstat) const
101  {
102  return std::numeric_limits<float>::epsilon();
103  }
104 
105  //------------------------------------------------------------------------------------------------------------------------------------------
106 
108  const geo::Vector_t& deltas,
109  const float maxDisplacement) const
110  {
111  return (std::fabs(gaps.Y()) > maxDisplacement || std::fabs(gaps.Z()) > maxDisplacement);
112  }
113 
114  //------------------------------------------------------------------------------------------------------------------------------------------
115 
117  const geo::Point_t& point2,
118  const geo::Vector_t& widths) const
119  {
120  return LArDetectorGap(point1.X(),
121  point1.Y() + widths.Y(),
122  point1.Z() + widths.Z(),
123  point2.X(),
124  point2.Y() - widths.Y(),
125  point2.Z() - widths.Z());
126  }
127 
128  //------------------------------------------------------------------------------------------------------------------------------------------
129 
130  inline PandoraApi::Geometry::LineGap::Parameters
132  {
133  const bool isGapInU((
134  std::fabs(gap.GetY2() - gap.GetY1()) >
135  gap
136  .GetMaxGapSize())); //Could have chosen Z here, resulting in switching Y<->Z and U<->V in the block below
137  PandoraApi::Geometry::LineGap::Parameters parameters;
138  parameters.m_lineGapType =
139  (isGapInU ?
140  pandora::TPC_WIRE_GAP_VIEW_U :
141  pandora::
142  TPC_WIRE_GAP_VIEW_V); //If gapSizeY is too large then the gap is in Z, therefore should be in kU (i.e. kZ)
143  parameters.m_lineStartX = gap.GetX2();
144  parameters.m_lineEndX = gap.GetX1();
145  parameters.m_lineStartZ = (isGapInU ? gap.GetZ1() : gap.GetY1());
146  parameters.m_lineEndZ = (isGapInU ? gap.GetZ2() : gap.GetY2());
147 
148  return parameters;
149  }
150 
151  //------------------------------------------------------------------------------------------------------------------------------------------
152 
153  inline PandoraApi::Geometry::LineGap::Parameters
155  const geo::View_t view,
156  const geo::TPCID::TPCID_t tpc,
157  const geo::CryostatID::CryostatID_t cstat,
158  const geo::Point_t& firstXYZ,
159  const geo::Point_t& lastXYZ,
160  const float halfWirePitch,
161  const float xFirst,
162  const float xLast,
163  const pandora::Pandora* pPandora) const
164  {
165  float first(0.f), last(0.f);
166  pandora::LineGapType gapType(pandora::TPC_DRIFT_GAP);
167  if (view == this->TargetViewU(tpc, cstat)) {
168  first = firstXYZ.Z();
169  last = lastXYZ.Z();
170  gapType = pandora::TPC_WIRE_GAP_VIEW_U;
171  }
172  else if (view == this->TargetViewV(tpc, cstat)) {
173  first = firstXYZ.Y();
174  last = lastXYZ.Y();
175  gapType = pandora::TPC_WIRE_GAP_VIEW_V;
176  }
178  first, last, xFirst, xLast, halfWirePitch, gapType);
179  }
180 
181 } // 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...
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
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:142
Detector interface for ProtoDUNE dual phase.
The data type to uniquely identify a Plane.
Definition: geo_types.h:463
float GetZ1() const
Get lower Z coordinate.
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.
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.
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.
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:180
unsigned int CryostatID_t
Type for the ID number.
Definition: geo_types.h:193
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:382
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
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.
art framework interface to geometry description
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.