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

Member Typedef Documentation

typedef std::vector<double> sim::LArVoxelCalculator::vector_type
private

Definition at line 82 of file LArVoxelCalculator.h.

Constructor & Destructor Documentation

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

Definition at line 27 of file LArVoxelCalculator.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.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.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).
constexpr details::BinObj< T > bin(T value)
Returns a wrapper to print the specified data in binary format.
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 50 of file LArVoxelCalculator.h.

50 { 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.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).
int sim::LArVoxelCalculator::TAxisToBin ( const double  value) const
inline

Definition at line 66 of file LArVoxelCalculator.h.

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

Definition at line 78 of file LArVoxelCalculator.h.

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

Definition at line 46 of file LArVoxelCalculator.h.

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

Definition at line 43 of file LArVoxelCalculator.h.

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

Definition at line 44 of file LArVoxelCalculator.h.

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

Definition at line 45 of file LArVoxelCalculator.h.

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

Definition at line 42 of file LArVoxelCalculator.h.

42 { 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 39 of file LArVoxelCalculator.h.

39 { 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 40 of file LArVoxelCalculator.h.

40 { 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 41 of file LArVoxelCalculator.h.

41 { 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 63 of file LArVoxelCalculator.h.

63 { return AxisToBin(0,value); }
int AxisToBin(const int, const double) const
temporary value
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 75 of file LArVoxelCalculator.h.

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

Definition at line 64 of file LArVoxelCalculator.h.

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

Definition at line 76 of file LArVoxelCalculator.h.

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

Definition at line 65 of file LArVoxelCalculator.h.

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

Definition at line 77 of file LArVoxelCalculator.h.

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

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 93 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 89 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 85 of file LArVoxelCalculator.h.


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