LArSoft  v10_04_05
Liquid Argon Software toolkit - https://larsoft.org/
lar_pandora::ProtoDUNEDualPhase Class Reference

Detector interface for ProtoDUNE dual phase. More...

#include "ProtoDUNEDualPhase.h"

Inheritance diagram for lar_pandora::ProtoDUNEDualPhase:
lar_pandora::VintageLArTPCThreeView lar_pandora::LArPandoraDetectorType

Public Member Functions

geo::View_t TargetViewU (const geo::TPCID::TPCID_t tpc, const geo::CryostatID::CryostatID_t cstat) const override
 Map a LArSoft view to Pandora's U view. More...
 
geo::View_t TargetViewV (const geo::TPCID::TPCID_t tpc, const geo::CryostatID::CryostatID_t cstat) const override
 Map a LArSoft view to Pandora's V view. More...
 
geo::View_t TargetViewW (const geo::TPCID::TPCID_t tpc, const geo::CryostatID::CryostatID_t cstat) const override
 Map a LArSoft view to Pandora's W view. More...
 
float WirePitchW () const override
 The wire pitch of the mapped W view. More...
 
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. More...
 
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. More...
 
LArDetectorGap CreateDetectorGap (const geo::Point_t &point1, const geo::Point_t &point2, const geo::Vector_t &widths) const override
 Create a detector gap. More...
 
void LoadDaughterDetectorGaps (const LArDriftVolume &driftVolume, const float maxDisplacement, LArDetectorGapList &listOfGaps) const override
 Create detector gaps for all daughter volumes in a logical TPC volume. More...
 
PandoraApi::Geometry::LineGap::Parameters CreateLineGapParametersFromDetectorGaps (const LArDetectorGap &gap) const override
 Create the line gap parameters to give to the pandora API. More...
 
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. More...
 
float WirePitchU () const override
 The wire pitch of the mapped U view. More...
 
float WirePitchV () const override
 The wire pitch of the mapped V view. More...
 
float WireAngleU (const geo::TPCID::TPCID_t tpc, const geo::CryostatID::CryostatID_t cstat) const override
 The angle of the wires in the mapped U view. More...
 
float WireAngleV (const geo::TPCID::TPCID_t tpc, const geo::CryostatID::CryostatID_t cstat) const override
 The angle of the wires in the mapped V view. More...
 
const geo::GeometryCoreGetLArSoftGeometry () const
 Loan the LArSoft geometry handle owned by this class. More...
 
const geo::WireReadoutGeomGetChannelMap () const
 

Detailed Description

Detector interface for ProtoDUNE dual phase.

Definition at line 20 of file ProtoDUNEDualPhase.h.

Member Function Documentation

bool lar_pandora::ProtoDUNEDualPhase::CheckDetectorGapSize ( const geo::Vector_t gaps,
const geo::Vector_t deltas,
const float  maxDisplacement 
) const
inlineoverridevirtual

Check whether a gap size is small enough to be registered as a detector gap.

Parameters
gapsa cartesean vector holding gap sizes between adjacent TPCs
deltasa cartesean vector holding distances between adjacent TPCs
maxDisplacementthe gap size threshold
Returns
logic bool

Implements lar_pandora::LArPandoraDetectorType.

Definition at line 107 of file ProtoDUNEDualPhase.h.

Referenced by LoadDaughterDetectorGaps().

110  {
111  return (std::fabs(gaps.Y()) > maxDisplacement || std::fabs(gaps.Z()) > maxDisplacement);
112  }
LArDetectorGap lar_pandora::ProtoDUNEDualPhase::CreateDetectorGap ( const geo::Point_t point1,
const geo::Point_t point2,
const geo::Vector_t widths 
) const
inlineoverridevirtual

Create a detector gap.

Parameters
point1a point on TPC1 that are closest to TPC2
point2a point on TPC2 that are closest to TPC1
widththe gap sizes
Returns
the detector gap object

Implements lar_pandora::LArPandoraDetectorType.

