All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Classes | Public Member Functions | Private Attributes | List of all members
ana::FiducialVolumeCosmicIdAlg Class Reference

#include <FiducialVolumeCosmicIdAlg.h>

Classes

struct  Config
 
struct  Fiducial
 

Public Member Functions

 FiducialVolumeCosmicIdAlg (const core::ProviderManager &manager, const Config &config)
 
 FiducialVolumeCosmicIdAlg (const core::ProviderManager &manager, const fhicl::ParameterSet &pset)
 
 ~FiducialVolumeCosmicIdAlg ()
 
void reconfigure (const core::ProviderManager &manager, const Config &config)
 
bool InFiducial (geo::Point_t point)
 
bool FiducialVolumeCosmicId (recob::Track track)
 

Private Attributes

std::vector< geo::BoxBoundedGeofFiducialVolumes
 
double fMinX
 
double fMinY
 
double fMinZ
 
double fMaxX
 
double fMaxY
 
double fMaxZ
 

Detailed Description

Definition at line 31 of file sbnana/sbnanalysis/ana/SBNOscReco/CosmicIDAlgs/FiducialVolumeCosmicIdAlg.h.

Constructor & Destructor Documentation

ana::FiducialVolumeCosmicIdAlg::FiducialVolumeCosmicIdAlg ( const core::ProviderManager manager,
const Config config 
)

Definition at line 5 of file sbnana/sbnanalysis/ana/SBNOscReco/CosmicIDAlgs/FiducialVolumeCosmicIdAlg.cc.

5  {
6  this->reconfigure(manager, config);
7 }
void reconfigure(const core::ProviderManager &manager, const Config &config)
ana::FiducialVolumeCosmicIdAlg::FiducialVolumeCosmicIdAlg ( const core::ProviderManager manager,
const fhicl::ParameterSet &  pset 
)
inline

Definition at line 59 of file sbnana/sbnanalysis/ana/SBNOscReco/CosmicIDAlgs/FiducialVolumeCosmicIdAlg.h.

59  :
60  FiducialVolumeCosmicIdAlg(manager, fhicl::Table<Config>(pset, {})()) {}
FiducialVolumeCosmicIdAlg(const core::ProviderManager &manager, const Config &config)
ana::FiducialVolumeCosmicIdAlg::~FiducialVolumeCosmicIdAlg ( )

Member Function Documentation

bool ana::FiducialVolumeCosmicIdAlg::FiducialVolumeCosmicId ( recob::Track  track)

Definition at line 53 of file sbnana/sbnanalysis/ana/SBNOscReco/CosmicIDAlgs/FiducialVolumeCosmicIdAlg.cc.

53  {
54 
55  bool startInFiducial = InFiducial(track.Vertex());
56 
57  bool endInFiducial = InFiducial(track.End());
58 
59  if(!startInFiducial && !endInFiducial) return true;
60 
61  return false;
62 
63 }
Point_t const & Vertex() const
Point_t const & End() const
bool ana::FiducialVolumeCosmicIdAlg::InFiducial ( geo::Point_t  point)

Definition at line 45 of file sbnana/sbnanalysis/ana/SBNOscReco/CosmicIDAlgs/FiducialVolumeCosmicIdAlg.cc.

45  {
46  for (const geo::BoxBoundedGeo vol: fFiducialVolumes) {
47  if (vol.ContainsPosition(point)) return true;
48  }
49  return false;
50 }
A base class aware of world box coordinatesAn object describing a simple shape can inherit from this ...
Definition: BoxBoundedGeo.h:33
void ana::FiducialVolumeCosmicIdAlg::reconfigure ( const core::ProviderManager manager,
const Config config 
)

Definition at line 15 of file sbnana/sbnanalysis/ana/SBNOscReco/CosmicIDAlgs/FiducialVolumeCosmicIdAlg.cc.

15  {
16  fFiducialVolumes.clear();
17 
18  fMinX = config.FiducialCuts().MinX();
19  fMinY = config.FiducialCuts().MinY();
20  fMinZ = config.FiducialCuts().MinZ();
21  fMaxX = config.FiducialCuts().MaxX();
22  fMaxY = config.FiducialCuts().MaxY();
23  fMaxZ = config.FiducialCuts().MaxZ();
24 
25  // get the set of fiducial volumes
26  for (auto const &cryo: manager.GetGeometryProvider()->IterateCryostats()) {
27  geo::GeometryCore::TPC_iterator tstart = manager.GetGeometryProvider()->begin_TPC(cryo.ID()),
28  tend = manager.GetGeometryProvider()->end_TPC(cryo.ID());
29 
30  double Min_X = std::min_element(tstart, tend, [](auto &lhs, auto &rhs) { return lhs.MinX() < rhs.MinX(); })->MinX();
31  double Min_Y = std::min_element(tstart, tend, [](auto &lhs, auto &rhs) { return lhs.MinY() < rhs.MinY(); })->MinY();
32  double Min_Z = std::min_element(tstart, tend, [](auto &lhs, auto &rhs) { return lhs.MinZ() < rhs.MinZ(); })->MinZ();
33 
34  double Max_X = std::max_element(tstart, tend, [](auto &lhs, auto &rhs) { return lhs.MaxX() < rhs.MaxX(); })->MaxX();
35  double Max_Y = std::max_element(tstart, tend, [](auto &lhs, auto &rhs) { return lhs.MaxY() < rhs.MaxY(); })->MaxY();
36  double Max_Z = std::max_element(tstart, tend, [](auto &lhs, auto &rhs) { return lhs.MaxZ() < rhs.MaxZ(); })->MaxZ();
37 
38  fFiducialVolumes.emplace_back(Min_X + fMinX, Max_X - fMaxX, Min_Y + fMinY, Max_Y - fMaxY, Min_Z + fMinZ, Max_Z - fMaxZ);
39  }
40 
41  return;
42 }
const geo::GeometryCore * GetGeometryProvider() const
TPC_iterator begin_TPC() const
Returns an iterator pointing to the first TPC in the detector.
IteratorBox< cryostat_iterator,&GeometryCore::begin_cryostat,&GeometryCore::end_cryostat > IterateCryostats() const
Enables ranged-for loops on all cryostats of the detector.
Forward iterator browsing all geometry elements in the detector.
Definition: GeometryCore.h:727
TPC_iterator end_TPC() const
Returns an iterator pointing after the last TPC in the detector.

Member Data Documentation

std::vector<geo::BoxBoundedGeo> ana::FiducialVolumeCosmicIdAlg::fFiducialVolumes
private
double ana::FiducialVolumeCosmicIdAlg::fMaxX
private
double ana::FiducialVolumeCosmicIdAlg::fMaxY
private
double ana::FiducialVolumeCosmicIdAlg::fMaxZ
private
double ana::FiducialVolumeCosmicIdAlg::fMinX
private
double ana::FiducialVolumeCosmicIdAlg::fMinY
private
double ana::FiducialVolumeCosmicIdAlg::fMinZ
private

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