All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
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 
10 
12 
13 #include <limits>
14 
15 namespace lar_pandora {
16 
17  /**
18  * @brief Detector interface for ProtoDUNE dual phase
19  */
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 
49  const LArDetectorGap& gap) const override;
50 
52  const geo::View_t view,
53  const geo::TPCID::TPCID_t tpc,
55  const double firstXYZ[3],
56  const double lastXYZ[3],
57  const float halfWirePitch,
58  const float xFirst,
59  const float xLast,
60  const pandora::Pandora* pPandora) const override;
61  };
62 
63  //------------------------------------------------------------------------------------------------------------------------------------------
64 
65  inline geo::View_t
67  const geo::CryostatID::CryostatID_t cstat) const
68  {
69  return this->GetLArSoftGeometry()->View(geo::PlaneID(cstat, tpc, 1));
70  }
71 
72  //------------------------------------------------------------------------------------------------------------------------------------------
73 
74  inline geo::View_t
76  const geo::CryostatID::CryostatID_t cstat) const
77  {
78  return this->GetLArSoftGeometry()->View(geo::PlaneID(cstat, tpc, 0));
79  }
80 
81  //------------------------------------------------------------------------------------------------------------------------------------------
82 
83  inline geo::View_t
85  const geo::CryostatID::CryostatID_t cstat) const
86  {
87  return geo::kUnknown;
88  }
89 
90  //------------------------------------------------------------------------------------------------------------------------------------------
91 
92  inline float
94  {
95  return 0.5f * (this->WirePitchU() + this->WirePitchV());
96  }
97 
98  //------------------------------------------------------------------------------------------------------------------------------------------
99 
100  inline float
102  const geo::CryostatID::CryostatID_t cstat) const
103  {
104  return std::numeric_limits<float>::epsilon();
105  }
106 
107  //------------------------------------------------------------------------------------------------------------------------------------------
108 
109  inline bool
111  const geo::Vector_t& deltas,
112  const float maxDisplacement) const
113  {
114  return (std::fabs(gaps.Y()) > maxDisplacement || std::fabs(gaps.Z()) > maxDisplacement);
115  }
116 
117  //------------------------------------------------------------------------------------------------------------------------------------------
118 
119  inline LArDetectorGap
121  const geo::Point_t& point2,
122  const geo::Vector_t& widths) const
123  {
124  return LArDetectorGap(point1.X(),
125  point1.Y() + widths.Y(),
126  point1.Z() + widths.Z(),
127  point2.X(),
128  point2.Y() - widths.Y(),
129  point2.Z() - widths.Z());
130  }
131 
132  //------------------------------------------------------------------------------------------------------------------------------------------
133 
136  {
137  const bool isGapInU((
138  std::fabs(gap.GetY2() - gap.GetY1()) >
139  gap
140  .GetMaxGapSize())); //Could have chosen Z here, resulting in switching Y<->Z and U<->V in the block below
142  parameters.m_lineGapType =
143  (isGapInU ?
144  pandora::TPC_WIRE_GAP_VIEW_U :
145  pandora::
146  TPC_WIRE_GAP_VIEW_V); //If gapSizeY is too large then the gap is in Z, therefore should be in kU (i.e. kZ)
147  parameters.m_lineStartX = gap.GetX2();
148  parameters.m_lineEndX = gap.GetX1();
149  parameters.m_lineStartZ = (isGapInU ? gap.GetZ1() : gap.GetY1());
150  parameters.m_lineEndZ = (isGapInU ? gap.GetZ2() : gap.GetY2());
151 
152  return parameters;
153  }
154 
155  //------------------------------------------------------------------------------------------------------------------------------------------
156 
159  const geo::View_t view,
160  const geo::TPCID::TPCID_t tpc,
161  const geo::CryostatID::CryostatID_t cstat,
162  const double firstXYZ[3],
163  const double lastXYZ[3],
164  const float halfWirePitch,
165  const float xFirst,
166  const float xLast,
167  const pandora::Pandora* pPandora) const
168  {
169  float first(0.f), last(0.f);
170  pandora::LineGapType gapType(pandora::TPC_DRIFT_GAP);
171  if (view == this->TargetViewU(tpc, cstat)) {
172  first = firstXYZ[2];
173  last = lastXYZ[2];
174  gapType = pandora::TPC_WIRE_GAP_VIEW_U;
175  }
176  else if (view == this->TargetViewV(tpc, cstat)) {
177  first = firstXYZ[1];
178  last = lastXYZ[1];
179  gapType = pandora::TPC_WIRE_GAP_VIEW_V;
180  }
182  first, last, xFirst, xLast, halfWirePitch, gapType);
183  }
184 
185 } // 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.
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.
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:164
virtual float WirePitchU() const override
The wire pitch of the mapped U view.
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
PandoraApi::Geometry::LineGap::Parameters CreateLineGapParametersFromDetectorGaps(const LArDetectorGap &gap) const override
Create the line gap parameters to give to the pandora API.
float GetZ1() const
Get lower Z coordinate.
virtual float WirePitchV() const override
The wire pitch of the mapped V view.
LArDetectorGap CreateDetectorGap(const geo::Point_t &point1, const geo::Point_t &point2, const geo::Vector_t &widths) const override
Create a detector gap.
Detector interface for a 3view, horizontal drift, single-phase LArTPC.
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.
float WirePitchW() const override
The wire pitch of the mapped W view.
const art::ServiceHandle< geo::Geometry > & GetLArSoftGeometry() const
Loan the LArSoft geometry handle owned by this class.
float GetX1() const
Get lower X coordinate.
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.
fhicl::Table< sbnd::crt::CRTDetSimParams > Parameters
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
void LoadDaughterDetectorGaps(const LArDriftVolume &driftVolume, const float maxDisplacement, LArDetectorGapList &listOfGaps) const override
Create detector gaps for all daughter volumes in a logical TPC volume.
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.
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
float GetY1() const
Get lower y coordinate.
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.
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.