Public Member Functions | List of all members
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 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. More...
 
- Public Member Functions inherited from lar_pandora::VintageLArTPCThreeView
virtual float WirePitchU () const override
 The wire pitch of the mapped U view. More...
 
virtual float WirePitchV () const override
 The wire pitch of the mapped V view. More...
 
virtual 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...
 
virtual 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 art::ServiceHandle< geo::Geometry > & GetLArSoftGeometry () const
 Loan the LArSoft geometry handle owned by this class. More...
 

Detailed Description

Detector interface for ProtoDUNE dual phase.

Definition at line 19 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

Reimplemented from lar_pandora::VintageLArTPCThreeView.

Definition at line 109 of file ProtoDUNEDualPhase.h.

112  {
113  return (std::fabs(gaps.Y()) > maxDisplacement || std::fabs(gaps.Z()) > maxDisplacement);
114  }
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

Reimplemented from lar_pandora::VintageLArTPCThreeView.

Definition at line 119 of file ProtoDUNEDualPhase.h.

122  {
123  return LArDetectorGap(point1.X(),
124  point1.Y() + widths.Y(),
125  point1.Z() + widths.Z(),
126  point2.X(),
127  point2.Y() - widths.Y(),
128  point2.Z() - widths.Z());
129  }
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

Reimplemented from lar_pandora::VintageLArTPCThreeView.

Definition at line 134 of file ProtoDUNEDualPhase.h.

135  {
136  const bool isGapInU((
137  std::fabs(gap.GetY2() - gap.GetY1()) >
138  gap
139  .GetMaxGapSize())); //Could have chosen Z here, resulting in switching Y<->Z and U<->V in the block below
140  PandoraApi::Geometry::LineGap::Parameters parameters;
141  parameters.m_lineGapType =
142  (isGapInU ?
143  pandora::TPC_WIRE_GAP_VIEW_U :
144  pandora::
145  TPC_WIRE_GAP_VIEW_V); //If gapSizeY is too large then the gap is in Z, therefore should be in kU (i.e. kZ)
146  parameters.m_lineStartX = gap.GetX2();
147  parameters.m_lineEndX = gap.GetX1();
148  parameters.m_lineStartZ = (isGapInU ? gap.GetZ1() : gap.GetY1());
149  parameters.m_lineEndZ = (isGapInU ? gap.GetZ2() : gap.GetY2());
150 
151  return parameters;
152  }
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 double  firstXYZ[3],
const double  lastXYZ[3],
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

Reimplemented from lar_pandora::VintageLArTPCThreeView.

Definition at line 157 of file ProtoDUNEDualPhase.h.

167  {
168  float first(0.f), last(0.f);
169  pandora::LineGapType gapType(pandora::TPC_DRIFT_GAP);
170  if (view == this->TargetViewU(tpc, cstat)) {
171  first = firstXYZ[2];
172  last = lastXYZ[2];
173  gapType = pandora::TPC_WIRE_GAP_VIEW_U;
174  }
175  else if (view == this->TargetViewV(tpc, cstat)) {
176  first = firstXYZ[1];
177  last = lastXYZ[1];
178  gapType = pandora::TPC_WIRE_GAP_VIEW_V;
179  }
181  first, last, xFirst, xLast, halfWirePitch, gapType);
182  }
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.
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

Reimplemented from lar_pandora::VintageLArTPCThreeView.

Definition at line 14 of file ProtoDUNEDualPhase.cxx.

