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

Detector interface for a 3view, horizontal drift, single-phase LArTPC. More...

#include "VintageLArTPCThreeView.h"

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

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 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 WirePitchW () const override
 The wire pitch of the mapped W 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...
 
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...
 
const geo::GeometryCoreGetLArSoftGeometry () const
 Loan the LArSoft geometry handle owned by this class. More...
 
const geo::WireReadoutGeomGetChannelMap () const
 

Private Attributes

art::ServiceHandle< geo::Geometrym_LArSoftGeometry
 the LArSoft geometry handle More...
 
geo::WireReadoutGeom const * m_wireReadoutGeom = &art::ServiceHandle<geo::WireReadout>()->Get()
 

Detailed Description

Detector interface for a 3view, horizontal drift, single-phase LArTPC.

Definition at line 29 of file VintageLArTPCThreeView.h.

Member Function Documentation

bool lar_pandora::VintageLArTPCThreeView::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 174 of file VintageLArTPCThreeView.h.

177  {
178  if (gaps.X() < 0.f || gaps.X() > maxDisplacement || deltas.Y() > maxDisplacement ||
179  deltas.Z() > maxDisplacement)
180  return false;
181  return true;
182  }
LArDetectorGap lar_pandora::VintageLArTPCThreeView::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 186 of file VintageLArTPCThreeView.h.

189  {
190  return LArDetectorGap(point1.X(), point1.Y(), point1.Z(), point2.X(), point2.Y(), point2.Z());
191  }
PandoraApi::Geometry::LineGap::Parameters lar_pandora::VintageLArTPCThreeView::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 205 of file VintageLArTPCThreeView.h.

References lar_pandora::detector_functions::CreateDriftGapParameters().

206  {
208  }
PandoraApi::Geometry::LineGap::Parameters CreateDriftGapParameters(const LArDetectorGap &gap)
Make the drift gap parameters for the Pandora API.
PandoraApi::Geometry::LineGap::Parameters lar_pandora::VintageLArTPCThreeView::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 213 of file VintageLArTPCThreeView.h.

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

223  {
224  float first(0.f), last(0.f);
225  pandora::LineGapType gapType(pandora::TPC_DRIFT_GAP);
226  if (view == TargetViewW(tpc, cstat)) {
227  first = firstXYZ.Z();
228  last = lastXYZ.Z();
229  gapType = pandora::TPC_WIRE_GAP_VIEW_W;
230  }
231  else if (view == TargetViewU(tpc, cstat)) {
232  first =
233  pPandora->GetPlugins()->GetLArTransformationPlugin()->YZtoU(firstXYZ.Y(), firstXYZ.Z());
234  last = pPandora->GetPlugins()->GetLArTransformationPlugin()->YZtoU(lastXYZ.Y(), lastXYZ.Z());
235  gapType = pandora::TPC_WIRE_GAP_VIEW_U;
236  }
237  else if (view == TargetViewV(tpc, cstat)) {
238  first =
239  pPandora->GetPlugins()->GetLArTransformationPlugin()->YZtoV(firstXYZ.Y(), firstXYZ.Z());
240  last = pPandora->GetPlugins()->GetLArTransformationPlugin()->YZtoV(lastXYZ.Y(), lastXYZ.Z());
241  gapType = pandora::TPC_WIRE_GAP_VIEW_V;
242  }
244  first, last, xFirst, xLast, halfWirePitch, gapType);
245  }
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.
geo::View_t TargetViewW(const geo::TPCID::TPCID_t tpc, const geo::CryostatID::CryostatID_t cstat) const override
Map a LArSoft view to Pandora&#39;s W view.
TFile f
Definition: plotHisto.C:6
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
inline

Loan the LArSoft geometry handle owned by this class.

Returns
The LArSoft geometry handle

Definition at line 249 of file VintageLArTPCThreeView.h.

References 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::VintageLArTPCThreeView::LoadDaughterDetectorGaps ( const LArDriftVolume driftVolume,
const float  maxDisplacement,
LArDetectorGapList listOfGaps 
) const
inlineoverridevirtual

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 195 of file VintageLArTPCThreeView.h.

198  {
199  return;
200  }
geo::View_t lar_pandora::VintageLArTPCThreeView::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 96 of file VintageLArTPCThreeView.h.

References geo::TPCGeo::DriftAxisWithSign(), m_LArSoftGeometry, m_wireReadoutGeom, geo::WireReadoutGeom::Plane(), geo::Positive, pmtana::sign(), geo::GeometryCore::TPC(), and geo::PlaneGeo::View().

Referenced by CreateLineGapParametersFromReadoutGaps(), WireAngleU(), and WirePitchU().

99  {
100  geo::TPCID const tpcID{cstat, tpc};
101  auto const [_, sign] = m_LArSoftGeometry->TPC(tpcID).DriftAxisWithSign();
102  return (sign == geo::DriftSign::Positive ?
103  m_wireReadoutGeom->Plane(geo::PlaneID(tpcID, 1)).View() :
104  m_wireReadoutGeom->Plane(geo::PlaneID(tpcID, 0)).View());
105  }
The data type to uniquely identify a Plane.
Definition: geo_types.h:364
DriftAxis DriftAxisWithSign() const
Returns the expected drift direction based on geometry.
Definition: TPCGeo.h:78
View_t View() const
Which coordinate does this plane measure.
Definition: PlaneGeo.h:155
art::ServiceHandle< geo::Geometry > m_LArSoftGeometry
the LArSoft geometry handle
The data type to uniquely identify a TPC.
Definition: geo_types.h:306
geo::WireReadoutGeom const * m_wireReadoutGeom
int sign(double val)
Definition: UtilFunc.cxx:104
Drift towards positive values.
PlaneGeo const & Plane(TPCID const &tpcid, View_t view) const
Returns the specified wire.
TPCGeo const & TPC(TPCID const &tpcid=details::tpc_zero) const
Returns the specified TPC.
Definition: GeometryCore.h:448
geo::View_t lar_pandora::VintageLArTPCThreeView::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 107 of file VintageLArTPCThreeView.h.