Definition at line 116 of file ProtoDUNEDualPhase.h.

Referenced by LoadDaughterDetectorGaps().

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  }
PandoraApi::Geometry::LineGap::Parameters lar_pandora::ProtoDUNEDualPhase::CreateLineGapParametersFromDetectorGaps ( const LArDetectorGap gap) const
inlineoverridevirtual

Create the line gap parameters to give to the pandora API.

Parameters
gapthe input detector gap
Returns
the pandora API's line gap parameters object

Implements lar_pandora::LArPandoraDetectorType.

Definition at line 131 of file ProtoDUNEDualPhase.h.

References lar_pandora::LArDetectorGap::GetX1(), lar_pandora::LArDetectorGap::GetX2(), lar_pandora::LArDetectorGap::GetY1(), lar_pandora::LArDetectorGap::GetY2(), lar_pandora::LArDetectorGap::GetZ1(), and lar_pandora::LArDetectorGap::GetZ2().

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  }
PandoraApi::Geometry::LineGap::Parameters lar_pandora::ProtoDUNEDualPhase::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
inlineoverridevirtual

Create the line gap parameters to give to the pandora API.

Parameters
viewthe LArSoft view
tpcthe LArSoft TPC ID
cstatthe LArSoft cryostat ID
firstXYZthe first 3D coordinate
lastXYZthe last 3D coordinate
halfWirePitchthe half wire pitch
pPandorathe pandora instance
xFirstthe min X of the gap
xLastthe max X of the gap
Returns
the pandora API's line gap parameters object

Implements lar_pandora::LArPandoraDetectorType.

Definition at line 154 of file ProtoDUNEDualPhase.h.

References lar_pandora::detector_functions::CreateReadoutGapParameters(), f, TargetViewU(), and TargetViewV().

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  }
TFile f
Definition: plotHisto.C:6
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.
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.
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.
const geo::GeometryCore & lar_pandora::VintageLArTPCThreeView::GetLArSoftGeometry ( ) const
inlineinherited

Loan the LArSoft geometry handle owned by this class.

Returns
The LArSoft geometry handle

Definition at line 249 of file VintageLArTPCThreeView.h.

References lar_pandora::VintageLArTPCThreeView::m_LArSoftGeometry.

Referenced by lar_pandora::ICARUS::TargetViewU(), and lar_pandora::ICARUS::TargetViewV().

250  {
251  return *m_LArSoftGeometry;
252  }
art::ServiceHandle< geo::Geometry > m_LArSoftGeometry
the LArSoft geometry handle
void lar_pandora::ProtoDUNEDualPhase::LoadDaughterDetectorGaps ( const LArDriftVolume driftVolume,
const float  maxDisplacement,
LArDetectorGapList listOfGaps 
) const
overridevirtual

Create detector gaps for all daughter volumes in a logical TPC volume.

Parameters
driftVolumethe parent drift volume
maxDisplacementthe gap size threshold
listOfGapsthe gaps vector to be filled

Implements lar_pandora::LArPandoraDetectorType.

Definition at line 13 of file ProtoDUNEDualPhase.cxx.

References CheckDetectorGapSize(), CreateDetectorGap(), f, lar_pandora::LArDaughterDriftVolume::GetCenterX(), lar_pandora::LArDaughterDriftVolume::GetCenterY(), lar_pandora::LArDaughterDriftVolume::GetCenterZ(), lar_pandora::LArDaughterDriftVolume::GetTpc(), lar_pandora::LArDriftVolume::GetTpcVolumeList(), lar_pandora::LArDaughterDriftVolume::GetWidthX(), lar_pandora::LArDaughterDriftVolume::GetWidthY(), lar_pandora::LArDaughterDriftVolume::GetWidthZ(), X1, X2, Y1, Y2, Z1, and Z2.

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  }
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.
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
intermediate_table::const_iterator const_iterator
Double_t X2
Definition: plot.C:263
TFile f
Definition: plotHisto.C:6
Double_t X1
Definition: plot.C:263
Double_t Y1
Definition: plot.C:263
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
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
geo::View_t lar_pandora::ProtoDUNEDualPhase::TargetViewU ( const geo::TPCID::TPCID_t  tpc,
const geo::CryostatID::CryostatID_t  cstat 
) const
inlineoverridevirtual

