KaliVeda
Toolkit for HIC analysis
KVFAZIARawDataAnalyser.cpp
1 //Created by KVClassFactory on Tue Jan 26 16:01:47 2016
2 //Author: bonnet,,,
3 
4 #include "KVFAZIARawDataAnalyser.h"
5 #include "KVMultiDetArray.h"
6 #include "KVDataSet.h"
7 
9 
10 
11 
15 {
16  // Default constructor
17 }
18 
19 
20 
23 
25 {
26  // Destructor
27 }
28 
29 
30 
33 
35 {
36  //called by the KVFAZIAReader::SlaveBegin() derived analysis class
37  Info("preInitAnalysis", "Appel");
38  if (gDataSet && !gMultiDetArray) {
39  Info("preInitAnalysis", "Building of FAZIA array");
41  }
42 }
43 
44 
45 
48 
50 {
51  //called by the KVFAZIAReader::Notify() derived analysis class
52  Info("preInitRun", "Appel");
53  gMultiDetArray->SetParameters(fRunNumber);
54 
55 }
56 
57 
58 
70 
72 {
73  // Perform analysis of chosen runs
74  // Before beginning the loop over the runs, the user's InitAnalysis() method is called.
75  // After completing the analysis of all runs, the user's EndAnalysis() method is called.
76  //
77  // Further customisation of the event loop is possible by overriding the methods
78  // preInitAnalysis()
79  // postInitAnalysis()
80  // preEndAnalysis()
81  // postEndAnalysis()
82  // which are executed respectively just before and just after the methods.
83 
84  if (gDataSet != GetDataSet()) GetDataSet()->cd();
85 
86  //loop over runs
87  GetRunList().Begin();
88  while (!GetRunList().End() && !AbortProcessingLoop()) {
90  Info("SubmitTask", "treatment of run# %d", fRunNumber);
91  ProcessRun();
92  }
93 
94 }
95 
96 
97 
106 
108 {
109  // Perform treatment of a given run
110  // Before processing each run, after opening the associated file, user's InitRun() method is called.
111  // After each run, user's EndRun() is called.
112  // For each event of each run, user's Analysis() method is called.
113  //
114  // For further customisation, the pre/post-methods are called just before and just after
115  // each of these methods (preInitRun(), postAnalysis(), etc. etc.)
116  TString fullPathToRunfile = gDataSet->GetFullPathToRunfile(GetDataType(), fRunNumber);
117  TFile* f = gDataSet->OpenRunfile<TFile>(GetDataType(), fRunNumber);
118  if (!(f && !f->IsZombie())) {
119  Error("ProcessRun", "file %s does not exist or is made zombie", fullPathToRunfile.Data());
120  return;
121  }
122 
123  theTree = (TTree*)f->Get("FAZIA");
124 
125  TString option("");
126  Info("SubmitTask", "Beginning TTree::Process...");
127  if (GetNbEventToRead()) {
129  }
130  else {
131  theTree->Process(GetUserClass(), option.Data());
132  }
133 
134  f->Close();
135 
136 }
137 
138 
#define f(i)
Option_t Option_t option
const KVString & GetDataType() const
const Char_t * GetUserClass()
static Bool_t AbortProcessingLoop()
Long64_t GetNbEventToRead(void) const
const KVDataSet * GetDataSet() const
const KVNumberList & GetRunList() const
FileType * OpenRunfile(const Char_t *type, Int_t run)
Definition: KVDataSet.h:167
TString GetFullPathToRunfile(const Char_t *type, Int_t run) const
Definition: KVDataSet.cpp:897
void cd() const
Definition: KVDataSet.cpp:745
Pilot analysis of raw FAZIA data.
virtual void preInitRun()
called by the KVFAZIAReader::Notify() derived analysis class
virtual ~KVFAZIARawDataAnalyser()
Destructor.
Int_t fRunNumber
run number of current file
virtual void preInitAnalysis()
called by the KVFAZIAReader::SlaveBegin() derived analysis class
virtual void SetParameters(UInt_t n, Bool_t physics_parameters_only=kFALSE)
static KVMultiDetArray * MakeMultiDetector(const Char_t *dataset_name, Int_t run=-1, TString classname="KVMultiDetArray")
void Begin(void) const
Int_t Next(void) const
const char * GetName() const override
virtual void Error(const char *method, const char *msgfmt,...) const
virtual void Info(const char *method, const char *msgfmt,...) const
const char * Data() const
virtual Long64_t Process(const char *filename, Option_t *option="", Long64_t nentries=kMaxEntries, Long64_t firstentry=0)
void End()
ClassImp(TPyArg)