LArSoft  v10_04_05
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 geo::WireReadoutGeom &wireReadoutGeom)
 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 27 of file LArPandoraDetectorType.cxx.

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

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

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

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

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

Factory class that returns the correct detector type interface.

Returns
The detector type interface

Definition at line 24 of file GetDetectorType.cxx.

References Get, geo::kU, geo::kV, geo::kW, geo::kY, and geo::kZ.

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().

25  {
26  auto const& wireReadoutGeom = art::ServiceHandle<geo::WireReadout>()->Get();
27 
28  const unsigned int nPlanes(wireReadoutGeom.MaxPlanes());
29  std::set<geo::View_t> planeSet;
30  for (auto const& plane : wireReadoutGeom.Iterate<geo::PlaneGeo>(geo::TPCID{0, 0}))
31  planeSet.insert(plane.View());
32 
33  if (nPlanes == 3 && planeSet.count(geo::kU) && planeSet.count(geo::kY) &&
34  planeSet.count(geo::kZ)) {
35  return new DUNEFarDetVDThreeView; //TODO Address bare pointer
36  }
37  if (nPlanes == 3 && planeSet.count(geo::kU) && planeSet.count(geo::kV) &&
38  planeSet.count(geo::kW)) {
39  return new VintageLArTPCThreeView;
40  }
41  if (nPlanes == 3 && planeSet.count(geo::kU) && planeSet.count(geo::kV) &&
42  planeSet.count(geo::kY)) {
43  return new ICARUS;
44  }
45  if (nPlanes == 2 && planeSet.count(geo::kW) && planeSet.count(geo::kY)) {
46  return new ProtoDUNEDualPhase;
47  }
48 
49  throw cet::exception("LArPandora") << "LArPandoraDetectorType::GetDetectorType --- unable to "
50  "determine the detector type from the geometry GDML";
51  }
Planes which measure V.
Definition: geo_types.h:132
Planes which measure Z direction.
Definition: geo_types.h:134
cout<< "Opened file "<< fin<< " ixs= "<< ixs<< endl;if(ixs==0) hhh=(TH1F *) fff-> Get("h1")
Definition: AddMC.C:8
Planes which measure Y direction.
Definition: geo_types.h:135
Planes which measure U.
Definition: geo_types.h:131
Geometry information for a single wire plane.The plane is represented in the geometry by a solid whic...
Definition: PlaneGeo.h:67
The data type to uniquely identify a TPC.
Definition: geo_types.h:306
Planes which measure W (third view for Bo, MicroBooNE, etc).
Definition: geo_types.h:133
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 geo::WireReadoutGeom wireReadoutGeom 
)

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 17 of file LArPandoraDetectorType.cxx.

References geo::WireReadoutGeom::WireAngleToVertical().

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

21  {
22  return 0.5f * M_PI - wireReadoutGeom.WireAngleToVertical(view, geo::TPCID{cstat, tpc});
23  }
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:306