IPhotonLibrary.h
Go to the documentation of this file.
1 ////# IPhotonLibrary.h header file
2 ////#
3 ////# Chris Backhouse, UCL, 2017
4 #ifndef IPHOTONLIBRARY_H
5 #define IPHOTONLIBRARY_H
6 
7 #include <vector>
8 #include <cstddef> // size_t
9 
10 class TF1; // forward declaration
11 
12 namespace phot
13 {
14  /// Interface shared by all PhotonLibrary-like classes
16  {
17  public:
18  /// Type for visibility count per optical channel.
19  using Counts_t = const float*;
20 
21  /// Type for time of arrival per optical channel.
22  using T0s_t = const float*;
23 
24  /// Type for function parameters
25  /// (which is not part of this interface yet).
26  using Params_t = std::vector<float> const*;
27 
28  /// Type for parametrization function
29  /// (which is not part of this interface yet).
30  using Functions_t = TF1*;
31 
32 
33  virtual ~IPhotonLibrary() = default;
34 
35  virtual float GetCount(size_t Voxel, size_t OpChannel) const = 0;
36  virtual float GetReflCount(size_t Voxel, size_t OpChannel) const = 0;
37  virtual float GetReflT0(size_t Voxel, size_t OpChannel) const = 0;
38 
39  /// Returns a pointer to NOpChannels() visibility values, one per channel
40  virtual Counts_t GetCounts(size_t Voxel) const = 0;
41  virtual Counts_t GetReflCounts(size_t Voxel) const = 0;
42  virtual T0s_t GetReflT0s(size_t Voxel) const = 0;
43 
44  /// Returns whether the current library deals with reflected light count.
45  virtual bool hasReflected() const = 0;
46 
47  /// Returns whether the current library deals with reflected light timing.
48  virtual bool hasReflectedT0() const = 0;
49 
50  virtual int NOpChannels() const = 0;
51  virtual int NVoxels() const = 0;
52 
53  virtual bool isVoxelValid(size_t Voxel) const
54  { return Voxel < (std::size_t) NVoxels(); }
55 
56  /// Returns the number of elements in the library
57  size_t LibrarySize() const { return NVoxels() * NOpChannels(); }
58  };
59 } // namespace
60 
61 #endif
Index OpChannel(Index detNum, Index channel)
virtual float GetReflT0(size_t Voxel, size_t OpChannel) const =0
virtual float GetReflCount(size_t Voxel, size_t OpChannel) const =0
virtual ~IPhotonLibrary()=default
virtual Counts_t GetReflCounts(size_t Voxel) const =0
virtual float GetCount(size_t Voxel, size_t OpChannel) const =0
virtual Counts_t GetCounts(size_t Voxel) const =0
Returns a pointer to NOpChannels() visibility values, one per channel.
std::vector< float > const * Params_t
virtual bool isVoxelValid(size_t Voxel) const
virtual int NOpChannels() const =0
General LArSoft Utilities.
virtual T0s_t GetReflT0s(size_t Voxel) const =0
virtual bool hasReflectedT0() const =0
Returns whether the current library deals with reflected light timing.
size_t LibrarySize() const
Returns the number of elements in the library.
const float * Counts_t
Type for visibility count per optical channel.
Interface shared by all PhotonLibrary-like classes.
const float * T0s_t
Type for time of arrival per optical channel.
virtual bool hasReflected() const =0
Returns whether the current library deals with reflected light count.
virtual int NVoxels() const =0