Library.h
Go to the documentation of this file.
1 ////////////////////////////////////////////////////////////////////////
2 /// \file Library.h
3 /// \brief Collection of events for matching
4 /// \author Christopher Backhouse - bckhouse@caltech.edu
5 ////////////////////////////////////////////////////////////////////////
6 
7 #ifndef LEM_LIBRARY_H
8 #define LEM_LIBRARY_H
9 
10 #include <string>
11 
14 
15 namespace lem
16 {
17  /// Collection of events for matching
18  class Library
19  {
20  public:
21  static Library* FromMMap(const std::string& libPath, bool touchAll);
22  static Library* FromMMapOnDemand(const std::string& libPath);
23  static Library* FromTrees(const std::string& libPath,
24  int splitLibFactor,
25  int splitLibIndex,
26  int downsampleFactor);
27 
28  ~Library();
29 
30  const LibrarySummary& Summary() const {return fSummary;}
31  unsigned int NEvents() const {return fLibSize;}
32  const MatchableEvent& Event(int i) const {return fLib[i];}
33  const MatchableEvent& DownsampledEvent(int i) const {return fLibDownsample[i];}
34  const MatchableEvent* Events() const {return fLib;}
36 
37  protected:
38  Library() {}
39  Library(const Library&);
40  Library& operator=(const Library&);
41 
42  static double SimpleSurvivalProb(const EventSummary& evt);
43 
45  unsigned int fLibSize;
48 
50  };
51 }
52 
53 #endif
long fMappingSize
Definition: Library.h:49
Simple representation of event for LEM use.
Definition: EventSummary.h:26
const MatchableEvent * Events() const
Definition: Library.h:34
Attach some information used in matching to an EventSummary.
Library & operator=(const Library &)
const MatchableEvent & DownsampledEvent(int i) const
Definition: Library.h:33
Collection of events for matching.
Definition: Library.h:18
const LibrarySummary & Summary() const
Definition: Library.h:30
LibrarySummary fSummary
Definition: Library.h:44
const MatchableEvent * DownsampledEvents() const
Definition: Library.h:35
MatchableEvent * fLib
Definition: Library.h:46
PID
Definition: FillPIDs.h:14
Details of the library LEM matches were made against.
unsigned int NEvents() const
Definition: Library.h:31
int evt
Details of the library LEM matches were made against.
Attach some information used in matching to an EventSummary.
static double SimpleSurvivalProb(const EventSummary &evt)
Definition: Library.cxx:28
static Library * FromMMapOnDemand(const std::string &libPath)
Definition: Library.cxx:82
static Library * FromTrees(const std::string &libPath, int splitLibFactor, int splitLibIndex, int downsampleFactor)
Definition: Library.cxx:100
const MatchableEvent & Event(int i) const
Definition: Library.h:32
MatchableEvent * fLibDownsample
Definition: Library.h:47
static Library * FromMMap(const std::string &libPath, bool touchAll)
Definition: Library.cxx:62
unsigned int fLibSize
Definition: Library.h:45
enum BeamMode string