1 #ifndef PHOTONLIBRARY_H 5 #define PHOTONLIBRARY_H 26 virtual float GetCount(
size_t Voxel,
size_t OpChannel)
const override;
27 void SetCount(
size_t Voxel,
size_t OpChannel,
float Count);
29 float GetTimingPar(
size_t Voxel,
size_t OpChannel,
size_t parnum)
const;
30 void SetTimingPar(
size_t Voxel,
size_t OpChannel,
float Count,
size_t parnum);
33 void SetTimingTF1(
size_t Voxel,
size_t OpChannel, TF1 func);
36 virtual float GetReflCount(
size_t Voxel,
size_t OpChannel)
const override;
37 void SetReflCount(
size_t Voxel,
size_t OpChannel,
float Count);
39 virtual float GetReflT0(
size_t Voxel,
size_t OpChannel)
const override;
40 void SetReflT0(
size_t Voxel,
size_t OpChannel,
float reflT0);
43 virtual float const*
GetCounts(
size_t Voxel)
const override;
47 virtual float const*
GetReflCounts(
size_t Voxel)
const override;
48 virtual float const*
GetReflT0s(
size_t Voxel)
const override;
60 void StoreLibraryToFile(std::string LibraryFile,
bool storeReflected=
false,
bool storeReflT0=
false,
size_t storeTiming=0)
const;
61 void LoadLibraryFromFile(std::string LibraryFile,
size_t NVoxels,
bool storeReflected=
false,
bool storeReflT0=
false,
size_t storeTiming=0,
int maxrange=200);
62 void CreateEmptyLibrary(
size_t NVoxels,
size_t NChannels,
bool storeReflected=
false,
bool storeReflT0=
false,
size_t storeTiming=0);
91 {
return Voxel * fNOpChannels + OpChannel; }
120 {
return fTimingParLookupTable[
uncheckedIndex(Voxel, OpChannel)][parnum];}
124 {
return fTimingParLookupTable[
uncheckedIndex(Voxel, OpChannel)][parnum]; }
129 {
return fTimingParTF1LookupTable[
uncheckedIndex(Voxel, OpChannel)]; }
146 return (val <= INT_MAX) ? (int)((ssize_t)val) : -1; }
virtual float GetReflT0(size_t Voxel, size_t OpChannel) const override
const_pointer data_address(size_type pos) const
Returns a constant pointer to the specified element.
size_t fTimingParNParameters
static int size_t2int(size_t val)
Converts size_t into integer.
TTree * ProduceTTree() const
float & uncheckedAccess(size_t Voxel, size_t OpChannel)
Unchecked access to a visibility datum.
size_t fHasTiming
Whether the current library deals with time propagation distribution.
void LoadLibraryFromFile(std::string LibraryFile, size_t NVoxels, bool storeReflected=false, bool storeReflT0=false, size_t storeTiming=0, int maxrange=200)
util::LazyVector< float > fReflLookupTable
virtual float const * GetCounts(size_t Voxel) const override
Returns a pointer to NOpChannels() visibility values, one per channel.
bool fHasReflectedT0
Whether the current library deals with reflected light timing.
void CreateEmptyLibrary(size_t NVoxels, size_t NChannels, bool storeReflected=false, bool storeReflT0=false, size_t storeTiming=0)
virtual float const * GetReflT0s(size_t Voxel) const override
virtual int NOpChannels() const override
virtual float GetReflCount(size_t Voxel, size_t OpChannel) const override
static std::string const OpChannelBranchName
Name of the optical channel number in the input tree.
float uncheckedAccess(size_t Voxel, size_t OpChannel) const
Unchecked access to a visibility datum.
void StoreLibraryToFile(std::string LibraryFile, bool storeReflected=false, bool storeReflT0=false, size_t storeTiming=0) const
float uncheckedAccessReflT(size_t Voxel, size_t OpChannel) const
Unchecked access to a reflected T0 visibility datum.
void SetCount(size_t Voxel, size_t OpChannel, float Count)
void SetTimingTF1(size_t Voxel, size_t OpChannel, TF1 func)
std::string fTimingParFormula
size_t uncheckedIndex(size_t Voxel, size_t OpChannel) const
Returns the index of visibility of specified voxel and cell.
util::LazyVector< float > fLookupTable
virtual bool hasReflectedT0() const override
Returns whether the current library deals with reflected light timing.
static size_t ExtractNOpChannels(TTree *tree)
Returns the number of optical channels in the specified tree.
void SetReflT0(size_t Voxel, size_t OpChannel, float reflT0)
bool fHasReflected
Whether the current library deals with reflected light counts.
const TF1 & uncheckedAccessTimingTF1(size_t Voxel, size_t OpChannel) const
Unchecked access to a parameter of the time distribution.
TF1 & uncheckedAccessTimingTF1(size_t Voxel, size_t OpChannel)
Unchecked access to a parameter of the time distribution.
float & uncheckedAccessTimingPar(size_t Voxel, size_t OpChannel, size_t parnum)
Unchecked access to a parameter of the time distribution.
TF1 * GetTimingTF1s(size_t Voxel) const
const std::vector< float > * GetTimingPars(size_t Voxel) const
Contiguous data container with lazy resizing on access.
util::LazyVector< TF1 > fTimingParTF1LookupTable
virtual float GetCount(size_t Voxel, size_t OpChannel) const override
void SetTimingPar(size_t Voxel, size_t OpChannel, float Count, size_t parnum)
General LArSoft Utilities.
float uncheckedAccessRefl(size_t Voxel, size_t OpChannel) const
Unchecked access to a reflected visibility datum.
float & uncheckedAccessRefl(size_t Voxel, size_t OpChannel)
Unchecked access to a reflected visibility datum.
virtual bool hasReflected() const override
Returns whether the current library deals with reflected light count.
float GetTimingPar(size_t Voxel, size_t OpChannel, size_t parnum) const
Interface shared by all PhotonLibrary-like classes.
util::LazyVector< std::vector< float > > fTimingParLookupTable
util::LazyVector< float > fReflTLookupTable
float & uncheckedAccessReflT(size_t Voxel, size_t OpChannel)
Unchecked access to a reflected T0 visibility datum.
virtual float const * GetReflCounts(size_t Voxel) const override
virtual int NVoxels() const override
void SetReflCount(size_t Voxel, size_t OpChannel, float Count)
bool hasTiming() const
Returns whether the current library deals with time propagation distributions.
float uncheckedAccessTimingPar(size_t Voxel, size_t OpChannel, size_t parnum) const
Unchecked access to a parameter the time distribution.