EventSummary.h
Go to the documentation of this file.
1 ////////////////////////////////////////////////////////////////////////
2 /// \file EventSummary.h
3 /// \brief Simple representation of event for LEM use
4 /// \author Christopher Backhouse - bckhouse@caltech.edu
5 ////////////////////////////////////////////////////////////////////////
6 
7 #ifndef LEM_EVENTSUMMARY_H
8 #define LEM_EVENTSUMMARY_H
9 
10 #include "LEM/func/LiteHit.h"
11 
12 #include "TString.h"
13 
14 #include <cstdlib>
15 
16 class TH2;
17 class TTree;
18 
19 namespace lem
20 {
21 
22  const int kVertexPlane = 64;
23  const int kVertexCell = 128;
24 
25  /// Simple representation of event for %LEM use
27  {
28  public:
30  EventSummary(const std::vector<LiteHit>& hs, int id, std::vector<int> pdgs);
32  ~EventSummary();
33 
34  EventSummary& operator=(const EventSummary& evt);
35 
36  bool IsSig() const
37  {
38  return (abs(pdg) == 12 && ccnc == 0 && abs(origPdg) == 14);
39  }
40 
41  std::string Description() const;
42  void FillHists(TH2* h1, TH2* h2, bool flipEven = false, bool flipOdd = false, bool idxs = false) const;
43  void SaveImage(TString fname, TString title = "") const;
44 
45  static void InitToTree(TTree* tr);
46  void ToTree(TTree* tr) const;
47 
48  static void InitFromTree(TTree* tr);
49  static EventSummary FromTree(TTree* tr, int evtIdx, bool enrich);
50 
51  int Length() const; ///< In planes
52 
53  unsigned short nhits;
55 
56  double totalPE;
57  double trueEVis;
58  double y;
59  int id;
60 
61  int run, subrun, event;
62  int ccnc, pdg, origPdg;
63  int mode;
64 
66 
67  unsigned char nParts;
68  int* partPdgs;
69 
70  double photL0, photL1;
71  double photE0, photE1;
72 
73  bool enrich; ///< Was this event generated in a filtered-for-pi0 job?
74 
75  static double fgDecayRate;
76  static double fgChargePower;
77 
78  protected:
79  void Finalize();
80  };
81 } // namespace
82 
83 #endif
unsigned short nhits
Definition: EventSummary.h:53
std::string Description() const
bool enrich
Was this event generated in a filtered-for-pi0 job?
Definition: EventSummary.h:73
Simple representation of event for LEM use.
Definition: EventSummary.h:26
static double fgChargePower
Definition: EventSummary.h:76
const int kVertexPlane
Definition: EventSummary.h:22
void abs(TH1 *hist)
EventSummary & operator=(const EventSummary &evt)
static void InitFromTree(TTree *tr)
PID
Definition: FillPIDs.h:14
static void InitToTree(TTree *tr)
bool IsSig() const
Definition: EventSummary.h:36
void SaveImage(TString fname, TString title="") const
const int kVertexCell
Definition: EventSummary.h:23
static EventSummary FromTree(TTree *tr, int evtIdx, bool enrich)
void ToTree(TTree *tr) const
TH1F * h2
Definition: plot.C:45
TH1F * h1
int Length() const
In planes.
::xsd::cxx::tree::string< char, simple_type > string
Definition: Database.h:154
Compressed hit info, basic component of LEM events.
unsigned char nParts
Definition: EventSummary.h:67
static double fgDecayRate
Definition: EventSummary.h:75
Compressed hit info, basic component of LEM events.
Definition: LiteHit.h:18
void FillHists(TH2 *h1, TH2 *h2, bool flipEven=false, bool flipOdd=false, bool idxs=false) const