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  Int_t Version() const override
70  {
71  return 2;
72  }
73  void Begin(TTree* tree) override;
74  void SlaveBegin(TTree* tree) override;
75  void Init(TTree* tree) override;
76  Bool_t Notify() override;
77  Bool_t Process(Long64_t entry) override;
78  Int_t GetEntry(Long64_t entry, Int_t getall = 0) override
79  {
80  return fChain ? fChain->GetTree()->GetEntry(entry, getall) : 0;
81  }
82  void SetOption(const char* option) override
83  {
84  fOption = option;
85  }
86  void SetObject(TObject* obj) override
87  {
88  fObject = obj;
89  }
90  void SetInputList(TList* input) override
91  {
92  fInput = input;
93  }
94  TList* GetOutputList() const override
95  {
96  return fOutput;
97  }
98  void SlaveTerminate() override;
99  void Terminate() override;
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  ClassDefOverride(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 ClassDefOverride(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.
void SetObject(TObject *obj) override
TList * GetOutputList() const override
TBranch * b_RunNumber
List of branches.
void SetOption(const char *option) override
Bool_t needToCallEndRun
tells if one needs to call EndRun
Int_t GetEntry(Long64_t entry, Int_t getall=0) override
void SlaveBegin(TTree *tree) override
TTree * fChain
pointer to the analyzed TTree or TChain
void Init(TTree *tree) override
static void Make(const Char_t *kvsname)
Automatic generation of derived class for gene data analysis.
Int_t RunNumber
Declaration of leave types.
Bool_t Notify() override
Long64_t fTreeEntry
this is the current TTree entry number, i.e. the argument passed to TSelector::Process(Long64_t entry...
Bool_t Process(Long64_t entry) override
void Begin(TTree *tree) override
void SetInputList(TList *input) override
KVINDRATriggerInfo * TriggerInfo
Int_t Version() const override
Information on INDRA event from DAQ trigger.
INDRA multidetector array geometry.
Definition: KVINDRA.h:66
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