Pandora
Pandora source code navigator
Loading...
Searching...
No Matches
ProtoDUNEDualPhase.cxx
Go to the documentation of this file.
1
10
11namespace lar_pandora {
12
14 const float maxDisplacement,
15 LArDetectorGapList& listOfGaps) const
16 {
17 for (LArDaughterDriftVolumeList::const_iterator
18 iterDghtr1 = driftVolume.GetTpcVolumeList().begin(),
19 iterDghtrEnd1 = driftVolume.GetTpcVolumeList().end();
20 iterDghtr1 != iterDghtrEnd1;
21 ++iterDghtr1) {
22 const LArDaughterDriftVolume& tpcVolume1(*iterDghtr1);
23
24 for (LArDaughterDriftVolumeList::const_iterator
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
Detector interface for ProtoDUNE dual phase.
daughter drift volume class to hold properties of daughter drift volumes
unsigned int GetTpc() const
Return tpc ID.
float GetWidthY() const
Return Y span of tpc volume.
float GetWidthZ() const
Return Z span of tpc volume.
float GetCenterZ() const
Return Z position at centre of tpc volume.
float GetCenterX() const
Return X position at centre of tpc volume.
float GetWidthX() const
Return X span of tpc volume.
float GetCenterY() const
Return Y position at centre of tpc volume.
drift volume class to hold properties of drift volume
const LArDaughterDriftVolumeList & GetTpcVolumeList() const
Return list of daughter drift volumes associated with this 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.
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.
void LoadDaughterDetectorGaps(const LArDriftVolume &driftVolume, const float maxDisplacement, LArDetectorGapList &listOfGaps) const override
Create detector gaps for all daughter volumes in a logical TPC volume.
std::vector< LArDetectorGap > LArDetectorGapList