References geo::TPCGeo::DriftAxisWithSign(), m_LArSoftGeometry, m_wireReadoutGeom, geo::WireReadoutGeom::Plane(), geo::Positive, pmtana::sign(), geo::GeometryCore::TPC(), and geo::PlaneGeo::View().

Referenced by CreateLineGapParametersFromReadoutGaps(), WireAngleV(), and WirePitchV().

110  {
111  geo::TPCID const tpcID{cstat, tpc};
112  auto const [_, sign] = m_LArSoftGeometry->TPC(tpcID).DriftAxisWithSign();
113  return (sign == geo::DriftSign::Positive ?
114  m_wireReadoutGeom->Plane(geo::PlaneID(tpcID, 0)).View() :
115  m_wireReadoutGeom->Plane(geo::PlaneID(tpcID, 1)).View());
116  }
The data type to uniquely identify a Plane.
Definition: geo_types.h:364
DriftAxis DriftAxisWithSign() const
Returns the expected drift direction based on geometry.
Definition: TPCGeo.h:78
View_t View() const
Which coordinate does this plane measure.
Definition: PlaneGeo.h:155
art::ServiceHandle< geo::Geometry > m_LArSoftGeometry
the LArSoft geometry handle
The data type to uniquely identify a TPC.
Definition: geo_types.h:306
geo::WireReadoutGeom const * m_wireReadoutGeom
int sign(double val)
Definition: UtilFunc.cxx:104
Drift towards positive values.
PlaneGeo const & Plane(TPCID const &tpcid, View_t view) const
Returns the specified wire.
TPCGeo const & TPC(TPCID const &tpcid=details::tpc_zero) const
Returns the specified TPC.
Definition: GeometryCore.h:448
geo::View_t lar_pandora::VintageLArTPCThreeView::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 120 of file VintageLArTPCThreeView.h.

References m_wireReadoutGeom, and geo::WireReadoutGeom::Plane().

Referenced by CreateLineGapParametersFromReadoutGaps(), WireAngleW(), and WirePitchW().

123  {
124  return m_wireReadoutGeom->Plane({cstat, tpc, 2}).View();
125  }
geo::WireReadoutGeom const * m_wireReadoutGeom
PlaneGeo const & Plane(TPCID const &tpcid, View_t view) const
Returns the specified wire.
float lar_pandora::VintageLArTPCThreeView::WireAngleU ( const geo::TPCID::TPCID_t  tpc,
const geo::CryostatID::CryostatID_t  cstat 
) const
inlineoverridevirtual

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 m_wireReadoutGeom, 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
inlineoverridevirtual

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 m_wireReadoutGeom, 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::VintageLArTPCThreeView::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 166 of file VintageLArTPCThreeView.h.

References m_wireReadoutGeom, TargetViewW(), and lar_pandora::detector_functions::WireAngle().

168  {
169  return detector_functions::WireAngle(TargetViewW(tpc, cstat), tpc, cstat, *m_wireReadoutGeom);
170  }
geo::View_t TargetViewW(const geo::TPCID::TPCID_t tpc, const geo::CryostatID::CryostatID_t cstat) const override
Map a LArSoft view to Pandora&#39;s W 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::WirePitchU ( ) const
inlineoverridevirtual

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 m_wireReadoutGeom, geo::WireReadoutGeom::Plane(), and TargetViewU().

Referenced by lar_pandora::ProtoDUNEDualPhase::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
inlineoverridevirtual

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 m_wireReadoutGeom, geo::WireReadoutGeom::Plane(), and TargetViewV().

Referenced by lar_pandora::ProtoDUNEDualPhase::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::VintageLArTPCThreeView::WirePitchW ( ) const
inlineoverridevirtual

The wire pitch of the mapped W view.

Returns
The mapped wire pitch

Implements lar_pandora::LArPandoraDetectorType.

Definition at line 143 of file VintageLArTPCThreeView.h.

References m_wireReadoutGeom, geo::WireReadoutGeom::Plane(), and TargetViewW().

144  {
145  return m_wireReadoutGeom->Plane({0, 0}, TargetViewW(0, 0)).WirePitch();
146  }
geo::View_t TargetViewW(const geo::TPCID::TPCID_t tpc, const geo::CryostatID::CryostatID_t cstat) const override
Map a LArSoft view to Pandora&#39;s W view.
geo::WireReadoutGeom const * m_wireReadoutGeom
PlaneGeo const & Plane(TPCID const &tpcid, View_t view) const
Returns the specified wire.

Member Data Documentation

art::ServiceHandle<geo::Geometry> lar_pandora::VintageLArTPCThreeView::m_LArSoftGeometry
private

the LArSoft geometry handle

Definition at line 90 of file VintageLArTPCThreeView.h.

Referenced by GetLArSoftGeometry(), TargetViewU(), and TargetViewV().

geo::WireReadoutGeom const* lar_pandora::VintageLArTPCThreeView::m_wireReadoutGeom = &art::ServiceHandle<geo::WireReadout>()->Get()
private

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