17  {
19  iterDghtr1 = driftVolume.GetTpcVolumeList().begin(),
20  iterDghtrEnd1 = driftVolume.GetTpcVolumeList().end();
21  iterDghtr1 != iterDghtrEnd1;
22  ++iterDghtr1) {
23  const LArDaughterDriftVolume& tpcVolume1(*iterDghtr1);
24 
26  iterDghtr2 = iterDghtr1,
27  iterDghtrEnd2 = driftVolume.GetTpcVolumeList().end();
28  iterDghtr2 != iterDghtrEnd2;
29  ++iterDghtr2) {
30  const LArDaughterDriftVolume& tpcVolume2(*iterDghtr2);
31 
32  if (tpcVolume1.GetTpc() == tpcVolume2.GetTpc()) continue;
33 
34  const float deltaX(std::fabs(tpcVolume1.GetCenterX() - tpcVolume2.GetCenterX()));
35  const float deltaY(std::fabs(tpcVolume1.GetCenterY() - tpcVolume2.GetCenterY()));
36  const float deltaZ(std::fabs(tpcVolume1.GetCenterZ() - tpcVolume2.GetCenterZ()));
37 
38  const float widthX(0.5f * (tpcVolume1.GetWidthX() + tpcVolume2.GetWidthX()));
39  const float widthY(0.5f * (tpcVolume1.GetWidthY() + tpcVolume2.GetWidthY()));
40  const float widthZ(0.5f * (tpcVolume1.GetWidthZ() + tpcVolume2.GetWidthZ()));
41 
42  const float gapX(deltaX - widthX);
43  const float gapY(deltaY - widthY);
44  const float gapZ(deltaZ - widthZ);
45 
46  const float X1((tpcVolume1.GetCenterX() < tpcVolume2.GetCenterX()) ?
47  (tpcVolume1.GetCenterX() + 0.5f * tpcVolume1.GetWidthX()) :
48  (tpcVolume2.GetCenterX() + 0.5f * tpcVolume2.GetWidthX()));
49  const float X2((tpcVolume1.GetCenterX() > tpcVolume2.GetCenterX()) ?
50  (tpcVolume1.GetCenterX() - 0.5f * tpcVolume1.GetWidthX()) :
51  (tpcVolume2.GetCenterX() - 0.5f * tpcVolume2.GetWidthX()));
52  const float Y1(std::min((tpcVolume1.GetCenterY() - 0.5f * tpcVolume1.GetWidthY()),
53  (tpcVolume2.GetCenterY() - 0.5f * tpcVolume2.GetWidthY())));
54  const float Y2(std::max((tpcVolume1.GetCenterY() + 0.5f * tpcVolume1.GetWidthY()),
55  (tpcVolume2.GetCenterY() + 0.5f * tpcVolume2.GetWidthY())));
56  const float Z1(std::min((tpcVolume1.GetCenterZ() - 0.5f * tpcVolume1.GetWidthZ()),
57  (tpcVolume2.GetCenterZ() - 0.5f * tpcVolume2.GetWidthZ())));
58  const float Z2(std::max((tpcVolume1.GetCenterZ() + 0.5f * tpcVolume1.GetWidthZ()),
59  (tpcVolume2.GetCenterZ() + 0.5f * tpcVolume2.GetWidthZ())));
60 
61  geo::Vector_t gaps(gapX, gapY, gapZ), deltas(deltaX, deltaY, deltaZ);
62  if (this->CheckDetectorGapSize(gaps, deltas, maxDisplacement)) {
63  geo::Point_t point1(X1, Y1, Z1), point2(X2, Y2, Z2);
64  geo::Vector_t widths(widthX, widthY, widthZ);
65  listOfGaps.emplace_back(this->CreateDetectorGap(point1, point2, widths));
66  }
67  }
68  }
69 
70  return;
71  }
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.
intermediate_table::const_iterator const_iterator
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
static int max(int a, int b)
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
T min(sqlite3 *const db, std::string const &table_name, std::string const &column_name)
Definition: statistics.h:55
LArDetectorGap CreateDetectorGap(const geo::Point_t &point1, const geo::Point_t &point2, const geo::Vector_t &widths) const override
Create a detector gap.
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

Reimplemented from lar_pandora::VintageLArTPCThreeView.

Definition at line 65 of file ProtoDUNEDualPhase.h.

67  {
68  return this->GetLArSoftGeometry()->View(geo::PlaneID(cstat, tpc, 1));
69  }
The data type to uniquely identify a Plane.
Definition: geo_types.h:472
const art::ServiceHandle< geo::Geometry > & GetLArSoftGeometry() const
Loan the LArSoft geometry handle owned by this class.
View_t View(geo::PlaneID const &pid) const
Returns the view (wire orientation) on the channels of specified TPC plane.
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

Reimplemented from lar_pandora::VintageLArTPCThreeView.

Definition at line 74 of file ProtoDUNEDualPhase.h.

76  {
77  return this->GetLArSoftGeometry()->View(geo::PlaneID(cstat, tpc, 0));
78  }
The data type to uniquely identify a Plane.
Definition: geo_types.h:472
const art::ServiceHandle< geo::Geometry > & GetLArSoftGeometry() const
Loan the LArSoft geometry handle owned by this class.
View_t View(geo::PlaneID const &pid) const
Returns the view (wire orientation) on the channels of specified TPC plane.
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

Reimplemented from lar_pandora::VintageLArTPCThreeView.

Definition at line 83 of file ProtoDUNEDualPhase.h.

85  {
86  return geo::kUnknown;
87  }
Unknown view.
Definition: geo_types.h:136
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

Reimplemented from lar_pandora::VintageLArTPCThreeView.

Definition at line 100 of file ProtoDUNEDualPhase.h.

102  {
103  return std::numeric_limits<float>::epsilon();
104  }
float lar_pandora::ProtoDUNEDualPhase::WirePitchW ( ) const
inlineoverridevirtual

The wire pitch of the mapped W view.

Returns
The mapped wire pitch

Reimplemented from lar_pandora::VintageLArTPCThreeView.

Definition at line 92 of file ProtoDUNEDualPhase.h.

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

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