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

66  {
67  PandoraApi::Geometry::LineGap::Parameters parameters;
68  parameters.m_lineGapType = pandora::TPC_DRIFT_GAP;
69  parameters.m_lineStartX = gap.GetX1();
70  parameters.m_lineEndX = gap.GetX2();
71  parameters.m_lineStartZ = -std::numeric_limits<float>::max();
72  parameters.m_lineEndZ = std::numeric_limits<float>::max();
73 
74  return parameters;
75  }
static int max(int a, int b)
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 80 of file LArPandoraDetectorType.cxx.

86  {
87  PandoraApi::Geometry::LineGap::Parameters parameters;
88  parameters.m_lineGapType = gapType;
89  parameters.m_lineStartX = xFirst;
90  parameters.m_lineEndX = xLast;
91  parameters.m_lineStartZ = std::min(firstPoint, lastPoint) - halfWirePitch;
92  parameters.m_lineEndZ = std::max(firstPoint, lastPoint) + halfWirePitch;
93 
94  return parameters;
95  }
static int max(int a, int b)
T min(sqlite3 *const db, std::string const &table_name, std::string const &column_name)
Definition: statistics.h:55
LArPandoraDetectorType * lar_pandora::detector_functions::GetDetectorType ( )

Factory class that returns the correct detector type interface.

Returns
The detector type interface

Definition at line 22 of file LArPandoraDetectorType.cxx.

23  {
25 
26  const unsigned int nPlanes(geo->MaxPlanes());
27  std::set<geo::_plane_proj> planeSet;
28  for (unsigned int iPlane = 0; iPlane < nPlanes; ++iPlane)
29  (void)planeSet.insert(geo->TPC(0, 0).Plane(iPlane).View());
30 
31  if (nPlanes == 3 && planeSet.count(geo::kU) && planeSet.count(geo::kY) &&
32  planeSet.count(geo::kZ)) {
33  return new DUNEFarDetVDThreeView; //TODO Address bare pointer
34  }
35  else if (nPlanes == 3 && planeSet.count(geo::kU) && planeSet.count(geo::kV) &&
36  planeSet.count(geo::kW)) {
37  return new VintageLArTPCThreeView;
38  }
39  else if (nPlanes == 3 && planeSet.count(geo::kU) && planeSet.count(geo::kV) &&
40  planeSet.count(geo::kY)) {
41  return new ICARUS;
42  }
43  else if (nPlanes == 2 && planeSet.count(geo::kW) && planeSet.count(geo::kY)) {
44  return new ProtoDUNEDualPhase;
45  }
46 
47  throw cet::exception("LArPandora") << "LArPandoraDetectorType::GetDetectorType --- unable to "
48  "determine the detector type from the geometry GDML";
49  }
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
View_t View() const
Which coordinate does this plane measure.
Definition: PlaneGeo.h:184
unsigned int MaxPlanes() const
Returns the largest number of planes among all TPCs in this detector.
TPCGeo const & TPC(unsigned int const tpc=0, unsigned int const cstat=0) const
Returns the specified TPC.
Planes which measure W (third view for Bo, MicroBooNE, etc).
Definition: geo_types.h:131
PlaneGeo const & Plane(geo::View_t view) const
Return the plane in the tpc with View_t view.
Definition: TPCGeo.cxx:263
LArSoft geometry interface.
Definition: ChannelGeo.h:16
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 54 of file LArPandoraDetectorType.cxx.

58  {
59  return (0.5f * M_PI - larsoftGeometry->WireAngleToVertical(view, tpc, cstat));
60  }
#define M_PI
Definition: includeROOT.h:54
double WireAngleToVertical(geo::View_t view, geo::TPCID const &tpcid) const
Returns the angle of the wires in the specified view from vertical.