4 #ifndef PHOTONLIBRARY_H 5 #define PHOTONLIBRARY_H 30 TTree* ProduceTTree()
const;
32 virtual float GetCount(
size_t Voxel,
size_t OpChannel)
const override;
33 void SetCount(
size_t Voxel,
size_t OpChannel,
float Count);
35 float GetTimingPar(
size_t Voxel,
size_t OpChannel,
size_t parnum)
const;
36 void SetTimingPar(
size_t Voxel,
size_t OpChannel,
float Count,
size_t parnum);
39 void SetTimingTF1(
size_t Voxel,
size_t OpChannel, TF1
func);
41 virtual float GetReflCount(
size_t Voxel,
size_t OpChannel)
const override;
42 void SetReflCount(
size_t Voxel,
size_t OpChannel,
float Count);
44 virtual float GetReflT0(
size_t Voxel,
size_t OpChannel)
const override;
45 void SetReflT0(
size_t Voxel,
size_t OpChannel,
float reflT0);
48 virtual float const* GetCounts(
size_t Voxel)
const override;
49 const std::vector<float>* GetTimingPars(
size_t Voxel)
const;
50 TF1* GetTimingTF1s(
size_t Voxel)
const;
52 virtual float const* GetReflCounts(
size_t Voxel)
const override;
53 virtual float const* GetReflT0s(
size_t Voxel)
const override;
73 return fHasReflectedT0;
77 bool storeReflected =
false,
78 bool storeReflT0 =
false,
79 size_t storeTiming = 0)
const;
82 bool storeReflected =
false,
83 bool storeReflT0 =
false,
84 size_t storeTiming = 0,
86 void CreateEmptyLibrary(
size_t NVoxels,
88 bool storeReflected =
false,
89 bool storeReflT0 =
false,
90 size_t storeTiming = 0);
100 return fVoxelDef.has_value();
117 fVoxelDef = voxelDef;
138 return isVoxelValidImpl(Voxel);
141 bool fHasReflected =
false;
142 bool fHasReflectedT0 =
165 art::TFileDirectory* fDir =
nullptr;
170 return Voxel < fNVoxels;
184 return fLookupTable[uncheckedIndex(Voxel, OpChannel)];
191 return fLookupTable[uncheckedIndex(Voxel, OpChannel)];
198 return fReflLookupTable[uncheckedIndex(Voxel, OpChannel)];
205 return fReflLookupTable[uncheckedIndex(Voxel, OpChannel)];
212 return fReflTLookupTable[uncheckedIndex(Voxel, OpChannel)];
219 return fReflTLookupTable[uncheckedIndex(Voxel, OpChannel)];
226 return fTimingParLookupTable[uncheckedIndex(Voxel, OpChannel)][parnum];
233 return fTimingParLookupTable[uncheckedIndex(Voxel, OpChannel)][parnum];
240 return fTimingParTF1LookupTable[uncheckedIndex(Voxel, OpChannel)];
248 return *(fTimingParTF1LookupTable.
data_address(uncheckedIndex(Voxel, OpChannel)));
252 void LoadMetadata(TDirectory& srcDir);
255 void StoreMetadata()
const;
261 static size_t ExtractNOpChannels(TTree*
tree);
Definitions of voxel data structures.
const_pointer data_address(size_type pos) const
Returns a constant pointer to the specified element.
size_t fTimingParNParameters
Index OpChannel(Index detNum, Index channel)
static int size_t2int(size_t val)
Converts size_t into integer.
std::optional< sim::PhotonVoxelDef > fVoxelDef
Voxel definition loaded from library metadata.
float & uncheckedAccess(size_t Voxel, size_t OpChannel)
Unchecked access to a visibility datum.
util::LazyVector< float > fReflLookupTable
sim::PhotonVoxelDef const & GetVoxelDef() const
bool hasVoxelDef() const
Returns whether voxel metadata is available.
virtual int NOpChannels() const override
Representation of a region of space diced into voxels.
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.
float uncheckedAccessReflT(size_t Voxel, size_t OpChannel) const
Unchecked access to a reflected T0 visibility datum.
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.
void SetVoxelDef(sim::PhotonVoxelDef const &voxelDef)
bool isVoxelValidImpl(size_t Voxel) const
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.
AdcSimulator::Count Count
Contiguous data container with lazy resizing on access.
util::LazyVector< TF1 > fTimingParTF1LookupTable
static int max(int a, int b)
virtual bool isVoxelValid(size_t Voxel) const override
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.
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 int NVoxels() const override
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.