KaliVeda
Toolkit for HIC analysis
KVINDRAGeneDataSelector.h
1 
7 #ifndef KVINDRAGeneDataSelector_h
8 #define KVINDRAGeneDataSelector_h
9 
10 #include <TROOT.h>
11 #include <TChain.h>
12 #include <TFile.h>
13 #include <TSelector.h>
14 #include "KVINDRATriggerInfo.h"
15 #include "Riostream.h"
16 #include "KVINDRA.h"
17 #include "KVEBYEDAT_ACQParam.h"
18 
45 protected :
47 
52 
57 
60 
61 public :
63  {
65  }
67  {
68  }
69  virtual Int_t Version() const
70  {
71  return 2;
72  }
73  virtual void Begin(TTree* tree);
74  virtual void SlaveBegin(TTree* tree);
75  virtual void Init(TTree* tree);
76  virtual Bool_t Notify();
77  virtual Bool_t Process(Long64_t entry);
78  virtual Int_t GetEntry(Long64_t entry, Int_t getall = 0)
79  {
80  return fChain ? fChain->GetTree()->GetEntry(entry, getall) : 0;
81  }
82  virtual void SetOption(const char* option)
83  {
84  fOption = option;
85  }
86  virtual void SetObject(TObject* obj)
87  {
88  fObject = obj;
89  }
90  virtual void SetInputList(TList* input)
91  {
92  fInput = input;
93  }
94  virtual TList* GetOutputList() const
95  {
96  return fOutput;
97  }
98  virtual void SlaveTerminate();
99  virtual void Terminate();
100  virtual void InitAnalysis()
101  {
102  };
103  virtual void InitRun()
104  {
105  };
106  virtual Bool_t Analysis()
107  {
108  return kTRUE;
109  };
110  virtual void EndRun()
111  {
112  };
113  virtual void EndAnalysis()
114  {
115  };
116  virtual Bool_t AtEndOfRun(void);
117  static void Make(const Char_t* kvsname);
119 
120  ClassDef(KVINDRAGeneDataSelector, 0) //Base class for analysis of INDRA pulser & laser data
121 };
122 
123 #endif
124 
125 #ifdef KVINDRAGeneDataSelector_cxx
127 {
135 
137  TriggerInfo = 0;
139  if (!tree) return;
140  fChain = tree;
141  fChain->SetMakeClass(1);
142 }
143 
145 {
151 
154  InitRun(); //user initialisations for run
155  return kTRUE;
156 }
157 
159 {
160 
161  if (!fChain->GetCurrentFile()) {
162  Info("SetBranchAddress", "No file open");
163  return;
164  }
166  gIndra = (KVINDRA*) fChain->GetCurrentFile()->Get("INDRA");
167 
168  if (!gIndra) {
169  Info("SetBranchAddress", "INDRA object not found in file");
170  return;
171  }
172 
179  fChain->SetBranchAddress("RunNumber", &RunNumber, &b_RunNumber);
180  fChain->SetBranchAddress("EventNumber", &EventNumber, &b_EventNumber);
181  fChain->SetBranchAddress("TriggerInfo", &TriggerInfo, &b_TriggerInfo);
182 
184  RunNumber = gIndra->GetCurrentRunNumber();
185 }
186 
187 #endif // #ifdef KVINDRAGeneDataSelector_cxx
int Int_t
bool Bool_t
char Char_t
constexpr Bool_t kFALSE
constexpr Bool_t kTRUE
#define ClassDef(name, id)
Option_t Option_t option
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void input
For analysing INDRA pulser & laser data.
TBranch * b_RunNumber
List of branches.
Bool_t needToCallEndRun
tells if one needs to call EndRun
virtual void SetInputList(TList *input)
virtual void SetOption(const char *option)
virtual Bool_t Process(Long64_t entry)
TTree * fChain
pointer to the analyzed TTree or TChain
virtual void Init(TTree *tree)
virtual Int_t GetEntry(Long64_t entry, Int_t getall=0)
virtual void SetObject(TObject *obj)
virtual void SlaveBegin(TTree *tree)
virtual Bool_t Notify()
static void Make(const Char_t *kvsname)
Automatic generation of derived class for gene data analysis.
virtual Int_t Version() const
Int_t RunNumber
Declaration of leave types.
Long64_t fTreeEntry
this is the current TTree entry number, i.e. the argument passed to TSelector::Process(Long64_t entry...
virtual TList * GetOutputList() const
virtual void Begin(TTree *tree)
KVINDRATriggerInfo * TriggerInfo
Information on INDRA event from DAQ trigger.
INDRA multidetector array geometry.
Definition: KVINDRA.h:71
UInt_t GetCurrentRunNumber() const
T * Get(const char *namecycle)
virtual void Info(const char *method, const char *msgfmt,...) const
TList * fInput
TString fOption
TSelectorList * fOutput
TObject * fObject
virtual Int_t GetEntry(Long64_t entry, Int_t getall=0)
TFile * GetCurrentFile() const
virtual void SetMakeClass(Int_t make)
virtual TTree * GetTree() const
Int_t SetBranchAddress(const char *bname, T **add, TBranch **ptr=nullptr)
long long Long64_t