Public Member Functions | Private Types | Private Attributes | List of all members
sim::LArVoxelCalculator Class Reference

#include <LArVoxelCalculator.h>

Public Member Functions

 LArVoxelCalculator (fhicl::ParameterSet const &pset)
 
double VoxelSizeX () const
 Access to voxel dimensions and offsets. More...
 
double VoxelSizeY () const
 
double VoxelSizeZ () const
 
double VoxelSizeT () const
 
double VoxelOffsetX () const
 
double VoxelOffsetY () const
 
double VoxelOffsetZ () const
 
double VoxelOffsetT () const
 
double EnergyCut () const
 
double SuggestedStepSize () const
 
int AxisToBin (const int, const double) const
 
int XAxisToBin (const double value) const
 
int YAxisToBin (const double value) const
 
int ZAxisToBin (const double value) const
 
int TAxisToBin (const double value) const
 
double BinToAxis (const int, const int) const
 
double XBinToAxis (const int value) const
 
double YBinToAxis (const int value) const
 
double ZBinToAxis (const int value) const
 
double TBinToAxis (const int value) const
 

Private Types

typedef std::vector< double > vector_type
 

Private Attributes

vector_type const m_voxelSize
 The sizes of the voxels in (x,y,z,t). Units are (mm,ns). More...
 
vector_type const m_voxelOffset
 
double const m_energyCut
 

Detailed Description

Definition at line 30 of file LArVoxelCalculator.h.

Member Typedef Documentation

Definition at line 79 of file LArVoxelCalculator.h.

Constructor & Destructor Documentation

sim::LArVoxelCalculator::LArVoxelCalculator ( fhicl::ParameterSet const &  pset)

Definition at line 27 of file LArVoxelCalculator_service.cc.

28  : m_voxelSize{pset.get<double>("VoxelSizeX"),
29  pset.get<double>("VoxelSizeY"),
30  pset.get<double>("VoxelSizeZ"),
31  pset.get<double>("VoxelSizeT")}
32  , m_voxelOffset{pset.get<double>("VoxelOffsetX"),
33  pset.get<double>("VoxelOffsetY"),
34  pset.get<double>("VoxelOffsetZ"),
35  pset.get<double>("VoxelOffsetT")}
36  , m_energyCut{pset.get<double>("VoxelEnergyCut")}
37  {}
vector_type const m_voxelOffset
vector_type const m_voxelSize
The sizes of the voxels in (x,y,z,t). Units are (mm,ns).

Member Function Documentation

int sim::LArVoxelCalculator::AxisToBin ( const int  axis,
const double  coord 
) const

Convert a co-ordinate axis (x, y, z, or t) into a bin number. The first argument is the axis (x=0, y=1, z=2, t=3) and the second is the value on that axis.

Definition at line 51 of file LArVoxelCalculator_service.cc.

53  {
54  // We have to be careful of how to handle the case when coord -
55  // offset < 0. The standard floor() function rounds the number in
56  // the correct direction.
57  return static_cast<int>( floor( ( coord - m_voxelOffset[axis] ) / m_voxelSize[axis] ) );
58  }
vector_type const m_voxelOffset
vector_type const m_voxelSize
The sizes of the voxels in (x,y,z,t). Units are (mm,ns).
auto coord(Vector &v, unsigned int n) noexcept
Returns an object to manage the coordinate n of a vector.
double sim::LArVoxelCalculator::BinToAxis ( const int  axis,
const int  bin 
) const

Get the value of an axis at the center of the given bin. The first argument is the axis (x=0, y=1, z=2, t=3) and the second is the bin number on that axis.

Definition at line 64 of file LArVoxelCalculator_service.cc.

66  {
67  return ( static_cast<double>(bin) + 0.5 ) * m_voxelSize[axis] + m_voxelOffset[axis];
68  }
vector_type const m_voxelOffset
vector_type const m_voxelSize
The sizes of the voxels in (x,y,z,t). Units are (mm,ns).
QTextStream & bin(QTextStream &s)
double sim::LArVoxelCalculator::EnergyCut ( ) const
inline

The energy in a voxel must be greater than this cut for it to be written to the output file.

Definition at line 47 of file LArVoxelCalculator.h.

47 { return m_energyCut; }
double sim::LArVoxelCalculator::SuggestedStepSize ( ) const

Returns a step size that's reasonable to use so that each segment of a track will be contained within a single voxel.

Returns a Monte-Carlo step size that's reasonable to use so that each segment of a track will be contained within a single voxel.

Definition at line 42 of file LArVoxelCalculator_service.cc.

43  {
44  return std::min( m_voxelSize[0], std::min( m_voxelSize[1], m_voxelSize[2] ) );
45  }
vector_type const m_voxelSize
The sizes of the voxels in (x,y,z,t). Units are (mm,ns).
T min(sqlite3 *const db, std::string const &table_name, std::string const &column_name)
Definition: statistics.h:55
int sim::LArVoxelCalculator::TAxisToBin ( const double  value) const
inline

