KaliVeda  1.12/06
Heavy-Ion Analysis Toolkit
KVOldINDRASelector.h
Go to the documentation of this file.
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 
46 
47 protected:
48 
49  enum {
51  kChangeMasses = BIT(15)
52  };
53 
59 
62 
67 
69 
70 #ifdef __WITHOUT_TSELECTOR_LONG64_T
72 #else
74 #endif
75 
77 #ifdef __WITHOUT_TSELECTOR_LONG64_T
79 #else
81 #endif
83 
90 
92 
94 
96 
98 
101 
104  void ParseOptions();
105 
107  {
108  return &data;
109  };
110 
111  virtual KVINDRADBRun* GetCurrentRun() const
112  {
113  return fCurrentRun;
114  };
115 
117  {
118  fBranchName = br_name;
119  };
120 
122 
123  void FillTH1(TH1* h1, Double_t one, Double_t two);
124  void FillTProfile(TProfile* h1, Double_t one, Double_t two, Double_t three);
125  void FillTH2(TH2* h2, Double_t one, Double_t two, Double_t three);
126  void FillKVDalitz(KVDalitzPlot* h2, Double_t one, Double_t two, Double_t three);
127  void FillTProfile2D(TProfile2D* h2, Double_t one, Double_t two, Double_t three, Double_t four);
128  void FillTH3(TH3* h3, Double_t one, Double_t two, Double_t three, Double_t four);
129 
130 public:
133 
135  {
136  return data;
137  }
139  {
142  return data->GetNumber();
143  }
144 
145  Int_t Version() const
146  {
147  return 2;
148  }
150  {
151  fCurrentRun = r;
152  }
153 
154  void Begin(TTree* tree);
155  void SlaveBegin(TTree* tree);
156  void Init(TTree* tree);
157  Bool_t Notify();
158 #ifdef __WITHOUT_TSELECTOR_LONG64_T
159  Bool_t Process(Int_t entry);
160 #else
161  Bool_t Process(Long64_t entry);
162 #endif
163  void SetOption(const char* option)
164  {
165  fOption = option;
166  }
167  void SetObject(TObject* obj)
168  {
169  fObject = obj;
170  }
171  void SetInputList(TList* input)
172  {
173  fInput = input;
174  }
176  {
177  return fOutput;
178  }
179  void SlaveTerminate();
180  void Terminate();
181 
182  /* user entry points */
183  virtual void InitAnalysis()
184  {
185  };
186  virtual void InitRun()
187  {
188  };
189  virtual Bool_t Analysis()
190  {
191  return kTRUE;
192  };
193  virtual void EndRun()
194  {
195  };
196  virtual void EndAnalysis()
197  {
198  };
199 
201  virtual void SetGVList(KVGVList* list);
202  virtual KVGVList* GetGVList(void);
203  virtual void AddGV(KVVarGlob*);
204  virtual KVVarGlob* AddGV(const Char_t* class_name,
205  const Char_t* name);
206  virtual KVVarGlob* GetGV(const Char_t*) const;
207  virtual void RecalculateGlobalVariables();
208 
209 #ifdef __WITHOUT_TSELECTOR_LONG64_T
210  virtual Int_t GetTreeEntry() const;
211 #else
212  virtual Long64_t GetTreeEntry() const;
213 #endif
214 
215  virtual void BuildEventList(void);
216  virtual Bool_t AtEndOfRun(void);
217 
218  virtual void SetDataSelector(const Char_t* dataSel = "")
219  {
220  fDataSelector = dataSel;
221  }
222  virtual const Char_t* GetDataSelector(void)
223  {
224  return fDataSelector.Data();
225  }
226 
227  virtual void LoadDataSelector(void);
228  virtual void SaveCurrentDataSelection(void);
229 
230  virtual const Char_t* GetDataSelectorFileName(void);
231 
232  virtual void ChangeFragmentMasses(UInt_t mass_formula);
233 
234  virtual void SetParticleConditions(const KVParticleCondition&);
235 
241 
247 
248  static void Make(const Char_t* kvsname = "MyOwnKVOldINDRASelector");
249 
250  virtual void CreateHistos();
251  virtual void CreateTrees();
252 
253  void FillHisto(KVString sname, Double_t one, Double_t two = 1, Double_t three = 1, Double_t four = 1);
254  void FillTree(KVString sname = "");
255 
258 
259  TH1* GetHisto(const Char_t* name);
260  TTree* GetTree(const Char_t* name);
261 
262  virtual void WriteHistoToFile(KVString filename = "FileFromKVOldINDRASelector.root", Option_t* option = "recreate");
263  virtual void WriteTreeToFile(KVString filename = "FileFromKVOldINDRASelector.root", Option_t* option = "recreate");
264 
265  virtual void SetOpt(const Char_t* option, const Char_t* value);
266  virtual Bool_t IsOptGiven(const Char_t* option);
267  virtual TString GetOpt(const Char_t* option) const;
268  virtual void UnsetOpt(const Char_t* opt);
269 
270  ClassDef(KVOldINDRASelector, 0); //Deprecated analysis class for TChains of KVINDRAReconEvents
271 };
272 
273 #endif
274 
275 
int Int_t
unsigned int UInt_t
ROOT::R::TRInterface & r
char Char_t
bool Bool_t
double Double_t
const Bool_t kTRUE
const char Option_t
#define BIT(n)
UInt_t GetNumber() const
Definition: KVBase.h:213
Fill 3D observables in a dalitz plot ,.
Definition: KVDalitzPlot.h:27
Class handling event lists for KVOldINDRASelector analysis of data chains.
Manage a list of global variables.
Definition: KVGVList.h:121
Extended version of ROOT THashList.
Definition: KVHashList.h:28
Database entry for each run of an INDRA experiment.
Definition: KVINDRADBRun.h:29
Event reconstructed from energy losses in INDRA multidetector.
Interface to (Linux) system lockfile command.
Definition: KVLockfile.h:69
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
Handles particle selection criteria for data analysis classes ,.
Extension of ROOT TString class which allows backwards compatibility with ROOT v3....
Definition: KVString.h:72
Base class for all global variable implementations.
Definition: KVVarGlob.h:217
TList * fInput
TString fOption
TSelectorList * fOutput
TObject * fObject
const char * Data() const
long long Long64_t