KaliVeda
Toolkit for HIC analysis
KVOldINDRASelector.h
1 
7 
8 #ifndef KVOldINDRASelector_h
9 #define KVOldINDRASelector_h
10 
11 #include <TROOT.h>
12 #include <TChain.h>
13 #include <TFile.h>
14 #include <TSelector.h>
15 #include "KVINDRAReconEvent.h"
16 #include "KVINDRA.h"
17 #include "KV2Body.h"
18 #include "KVGVList.h"
19 #include "TStopwatch.h"
20 #include "TEventList.h"
21 #include "KVDataSelector.h"
22 #include "KVParticleCondition.h"
23 #include "KVString.h"
24 #include "KVLockfile.h"
25 #include "KVConfig.h"
26 #include "KVDataAnalyser.h"
27 #include "KVHashList.h"
28 #include "KVNameValueList.h"
29 #include "KVINDRADBRun.h"
30 
31 #include "TH1.h"
32 #include "TH2.h"
33 #include "TH3.h"
34 #include "TProfile2D.h"
35 #include "TProfile.h"
36 #include "KVDalitzPlot.h"
37 
47 
48 protected:
49 
50  enum {
52  kChangeMasses = BIT(15)
53  };
54 
60 
63 
68 
70 
71 #ifdef __WITHOUT_TSELECTOR_LONG64_T
73 #else
75 #endif
76 
78 #ifdef __WITHOUT_TSELECTOR_LONG64_T
80 #else
82 #endif
84 
91 
93 
95 
97 
99 
102 
105  void ParseOptions();
106 
108  {
109  return &data;
110  };
111 
112  virtual KVINDRADBRun* GetCurrentRun() const
113  {
114  return fCurrentRun;
115  };
116 
118  {
119  fBranchName = br_name;
120  };
121 
123 
124  void FillTH1(TH1* h1, Double_t one, Double_t two);
125  void FillTProfile(TProfile* h1, Double_t one, Double_t two, Double_t three);
126  void FillTH2(TH2* h2, Double_t one, Double_t two, Double_t three);
127  void FillKVDalitz(KVDalitzPlot* h2, Double_t one, Double_t two, Double_t three);
128  void FillTProfile2D(TProfile2D* h2, Double_t one, Double_t two, Double_t three, Double_t four);
129  void FillTH3(TH3* h3, Double_t one, Double_t two, Double_t three, Double_t four);
130 
131 public:
134 
136  {
137  return data;
138  }
140  {
143  return data->GetNumber();
144  }
145 
146  Int_t Version() const
147  {
148  return 2;
149  }
151  {
152  fCurrentRun = r;
153  }
154 
155  void Begin(TTree* tree);
156  void SlaveBegin(TTree* tree);
157  void Init(TTree* tree);
158  Bool_t Notify();
159 #ifdef __WITHOUT_TSELECTOR_LONG64_T
160  Bool_t Process(Int_t entry);
161 #else
162  Bool_t Process(Long64_t entry);
163 #endif
164  void SetOption(const char* option)
165  {
166  fOption = option;
167  }
168  void SetObject(TObject* obj)
169  {
170  fObject = obj;
171  }
172  void SetInputList(TList* input)
173  {
174  fInput = input;
175  }
177  {
178  return fOutput;
179  }
180  void SlaveTerminate();
181  void Terminate();
182 
183  /* user entry points */
184  virtual void InitAnalysis()
185  {
186  };
187  virtual void InitRun()
188  {
189  };
190  virtual Bool_t Analysis()
191  {
192  return kTRUE;
193  };
194  virtual void EndRun()
195  {
196  };
197  virtual void EndAnalysis()
198  {
199  };
200 
202  virtual void SetGVList(KVGVList* list);
203  virtual KVGVList* GetGVList(void);
204  virtual void AddGV(KVVarGlob*);
205  virtual KVVarGlob* AddGV(const Char_t* class_name,
206  const Char_t* name);
207  virtual KVVarGlob* GetGV(const Char_t*) const;
208  virtual void RecalculateGlobalVariables();
209 
210 #ifdef __WITHOUT_TSELECTOR_LONG64_T
211  virtual Int_t GetTreeEntry() const;
212 #else
213  virtual Long64_t GetTreeEntry() const;
214 #endif
215 
216  virtual void BuildEventList(void);
217  virtual Bool_t AtEndOfRun(void);
218 
219  virtual void SetDataSelector(const Char_t* dataSel = "")
220  {
221  fDataSelector = dataSel;
222  }
223  virtual const Char_t* GetDataSelector(void)
224  {
225  return fDataSelector.Data();
226  }
227 
228  virtual void LoadDataSelector(void);
229  virtual void SaveCurrentDataSelection(void);
230 
231  virtual const Char_t* GetDataSelectorFileName(void);
232 
233  virtual void ChangeFragmentMasses(UInt_t mass_formula);
234 
235  virtual void SetParticleConditions(const KVParticleCondition&);
236 
242 
248 
249  static void Make(const Char_t* kvsname = "MyOwnKVOldINDRASelector");
250 
251  virtual void CreateHistos();
252  virtual void CreateTrees();
253 
254  void FillHisto(KVString sname, Double_t one, Double_t two = 1, Double_t three = 1, Double_t four = 1);
255  void FillTree(KVString sname = "");
256 
259 
260  TH1* GetHisto(const Char_t* name);
261  TTree* GetTree(const Char_t* name);
262 
263  virtual void WriteHistoToFile(KVString filename = "FileFromKVOldINDRASelector.root", Option_t* option = "recreate");
264  virtual void WriteTreeToFile(KVString filename = "FileFromKVOldINDRASelector.root", Option_t* option = "recreate");
265 
266  virtual void SetOpt(const Char_t* option, const Char_t* value);
267  virtual Bool_t IsOptGiven(const Char_t* option);
268  virtual TString GetOpt(const Char_t* option) const;
269  virtual void UnsetOpt(const Char_t* opt);
270 
271  ClassDef(KVOldINDRASelector, 0); //Deprecated analysis class for TChains of KVINDRAReconEvents
272 };
273 
274 #endif
275 
276 
int Int_t
unsigned int UInt_t
ROOT::R::TRInterface & r
bool Bool_t
char Char_t
double Double_t
constexpr Bool_t kTRUE
const char Option_t
#define BIT(n)
Option_t Option_t option
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void input
UInt_t GetNumber() const
Definition: KVBase.h:220
Fill 3D observables in a dalitz plot ,.
Definition: KVDalitzPlot.h:28
Class handling event lists for KVOldINDRASelector analysis of data chains.
#define KVGVLIST_OPTIMIZE_GVLIST
Definition: KVGVList.h:227
Extended version of ROOT THashList.
Definition: KVHashList.h:29
Database entry for each run of an INDRA experiment.
Definition: KVINDRADBRun.h:30
Event reconstructed from energy losses in INDRA multidetector.
Interface to (Linux) system lockfile command.
Definition: KVLockfile.h:70
Handles lists of named parameters with different types, a list of KVNamedParameter objects.
Former base analysis class for INDRA data.
KVINDRADBRun * fCurrentRun
current run
virtual const Char_t * GetDataSelectorFileName(void)
virtual void WriteTreeToFile(KVString filename="FileFromKVOldINDRASelector.root", Option_t *option="recreate")
If no filename is specified, assume that the current directory is writable.
void Init(TTree *tree)
virtual KVINDRADBRun * GetCurrentRun() const
KVINDRAReconEvent * data
Declaration of leaves types.
virtual void UnsetOpt(const Char_t *opt)
Removes the option 'opt' from the internal lists, as if it had never been set.
void FillTH3(TH3 *h3, Double_t one, Double_t two, Double_t three, Double_t four)
void SetObject(TObject *obj)
TList * GetOutputList() const
void SetOption(const char *option)
virtual TString GetOpt(const Char_t *option) const
TH1 * GetHisto(const Char_t *name)
KVNameValueList fOptionList
parsed list of options given to TTree::Process
void FillTH2(TH2 *h2, Double_t one, Double_t two, Double_t three)
virtual void AddGV(KVVarGlob *)
Long64_t fTreeEntry
this is the current TTree entry number, i.e. the argument passed to TSelector::Process(Long64_t entry...
Int_t fCurrentTreeNumber
This is the current tree number.
void FillHisto(KVString sname, Double_t one, Double_t two=1, Double_t three=1, Double_t four=1)
virtual void SaveCurrentDataSelection(void)
virtual void RecalculateGlobalVariables()
static KVString fBranchName
name of branch which contains KVINDRAReconEvent objects in the TTree
KVGVList * gvlist
List of global variables.
virtual void InitRun()
TString fDataSelector
Name of the KVDataSelector.
UInt_t fNewMassFormula
new mass formula to apply to fragments, if required
virtual KVGVList * GetGVList(void)
void FillKVDalitz(KVDalitzPlot *h2, Double_t one, Double_t two, Double_t three)
virtual void SetParticleConditions(const KVParticleCondition &)
virtual Bool_t Analysis()
virtual Bool_t AtEndOfRun(void)
void FillTProfile2D(TProfile2D *h2, Double_t one, Double_t two, Double_t three, Double_t four)
virtual void SetGVList(KVGVList *list)
handling global variables for analysis
TTree * fChain
pointer to the analyzed TTree or TChain
KVINDRAReconEvent * GetEvent()
Bool_t Process(Long64_t entry)
void FillTree(KVString sname="")
TTree * GetTree(const Char_t *name)
virtual ~ KVOldINDRASelector()
void FillTH1(TH1 *h1, Double_t one, Double_t two)
virtual void SetOpt(const Char_t *option, const Char_t *value)
Set a value for an option.
KVDataSelector * fKVDataSelector
KVDataSelector.
KVINDRAReconEvent ** GetEventReference()
void SetInputList(TList *input)
TStopwatch * fTimer
used to time analysis
virtual const Char_t * GetDataSelector(void)
KVOldINDRASelector(TTree *tree=0)
ctor
void SlaveTerminate()
Function called at the end of the event loop in each PROOF slave.
virtual void ChangeFragmentMasses(UInt_t mass_formula)
TEventList * fEvtList
this is the current event list.
Bool_t * fTEVLexist
tells if the TEventList exist for each run
virtual Long64_t GetTreeEntry() const
Long64_t * fTreeOffset
this is the current TTree offset table
void FillTProfile(TProfile *h1, Double_t one, Double_t two, Double_t three)
static void Make(const Char_t *kvsname="MyOwnKVOldINDRASelector")
Automatic generation of KVOldINDRASelector-derived class for KaliVeda analysis.
ClassDef(KVOldINDRASelector, 0)
virtual Bool_t IsOptGiven(const Char_t *option)
Returns kTRUE if the option 'opt' has been set.
virtual void LoadDataSelector(void)
virtual void SetDataSelector(const Char_t *dataSel="")
virtual KVVarGlob * GetGV(const Char_t *) const
void SetCurrentRun(KVINDRADBRun *r)
Bool_t needToSelect
tells if one needs to build the TEventList
TBranch * b_data
List of branches.
KVParticleCondition * fPartCond
(optional) conditions for selecting particles
void Begin(TTree *tree)
virtual void EndAnalysis()
void SetINDRAReconEventBranchName(const Char_t *br_name)
KVLockfile dataselector_lock
for locking user's data selector file
void SlaveBegin(TTree *tree)
virtual void WriteHistoToFile(KVString filename="FileFromKVOldINDRASelector.root", Option_t *option="recreate")
virtual void InitAnalysis()
virtual void BuildEventList(void)
Bool_t needToCallEndRun
tells if one needs to call EndRun
Extension of ROOT TString class which allows backwards compatibility with ROOT v3....
Definition: KVString.h:73
Base class for all global variable implementations.
Definition: KVVarGlob.h:233
TList * fInput
TString fOption
TSelectorList * fOutput
TObject * fObject
const char * Data() const
long long Long64_t