25 TotalEntriesToRead = 0;
70 if ((!fRunFile) || fRunFile->IsZombie()) {
72 if (fRunFile)
delete fRunFile;
91 Long64_t nevents = GetNbEventToRead();
94 cout << endl <<
"Reading all events from file " << raw_file.
Data() << endl;
97 cout << endl <<
"Reading " << nevents <<
" events from file " << raw_file.
Data() << endl;
100 cout <<
"Starting analysis of run " << fRunNumber <<
" on : ";
102 cout << now.
AsString() << endl << endl;
104 fCurrentRun->Print();
112 while ((nevents-- ? fRunFile->GetNextEvent() :
kFALSE) && !AbortProcessingLoop()) {
117 if (!Analysis())
break;
120 if (CheckStatusUpdateInterval(fEventNumber)) DoStatusUpdate(fEventNumber);
125 cout <<
"Ending analysis of run " << fRunNumber <<
" on : ";
127 cout << now2.
AsString() << endl << endl;
128 cout << endl <<
"Finished reading " << fEventNumber - 1 <<
" events from file " << raw_file.
Data() << endl << endl;
166 if (
gDataSet != GetDataSet()) GetDataSet()->cd();
173 CalculateTotalEventsToRead();
176 GetRunList().Begin();
177 while (!GetRunList().
End() && !AbortProcessingLoop()) {
178 fRunNumber = GetRunList().Next();
182 if (fCombinedOutputFile !=
"") {
183 Info(
"Terminate",
"combine = %s", fCombinedOutputFile.Data());
188 if (fHistoList.GetEntries()) {
190 Info(
"Terminate",
"both");
198 Info(
"Terminate",
"histo");
199 SaveHistos(fCombinedOutputFile);
202 else if (fTreeFile) {
204 Info(
"Terminate",
"tree");
209 else Info(
"Terminate",
"none");
234 TotalEntriesToRead = 0;
235 GetRunList().Begin();
236 while (!GetRunList().
End()) {
237 Int_t r = GetRunList().Next();
256 Error(
"AddTree",
"You must call CreateTreeFile(const Char_t*) before using this method!");
259 tree->SetDirectory(fTreeFile);
282 FillTH3((
TH3*)
h1, one, two, three, four);
286 FillTH2((
TH2*)
h1, one, two, three);
290 FillTH1(
h1, one, two);
292 Warning(
"FillHisto",
"%s -> Classe non prevue ...", fHistoList.FindObject(histo_name)->ClassName());
295 Warning(
"FillHisto",
"%s introuvable", histo_name);
312 Warning(
"FillHisto",
"%s introuvable", histo_name);
332 if (!strcmp(tree_name,
"")) {
333 fTreeList.Execute(
"Fill",
"");
337 if ((
tt = GetTree(tree_name))) {
341 Warning(
"FillTree",
"%s introuvable", tree_name);
377 if (!fHistoList.GetEntries())
return;
380 if (!strcmp(filename,
""))
383 histo_file_name = filename;
397 TIter next(GetHistoList());
399 while ((obj = next())) {
402 if (((
TH1*)obj)->GetEntries() > 0) {
428 if (!strcmp(filename,
""))
431 tree_file_name = filename;
434 fTreeFile =
new TFile(tree_file_name,
"RECREATE");
451 kTRUE,
"RawAnalysisTemplate");
KVMultiDetArray * gMultiDetArray
ClassImp(KVPartitionList) void KVPartitionList
Initialisation.
R__EXTERN TSystem * gSystem
static void CombineFiles(const Char_t *file1, const Char_t *file2, const Char_t *newfilename, Bool_t keep=kTRUE)
Factory class for generating skeleton files for new classes.
void GenerateCode()
Generate header and implementation file for currently-defined class.
void AddImplIncludeFile(const Char_t *filename)
ULong64_t GetEvents() const
FileType * OpenRunfile(const Char_t *type, Int_t run)
TString GetFullPathToRunfile(const Char_t *type, Int_t run) const
KVDBRun * GetDBRun(Int_t number) const
static KVMultiDetArray * MakeMultiDetector(const Char_t *dataset_name, Int_t run=-1, TString classname="KVMultiDetArray")
Bool_t HandleRawDataEvent(KVRawDataReader *)
Abstract base class for user analysis of raw data.
virtual void SaveHistos(const Char_t *filename="", Option_t *option="recreate", Bool_t onlyfilled=kFALSE)
Bool_t CreateTreeFile(const Char_t *filename="")
void FillTree(const Char_t *sname="")
void FillHisto(const Char_t *sname, Double_t one, Double_t two=1, Double_t three=1, Double_t four=1)
virtual ~KVRawDataAnalyser()
Destructor.
static void Make(const Char_t *kvsname="MyOwnRawDataAnalyser")
Automatic generation of derived class for raw data analysis.
void CalculateTotalEventsToRead()
loop over runs and calculate total events
void AddTree(TTree *tree)
void AbortDuringRunProcessing()
Method called to abort analysis during processing of a run.
Abstract base class for reading raw (DAQ) data.
Extension of ROOT TString class which allows backwards compatibility with ROOT v3....
const char * AsString() const
virtual Bool_t cd(const char *path=nullptr)
virtual Int_t Fill(const char *name, Double_t w)
virtual const char * GetName() const
virtual Int_t Write(const char *name=0, Int_t option=0, Int_t bufsize=0)
virtual Bool_t InheritsFrom(const char *classname) const
const char * Data() const
void Form(const char *fmt,...)
virtual int Rename(const char *from, const char *to)
RooCmdArg ClassName(const char *name)
BinData::ErrorType GetDataType(const TGraph *gr, DataOptions &fitOpt)
TH1 * GetHisto(const std::string file, const std::string path, const std::string obj)