All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Functions
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 28 of file LArPandoraDetectorType.cxx.

29  {
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  }
fhicl::Table< sbnd::crt::CRTDetSimParams > Parameters
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 43 of file LArPandoraDetectorType.cxx.

49  {
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  }
fhicl::Table< sbnd::crt::CRTDetSimParams > Parameters
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.

25  {
26  art::ServiceHandle<geo::Geometry const> geo;
27 
28  const unsigned int nPlanes(geo->MaxPlanes());
29  std::set<geo::_plane_proj> planeSet;
30  for (unsigned int iPlane = 0; iPlane < nPlanes; ++iPlane)
31  (void)planeSet.insert(geo->TPC(0, 0).Plane(iPlane).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  else if (nPlanes == 3 && planeSet.count(geo::kU) && planeSet.count(geo::kV) &&
38  planeSet.count(geo::kW)) {
39  return new VintageLArTPCThreeView;
40  }
41  else if (nPlanes == 3 && planeSet.count(geo::kU) && planeSet.count(geo::kV) &&
42  planeSet.count(geo::kY)) {
43  return new ICARUS;
44  }
45  else 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:130
Planes which measure Z direction.
Definition: geo_types.h:132
Planes which measure Y direction.
Definition: geo_types.h:133
Planes which measure U.
Definition: geo_types.h:129
Planes which measure W (third view for Bo, MicroBooNE, etc).
Definition: geo_types.h:131
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 17 of file LArPandoraDetectorType.cxx.

21  {
22  return (0.5f * M_PI - larsoftGeometry->WireAngleToVertical(view, tpc, cstat));
23  }