KaliVeda
Toolkit for HIC analysis
KVRawDataAnalyser.h
1 
4 #ifndef __KVRAWDATAANALYSER_H
5 #define __KVRAWDATAANALYSER_H
6 
7 #include "KVDataSetAnalyser.h"
8 #include "KVHashList.h"
9 #include "KVRawDataReader.h"
10 #include "KVDBRun.h"
11 
12 #include <KVUserAnalysisOptionList.h>
13 #include <TH2.h>
14 #include <TH3.h>
15 #include <TProfile.h>
16 #include <TProfile2D.h>
17 
18 class KVDetectorEvent;
19 
28 protected:
29 
40 
41  void ProcessRun();
42 
44 
45  /*** Methods copied from KVEventSelector ***/
46 
47  void FillTH1(TH1* h1, Double_t one, Double_t two)
48  {
49  h1->Fill(one, two);
50  }
51  void FillTProfile(TProfile* h1, Double_t one, Double_t two, Double_t three)
52  {
53  h1->Fill(one, two, three);
54  }
55  void FillTH2(TH2* h2, Double_t one, Double_t two, Double_t three)
56  {
57  h2->Fill(one, two, three);
58  }
59  void FillTProfile2D(TProfile2D* h2, Double_t one, Double_t two, Double_t three, Double_t four)
60  {
61  h2->Fill(one, two, three, four);
62  }
63  void FillTH3(TH3* h3, Double_t one, Double_t two, Double_t three, Double_t four)
64  {
65  h3->Fill(one, two, three, four);
66  }
67 
68  void SetCombinedOutputFile(const KVString& filename)
69  {
78  }
79  /*** END: Methods copied from KVEventSelector ***/
80 
81 public:
83  {
84  return TotalEntriesToRead;
85  }
86 
88  virtual ~KVRawDataAnalyser();
89 
91  {
92  Obsolete("GetDetectorEvent", "1.11", "2.0");
93  return nullptr;
94  }
95 
96  virtual void InitAnalysis() = 0;
97  virtual void InitRun() = 0;
98  virtual Bool_t Analysis() = 0;
99  virtual void EndRun() = 0;
100  virtual void EndAnalysis() = 0;
101 
103  {
104  return fRunNumber;
105  }
107  {
108  return fEventNumber;
109  }
111  {
112  return fCurrentRun;
113  }
114 
115  void SubmitTask();
116  static void Make(const Char_t* kvsname = "MyOwnRawDataAnalyser");
117 
119 
121  {
122  return *fRunFile;
123  }
124 
125  /*** Methods copied from KVEventSelector ***/
126 
127  void AddHisto(TH1* histo)
128  {
129  fHistoList.Add(histo);
130  }
131  void AddTree(TTree* tree);
132 
133  void FillHisto(const Char_t* sname, Double_t one, Double_t two = 1, Double_t three = 1, Double_t four = 1);
134  void FillHisto(const Char_t* sname, const Char_t* label, Double_t weight = 1);
135  void FillTree(const Char_t* sname = "");
136 
137  const KVHashList* GetHistoList() const
138  {
139  return &fHistoList;
140  }
141  const KVHashList* GetTreeList() const
142  {
143  return &fTreeList;
144  }
145 
146  TH1* GetHisto(const Char_t* name) const
147  {
148  return fHistoList.get_object<TH1>(name);
149  }
150  TTree* GetTree(const Char_t* name) const
151  {
152  return fTreeList.get_object<TTree>(name);
153  }
154 
155  virtual void SaveHistos(const Char_t* filename = "", Option_t* option = "recreate", Bool_t onlyfilled = kFALSE);
156  void SetJobOutputFileName(const TString& filename)
157  {
164 
165 #ifdef WITH_CPP11
166  if (IsRunningBatchAnalysis() && (GetProofMode() == KVDataAnalyser::EProofMode::None))
167 #else
169 #endif
170  SetCombinedOutputFile(Form("%s.root", GetBatchSystem()->GetJobName()));
171 
172  else
174  }
175  Bool_t CreateTreeFile(const Char_t* filename = "");
176 
177  void SetOpt(const Char_t* option, const Char_t* value)
178  {
180  }
181  Bool_t IsOptGiven(const Char_t* option)
182  {
183  return fOptionList.IsOptGiven(option);
184  }
185  TString GetOpt(const Char_t* option) const
186  {
187  return fOptionList.GetOpt(option);
188  }
189  void UnsetOpt(const Char_t* opt)
190  {
191  fOptionList.UnsetOpt(opt);
192  }
193  /*** END: Methods copied from KVEventSelector ***/
194 
195  ClassDef(KVRawDataAnalyser, 1) //Abstract base class for user analysis of raw data
196 };
197 
198 #endif
int Int_t
bool Bool_t
char Char_t
double Double_t
const char Option_t
#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 char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char filename
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void value
char name[80]
char * Form(const char *fmt,...)
Description of an experimental run in database ,,.
Definition: KVDBRun.h:36
virtual const KVBatchSystem * GetBatchSystem()
EProofMode GetProofMode() const
static Bool_t IsRunningBatchAnalysis()
Pilots user analysis of experimental data.
List of hit groups in a multidetector array.
Extended version of ROOT THashList.
Definition: KVHashList.h:29
Abstract base class for user analysis of raw data.
virtual Bool_t Analysis()=0
const KVHashList * GetTreeList() const
KVHashList fHistoList
list of histograms of user analysis
KVDetectorEvent * GetDetectorEvent() const
KVRawDataReader * fRunFile
currently analysed run file
void FillTProfile(TProfile *h1, Double_t one, Double_t two, Double_t three)
Long64_t GetTotalEntriesToRead() const
virtual void InitRun()=0
Int_t fRunNumber
run number of current file
virtual void SaveHistos(const Char_t *filename="", Option_t *option="recreate", Bool_t onlyfilled=kFALSE)
KVRawDataAnalyser()
Default constructor.
void FillTProfile2D(TProfile2D *h2, Double_t one, Double_t two, Double_t three, Double_t four)
KVHashList fTreeList
list of trees of user analysis
Bool_t IsOptGiven(const Char_t *option)
KVString fCombinedOutputFile
optional name for single results file with trees and histos
Long64_t fEventNumber
event number in current run
virtual void EndAnalysis()=0
Bool_t CreateTreeFile(const Char_t *filename="")
Long64_t GetEventNumber() const
void FillTree(const Char_t *sname="")
Int_t GetRunNumber() const
void FillTH3(TH3 *h3, Double_t one, Double_t two, Double_t three, Double_t four)
void FillHisto(const Char_t *sname, Double_t one, Double_t two=1, Double_t three=1, Double_t four=1)
KVDBRun * GetCurrentRun() const
void SetJobOutputFileName(const TString &filename)
void UnsetOpt(const Char_t *opt)
virtual ~KVRawDataAnalyser()
Destructor.
static void Make(const Char_t *kvsname="MyOwnRawDataAnalyser")
Automatic generation of derived class for raw data analysis.
void FillTH1(TH1 *h1, Double_t one, Double_t two)
void AddHisto(TH1 *histo)
virtual void InitAnalysis()=0
void CalculateTotalEventsToRead()
loop over runs and calculate total events
const KVRawDataReader & GetRunFileReader() const
KVDBRun * fCurrentRun
poiner to current run
TString GetOpt(const Char_t *option) const
KVUserAnalysisOptionList fOptionList
list of options set by user for analysis
const KVHashList * GetHistoList() const
void FillTH2(TH2 *h2, Double_t one, Double_t two, Double_t three)
void SetCombinedOutputFile(const KVString &filename)
virtual void EndRun()=0
TTree * GetTree(const Char_t *name) const
void AddTree(TTree *tree)
TH1 * GetHisto(const Char_t *name) const
void AbortDuringRunProcessing()
Method called to abort analysis during processing of a run.
void SetOpt(const Char_t *option, const Char_t *value)
Abstract base class for reading raw (DAQ) data.
T * get_object(const TString &name) const
virtual void Add(TObject *obj)
Extension of ROOT TString class which allows backwards compatibility with ROOT v3....
Definition: KVString.h:73
Handle list of options and input parameters for user analyis .
void SetOpt(const Char_t *option, const Char_t *value)
TString GetOpt(const Char_t *opt) const
Bool_t IsOptGiven(const Char_t *opt)
void UnsetOpt(const Char_t *opt)
virtual Int_t Fill(const char *name, Double_t w)
virtual Int_t Fill(const char *namex, const char *namey, Double_t w)
virtual Int_t Fill(const char *namex, const char *namey, const char *namez, Double_t w)
void Obsolete(const char *method, const char *asOfVers, const char *removedFromVers) const
virtual Int_t Fill(const char *namex, const char *namey, Double_t z, Double_t w=1.)
long long Long64_t
TH1F * h1