Map a LArSoft view to Pandora's U view.

Parameters
tpcthe LArSoft TPC ID
cstatthe LArSoft cryostat ID
Returns
The mapped LArSoft view

Implements lar_pandora::LArPandoraDetectorType.

Definition at line 65 of file ProtoDUNEDualPhase.h.

References lar_pandora::VintageLArTPCThreeView::GetChannelMap(), and geo::WireReadoutGeom::Plane().

Referenced by CreateLineGapParametersFromReadoutGaps().

68  {
69  return this->GetChannelMap().Plane({cstat, tpc, 1}).View();
70  }
const geo::WireReadoutGeom & GetChannelMap() const
PlaneGeo const & Plane(TPCID const &tpcid, View_t view) const
Returns the specified wire.
geo::View_t lar_pandora::ProtoDUNEDualPhase::TargetViewV ( const geo::TPCID::TPCID_t  tpc,
const geo::CryostatID::CryostatID_t  cstat 
) const
inlineoverridevirtual

Map a LArSoft view to Pandora's V view.

Parameters
tpcthe LArSoft TPC ID
cstatthe LArSoft cryostat ID
Returns
The mapped LArSoft view

Implements lar_pandora::LArPandoraDetectorType.

Definition at line 74 of file ProtoDUNEDualPhase.h.

References lar_pandora::VintageLArTPCThreeView::GetChannelMap(), and geo::WireReadoutGeom::Plane().

Referenced by CreateLineGapParametersFromReadoutGaps().

77  {
78  return this->GetChannelMap().Plane({cstat, tpc, 0}).View();
79  }
const geo::WireReadoutGeom & GetChannelMap() const
PlaneGeo const & Plane(TPCID const &tpcid, View_t view) const
Returns the specified wire.
geo::View_t lar_pandora::ProtoDUNEDualPhase::TargetViewW ( const geo::TPCID::TPCID_t  tpc,
const geo::CryostatID::CryostatID_t  cstat 
) const
inlineoverridevirtual

Map a LArSoft view to Pandora's W view.

Parameters
tpcthe LArSoft TPC ID
cstatthe LArSoft cryostat ID
Returns
The mapped LArSoft view

Implements lar_pandora::LArPandoraDetectorType.

Definition at line 83 of file ProtoDUNEDualPhase.h.

References geo::kUnknown.

86  {
87  return geo::kUnknown;
88  }
Unknown view.
Definition: geo_types.h:138
float lar_pandora::VintageLArTPCThreeView::WireAngleU ( const geo::TPCID::TPCID_t  tpc,
const geo::CryostatID::CryostatID_t  cstat 
) const
inlineoverridevirtualinherited

The angle of the wires in the mapped U view.

Returns
The mapped wire angle

Implements lar_pandora::LArPandoraDetectorType.

Definition at line 150 of file VintageLArTPCThreeView.h.

References lar_pandora::VintageLArTPCThreeView::m_wireReadoutGeom, lar_pandora::VintageLArTPCThreeView::TargetViewU(), and lar_pandora::detector_functions::WireAngle().

152  {
153  return detector_functions::WireAngle(TargetViewU(tpc, cstat), tpc, cstat, *m_wireReadoutGeom);
154  }
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.
geo::WireReadoutGeom const * m_wireReadoutGeom
float WireAngle(const geo::View_t view, const geo::TPCID::TPCID_t tpc, const geo::CryostatID::CryostatID_t cstat, const geo::WireReadoutGeom &wireReadoutGeom)
Calculate the wire angle of a LArTPC view in a given TPC/cryostat.
float lar_pandora::VintageLArTPCThreeView::WireAngleV ( const geo::TPCID::TPCID_t  tpc,
const geo::CryostatID::CryostatID_t  cstat 
) const
inlineoverridevirtualinherited

