#include <PhotonLibrary.h>
Public Member Functions | |
PhotonLibrary (art::TFileDirectory *pDir=nullptr) | |
If no valid pDir is provided, storage features will not be supported. More... | |
TTree * | ProduceTTree () const |
virtual float | GetCount (size_t Voxel, size_t OpChannel) const override |
void | SetCount (size_t Voxel, size_t OpChannel, float Count) |
float | GetTimingPar (size_t Voxel, size_t OpChannel, size_t parnum) const |
void | SetTimingPar (size_t Voxel, size_t OpChannel, float Count, size_t parnum) |
void | SetTimingTF1 (size_t Voxel, size_t OpChannel, TF1 func) |
virtual float | GetReflCount (size_t Voxel, size_t OpChannel) const override |
void | SetReflCount (size_t Voxel, size_t OpChannel, float Count) |
virtual float | GetReflT0 (size_t Voxel, size_t OpChannel) const override |
void | SetReflT0 (size_t Voxel, size_t OpChannel, float reflT0) |
virtual float const * | GetCounts (size_t Voxel) const override |
Returns a pointer to NOpChannels() visibility values, one per channel. More... | |
const std::vector< float > * | GetTimingPars (size_t Voxel) const |
TF1 * | GetTimingTF1s (size_t Voxel) const |
virtual float const * | GetReflCounts (size_t Voxel) const override |
virtual float const * | GetReflT0s (size_t Voxel) const override |
bool | hasTiming () const |
Returns whether the current library deals with time propagation distributions. More... | |
virtual bool | hasReflected () const override |
Returns whether the current library deals with reflected light count. More... | |
virtual bool | hasReflectedT0 () const override |
Returns whether the current library deals with reflected light timing. More... | |
void | StoreLibraryToFile (std::string LibraryFile, bool storeReflected=false, bool storeReflT0=false, size_t storeTiming=0) const |
void | LoadLibraryFromFile (std::string LibraryFile, size_t NVoxels, bool storeReflected=false, bool storeReflT0=false, size_t storeTiming=0, int maxrange=200) |
void | CreateEmptyLibrary (size_t NVoxels, size_t NChannels, bool storeReflected=false, bool storeReflT0=false, size_t storeTiming=0) |
Metadata: voxel information | |
bool | hasVoxelDef () const |
Returns whether voxel metadata is available. More... | |
sim::PhotonVoxelDef const & | GetVoxelDef () const |
void | SetVoxelDef (sim::PhotonVoxelDef const &voxelDef) |
Public Member Functions inherited from phot::IPhotonLibrary | |
virtual | ~IPhotonLibrary ()=default |
size_t | LibrarySize () const |
Returns the number of elements in the library. More... | |
Private Member Functions | |
virtual int | NOpChannels () const override |
virtual int | NVoxels () const override |
virtual bool | isVoxelValid (size_t Voxel) const override |
bool | isVoxelValidImpl (size_t Voxel) const |
size_t | uncheckedIndex (size_t Voxel, size_t OpChannel) const |
Returns the index of visibility of specified voxel and cell. More... | |
float | uncheckedAccess (size_t Voxel, size_t OpChannel) const |
Unchecked access to a visibility datum. More... | |
float & | uncheckedAccess (size_t Voxel, size_t OpChannel) |
Unchecked access to a visibility datum. More... | |
float | uncheckedAccessRefl (size_t Voxel, size_t OpChannel) const |
Unchecked access to a reflected visibility datum. More... | |
float & | uncheckedAccessRefl (size_t Voxel, size_t OpChannel) |
Unchecked access to a reflected visibility datum. More... | |
float | uncheckedAccessReflT (size_t Voxel, size_t OpChannel) const |
Unchecked access to a reflected T0 visibility datum. More... | |
float & | uncheckedAccessReflT (size_t Voxel, size_t OpChannel) |
Unchecked access to a reflected T0 visibility datum. More... | |
float | uncheckedAccessTimingPar (size_t Voxel, size_t OpChannel, size_t parnum) const |
Unchecked access to a parameter the time distribution. More... | |
float & | uncheckedAccessTimingPar (size_t Voxel, size_t OpChannel, size_t parnum) |
Unchecked access to a parameter of the time distribution. More... | |
TF1 & | uncheckedAccessTimingTF1 (size_t Voxel, size_t OpChannel) |
Unchecked access to a parameter of the time distribution. More... | |
const TF1 & | uncheckedAccessTimingTF1 (size_t Voxel, size_t OpChannel) const |
Unchecked access to a parameter of the time distribution. More... | |
void | LoadMetadata (TDirectory &srcDir) |
Reads the metadata from specified ROOT directory and sets it as current. More... | |
void | StoreMetadata () const |
Writes the current metadata (if any) into the ROOT output file. More... | |
Static Private Member Functions | |
static size_t | ExtractNOpChannels (TTree *tree) |
Returns the number of optical channels in the specified tree. More... | |
static int | size_t2int (size_t val) |
Converts size_t into integer. More... | |
Private Attributes | |
bool | fHasReflected = false |
Whether the current library deals with reflected light counts. More... | |
bool | fHasReflectedT0 |
Whether the current library deals with reflected light timing. More... | |
size_t | fHasTiming |
Whether the current library deals with time propagation distribution. More... | |
util::LazyVector< float > | fLookupTable |
util::LazyVector< float > | fReflLookupTable |
util::LazyVector< float > | fReflTLookupTable |
util::LazyVector< std::vector< float > > | fTimingParLookupTable |
util::LazyVector< TF1 > | fTimingParTF1LookupTable |
std::string | fTimingParFormula |
size_t | fTimingParNParameters |
size_t | fNOpChannels |
size_t | fNVoxels |
std::optional< sim::PhotonVoxelDef > | fVoxelDef |
Voxel definition loaded from library metadata. More... | |
art::TFileDirectory * | fDir = nullptr |
ROOT directory where to write data. More... | |
Static Private Attributes | |
static std::string const | OpChannelBranchName = "OpChannel" |
Name of the optical channel number in the input tree. More... | |
Additional Inherited Members | |
Public Types inherited from phot::IPhotonLibrary | |
using | Counts_t = const float * |
Type for visibility count per optical channel. More... | |
using | T0s_t = const float * |
Type for time of arrival per optical channel. More... | |
using | Params_t = std::vector< float > const * |
using | Functions_t = TF1 * |
Definition at line 25 of file PhotonLibrary.h.
phot::PhotonLibrary::PhotonLibrary | ( | art::TFileDirectory * | pDir = nullptr | ) |
If no valid pDir
is provided, storage features will not be supported.
Definition at line 47 of file PhotonLibrary.cxx.
void phot::PhotonLibrary::CreateEmptyLibrary | ( | size_t | NVoxels, |
size_t | NChannels, | ||
bool | storeReflected = false , |
||
bool | storeReflT0 = false , |
||
size_t | storeTiming = 0 |
||
) |
Definition at line 135 of file PhotonLibrary.cxx.
|
staticprivate |
Returns the number of optical channels in the specified tree.
Definition at line 578 of file PhotonLibrary.cxx.
|
overridevirtual |
Implements phot::IPhotonLibrary.
Definition at line 311 of file PhotonLibrary.cxx.
|
overridevirtual |
Returns a pointer to NOpChannels() visibility values, one per channel.
Implements phot::IPhotonLibrary.
Definition at line 407 of file PhotonLibrary.cxx.
|
overridevirtual |
Implements phot::IPhotonLibrary.
Definition at line 330 of file PhotonLibrary.cxx.
|
overridevirtual |
Implements phot::IPhotonLibrary.
Definition at line 458 of file PhotonLibrary.cxx.
|
overridevirtual |
Implements phot::IPhotonLibrary.
Definition at line 340 of file PhotonLibrary.cxx.
|
overridevirtual |
Implements phot::IPhotonLibrary.
Definition at line 469 of file PhotonLibrary.cxx.
float phot::PhotonLibrary::GetTimingPar | ( | size_t | Voxel, |
size_t | OpChannel, | ||
size_t | parnum | ||
) | const |
Definition at line 321 of file PhotonLibrary.cxx.
const std::vector< float > * phot::PhotonLibrary::GetTimingPars | ( | size_t | Voxel | ) | const |
Definition at line 418 of file PhotonLibrary.cxx.
TF1 * phot::PhotonLibrary::GetTimingTF1s | ( | size_t | Voxel | ) | const |
Definition at line 429 of file PhotonLibrary.cxx.
|
inline |
Returns the current voxel metadata (undefined behaviour if none).
hasVoxelDef()
Definition at line 106 of file PhotonLibrary.h.
|
inlineoverridevirtual |
Returns whether the current library deals with reflected light count.
Implements phot::IPhotonLibrary.
Definition at line 64 of file PhotonLibrary.h.
|
inlineoverridevirtual |
Returns whether the current library deals with reflected light timing.
Implements phot::IPhotonLibrary.
Definition at line 71 of file PhotonLibrary.h.
|
inline |
Returns whether the current library deals with time propagation distributions.
Definition at line 57 of file PhotonLibrary.h.
|
inline |
Returns whether voxel metadata is available.
Definition at line 98 of file PhotonLibrary.h.
|
inlineoverrideprivatevirtual |
Reimplemented from phot::IPhotonLibrary.
Definition at line 136 of file PhotonLibrary.h.
|
inlineprivate |
Definition at line 168 of file PhotonLibrary.h.
void phot::PhotonLibrary::LoadLibraryFromFile | ( | std::string | LibraryFile, |
size_t | NVoxels, | ||
bool | storeReflected = false , |
||
bool | storeReflT0 = false , |
||
size_t | storeTiming = 0 , |
||
int | maxrange = 200 |
||
) |
Definition at line 166 of file PhotonLibrary.cxx.
|
private |
Reads the metadata from specified ROOT directory and sets it as current.
Definition at line 479 of file PhotonLibrary.cxx.
|
inlineoverrideprivatevirtual |
|
inlineoverrideprivatevirtual |
TTree* phot::PhotonLibrary::ProduceTTree | ( | ) | const |
void phot::PhotonLibrary::SetCount | ( | size_t | Voxel, |
size_t | OpChannel, | ||
float | Count | ||
) |
Definition at line 351 of file PhotonLibrary.cxx.
void phot::PhotonLibrary::SetReflCount | ( | size_t | Voxel, |
size_t | OpChannel, | ||
float | Count | ||
) |
Definition at line 384 of file PhotonLibrary.cxx.
void phot::PhotonLibrary::SetReflT0 | ( | size_t | Voxel, |
size_t | OpChannel, | ||
float | reflT0 | ||
) |
Definition at line 395 of file PhotonLibrary.cxx.
void phot::PhotonLibrary::SetTimingPar | ( | size_t | Voxel, |
size_t | OpChannel, | ||
float | Count, | ||
size_t | parnum | ||
) |
Definition at line 362 of file PhotonLibrary.cxx.
void phot::PhotonLibrary::SetTimingTF1 | ( | size_t | Voxel, |
size_t | OpChannel, | ||
TF1 | func | ||
) |
Definition at line 373 of file PhotonLibrary.cxx.
|
inline |
Copies the specified voxel definition into our own (overwrites the existing metadata if any).
Definition at line 115 of file PhotonLibrary.h.
|
inlinestaticprivate |
Converts size_t into integer.
Definition at line 265 of file PhotonLibrary.h.
void phot::PhotonLibrary::StoreLibraryToFile | ( | std::string | LibraryFile, |
bool | storeReflected = false , |
||
bool | storeReflT0 = false , |
||
size_t | storeTiming = 0 |
||
) | const |
Definition at line 52 of file PhotonLibrary.cxx.
|
private |
Writes the current metadata (if any) into the ROOT output file.
Definition at line 528 of file PhotonLibrary.cxx.
|
inlineprivate |
Unchecked access to a visibility datum.
Definition at line 182 of file PhotonLibrary.h.
|
inlineprivate |
Unchecked access to a visibility datum.
Definition at line 189 of file PhotonLibrary.h.
|
inlineprivate |
Unchecked access to a reflected visibility datum.
Definition at line 196 of file PhotonLibrary.h.
|
inlineprivate |
Unchecked access to a reflected visibility datum.
Definition at line 203 of file PhotonLibrary.h.
|
inlineprivate |
Unchecked access to a reflected T0 visibility datum.
Definition at line 210 of file PhotonLibrary.h.
|
inlineprivate |
Unchecked access to a reflected T0 visibility datum.
Definition at line 217 of file PhotonLibrary.h.
|
inlineprivate |
Unchecked access to a parameter the time distribution.
Definition at line 224 of file PhotonLibrary.h.
|
inlineprivate |
Unchecked access to a parameter of the time distribution.
Definition at line 231 of file PhotonLibrary.h.
|
inlineprivate |
Unchecked access to a parameter of the time distribution.
Definition at line 238 of file PhotonLibrary.h.
|
inlineprivate |
Unchecked access to a parameter of the time distribution.
Definition at line 245 of file PhotonLibrary.h.
|
inlineprivate |
Returns the index of visibility of specified voxel and cell.
Definition at line 175 of file PhotonLibrary.h.
|
private |
ROOT directory where to write data.
Definition at line 165 of file PhotonLibrary.h.
|
private |
Whether the current library deals with reflected light counts.
Definition at line 141 of file PhotonLibrary.h.
|
private |
Whether the current library deals with reflected light timing.
Definition at line 142 of file PhotonLibrary.h.
|
private |
Whether the current library deals with time propagation distribution.
Definition at line 145 of file PhotonLibrary.h.
|
private |
Definition at line 150 of file PhotonLibrary.h.
|
private |
Definition at line 158 of file PhotonLibrary.h.
|
private |
Definition at line 159 of file PhotonLibrary.h.
|
private |
Definition at line 151 of file PhotonLibrary.h.
|
private |
Definition at line 152 of file PhotonLibrary.h.
|
private |
Definition at line 155 of file PhotonLibrary.h.
|
private |
Definition at line 153 of file PhotonLibrary.h.
|
private |
Definition at line 156 of file PhotonLibrary.h.
|
private |
Definition at line 154 of file PhotonLibrary.h.
|
private |
Voxel definition loaded from library metadata.
Definition at line 162 of file PhotonLibrary.h.
|
staticprivate |
Name of the optical channel number in the input tree.
Definition at line 258 of file PhotonLibrary.h.