KaliVeda
Toolkit for HIC analysis
KVFAZIASelector.cpp
1 //Created by KVClassFactory on Wed Jan 28 09:54:34 2015
2 //Author: Eric Bonnet
3 
4 #include "KVFAZIASelector.h"
5 #include "KVReconstructedNucleus.h"
6 #include "KVBatchSystem.h"
7 #include "KVFAZIA.h"
8 #include "KVDataSet.h"
9 #include "KVDataAnalyser.h"
10 #include "KVFAZIAReconDataAnalyser.h"
11 #include "KVFAZIADetector.h"
12 #include "KVSignal.h"
13 #include "KVClassFactory.h"
14 
15 #include "KVDataRepositoryManager.h"
16 #include "KVDataSetManager.h"
17 #include "KVFAZIADBRun.h"
18 #include "KVFAZIADB.h"
19 #include "KVFileReader.h"
20 
22 
23 // BEGIN_HTML <!--
25 /* -->
26 <h2>KVFAZIASelector</h2>
27 <h4>selector to analyze FAZIA reconstructed data</h4>
28 <!-- */
29 // --> END_HTML
31 
32 // This class is derived from the KaliVeda class KVSelector.
33 // The following members functions are called by the TTree::Process() functions:
34 // InitRun(): called everytime a run starts
35 // EndRun(): called everytime a run ends
36 // InitAnalysis(): called at the beginning of the analysis
37 // a convenient place to create your histograms.
38 // Analysis(): called for each event. In this function you
39 // fill your histograms.
40 // EndAnalysis(): called at the end of a loop on the tree,
41 // a convenient place to draw/fit your histograms.
42 //
43 // Modify these methods as you wish in order to create your analysis class.
44 // Don't forget that for every class used in the analysis, you must put a
45 // line '#include' at the beginning of this file.
46 // E.g. if you want to access informations on the FAZIA multidetector
47 // through the global pointer gIndra, you must AT LEAST add the line
48 // #include "KVFAZIA.h"
49 
50 
51 
56 void KVFAZIASelector::SlaveBegin(TTree* tree)
57 {
58  // The SlaveBegin() function is called after the Begin() function.
59  // When running with PROOF SlaveBegin() is called on each slave server.
60  // The tree argument is deprecated (on PROOF 0 is passed).
61 
62  SetReadingOfRawData(kFALSE);
63  gDataAnalyser->preInitAnalysis();
64 
65  //
66  // ParseOptions : Manage options passed as arguments
67  // done in KVEventSelector::SlaveBegin
69 
70 }
71 
72 
73 
83 
85 {
86  // The Init() function is called when the selector needs to initialize
87  // a new tree or chain. Typically here the branch addresses and branch
88  // pointers of the tree will be set.
89  // It is normally not necessary to make changes to the generated
90  // code, but the routine can be extended by the user if needed.
91  // Init() will be called many times when running on PROOF
92  // (once per file to be processed).
93 
94  // Set object pointer
95 
96  Event = 0;
97  // Set branch addresses and branch pointers
98  if (!tree) return;
99  fChain = tree;
100  fChain->SetMakeClass(1);
101 
102  if (strcmp(GetBranchName(), "") && fChain->GetBranch(GetBranchName())) {
103  Info("Init", "Analysing data in branch : %s", GetBranchName());
105  }
106  if (NeedToReadRawData())
107  LinkRawData();
108 
109  //user additional branches addressing
111  fEventsRead = 0;
112  fOutputFile = 0;
113 
114 }
115 
116 
117 
124 
126 {
127  // The Notify() function is called when a new file is opened. This
128  // can be either for a new TTree in a TChain or when when a new TTree
129  // is started when using PROOF. It is normally not necessary to make changes
130  // to the generated code, but the routine can be extended by the
131  // user if needed. The return value is currently not used.
132 
133  if (fNotifyCalled) return kTRUE; // avoid multiple calls at beginning of analysis
135 
136  Info("Notify", "Beginning analysis of file %s (%lld events)", fChain->GetCurrentFile()->GetName(), fChain->GetTree()->GetEntries());
137  gDataAnalyser->preInitRun();
138  fCurrentRun = ((KVFAZIAReconDataAnalyser*)gDataAnalyser)->GetCurrentRunNumber();
139  printf("KVFAZIASelector-LOG: Start run : %d\n", fCurrentRun);
140  if (fAutomatic)
142  InitRun(); //user initialisations for run
143 
144  return kTRUE;
145 }
146 
147 
148 
150 
152 {
153  Info("LinkRawData", "Enable reading of raw data : %s\n", rawdatabranchname.Data());
154  RawEvent = 0;
156 }
157 
158 
159 
161 
163 {
164  KVFAZIADetector* det = 0;
165  KVSignal* sig = 0;
166 
167  TIter next_s(RawEvent->GetSignals());
168  while ((sig = (KVSignal*)next_s())) {
169  sig->DeduceFromName();
170  det = (KVFAZIADetector*)gFazia->GetDetector(sig->GetDetectorName());
171  if (!det)
173  if (det)
174  det->SetSignal(sig, sig->GetType());
175  else
176  Warning("ConnectSignalsToDetectors", "Unknown detector %s", sig->GetDetectorName());
177  }
178 
179 }
180 
181 
182 
184 
186 {
188 
189  //check if the reading of raw data is needed
190  if (IsOptGiven("ReadRawData")) SetReadingOfRawData(GetOpt("ReadRawData").Atoi());
191 
192  //Force the name of the KVEvent branch after the call to ParseOption
193  SetBranchName("FAZIAReconEvent");
194 }
195 
196 
197 
200 
201 void KVFAZIASelector::Make(const Char_t* kvsname)
202 {
203  // Automatic generation of KVSelector-derived class for KaliVeda analysis
204  KVClassFactory cf(kvsname, "User analysis class", Class_Name(), kTRUE);
205  cf.AddImplIncludeFile("KVReconstructedNucleus.h");
206  cf.AddImplIncludeFile("KVBatchSystem.h");
207  cf.AddImplIncludeFile("KVFAZIA.h");
208  cf.GenerateCode();
209 }
210 
211 
212 
221 
223 {
224  //indicate if outputs (histograms, trees or other objects
225  //has to be managed automatically by the selector
226  //
227  //to be active FAZIA_SELECTOR_OUTPUTS shell variable
228  //has to be defined in your .cshrc type configuration file
229  //the format of the output file will be :
230  // FAZIA_SELECTOR_OUTPUTS/nameofthekvfaziaselector/dataset/R%d.root
231  fOutputPath = "";
232  if (automatic) {
233  TString output_path = gSystem->Getenv("FAZIASELECTOR_OUTPUTS");
234  fOutputPath.Form("%s/%s/%s", output_path.Data(), GetName(), gDataSet->GetName());
235  if (output_path == "") {
236  Error("CreateOutputFile", "FAZIASELECTOR_OUTPUTS shell variable has to defined first");
237  fAutomatic = kFALSE;
238  fOutputPath = "";
239  return;
240  }
241  else if (gSystem->Exec(Form("test -d %s", fOutputPath.Data())) != 0) {
242  Info("SetAutomaticManagementOfOutputs", "Creation of %s directory", fOutputPath.Data());
243  if (gSystem->mkdir(fOutputPath.Data(), kTRUE) != 0) {
244  Info("SetAutomaticManagementOfOutputs", "Error in the %s directory creation", fOutputPath.Data());
245  fAutomatic = kFALSE;
246  fOutputPath = "";
247  return;
248  }
249  }
250  }
251  fAutomatic = automatic;
252 }
253 
254 
267 
269 {
270  //create ROOT file where all outputs coming from
271  //the selector will be stores
272  //to be active FAZIA_SELECTOR_OUTPUTS shell variable
273  //has to be defined in your .cshrc type configuration file
274  //the format of the output file will be :
275  // FAZIA_SELECTOR_OUTPUTS/nameofthekvfaziaselector/dataset/R%d.root
276  //When it is created, the output file name is tmp_R%d.root
277  //and renamed at the end of the run R%d.root
278  //This helps to know if the entire run has been read
279  //
280  //
281  fOutputFile = new TFile(Form("%s/tmp_R%d.root", fOutputPath.Data(), GetCurrentRunNumber()), "recreate");
282  if (fOutputFile && fOutputFile->IsOpen())
283  return kTRUE;
284  return kFALSE;
285 }
286 
287 
292 
294 {
295  //write in and close the ROOT file created by the CreateOutputFile
296  //method
297  //
298  if (!fOutputFile) {
299  Error("SaveAndCloseOutputFile", "No file open for writing outputs");
300  return kFALSE;
301  }
302 
303  fOutputFile->cd();
304  fOutputFile->Write();
305  fOutputFile->Close();
306 
307  TString fmt1, fmt2;
308  fmt1.Form("%s/tmp_R%d.root", fOutputPath.Data(), GetCurrentRunNumber());
309  fmt2.Form("%s/R%d.root", fOutputPath.Data(), GetCurrentRunNumber());
310 
311  gROOT->ProcessLine(Form(".! mv %s %s", fmt1.Data(), fmt2.Data()));
312  return kTRUE;
313 }
314 
315 
316 
319 
321 {
322  // Testing whether EndRun() should be called
323  if (AtEndOfRun()) {
324  Info("Process", "End of file reached after %lld events", fEventsRead);
325  EndRun();
326  printf("KVFAZIASelector-LOG: End run : %d\n", fCurrentRun);
327  if (fAutomatic)
329  fNotifyCalled = kFALSE;//Notify will be called when next file is opened (in TChain)
330  }
331 
332 }
333 
334 
335 
343 
344 void KVFAZIASelector::CheckListOfWellEndedRuns(const Char_t* kvsname, const Char_t* dsname)
345 {
346  //static method
347  //List well ended files in the corresponding directory :
348  //FAZIA_SELECTOR_OUTPUTS/[kvsname]/[dsname]/
349  //Only available if the selector you ran
350  //had the option SetAutomaticManagementOfOutputs(kTRUE)
351  //
352  TString output_path = gSystem->Getenv("FAZIASELECTOR_OUTPUTS");
353  TString op;
354  op.Form("%s/%s/%s", output_path.Data(), kvsname, dsname);
355  if (output_path == "") {
356  printf("Error in CheckListOfEndedRuns : FAZIASELECTOR_OUTPUTS shell variable is not defined\n");
357  return;
358  }
359  if (gSystem->Exec(Form("test -d %s", op.Data())) != 0) {
360  printf("directory %s does not exist\n", op.Data());
361  return;
362  }
363  KVNumberList lr;
364  KVString lruns = gSystem->GetFromPipe(Form("ls %s/R*.root", op.Data()));
365  lruns.Begin("\n");
366  Int_t run = -1;
367  while (!lruns.End()) {
368  KVString srun = lruns.Next();
369  srun = gSystem->BaseName(srun.Data());
370  Int_t rep = sscanf(srun.Data(), "R%d.root", &run);
371  if (rep == 1)
372  lr.Add(run);
373  }
374  if (lr.GetNValues() > 0)
375  printf("Ended runs for the selector %s and the dataset %s are:\n%s\n", kvsname, dsname, lr.AsString());
376  else
377  printf("No runs ended for the selector %s and the dataset %s\n", kvsname, dsname);
378 }
379 
380 
405 
406 void KVFAZIASelector::MergeListOfEndedRuns(const Char_t* kvsname, const Char_t* dsname)
407 {
408  //static method
409  //Gather well ended files in the corresponding directory :
410  //FAZIA_SELECTOR_OUTPUTS/[kvsname]/[dsname]/
411  //Files are merged using the hadd command
412  //the -f option is set, so previous output file is deleted
413  //
414  //To avoid mixing, one merging is done for each system
415  //
416  //The output file is deduced from system name
417  //Example for "48Ca + 48Ca 35.0 MeV/A" gives 48Ca48Ca35.0
418  //
419  //An additional TEnv file is created with the format
420  // listruns_48Ca48Ca35.0.env to follow the previous example
421  //It is a summary of info coming from the merging :
422  // System: 48Ca + 48Ca 35.0 MeV/A
423  // DataSet: FAZIASYM
424  // Selector: CheckCsIIdentification
425  // Number: 34
426  // RunList: 14588-14621
427  //
428  //Only available if the selector you ran
429  //had the option SetAutomaticManagementOfOutputs(kTRUE)
430  //
431  TString output_path = gSystem->Getenv("FAZIASELECTOR_OUTPUTS");
432  TString op;
433  op.Form("%s/%s/%s", output_path.Data(), kvsname, dsname);
434  if (output_path == "") {
435  printf("Error in CheckListOfEndedRuns : FAZIASELECTOR_OUTPUTS shell variable is not defined\n");
436  return;
437  }
438  if (gSystem->Exec(Form("test -d %s", op.Data())) != 0) {
439  printf("directory %s does not exist\n", op.Data());
440  return;
441  }
442 
443  if (!(gDataSet)) {
445  gDataRepositoryManager->Init();
446  gDataSetManager->GetDataSet(dsname)->cd();
447  }
448 
449  KVNumberList lall;
450  TList* lsyst = new TList();
451  lsyst->SetOwner(kTRUE);
452  KVNumberList* lpersyst = 0;
453  KVString lruns = gSystem->GetFromPipe(Form("ls %s/R*.root", op.Data()));
454  lruns.Begin("\n");
455  Int_t run = -1;
456  while (!lruns.End()) {
457  KVString srun = lruns.Next();
458  srun = gSystem->BaseName(srun.Data());
459  Int_t rep = sscanf(srun.Data(), "R%d.root", &run);
460  if (rep == 1) {
461  KVFAZIADBRun* fr = gFaziaDB->GetRun(run);
462  lall.Add(run);
463  if (!(lpersyst = (KVNumberList*)lsyst->FindObject(fr->GetSystemName()))) {
464  lpersyst = new KVNumberList();
465  lpersyst->SetName(fr->GetSystemName());
466  printf("creation de la liste associee a : %s\n", fr->GetSystemName());
467  lsyst->Add(lpersyst);
468  }
469  lpersyst->Add(run);
470  }
471  }
472 
473 
474  TIter next(lsyst);
475  while ((lpersyst = (KVNumberList*)next())) {
476  TEnv fruns;
477 
478  TString slist(lpersyst->GetExpandedList());
479  slist.ReplaceAll(" ", ",");
480  TString sname(lpersyst->GetName());
481  sname.ReplaceAll("+ ", "");
482  sname.ReplaceAll(" MeV/A", "");
483  sname.ReplaceAll(" ", "");
484  TString inst = "";
485  if (lpersyst->GetNValues() > 1) {
486  inst.Form("hadd -f -k -v 0 %s/%s.root %s/R{%s}.root",
487  op.Data(),
488  sname.Data(),
489  op.Data(),
490  slist.Data()
491  );
492  }
493  else if (lpersyst->GetNValues() == 1) {
494  inst.Form("hadd -f -k -v 0 %s/%s.root %s/R%d.root",
495  op.Data(),
496  sname.Data(),
497  op.Data(),
498  lpersyst->First()
499  );
500  }
501 
502 
503  if (inst != "") {
504  std::cout << "Creation of output file " << sname.Data() << ".root from run list:" << std::endl;
505  std::cout << lpersyst->AsString() << " ..." << std::endl;
506  KVString sroot;
507  sroot.Form("%s/%s.root",
508  op.Data(),
509  sname.Data()
510  );
511 
512  fruns.SetValue("System", lpersyst->GetName());
513  fruns.SetValue("DataSet", dsname);
514  fruns.SetValue("Selector", kvsname);
515  fruns.SetValue("Number", lpersyst->GetNValues());
516  fruns.SetValue("RunList", lpersyst->AsString());
517  gSystem->Exec(inst.Data());
518  std::cout << " ... done" << std::endl;
519  fruns.WriteFile(
520  Form("%s/listruns_%s.env",
521  op.Data(),
522  sname.Data()
523  )
524  );
525  }
526 
527  }
528 
529 
530  delete lsyst;
531 
532 }
533 
534 
545 
546 void KVFAZIASelector::GetMissingRunsListing(const Char_t* kvsname, const Char_t* dsname)
547 {
548  //static method
549  //
550  //Read the TEnv file created by the MergeListOfEndedRuns method with the format
551  // listruns_[SYSTEM].env
552  //extract the system name and the run list of the well ended file
553  //and compare this list to the all run list of the system for the considering dataset
554  //The output is a printing of the missing runs
555  //compare to the system run list
556  //
557  TString output_path = gSystem->Getenv("FAZIASELECTOR_OUTPUTS");
558  TString op;
559  op.Form("%s/%s/%s", output_path.Data(), kvsname, dsname);
560  if (output_path == "") {
561  printf("Error in CheckListOfEndedRuns : FAZIASELECTOR_OUTPUTS shell variable is not defined\n");
562  return;
563  }
564  if (gSystem->Exec(Form("test -d %s", op.Data())) != 0) {
565  printf("directory %s does not exist\n", op.Data());
566  return;
567  }
568 
569  if (!(gDataSet)) {
571  gDataRepositoryManager->Init();
572  gDataSetManager->GetDataSet(dsname)->cd();
573  }
574 
575  KVString lenv = gSystem->GetFromPipe(Form("ls %s/*env", op.Data()));
576  lenv.Begin("\n");
577  while (!lenv.End()) {
578  TEnv env;
579  KVString senv = lenv.Next();
580  env.ReadFile(senv.Data(), kEnvAll);
581  TString syst(env.GetValue("System", ""));
582  TString sruns(env.GetValue("RunList", ""));
583  KVDBSystem* dbsys = gFaziaDB->GetSystem(syst.Data());
584  if (dbsys) {
585  KVNumberList ltot;
586  dbsys->GetRunList(ltot);
587  ltot.Remove(sruns.Data());
588  if (ltot.GetNValues() > 0)
589  printf("System: %s, Missing Runs %s\n", dbsys->GetName(), ltot.AsString());
590  else
591  printf("System: %s, All runs done\n", dbsys->GetName());
592  }
593  }
594 
595 }
596 
597 
627 
628 void KVFAZIASelector::CheckBatchOutputFiles(const Char_t* kvsname, Bool_t eraseafter)
629 {
630  //static method
631  //
632  //Get the list of output batch files
633  //with the format [kvsname]_R*.o*
634  //for example :
635  // CheckCsIIdentification_R14748-14767.o110904
636  // Extract information on CPU, Memory consuming
637  // and the list of ended/not ended files
638  //
639  // It is more adapted than the analyse_logs
640  // script when several runs are in a same job
641  //
642  // output TEnv file is produced with the following information
643  // with the following format : [kvsname].joblog
644  // example with CheckCsIIdentification.joblog
645  //
646  // Nfiles: 21
647  // Runlist: 14588-14905
648  // CpuSys(s): 4.51931
649  // CpuUser(s): 494.547
650  // CpuPerRun: 24.7273
651  // ResMem(MB): 474.09
652  // VirtMem(MB): 1870.77
653  // MissingRuns:
654  //
655  // if eraseafter=kTRUE, (kFALSE by default),
656  // log files are erased after the checking
657  //
658  KVFileReader fr;
659  KVString lfiles = gSystem->GetFromPipe(Form("ls %s_R*.o*", kvsname));
660  lfiles += "\n";
661  lfiles += gSystem->GetFromPipe(Form("ls %s.o*", kvsname));
662 
663  lfiles.Begin("\n");
664  Double_t max_sys_time = 0, max_cpu_time = 0, max_res_mem = 0, max_virt_mem = 0, max_ratio = 0;
665  Double_t sys_time = 0, cpu_time = 0, res_mem = 0, virt_mem = 0;
666  KVNumberList linit_all;
667  KVNumberList lstarted_all;
668  KVNumberList lended_all;
669  Int_t nf = 0;
670  while (!lfiles.End()) {
671  KVString file = lfiles.Next();
672  fr.OpenFileToRead(file.Data());
673 
674  KVNumberList linit;
675  KVNumberList lstarted;
676  KVNumberList lended;
677  Int_t num = -1;
678  while (fr.IsOK()) {
679  fr.ReadLine(0);
681  //Info in <KVDataAnalyser::SetRuns>: Accepted runs : 14788-14807
682  if (line.BeginsWith("Info in <KVFAZIAReconDataAnalyser::SetRuns>: Accepted runs :")) {
683  line.ReplaceAll("Info in <KVFAZIAReconDataAnalyser::SetRuns>: Accepted runs :", "");
684  linit.Add(line.Data());
685  linit_all.Add(line.Data());
686  }
687  else if (line.BeginsWith("Info in <KVFAZIAReconDataAnalyser::SubmitTask>: treatment of run#")) {
688  line.ReplaceAll("Info in <KVFAZIAReconDataAnalyser::SubmitTask>: treatment of run#", "");
689  num = line.Atoi();
690  lstarted.Add(num);
691  lstarted_all.Add(num);
692  }
693  else if (line.BeginsWith(Form("Info in <%s::Process>: End of file reached after ", kvsname))) {
694  lended.Add(num);
695  lended_all.Add(num);
696  }
697  else if (line.BeginsWith("CpuSys = ")) {
698  sscanf(line.Data(), " CpuSys = %lf s. CpuUser = %lf s. ResMem = %lf MB VirtMem = %lf MB",
699  &sys_time, &cpu_time, &res_mem, &virt_mem);
700 
701  }
702  }
703  fr.CloseFile();
704  if (linit.GetNValues()) {
705  Double_t ratio = 0;
706  if (lended.GetNValues() > 0)
707  ratio = cpu_time / lended.GetNValues();
708  if (ratio > max_ratio) max_ratio = ratio;
709 
710  if (sys_time > max_sys_time) max_sys_time = sys_time;
711  if (cpu_time > max_cpu_time) max_cpu_time = cpu_time;
712  if (res_mem > max_res_mem) max_res_mem = res_mem;
713  if (virt_mem > max_virt_mem) max_virt_mem = virt_mem;
714 
715  linit.Remove(lstarted);
716  if (linit.GetNValues() > 0)
717  printf("in %s : runs not started : %s\n", file.Data(), linit.AsString());
718 
719  lstarted.Remove(lended);
720  if (lstarted.GetNValues() > 0)
721  printf("in %s : runs not ended : %s\n", file.Data(), lstarted.AsString());
722  }
723  else {
724  printf("in %s : initial run list is empty\n", file.Data());
725  }
726  nf += 1;
727 
728  }
729 
730  if (nf > 0) {
731  TEnv env;
732  env.SetValue("Nfiles", nf);
733  env.SetValue("Runlist", linit_all.AsString());
734  env.SetValue("CpuSys(s)", max_sys_time);
735  env.SetValue("CpuUser(s)", max_cpu_time);
736  env.SetValue("CpuPerRun", max_ratio);
737  env.SetValue("ResMem(MB)", max_res_mem);
738  env.SetValue("VirtMem(MB)", max_virt_mem);
739 
740  printf("%d log files read\n", nf);
741  printf("initial runlist : %s\n", linit_all.AsString());
742  printf("Maximum values\n");
743  printf("CpuSys=%lf s\nCpuUser=%lf s (%lf s/run)\nResMem=%lf MB\nVirtMem=%lf MB\n",
744  max_sys_time,
745  max_cpu_time,
746  max_ratio,
747  max_res_mem,
748  max_virt_mem
749  );
750 
751  KVNumberList lmissing;
752 
753  linit_all.Remove(lstarted_all);
754  if (linit_all.GetNValues() > 0)
755  printf("\truns not started : %s\n", linit_all.AsString());
756  lmissing.Add(linit_all);
757  lstarted_all.Remove(lended_all);
758  if (lstarted_all.GetNValues() > 0)
759  printf("\truns not ended : %s\n", lstarted_all.AsString());
760  lmissing.Add(lstarted_all);
761  if (lmissing.GetNValues() > 0)
762  printf("\t%d runs to be done : %s with a total time of %lf\n", lmissing.GetNValues(), lmissing.AsString(), max_ratio * lmissing.GetNValues());
763  env.SetValue("MissingRuns", lmissing.AsString());
764  env.WriteFile(Form("%s.joblog", kvsname));
765 
766  if (eraseafter) {
767  gROOT->ProcessLine(Form(".! rm %s_R*.o*", kvsname));
768  gROOT->ProcessLine(Form(".! rm %s.o*", kvsname));
769  }
770 
771  }
772 }
773 
774 
int Int_t
bool Bool_t
char Char_t
constexpr Bool_t kFALSE
double Double_t
constexpr Bool_t kTRUE
kEnvAll
#define gROOT
char * Form(const char *fmt,...)
R__EXTERN TSystem * gSystem
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)
const Char_t * GetSystemName() const
Definition: KVDBRun.h:129
Database class used to store information on different colliding systems studied during an experiment....
Definition: KVDBSystem.h:52
virtual void GetRunList(KVNumberList &) const
Fills the KVNumberList object with the list of all run numbers associated with this system.
Definition: KVDBSystem.cpp:234
virtual void preInitAnalysis()
virtual void preInitRun()
Manages access to one or more data repositories.
KVDataSet * GetDataSet(Int_t) const
Return pointer to DataSet using index in list of all datasets, index>=0.
void cd() const
Definition: KVDataSet.cpp:745
const Char_t * GetBranchName() const
virtual void EndRun()
Long64_t fEventsRead
number of events read
TTree * fChain
pointer to the analyzed TTree or TChain
virtual void SlaveBegin(TTree *tree)
Bool_t AtEndOfRun(void)
TBranch * b_Event
List of branches.
void SetBranchName(const Char_t *n)
virtual void SetAdditionalBranchAddress()
Bool_t IsOptGiven(const Char_t *option)
Bool_t fNotifyCalled
avoid multiple calls to Notify/InitRun
TString GetOpt(const Char_t *option) const
virtual void ParseOptions()
virtual void InitRun()
virtual KVDBSystem * GetSystem(const Char_t *system) const
Definition: KVExpDB.h:85
Database entry for a run in a FAZIA experiment.
Definition: KVFAZIADBRun.h:15
KVFAZIADBRun * GetRun(Int_t run) const
Definition: KVFAZIADB.h:48
Base class for FAZIA detectors.
void SetSignal(TGraph *signal, const Char_t *signal_name)
static const Char_t * GetNewName(KVString oldname)
TClonesArray * GetSignals() const
Pilot analysis of reconstructed FAZIA data.
Analysis of FAZIA data.
virtual void ParseOptions()
void SetAutomaticManagementOfOutputs(Bool_t automatic=kTRUE)
TString rawdatabranchname
Bool_t NeedToReadRawData() const
virtual Bool_t Notify()
virtual void CheckEndOfRun()
Testing whether EndRun() should be called.
KVFAZIARawEvent * RawEvent
static void MergeListOfEndedRuns(const Char_t *kvsname, const Char_t *dsname)
static void CheckListOfWellEndedRuns(const Char_t *kvsname, const Char_t *dsname)
virtual void Init(TTree *tree)
Bool_t SetReadingOfRawData(Bool_t need=kFALSE)
Bool_t SaveAndCloseOutputFile()
static void GetMissingRunsListing(const Char_t *kvsname, const Char_t *dsname)
Int_t GetCurrentRunNumber() const
void ConnectSignalsToDetectors()
static void CheckBatchOutputFiles(const Char_t *kvsname, Bool_t eraseafter=kFALSE)
static void Make(const Char_t *kvsname="MyOwnFAZIASelector")
Automatic generation of KVSelector-derived class for KaliVeda analysis.
Handle reading columns of numeric data in text files.
Definition: KVFileReader.h:120
KVString GetCurrentLine()
Definition: KVFileReader.h:319
void CloseFile()
Definition: KVFileReader.h:236
ReadStatus ReadLine(const KVString &pattern="")
Definition: KVFileReader.h:242
Bool_t IsOK()
Definition: KVFileReader.h:230
Bool_t OpenFileToRead(const KVString &filename)
Definition: KVFileReader.h:209
KVDetector * GetDetector(const Char_t *name) const
Return detector in this structure with given name.
Strings used to represent a set of ranges of values.
Definition: KVNumberList.h:85
virtual void SetName(const char *name)
Int_t First() const
Returns smallest number included in list.
const Char_t * AsString(Int_t maxchars=0) const
void Remove(Int_t)
Remove value 'n' from the list.
Int_t GetNValues() const
const Char_t * GetExpandedList() const
virtual const char * GetName() const
Definition: KVNumberList.h:128
void Add(Int_t)
Add value 'n' to the list.
const Char_t * GetType() const
Definition: KVSignal.h:98
const Char_t * GetDetectorName() const
Definition: KVSignal.h:85
void DeduceFromName()
Definition: KVSignal.cpp:288
Extension of ROOT TString class which allows backwards compatibility with ROOT v3....
Definition: KVString.h:73
void Begin(TString delim) const
Definition: KVString.cpp:565
Bool_t End() const
Definition: KVString.cpp:634
KVString Next(Bool_t strip_whitespace=kFALSE) const
Definition: KVString.cpp:695
virtual void SetOwner(Bool_t enable=kTRUE)
Bool_t cd() override
virtual Int_t WriteFile(const char *fname, EEnvLevel level=kEnvAll)
virtual const char * GetValue(const char *name, const char *dflt) const
virtual Int_t ReadFile(const char *fname, EEnvLevel level)
virtual void SetValue(const char *name, const char *value, EEnvLevel level=kEnvChange, const char *type=nullptr)
virtual Bool_t IsOpen() const
Int_t Write(const char *name=nullptr, Int_t opt=0, Int_t bufsiz=0) const override
void Close(Option_t *option="") override
TObject * FindObject(const char *name) const override
void Add(TObject *obj) override
const char * GetName() const override
virtual const char * GetName() const
virtual void Warning(const char *method, const char *msgfmt,...) const
virtual void Error(const char *method, const char *msgfmt,...) const
virtual void Info(const char *method, const char *msgfmt,...) const
static const char * Class_Name()
const char * Data() const
void Form(const char *fmt,...)
TString & ReplaceAll(const char *s1, const char *s2)
virtual const char * Getenv(const char *env)
virtual int mkdir(const char *name, Bool_t recursive=kFALSE)
virtual Int_t Exec(const char *shellcmd)
virtual const char * BaseName(const char *pathname)
virtual TString GetFromPipe(const char *command)
virtual TBranch * GetBranch(const char *name)
TFile * GetCurrentFile() const
virtual void SetMakeClass(Int_t make)
virtual Long64_t GetEntries() const
virtual TTree * GetTree() const
Int_t SetBranchAddress(const char *bname, T **add, TBranch **ptr=nullptr)
TLine * line
ClassImp(TPyArg)