Public Member Functions | Private Attributes | List of all members
WireCell::Diffusion Class Reference

#include <Diffusion.h>

Inheritance diagram for WireCell::Diffusion:
WireCell::IDiffusion WireCell::IData< IDiffusion >

Public Member Functions

 Diffusion (IDepo::pointer depo, int nlong, int ntrans, double lmin, double tmin, double lmax, double tmax)
 
 Diffusion (const Diffusion &other)
 
Diffusionoperator= (const Diffusion &other)
 
virtual ~Diffusion ()
 
virtual IDepo::pointer depo () const
 Return the deposition that led to this diffusion. More...
 
virtual int lsize () const
 Helper method to give the array size in longitudinal dimension. More...
 
virtual int tsize () const
 Helper method to give the array size in transverse dimension. More...
 
virtual double get (int lind, int tind) const
 Get value at bin. More...
 
virtual double set (int lind, int tind, double value)
 
virtual double lpos (int ind, double offset=0.0) const
 
virtual double tpos (int ind, double offset=0.0) const
 
- Public Member Functions inherited from WireCell::IDiffusion
virtual ~IDiffusion ()
 
double lbegin () const
 Return begin of diffusion patch in longitudinal direction. More...
 
double tbegin () const
 Return begin of diffusion patch in transverse direction. More...
 
double lend () const
 Return end of diffusion patch in longitudinal direction. More...
 
double tend () const
 Return end of diffusion patch in transverse direction. More...
 
double lbin () const
 Return bins size in longitudinal direction. More...
 
double tbin () const
 Return bins size in transverse direction. More...
 
- Public Member Functions inherited from WireCell::IData< IDiffusion >
virtual ~IData ()
 

Private Attributes

IDepo::pointer m_depo
 
boost::multi_array< double, 2 > array
 
double lmin
 
double tmin
 
double lmax
 
double tmax
 
double lbin
 
double tbin
 

Additional Inherited Members

- Public Types inherited from WireCell::IData< IDiffusion >
typedef IDiffusion value_type
 
typedef std::shared_ptr< const IDiffusionpointer
 
typedef std::vector< pointervector
 
typedef std::shared_ptr< const vectorshared_vector
 

Detailed Description

Definition at line 12 of file Diffusion.h.

Constructor & Destructor Documentation

Diffusion::Diffusion ( IDepo::pointer  depo,
int  nlong,
int  ntrans,
double  lmin,
double  tmin,
double  lmax,
double  tmax 
)

Definition at line 4 of file Diffusion.cxx.

6  : m_depo(depo),
7  array(boost::extents[nlong][ntrans])
9 {
10  lbin = (lmax-lmin) / nlong;
11  tbin = (tmax-tmin) / ntrans;
12 }
double lbin() const
Return bins size in longitudinal direction.
Definition: IDiffusion.h:52
IDepo::pointer m_depo
Definition: Diffusion.h:14
virtual IDepo::pointer depo() const
Return the deposition that led to this diffusion.
Definition: Diffusion.cxx:39
boost::multi_array< double, 2 > array
Definition: Diffusion.h:15
double tbin() const
Return bins size in transverse direction.
Definition: IDiffusion.h:54
Diffusion::Diffusion ( const Diffusion other)

Definition at line 14 of file Diffusion.cxx.

15  : m_depo(other.m_depo)
16  , array(other.array)
17  , lmin(other.lmin), tmin(other.tmin), lmax(other.lmax), tmax(other.tmax)
18 {
19 }
IDepo::pointer m_depo
Definition: Diffusion.h:14
boost::multi_array< double, 2 > array
Definition: Diffusion.h:15
Diffusion::~Diffusion ( )
virtual

Definition at line 35 of file Diffusion.cxx.

36 {
37 }

Member Function Documentation

IDepo::pointer Diffusion::depo ( ) const
virtual

Return the deposition that led to this diffusion.

Implements WireCell::IDiffusion.

Definition at line 39 of file Diffusion.cxx.

40 {
41  return m_depo;
42 }
IDepo::pointer m_depo
Definition: Diffusion.h:14
double Diffusion::get ( int  lind,
int  tind 
) const
virtual

Get value at bin.

Implements WireCell::IDiffusion.

Definition at line 52 of file Diffusion.cxx.

53 {
54  return array[lind][tind];
55 }
boost::multi_array< double, 2 > array
Definition: Diffusion.h:15
double Diffusion::lpos ( int  ind,
double  offset = 0.0 
) const
virtual

Implements WireCell::IDiffusion.

Definition at line 62 of file Diffusion.cxx.

63 {
64  return lmin + (ind+offset)*lbin;
65 }
double lbin() const
Return bins size in longitudinal direction.
Definition: IDiffusion.h:52
int Diffusion::lsize ( ) const
virtual

Helper method to give the array size in longitudinal dimension.

Implements WireCell::IDiffusion.

Definition at line 43 of file Diffusion.cxx.

44 {
45  return array.shape()[0];
46 }
boost::multi_array< double, 2 > array
Definition: Diffusion.h:15
Diffusion & Diffusion::operator= ( const Diffusion other)

Definition at line 21 of file Diffusion.cxx.

22 {
23  m_depo = other.m_depo;
24  array.resize(boost::extents[other.lsize()][other.tsize()]);
25  array = other.array;
26  lmin = other.lmin;
27  tmin = other.tmin;
28  lmax = other.lmax;
29  tmax = other.tmax;
30  // isn't C++ fun?
31  return *this;
32 }
virtual int lsize() const
Helper method to give the array size in longitudinal dimension.
Definition: Diffusion.cxx:43
IDepo::pointer m_depo
Definition: Diffusion.h:14
virtual int tsize() const
Helper method to give the array size in transverse dimension.
Definition: Diffusion.cxx:47
boost::multi_array< double, 2 > array
Definition: Diffusion.h:15
double Diffusion::set ( int  lind,
int  tind,
double  value 
)
virtual

Definition at line 56 of file Diffusion.cxx.

57 {
58  array[lind][tind] = value;
59  return value;
60 }
const GenericPointer< typename T::ValueType > T2 value
Definition: pointer.h:1225
boost::multi_array< double, 2 > array
Definition: Diffusion.h:15
double Diffusion::tpos ( int  ind,
double  offset = 0.0 
) const
virtual

Implements WireCell::IDiffusion.

Definition at line 67 of file Diffusion.cxx.

68 {
69  return tmin + (ind+offset)*tbin;
70 }
double tbin() const
Return bins size in transverse direction.
Definition: IDiffusion.h:54
int Diffusion::tsize ( ) const
virtual

Helper method to give the array size in transverse dimension.

Implements WireCell::IDiffusion.

Definition at line 47 of file Diffusion.cxx.

48 {
49  return array.shape()[1];
50 }
boost::multi_array< double, 2 > array
Definition: Diffusion.h:15

Member Data Documentation

boost::multi_array<double, 2> WireCell::Diffusion::array
private

Definition at line 15 of file Diffusion.h.

double WireCell::Diffusion::lbin
private

Definition at line 16 of file Diffusion.h.

double WireCell::Diffusion::lmax
private

Definition at line 16 of file Diffusion.h.

double WireCell::Diffusion::lmin
private

Definition at line 16 of file Diffusion.h.

IDepo::pointer WireCell::Diffusion::m_depo
private

Definition at line 14 of file Diffusion.h.

double WireCell::Diffusion::tbin
private

Definition at line 16 of file Diffusion.h.

double WireCell::Diffusion::tmax
private

Definition at line 16 of file Diffusion.h.

double WireCell::Diffusion::tmin
private

Definition at line 16 of file Diffusion.h.


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