LArSoft  v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
ProtoDUNEDualPhase.cxx
Go to the documentation of this file.
1 
10 
11 namespace lar_pandora {
12 
14  const float maxDisplacement,
15  LArDetectorGapList& listOfGaps) const
16  {
18  iterDghtr1 = driftVolume.GetTpcVolumeList().begin(),
19  iterDghtrEnd1 = driftVolume.GetTpcVolumeList().end();
20  iterDghtr1 != iterDghtrEnd1;
21  ++iterDghtr1) {
22  const LArDaughterDriftVolume& tpcVolume1(*iterDghtr1);
23 
25  iterDghtr2 = iterDghtr1,
26  iterDghtrEnd2 = driftVolume.GetTpcVolumeList().end();
27  iterDghtr2 != iterDghtrEnd2;
28  ++iterDghtr2) {
29  const LArDaughterDriftVolume& tpcVolume2(*iterDghtr2);
30 
31  if (tpcVolume1.GetTpc() == tpcVolume2.GetTpc()) continue;
32 
33  const float deltaX(std::fabs(tpcVolume1.GetCenterX() - tpcVolume2.GetCenterX()));
34  const float deltaY(std::fabs(tpcVolume1.GetCenterY() - tpcVolume2.GetCenterY()));
35  const float deltaZ(std::fabs(tpcVolume1.GetCenterZ() - tpcVolume2.GetCenterZ()));
36 
37  const float widthX(0.5f * (tpcVolume1.GetWidthX() + tpcVolume2.GetWidthX()));
38  const float widthY(0.5f * (tpcVolume1.GetWidthY() + tpcVolume2.GetWidthY()));
39  const float widthZ(0.5f * (tpcVolume1.GetWidthZ() + tpcVolume2.GetWidthZ()));
40 
41  const float gapX(deltaX - widthX);
42  const float gapY(deltaY - widthY);
43  const float gapZ(deltaZ - widthZ);
44 
45  const float X1((tpcVolume1.GetCenterX() < tpcVolume2.GetCenterX()) ?
46  (tpcVolume1.GetCenterX() + 0.5f * tpcVolume1.GetWidthX()) :
47  (tpcVolume2.GetCenterX() + 0.5f * tpcVolume2.GetWidthX()));
48  const float X2((tpcVolume1.GetCenterX() > tpcVolume2.GetCenterX()) ?
49  (tpcVolume1.GetCenterX() - 0.5f * tpcVolume1.GetWidthX()) :
50  (tpcVolume2.GetCenterX() - 0.5f * tpcVolume2.GetWidthX()));
51  const float Y1(std::min((tpcVolume1.GetCenterY() - 0.5f * tpcVolume1.GetWidthY()),
52  (tpcVolume2.GetCenterY() - 0.5f * tpcVolume2.GetWidthY())));
53  const float Y2(std::max((tpcVolume1.GetCenterY() + 0.5f * tpcVolume1.GetWidthY()),
54  (tpcVolume2.GetCenterY() + 0.5f * tpcVolume2.GetWidthY())));
55  const float Z1(std::min((tpcVolume1.GetCenterZ() - 0.5f * tpcVolume1.GetWidthZ()),
56  (tpcVolume2.GetCenterZ() - 0.5f * tpcVolume2.GetWidthZ())));
57  const float Z2(std::max((tpcVolume1.GetCenterZ() + 0.5f * tpcVolume1.GetWidthZ()),
58  (tpcVolume2.GetCenterZ() + 0.5f * tpcVolume2.GetWidthZ())));
59 
60  geo::Vector_t gaps(gapX, gapY, gapZ), deltas(deltaX, deltaY, deltaZ);
61  if (this->CheckDetectorGapSize(gaps, deltas, maxDisplacement)) {
62  geo::Point_t point1(X1, Y1, Z1), point2(X2, Y2, Z2);
63  geo::Vector_t widths(widthX, widthY, widthZ);
64  listOfGaps.emplace_back(this->CreateDetectorGap(point1, point2, widths));
65  }
66  }
67  }
68 
69  return;
70  }
71 
72 } // namespace lar_pandora
float GetCenterZ() const
Return Z position at centre of tpc volume.
float GetWidthY() const
Return Y span of tpc volume.
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.
daughter drift volume class to hold properties of daughter drift volumes
float GetWidthZ() const
Return Z span of tpc volume.
float GetWidthX() const
Return X span of tpc volume.
Detector interface for ProtoDUNE dual phase.
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.
intermediate_table::const_iterator const_iterator
Double_t X2
Definition: plot.C:263
TFile f
Definition: plotHisto.C:6
const LArDaughterDriftVolumeList & GetTpcVolumeList() const
Return list of daughter drift volumes associated with this drift volume.
Double_t X1
Definition: plot.C:263
Double_t Y1
Definition: plot.C:263
float GetCenterX() const
Return X position at centre of tpc volume.
float GetCenterY() const
Return Y position at centre of tpc volume.
Double_t Z2
Definition: plot.C:263
Double_t Z1
Definition: plot.C:263
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
std::vector< LArDetectorGap > LArDetectorGapList
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.
Double_t Y2
Definition: plot.C:263
unsigned int GetTpc() const
Return tpc ID.