LArSoft  v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
lar_pandora::detector_functions Namespace Reference

Functions

LArPandoraDetectorTypeGetDetectorType ()
 Factory class that returns the correct detector type interface. More...
 
float WireAngle (const geo::View_t view, const geo::TPCID::TPCID_t tpc, const geo::CryostatID::CryostatID_t cstat, const art::ServiceHandle< geo::Geometry > &larsoftGeometry)
 Calculate the wire angle of a LArTPC view in a given TPC/cryostat. More...
 
PandoraApi::Geometry::LineGap::Parameters CreateDriftGapParameters (const LArDetectorGap &gap)
 Make the drift gap parameters for the Pandora API. More...
 
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. More...
 

Function Documentation

PandoraApi::Geometry::LineGap::Parameters lar_pandora::detector_functions::CreateDriftGapParameters ( const LArDetectorGap gap)

Make the drift gap parameters for the Pandora API.

Parameters
gapthe detector gap object
Returns
the line gap parameters for the Pandora API

Definition at line 26 of file LArPandoraDetectorType.cxx.

References lar_pandora::LArDetectorGap::GetX1(), and lar_pandora::LArDetectorGap::GetX2().

Referenced by lar_pandora::VintageLArTPCThreeView::CreateLineGapParametersFromDetectorGaps().

28  {
29  PandoraApi::Geometry::LineGap::Parameters parameters;
30  parameters.m_lineGapType = pandora::TPC_DRIFT_GAP;
31  parameters.m_lineStartX = gap.GetX1();
32  parameters.m_lineEndX = gap.GetX2();
33  parameters.m_lineStartZ = -std::numeric_limits<float>::max();
34  parameters.m_lineEndZ = std::numeric_limits<float>::max();
35 
36  return parameters;
37  }
PandoraApi::Geometry::LineGap::Parameters lar_pandora::detector_functions::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.

Parameters
firstPointthe first point in the gap
lastPointthe last point ih the gap
xFirstthe min X of the gap
xLastthe max X of the gap
halfWirePitchthe half wire pitch
gapTypethe pandora gap type
Returns
the line gap parameters for the Pandora API

Definition at line 41 of file LArPandoraDetectorType.cxx.

Referenced by lar_pandora::ProtoDUNEDualPhase::CreateLineGapParametersFromReadoutGaps(), and lar_pandora::VintageLArTPCThreeView::CreateLineGapParametersFromReadoutGaps().

48  {
49  PandoraApi::Geometry::LineGap::Parameters parameters;
50  parameters.m_lineGapType = gapType;
51  parameters.m_lineStartX = xFirst;
52  parameters.m_lineEndX = xLast;
53  parameters.m_lineStartZ = std::min(firstPoint, lastPoint) - halfWirePitch;
54  parameters.m_lineEndZ = std::max(firstPoint, lastPoint) + halfWirePitch;
55 
56  return parameters;
57  }
LArPandoraDetectorType * lar_pandora::detector_functions::GetDetectorType ( )

Factory class that returns the correct detector type interface.

Returns
The detector type interface

Definition at line 23 of file GetDetectorType.cxx.

References geo::kU, geo::kV, geo::kW, geo::kY, geo::kZ, geo::GeometryCore::MaxPlanes(), geo::TPCGeo::Plane(), geo::GeometryCore::TPC(), and geo::PlaneGeo::View().

Referenced by ShowerRecoTools::ShowerPandoraSlidingFitTrackFinder::CalculateElement(), lar_pandora::LArPandoraInput::CreatePandoraDetectorGaps(), lar_pandora::LArPandoraInput::CreatePandoraHits2D(), lar_pandora::LArPandoraInput::CreatePandoraReadoutGaps(), lar_pandora::LArPandoraGeometry::LoadDetectorGaps(), lar_pandora::LArPandoraGeometry::LoadGeometry(), and lar_pandora::LArPandoraTrackCreation::produce().

24  {
26 
27  const unsigned int nPlanes(geo->MaxPlanes());
28  std::set<geo::_plane_proj> planeSet;
29  for (unsigned int iPlane = 0; iPlane < nPlanes; ++iPlane)
30  (void)planeSet.insert(geo->TPC().Plane(iPlane).View());
31 
32  if (nPlanes == 3 && planeSet.count(geo::kU) && planeSet.count(geo::kY) &&
33  planeSet.count(geo::kZ)) {
34  return new DUNEFarDetVDThreeView; //TODO Address bare pointer
35  }
36  else if (nPlanes == 3 && planeSet.count(geo::kU) && planeSet.count(geo::kV) &&
37  planeSet.count(geo::kW)) {
38  return new VintageLArTPCThreeView;
39  }
40  else if (nPlanes == 3 && planeSet.count(geo::kU) && planeSet.count(geo::kV) &&
41  planeSet.count(geo::kY)) {
42  return new ICARUS;
43  }
44  else if (nPlanes == 2 && planeSet.count(geo::kW) && planeSet.count(geo::kY)) {
45  return new ProtoDUNEDualPhase;
46  }
47 
48  throw cet::exception("LArPandora") << "LArPandoraDetectorType::GetDetectorType --- unable to "
49  "determine the detector type from the geometry GDML";
50  }
Planes which measure V.
Definition: geo_types.h:136
Planes which measure Z direction.
Definition: geo_types.h:138
Planes which measure Y direction.
Definition: geo_types.h:139
TPCGeo const & TPC(TPCID const &tpcid=tpc_zero) const
Returns the specified TPC.
Definition: GeometryCore.h:722
Planes which measure U.
Definition: geo_types.h:135
View_t View() const
Which coordinate does this plane measure.
Definition: PlaneGeo.h:166
unsigned int MaxPlanes() const
Returns the largest number of planes among all TPCs in this detector.
Planes which measure W (third view for Bo, MicroBooNE, etc).
Definition: geo_types.h:137
PlaneGeo const & Plane(geo::View_t view) const
Return the plane in the tpc with View_t view.
Definition: TPCGeo.cxx:252
Namespace collecting geometry-related classes utilities.
cet::coded_exception< error, detail::translate > exception
Definition: exception.h:33
float lar_pandora::detector_functions::WireAngle ( const geo::View_t  view,
const geo::TPCID::TPCID_t  tpc,
const geo::CryostatID::CryostatID_t  cstat,
const art::ServiceHandle< geo::Geometry > &  larsoftGeometry 
)

Calculate the wire angle of a LArTPC view in a given TPC/cryostat.

Parameters
viewthe LArSoft view
tpcthe LArSoft TPC ID
cstatthe LArSoft cryostat ID
larsoftGeometrythe LArSoft geometry service handle
Returns
the wire angle

Definition at line 16 of file LArPandoraDetectorType.cxx.

References geo::GeometryCore::WireAngleToVertical().

Referenced by lar_pandora::VintageLArTPCThreeView::WireAngleU(), lar_pandora::VintageLArTPCThreeView::WireAngleV(), lar_pandora::ICARUS::WireAngleW(), and lar_pandora::VintageLArTPCThreeView::WireAngleW().

20  {
21  return 0.5f * M_PI - larsoftGeometry->WireAngleToVertical(view, geo::TPCID{cstat, tpc});
22  }
double WireAngleToVertical(View_t view, TPCID const &tpcid) const
Returns the angle of the wires in the specified view from vertical.
The data type to uniquely identify a TPC.
Definition: geo_types.h:381