All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
sbncode/sbncode/OpT0Finder/flashmatch/Base/FMWKTools/PhotonLibrary.h
Go to the documentation of this file.
1 /*
2  PhotonLibrary basically copied from
3 
4  */
5 
6 #ifndef PHOTONLIBRARY_H
7 #define PHOTONLIBRARY_H
8 
9 #include "TTree.h"
10 #include "PhotonVoxels.h"
11 #include <vector>
12 #include <string>
13 
14 namespace phot{
15 
16  class PhotonLibrary
17  {
18  public:
19  PhotonLibrary();
21 
22  float GetCount(size_t Voxel, size_t OpChannel);
23  void SetCount(size_t Voxel, size_t OpChannel, float Count);
24 
25  const std::vector<float>* GetCounts(size_t Voxel) const;
26  inline const std::vector<std::vector<float> >& GetData() const
27  { return fLookupTable; }
28 
29  void StoreLibraryToFile(std::string LibraryFile);
30  void LoadLibraryFromFile(std::string LibraryFile, size_t NVoxels);
31  void CreateEmptyLibrary(size_t NVoxels, size_t NChannels);
32 
33 
34  int NOpChannels() const { return fNOpChannels; }
35  int NVoxels() const { return fNVoxels; }
36 
37  private:
38  // fLookupTable[Voxel]->at(OpChannel) = Count
39  std::vector<std::vector<float> > fLookupTable;
40  size_t fNOpChannels;
41  size_t fNVoxels;
42 
43  static std::vector<float> EmptyChannelsList;
44 
45  static std::vector<float>* EmptyList()
46  { EmptyChannelsList.clear(); return &EmptyChannelsList; }
47  };
48 
49 }
50 
51 #endif
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)
const std::vector< std::vector< float > > & GetData() const
void StoreLibraryToFile(std::string LibraryFile, bool storeReflected=false, bool storeReflT0=false, size_t storeTiming=0) const
void SetCount(size_t Voxel, size_t OpChannel, float Count)
virtual float const * GetCounts(size_t Voxel) const override
Returns a pointer to NOpChannels() visibility values, one per channel.
virtual float GetCount(size_t Voxel, size_t OpChannel) const override