The angle of the wires in the mapped V view.

Returns
The mapped wire angle

Implements lar_pandora::LArPandoraDetectorType.

Definition at line 158 of file VintageLArTPCThreeView.h.

References lar_pandora::VintageLArTPCThreeView::m_wireReadoutGeom, lar_pandora::VintageLArTPCThreeView::TargetViewV(), and lar_pandora::detector_functions::WireAngle().

160  {
161  return detector_functions::WireAngle(TargetViewV(tpc, cstat), tpc, cstat, *m_wireReadoutGeom);
162  }
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.
geo::WireReadoutGeom const * m_wireReadoutGeom
float WireAngle(const geo::View_t view, const geo::TPCID::TPCID_t tpc, const geo::CryostatID::CryostatID_t cstat, const geo::WireReadoutGeom &wireReadoutGeom)
Calculate the wire angle of a LArTPC view in a given TPC/cryostat.
float lar_pandora::ProtoDUNEDualPhase::WireAngleW ( const geo::TPCID::TPCID_t  tpc,
const geo::CryostatID::CryostatID_t  cstat 
) const
inlineoverridevirtual

The angle of the wires in the mapped V view.

Returns
The mapped wire angle

Implements lar_pandora::LArPandoraDetectorType.

Definition at line 99 of file ProtoDUNEDualPhase.h.

101  {
102  return std::numeric_limits<float>::epsilon();
103  }
float lar_pandora::VintageLArTPCThreeView::WirePitchU ( ) const
inlineoverridevirtualinherited

The wire pitch of the mapped U view.

Returns
The mapped wire pitch

Implements lar_pandora::LArPandoraDetectorType.

Definition at line 129 of file VintageLArTPCThreeView.h.

References lar_pandora::VintageLArTPCThreeView::m_wireReadoutGeom, geo::WireReadoutGeom::Plane(), and lar_pandora::VintageLArTPCThreeView::TargetViewU().

Referenced by WirePitchW().

130  {
131  return m_wireReadoutGeom->Plane({0, 0}, TargetViewU(0, 0)).WirePitch();
132  }
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.
geo::WireReadoutGeom const * m_wireReadoutGeom
PlaneGeo const & Plane(TPCID const &tpcid, View_t view) const
Returns the specified wire.
float lar_pandora::VintageLArTPCThreeView::WirePitchV ( ) const
inlineoverridevirtualinherited

The wire pitch of the mapped V view.

Returns
The mapped wire pitch

Implements lar_pandora::LArPandoraDetectorType.

Definition at line 136 of file VintageLArTPCThreeView.h.

References lar_pandora::VintageLArTPCThreeView::m_wireReadoutGeom, geo::WireReadoutGeom::Plane(), and lar_pandora::VintageLArTPCThreeView::TargetViewV().

Referenced by WirePitchW().

137  {
138  return m_wireReadoutGeom->Plane({0, 0}, TargetViewV(0, 0)).WirePitch();
139  }
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.
geo::WireReadoutGeom const * m_wireReadoutGeom
PlaneGeo const & Plane(TPCID const &tpcid, View_t view) const
Returns the specified wire.
float lar_pandora::ProtoDUNEDualPhase::WirePitchW ( ) const
inlineoverridevirtual

The wire pitch of the mapped W view.

Returns
The mapped wire pitch

Implements lar_pandora::LArPandoraDetectorType.

Definition at line 92 of file ProtoDUNEDualPhase.h.

References lar_pandora::VintageLArTPCThreeView::WirePitchU(), and lar_pandora::VintageLArTPCThreeView::WirePitchV().

93  {
94  return 0.5f * (this->WirePitchU() + this->WirePitchV());
95  }
float WirePitchV() const override
The wire pitch of the mapped V view.
float WirePitchU() const override
The wire pitch of the mapped U view.

The documentation for this class was generated from the following files: