All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
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 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

Reimplemented from lar_pandora::VintageLArTPCThreeView.

Definition at line 110 of file ProtoDUNEDualPhase.h.

113  {
114  return (std::fabs(gaps.Y()) > maxDisplacement || std::fabs(gaps.Z()) > maxDisplacement);
115  }
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 120 of file ProtoDUNEDualPhase.h.

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  }
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 135 of file ProtoDUNEDualPhase.h.

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  }
fhicl::Table< sbnd::crt::CRTDetSimParams > Parameters
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 158 of file ProtoDUNEDualPhase.h.

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  }
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.
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.
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.
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  {
18  for (LArDaughterDriftVolumeList::const_iterator
19  iterDghtr1 = driftVolume.GetTpcVolumeList().begin(),
20  iterDghtrEnd1 = driftVolume.GetTpcVolumeList().end();
21  iterDghtr1 != iterDghtrEnd1;
22  ++iterDghtr1) {
23  const LArDaughterDriftVolume& tpcVolume1(*iterDghtr1);
24 
25  for (LArDaughterDriftVolumeList::const_iterator
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.
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
BEGIN_PROLOG supported so bottom corner of box bottom corner of box bottom corner of box top corner of box Y1
LArDetectorGap CreateDetectorGap(const geo::Point_t &point1, const geo::Point_t &point2, const geo::Vector_t &widths) const override
Create a detector gap.
BEGIN_PROLOG supported so bottom corner of box bottom corner of box bottom corner of box top corner of box top corner of box Z1
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
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 66 of file ProtoDUNEDualPhase.h.

68  {
69  return this->GetLArSoftGeometry()->View(geo::PlaneID(cstat, tpc, 1));
70  }
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.
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 75 of file ProtoDUNEDualPhase.h.

77  {
78  return this->GetLArSoftGeometry()->View(geo::PlaneID(cstat, tpc, 0));
79  }
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.
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 84 of file ProtoDUNEDualPhase.h.

86  {
87  return geo::kUnknown;
88  }
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 101 of file ProtoDUNEDualPhase.h.

103  {
104  return std::numeric_limits<float>::epsilon();
105  }
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 93 of file ProtoDUNEDualPhase.h.

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

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