Definition at line 63 of file LArVoxelCalculator.h.

63 { return AxisToBin(3,value); }
int AxisToBin(const int, const double) const
double sim::LArVoxelCalculator::TBinToAxis ( const int  value) const
inline

Definition at line 75 of file LArVoxelCalculator.h.

75 { return BinToAxis(3,value); }
double BinToAxis(const int, const int) const
double sim::LArVoxelCalculator::VoxelOffsetT ( ) const
inline

Definition at line 43 of file LArVoxelCalculator.h.

43 { return m_voxelOffset[3]; }
vector_type const m_voxelOffset
double sim::LArVoxelCalculator::VoxelOffsetX ( ) const
inline

Definition at line 40 of file LArVoxelCalculator.h.

40 { return m_voxelOffset[0]; }
vector_type const m_voxelOffset
double sim::LArVoxelCalculator::VoxelOffsetY ( ) const
inline

Definition at line 41 of file LArVoxelCalculator.h.

41 { return m_voxelOffset[1]; }
vector_type const m_voxelOffset
double sim::LArVoxelCalculator::VoxelOffsetZ ( ) const
inline

Definition at line 42 of file LArVoxelCalculator.h.

42 { return m_voxelOffset[2]; }
vector_type const m_voxelOffset
double sim::LArVoxelCalculator::VoxelSizeT ( ) const
inline

Definition at line 39 of file LArVoxelCalculator.h.

39 { return m_voxelSize[3]; }
vector_type const m_voxelSize
The sizes of the voxels in (x,y,z,t). Units are (mm,ns).
double sim::LArVoxelCalculator::VoxelSizeX ( ) const
inline

Access to voxel dimensions and offsets.

Definition at line 36 of file LArVoxelCalculator.h.

36 { return m_voxelSize[0]; }
vector_type const m_voxelSize
The sizes of the voxels in (x,y,z,t). Units are (mm,ns).
double sim::LArVoxelCalculator::VoxelSizeY ( ) const
inline

Definition at line 37 of file LArVoxelCalculator.h.

37 { return m_voxelSize[1]; }
vector_type const m_voxelSize
The sizes of the voxels in (x,y,z,t). Units are (mm,ns).
double sim::LArVoxelCalculator::VoxelSizeZ ( ) const
inline

Definition at line 38 of file LArVoxelCalculator.h.

38 { return m_voxelSize[2]; }
vector_type const m_voxelSize
The sizes of the voxels in (x,y,z,t). Units are (mm,ns).
int sim::LArVoxelCalculator::XAxisToBin ( const double  value) const
inline

Provide an alternate access to the above routine with individual routines for the axes:

Definition at line 60 of file LArVoxelCalculator.h.

60 { return AxisToBin(0,value); }
int AxisToBin(const int, const double) const
double sim::LArVoxelCalculator::XBinToAxis ( const int  value) const
inline

Provide an alternate access to the above routine with individual routines for the axes:

Definition at line 72 of file LArVoxelCalculator.h.

72 { return BinToAxis(0,value); }
double BinToAxis(const int, const int) const
int sim::LArVoxelCalculator::YAxisToBin ( const double  value) const
inline

Definition at line 61 of file LArVoxelCalculator.h.

61 { return AxisToBin(1,value); }
int AxisToBin(const int, const double) const
double sim::LArVoxelCalculator::YBinToAxis ( const int  value) const
inline

Definition at line 73 of file LArVoxelCalculator.h.

73 { return BinToAxis(1,value); }
double BinToAxis(const int, const int) const
int sim::LArVoxelCalculator::ZAxisToBin ( const double  value) const
inline

Definition at line 62 of file LArVoxelCalculator.h.

62 { return AxisToBin(2,value); }
int AxisToBin(const int, const double) const
double sim::LArVoxelCalculator::ZBinToAxis ( const int  value) const
inline

Definition at line 74 of file LArVoxelCalculator.h.

74 { return BinToAxis(2,value); }
double BinToAxis(const int, const int) const

Member Data Documentation

double const sim::LArVoxelCalculator::m_energyCut
private

The total amount of energy in a voxel must be greater than this value for it to be written to the output.

Definition at line 90 of file LArVoxelCalculator.h.

vector_type const sim::LArVoxelCalculator::m_voxelOffset
private

The offsets of the voxel binning from the origin in (x,y,z,t). Units are (mm,ns).

Definition at line 86 of file LArVoxelCalculator.h.

vector_type const sim::LArVoxelCalculator::m_voxelSize
private

The sizes of the voxels in (x,y,z,t). Units are (mm,ns).

Definition at line 82 of file LArVoxelCalculator.h.


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