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 "KVGVList.h"
17 #include "TStopwatch.h"
18 #include "TEventList.h"
19 #include "KVDataSelector.h"
20 #include "KVParticleCondition.h"
21 #include "KVString.h"
22 #include "KVLockfile.h"
23 #include "KVHashList.h"
24 #include "KVNameValueList.h"
25 #include "KVINDRADBRun.h"
26 
27 #include "TH1.h"
28 #include "TH2.h"
29 #include "TH3.h"
30 #include "TProfile2D.h"
31 #include "TProfile.h"
32 #include "KVDalitzPlot.h"
33 
43 
44 protected:
45 
46  enum {
48  kChangeMasses = BIT(15)
49  };
50 
56 
59 
64 
66 
67 #ifdef __WITHOUT_TSELECTOR_LONG64_T
69 #else
71 #endif
72 
74 #ifdef __WITHOUT_TSELECTOR_LONG64_T
76 #else
78 #endif
80 
87 
89 
91 
93 
95 
98 
101  void ParseOptions();
102 
104  {
105  return &data;
106  };
107 
108  virtual KVINDRADBRun* GetCurrentRun() const
109  {
110  return fCurrentRun;
111  };
112 
114  {
115  fBranchName = br_name;
116  };
117 
119 
120  void FillTH1(TH1* h1, Double_t one, Double_t two);
121  void FillTProfile(TProfile* h1, Double_t one, Double_t two, Double_t three);
122  void FillTH2(TH2* h2, Double_t one, Double_t two, Double_t three);
123  void FillKVDalitz(KVDalitzPlot* h2, Double_t one, Double_t two, Double_t three);
124  void FillTProfile2D(TProfile2D* h2, Double_t one, Double_t two, Double_t three, Double_t four);
125  void FillTH3(TH3* h3, Double_t one, Double_t two, Double_t three, Double_t four);
126 
127 public:
130 
132  {
133  return data;
134  }
136  {
139  return data->GetNumber();
140  }
141 
142  Int_t Version() const override
143  {
144  return 2;
145  }
147  {
148  fCurrentRun = r;
149  }
150 
151  void Begin(TTree* tree) override;
152  void SlaveBegin(TTree* tree) override;
153  void Init(TTree* tree) override;
154  Bool_t Notify() override;
155 #ifdef __WITHOUT_TSELECTOR_LONG64_T
156  Bool_t Process(Int_t entry) override;
157 #else
158  Bool_t Process(Long64_t entry) override;
159 #endif
160  void SetOption(const char* option) override
161  {
162  fOption = option;
163  }
164  void SetObject(TObject* obj) override
165  {
166  fObject = obj;
167  }
168  void SetInputList(TList* input) override
169  {
170  fInput = input;
171  }
172  TList* GetOutputList() const override
173  {
174  return fOutput;
175  }
176  void SlaveTerminate() override;
177  void Terminate() override;
178 
179  /* user entry points */
180  virtual void InitAnalysis()
181  {
182  };
183  virtual void InitRun()
184  {
185  };
186  virtual Bool_t Analysis()
187  {
188  return kTRUE;
189  };
190  virtual void EndRun()
191  {
192  };
193  virtual void EndAnalysis()
194  {
195  };
196 
198  virtual void SetGVList(KVGVList* list);
199  virtual KVGVList* GetGVList(void);
200  virtual void AddGV(KVVarGlob*);
201  virtual KVVarGlob* AddGV(const Char_t* class_name,
202  const Char_t* name);
203  virtual KVVarGlob* GetGV(const Char_t*) const;
204  virtual void RecalculateGlobalVariables();
205 
206 #ifdef __WITHOUT_TSELECTOR_LONG64_T
207  virtual Int_t GetTreeEntry() const;
208 #else
209  virtual Long64_t GetTreeEntry() const;
210 #endif
211 
212  virtual void BuildEventList(void);
213  virtual Bool_t AtEndOfRun(void);
214 
215  virtual void SetDataSelector(const Char_t* dataSel = "")
216  {
217  fDataSelector = dataSel;
218  }
219  virtual const Char_t* GetDataSelector(void)
220  {
221  return fDataSelector.Data();
222  }
223 
224  virtual void LoadDataSelector(void);
225  virtual void SaveCurrentDataSelection(void);
226 
227  virtual const Char_t* GetDataSelectorFileName(void);
228 
229  virtual void ChangeFragmentMasses(UInt_t mass_formula);
230 
231  virtual void SetParticleConditions(const KVParticleCondition&);
232 
238 
244 
245  static void Make(const Char_t* kvsname = "MyOwnKVOldINDRASelector");
246 
247  virtual void CreateHistos();
248  virtual void CreateTrees();
249 
250  void FillHisto(KVString sname, Double_t one, Double_t two = 1, Double_t three = 1, Double_t four = 1);
251  void FillTree(KVString sname = "");
252 
255 
256  TH1* GetHisto(const Char_t* name);
257  TTree* GetTree(const Char_t* name);
258 
259  virtual void WriteHistoToFile(KVString filename = "FileFromKVOldINDRASelector.root", Option_t* option = "recreate");
260  virtual void WriteTreeToFile(KVString filename = "FileFromKVOldINDRASelector.root", Option_t* option = "recreate");
261 
262  virtual void SetOpt(const Char_t* option, const Char_t* value);
263  virtual Bool_t IsOptGiven(const Char_t* option);
264  virtual TString GetOpt(const Char_t* option) const;
265  virtual void UnsetOpt(const Char_t* opt);
266 
267  ClassDefOverride(KVOldINDRASelector, 0); //Deprecated analysis class for TChains of KVINDRAReconEvents
268 };
269 
270 #endif
271 
272 
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:219
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.
void SetObject(TObject *obj) override
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.
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 SlaveBegin(TTree *tree) override
virtual TString GetOpt(const Char_t *option) const
TH1 * GetHisto(const Char_t *name)
TList * GetOutputList() const override
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 *)
ClassDefOverride(KVOldINDRASelector, 0)
void Terminate() override
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()
Int_t Version() const override
void SetInputList(TList *input) override
TString fDataSelector
Name of the KVDataSelector.
UInt_t fNewMassFormula
new mass formula to apply to fragments, if required
Bool_t Process(Long64_t entry) override
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()
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()
TStopwatch * fTimer
used to time analysis
virtual const Char_t * GetDataSelector(void)
void SlaveTerminate() override
Function called at the end of the event loop in each PROOF slave.
KVOldINDRASelector(TTree *tree=0)
ctor
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.
void Begin(TTree *tree) override
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
virtual void EndAnalysis()
void SetINDRAReconEventBranchName(const Char_t *br_name)
KVLockfile dataselector_lock
for locking user's data selector file
void SetOption(const char *option) override
virtual void WriteHistoToFile(KVString filename="FileFromKVOldINDRASelector.root", Option_t *option="recreate")
virtual void InitAnalysis()
void Init(TTree *tree) override
virtual void BuildEventList(void)
Bool_t Notify() override
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