KaliVeda
Toolkit for HIC analysis
KVDataAnalyser.cpp
1 /*
2 $Id: KVDataAnalyser.cpp,v 1.40 2009/01/14 16:15:46 franklan Exp $
3 $Revision: 1.40 $
4 $Date: 2009/01/14 16:15:46 $
5 $Author: franklan $
6 */
7 
8 #include "KVBase.h"
9 #include "KVDataAnalyser.h"
10 #include "KVDataAnalysisTask.h"
11 #include "KVDataSetManager.h"
12 #include "KVString.h"
13 #include "TObjString.h"
14 #include "TObjArray.h"
15 #include "Riostream.h"
16 #include "KVBatchSystemManager.h"
17 #include "TPluginManager.h"
18 #include "TSystemDirectory.h"
19 #include "TROOT.h"
20 #include "TClass.h"
21 #include "THashList.h"
22 #include "KVError.h"
23 
24 using namespace std;
26 
28 
29 KVDataAnalyser* gDataAnalyser = 0;
30 
31 
34 
36 {
37  //Default constructor.
38  fParent = nullptr;
39  fBatch = kFALSE;
40  fTask = nullptr;
41  fQuit = kFALSE;
42  fSubmit = kFALSE;
43  nbEventToRead = -1;
44  fUserClassIsOK = kFALSE;
45  if (!gBatchSystemManager) new KVBatchSystemManager;
46  fBatchSystem = 0;
47  fChoseRunMode = kFALSE;
48  fWorkDirInit = fWorkDirEnd = 0;
49  fMenus = kFALSE;
50 #ifdef WITH_CPP11
51  fProofMode = EProofMode::None;
52 #else
53  fProofMode = None;
54 #endif
55  fUseBaseClassSubmitTask = kFALSE;
56 }
57 
58 
59 
62 
63 KVDataAnalyser::~KVDataAnalyser()
64 {
65  //Default destructor.
66  SafeDelete(fWorkDirInit);
67  SafeDelete(fWorkDirEnd);
68  if (gDataAnalyser == this)gDataAnalyser = nullptr;
69 }
70 
71 
72 
74 
76 {
77  fDataType = "";
78  fTask = nullptr;
79  fQuit = kFALSE;
80  fSubmit = kFALSE;
81  fUserClassIsOK = kFALSE;
82  fUserClass.reset();
83  fUserClassOptions = "";
84  nbEventToRead = -1;
85  fBatchSystem = nullptr;
86  fChoseRunMode = kFALSE;
87 #ifdef WITH_CPP11
88  fProofMode = EProofMode::None;
89 #else
90  fProofMode = None;
91 #endif
92 }
93 
94 
95 
96 
99 
101 {
102  //Check all task variables, then run analyser
103 
104  fSubmit = kFALSE;
105  //print welcome message for main (parent) analyser
106  if (!fParent && !fMenus) KVBase::PrintSplashScreen();
107 
108  if (CheckTaskVariables()) {
109  if (fBatchSystem && !BatchMode()) {
110  //if batch mode is requested, the job is submitted to the chosen batch system
111  fBatchSystem->SubmitTask(this);
112  }
113  else {
114  if (BatchMode() && fBatchSystem && !fParent) fBatchSystem->Print("log");
115  if (!RunningInLaunchDirectory() && fParent) {
116  //when batch job runs in directory different to launch directory,
117  //we scan the list of files present in the current working directory
118  //just prior to running the analysis task
119  ScanWorkingDirectory(&fWorkDirInit);
120  }
121  if (!PreSubmitCheck()) return;
122 
123  // The following horrific kludge is supposed to solve the following problem:
124  // when running in batch mode (GridEngine) the data analyser created in
125  // KaliVedaAnalysis.cpp has to be of the right type (KVSimDirAnalyser or KVDataSetAnalyser)
126  // in order for it to read all necessary informations from the batch env file
127  // by calling the appropriate ReadBatchEnvFile override.
128  // However, when Run() is called for this object from KaliVedaAnalysis.cpp,
129  // we have to call the KVDataAnalyser::SubmitTask method, not the override in the
130  // derived class.
131  if (fUseBaseClassSubmitTask)
133  else
134  SubmitTask();
135 
136  if (!RunningInLaunchDirectory() && fParent) {
137  //when batch job runs in directory different to launch directory,
138  //we scan the list of files present in the current working directory
139  //just after running the analysis task
140  ScanWorkingDirectory(&fWorkDirEnd);
141  //any files which are present in the second list which were not present
142  //in the first list will be copied back to the launch directory
143  CopyAnalysisResultsToLaunchDirectory();
144  }
145  if (BatchMode() && fBatchSystem && !fParent) {
146  // at end of batch jobs,
147  // remove .[jobname] and [jobname].status files from $HOME directory
148  // remove .[jobname].bak and [jobname].status.bak files from $HOME directory
149  TString ff;
150  AssignAndDelete(ff, gSystem->ConcatFileName(gSystem->Getenv("HOME"), Form(".%s", GetBatchName())));
151  gSystem->Unlink(ff);
152  AssignAndDelete(ff, gSystem->ConcatFileName(gSystem->Getenv("HOME"), Form(".%s.bak", GetBatchName())));
153  gSystem->Unlink(ff);
154  AssignAndDelete(ff, gSystem->ConcatFileName(gSystem->Getenv("HOME"), Form("%s.status", GetBatchName())));
155  gSystem->Unlink(ff);
156  AssignAndDelete(ff, gSystem->ConcatFileName(gSystem->Getenv("HOME"), Form("%s.status.bak", GetBatchName())));
157  gSystem->Unlink(ff);
158  }
159  }
160  }
161  PostRunReset();
162 }
163 
164 
165 
166 
169 
171 {
172  //Run data analyser in menu-driven mode
173 
174  fMenus = kTRUE;
175  Reset();
177 
178  while (!fQuit) {
179  if (NeedToChooseWhatToDo())
180  ChooseWhatToDo();
181  else if (NeedToChooseWhatToAnalyse())
182  ChooseWhatToAnalyse();
183  else if (fSubmit) {
184  Run();
185  Reset();
187  }
188  }
189 }
190 
191 
192 
193 
198 
200 {
201  //Checks the task variables
202  //In batch mode, we first set the task variables by reading the
203  //batch env file associated with the name set for the batch job
204 
205  if (BatchMode()) ReadBatchEnvFile(Form(".%s", GetBatchName()));
206 
207  //if (!CheckWhatToAnalyseAndHow()) return kFALSE;
208 
209  if (fTask->WithUserClass() && fUserClass.name != ClassName()) {
210  //task requires user analysis class
211  if (fUserClass.name.IsNull()) {
212  if (BatchMode()) return kFALSE; // avoid infinite loop in batch mode
213  ChooseUserClass();
214  }
215 
216  if (!CheckIfUserClassIsValid(fUserClassAlternativeBaseClass)) {
217  cout << "============> Warning <=============" << endl;
218  cout << GetUserClassName() << " is not a valid " << fTask->GetUserBaseClass() << endl;
219  cout << "Analysis aborted." << endl;
220  cout << "====================================" << endl;
221  /*if (BatchMode())*/ return kFALSE; // avoid infinite loop in batch mode
222  //ChooseUserClass();
223  }
224  }
225 
226  if (nbEventToRead < 0) {
227  ChooseNbEventToRead();
228  }
229 
230  return kTRUE;
231 }
232 
233 
234 
236 
238 {
239  if (NeedToChooseWhatToDo()) {
240  return kFALSE;
241  }
242 
243  if (NeedToChooseWhatToAnalyse()) {
244  return kFALSE;
245  }
246  return kTRUE;
247 }
248 
249 
250 
251 
252 
253 
258 
260 {
261  //Set analysis task and data type
262  //For ways of obtaining pointers to data analysis tasks for any given dataset,
263  //see method KVDataSet::GetAnalysisTask(const Char_t* keywords) const.
264  fTask = at;
265  if (at)
266  fDataType = at->GetPrereq();
267  else
268  fDataType = "";
269 }
270 
271 
272 
273 
277 
279 {
280 // Add to the includes paths the user's includes paths
281 // the includes paths have to be separated by a white space
282 
283  fIncludes = "";
284  if (!incDirs) {
285  return;
286  }
287  TString tmp = incDirs;
288  TString curIncDir = gSystem->GetIncludePath();
289  TObjArray* oa = tmp.Tokenize(" ");
290  oa->SetOwner(kTRUE);
291  TIter next(oa);
292  TObjString* st = 0;
293  while ((st = (TObjString*)next())) {
294  TString id = st->GetString();
295  if (id.Length()) {
296  fIncludes += id.Data();
297  fIncludes += " ";
298  if (!curIncDir.Contains(id.Data())) {
299  cout << "Include path \"" << id.Data() << "\" added." << endl;
300  id.Prepend("-I");
301  gSystem->AddIncludePath(id.Data());
302  }
303  }
304  }
305  delete oa;
306 }
307 
308 
309 
310 
314 
316 {
317 // Load the user's libraries
318 // the libraries have to be separated by a white space
319 
320  fLibraries = "";
321  if (!libs) {
322  return;
323  }
324  KVString tmp = libs;
325  KVString slib = gSystem->GetLibraries("", "D");
326 
327  tmp.Begin(" ");
328  while (!tmp.End()) {
329 
330  KVString id = tmp.Next();
331 
332  Bool_t loaded = kFALSE;
333  slib.Begin(" ");
334  while (!slib.End() && !loaded) {
335  KVString ss = slib.Next();
336  if (ss == id) {
337  Info("SetUserLibraries", "%s already load", id.Data());
338  loaded = kTRUE;
339  }
340  else {
341  }
342  }
343  if (!loaded) {
344  Info("SetUserLibraries", "Library \"%s\"added.", id.Data());
345  gSystem->Load(id.Data());
346  }
347  fLibraries += id.Data();
348  fLibraries += " ";
349  }
350 
351 }
352 
353 
354 
355 
358 
360 {
361  // Ask user to set number of events to read
362 
363  SetNbEventToRead(-1);
364  while (nbEventToRead < 0) {
365  cout << "Give the number of events to read [<RET>=all]:" << endl;
366  KVString ntr;
367  ntr.ReadToDelim(cin);
368  if (ntr.IsDigit() || !ntr.Length()) {
369  if (ntr.Length()) {
370  nbEventToRead = (Long64_t) ntr.Atoi();
371  }
372  else {
373  nbEventToRead = 0;
374  }
375  }
376  else {
377  cout << "\"" << ntr.
378  Data() << "\" is not a number. Please retry." << endl;
379  }
380  }
381 }
382 
383 
384 
385 
389 
391 {
392  //Creates an instance of a class derived from KVDataAnalyser defined as a plugin
393 
394  //check and load plugin library
395  TPluginHandler* ph;
396  if (!(ph = KVBase::LoadPlugin("KVDataAnalyser", plugin)))
397  return 0;
398 
399  //execute constructor
400  KVDataAnalyser* da = (KVDataAnalyser*) ph->ExecPlugin(0);
401 
402  return da;
403 }
404 
405 
406 
407 
410 
412 {
413  //Choose the user's analysis class
414  fUserClass.name = "";
415  while (!fUserClass.name.Length()) {
416  cout << "Give the name of the analysis class derived from " << fTask->GetUserBaseClass() << ":" << endl;
417  fUserClass.name.ReadLine(cin);
418  fUserClassIsOK = kFALSE;
419  }
420 }
421 
422 
423 
424 
428 
430 {
431  // Check if files containing user's class can be located.
432  // The names of the implementation and header files are stored in fUserClassImp and fUserClassDec.
433 
434  return KVBase::FindClassSourceFiles(fUserClass.name,
435  fUserClass.imp_file, fUserClass.dec_file, fUserClass.dir_name);
436 }
437 
438 
439 
440 
457 
459 {
460  //Return kTRUE if the name of the class given by the user (fUserClass) is valid
461  //for the analysis task. This is so if one of the following is true:
462  // - the class library has already been loaded. In this case the class will exist
463  // in the dictionary (gROOT->GetClass()); we check if it derived from the
464  // base class defined for the analysis task
465  // - a plugin exists defining this class as an extension of the base class defined
466  // for the analysis task (gROOT->GetPluginManager()->FindHandler(...): the URI for
467  // the plugin must be the same as the name of the class)
468  // - source files for the class are present in the working directory. In this case
469  // we can add a plugin handler for the class.
470  //In the latter two cases, the class is valid if compilation succeeds.
471  //
472  //If the user's class may in fact be derived from an alternative base class, rather
473  //than the base class defined for this analysis task (see KVDataAnalysisTask::SetUserBaseClass)
474  //you can supply the name of this class (or a comma-separated list of base classes).
475 
476  TObject* o = GetInstanceOfUserClass(alternative_base_class);
477  if (o) {
478  delete o;
479  return kTRUE;
480  }
481  return kFALSE;
482 }
483 
484 
485 
486 
497 
499 {
500  // Returns string to be appended to name of user class for compilation with ACliC in
501  // GetInstanceOfUserClass. This depends on the boolean resources:
502  //
503  // KVDataAnalyser.UserClass.Debug: ( "yes" => "g" )
504  // KVDataAnalyser.UserClass.Optimise: ( "yes" => "O" )
505  // KVDataAnalyser.UserClass.ForceRecompile: ( "no" => "+"; "yes" => "++" )
506  //
507  // Note that if both Debug and Optimise are set to "yes/true", we use Debug mode.
508  // (can't have BOTH debug & optimisation).
509 
510  static TString aclic;
511  if (gEnv->GetValue("KVDataAnalyser.UserClass.ForceRecompile", kFALSE)) aclic = "++";
512  else aclic = "+";
513  if (gEnv->GetValue("KVDataAnalyser.UserClass.Debug", kFALSE)) aclic += "g";
514  else if (gEnv->GetValue("KVDataAnalyser.UserClass.Optimise", kFALSE)) aclic += "O";
515  return aclic.Data();
516 }
517 
518 
519 
521 
523 {
524  fBatchSystem = nullptr;
525 }
526 
527 
528 
529 
545 
547 {
548  //Return an instance of the class given by the user (fUserClass), if it is valid.
549  //If the user class is given in the form of source code, it will be (re)compiled
550  //if it has not already been loaded and/or the source has changed since the last
551  //build, using ACliC. If the resource
552  //
553  // KVDataAnalyser.UserClass.Debug: yes
554  //
555  //is set, the user's class will be compiled with extra debugging information
556  //
557  //Once compiled, we check that the user's class is indeed derived from the base
558  //class defined for this analysis task (see KVDataAnalysisTask::SetUserBaseClass).
559  //If the user's class may in fact be derived from an alternative base class, you
560  //can supply the name of this class (or comma-separated list of base classes).
561 
562  // make sure any required plugin library defining base class for user's analysis class is loaded
563  if (!fTask->CheckUserBaseClassIsLoaded()) return 0x0;
564 
565  //do we have a plugin ?
566  TPluginHandler* ph = gROOT->GetPluginManager()->FindHandler(fTask->GetUserBaseClass(), fUserClass.name);
567  if (!ph) {//no plugin defined
568 
569  //if it is a precompiled class (i.e. already part of KaliVeda),
570  //it will be in the dictionary already
571  TClass* cl = gROOT->GetClass(fUserClass.name);
572 
573  //do we have source files ?
574  if (DoUserClassFilesExist()) {
575  //compile & load user's source files using ACLIC. ACliC options read by GetACliCMode() from .kvrootrc
576  TString cmd;
577  cmd.Form(".L %s%s", fUserClass.full_path_imp().Data(), GetACliCMode());
578  gROOT->ProcessLine(cmd.Data());
579  //class will be in dictionary if compilation successful
580  cl = gROOT->GetClass(fUserClass.name);
581  }
582  else if (!cl) {
583  //class not in dictionary and no source files. help!
584  Info("GetInstanceOfUserClass", "Class %s is unknown and no source files available",
585  fUserClass.name.Data());
586  return 0;
587  }
588  if (!cl) {
589  //compilation of user class has failed
590  Info("GetInstanceOfUserClass", "Compilation of class %s failed. Correct the mistakes and try again",
591  fUserClass.name.Data());
592  return 0;
593  }
594  if (!cl->GetBaseClass(fTask->GetUserBaseClass())) {
595  // class does not inherit from base class defined by analysis task
596  if (alternative_base_class == "") { // no alternative base classes provided
597  Info("GetInstanceOfUserClass", "Class %s does not inherit from correct base class (%s), or compilation of class %s failed. Correct the mistakes and try again",
598  fUserClass.name.Data(), fTask->GetUserBaseClass(), fUserClass.name.Data());
599  return nullptr;
600  }
601  else {
602  // check alternative base class(es) - it may still be good!
603  bool got_good_base = false;
604  TString good_base = "";
605  alternative_base_class.Begin(",");
606  while (!alternative_base_class.End()) {
607  good_base = alternative_base_class.Next(kTRUE);
608  if (cl->GetBaseClass(good_base)) {
609  got_good_base = true;
610  break;
611  }
612  }
613  if (got_good_base) {
614  Info("GetInstanceOfUserClass", "Class %s inherits from alternative base class %s: OK!",
615  fUserClass.name.Data(), good_base.Data());
616  }
617  else {
618  Info("GetInstanceOfUserClass", "Class %s does not inherit from task-defined base class (%s) or any provided alternative base classes (%s), or compilation of class %s failed. Correct the mistakes and try again",
619  fUserClass.name.Data(), fTask->GetUserBaseClass(), alternative_base_class.Data(), fUserClass.name.Data());
620  return nullptr;
621  }
622  }
623  }
624  //EVERYTHING OK!! now instanciate an object of the new class
625  return (TObject*)cl->New();
626  }
627  else {
628  Info("GetInstanceOfUserClass", "Found plugin handler for class %s",
629  fUserClass.name.Data());
630  //load class from plugin
631  ph = KVBase::LoadPlugin(fTask->GetUserBaseClass(), fUserClass.name.Data());
632  if (!ph) {
633  Info("GetInstanceOfUserClass", "KVBase::LoadPlugin failed for %s", fUserClass.name.Data());
634  return 0;
635  }
636  TObject* obj = (TObject*)ph->ExecPlugin(0);
637  if (obj) {
638  //Info("GetInstanceOfUserClass", "constructor OK for %s", fUserClass.Data());
639  if (obj->InheritsFrom(fTask->GetUserBaseClass())) return obj;
640  Info("GetInstanceOfUserClass", "%s does not inherit from %s", fUserClass.name.Data(), fTask->GetUserBaseClass());
641  return 0;
642  }
643  else {
644  Info("GetInstanceOfUserClass", "constructor not OK for %s", fUserClass.name.Data());
645  return 0;
646  }
647  }
648  return 0;
649 }
650 
651 
652 
653 
658 
660 {
661  //Set name of user analysis class.
662  //If check=kTRUE (default), we check the validity of the class
663  //if check=kFALSE we do not check and assume that the class is valid
664 
665  fUserClass = kvs;
666  if (check) {
667  fUserClassIsOK = CheckIfUserClassIsValid();
668  }
669  else {
670  fUserClassIsOK = kTRUE;
671  }
672 }
673 
674 
675 
676 
682 
684 {
685  //Save (in the TEnv fBatchEnv) all necessary information on analysis task which can be used to execute it later
686  //(i.e. when batch processing system executes the job).
687  //If save=kTRUE (default), write the information in a file whose name is given by ".jobname"
688  //where 'jobname' is the name of the job as given to the batch system.
689 
690  OpenBatchInfoFile(Form(".%s", jobname.Data()));
691  if (fBatchSystem) {
692  fBatchEnv->SetValue("BatchSystem", fBatchSystem->GetName());
693  fBatchSystem->WriteBatchEnvFile(GetBatchInfoFile());
694  }
695  fBatchEnv->SetValue("AnalysisTask", fTask->GetType());
696 
697  if (fTask->WithUserClass()) {
698  fBatchEnv->SetValue("UserClass", GetUserClass().name);
699  if (!GetUserClass().with_files()) {
700  if (!DoUserClassFilesExist()) {
701  Warning("WriteBatchEnvFile", "Source files for user class %s do not exist. Job will not work.",
702  GetUserClass().name.Data());
703  }
704  }
705  if(!GetUserClass().dir_name.IsNull()) fBatchEnv->SetValue("UserClassDir", GetUserClass().dir_name);
706  fBatchEnv->SetValue("UserClassOptions", fUserClassOptions);
707  fBatchEnv->SetValue("UserClassImp", GetUserClass().imp_file);
708  fBatchEnv->SetValue("UserClassDec", GetUserClass().dec_file);
709  }
710  else {
711  // a task without a user class may still need to pass options to the predefined analysis class
712  if (fUserClassOptions != "") fBatchEnv->SetValue("UserClassOptions", fUserClassOptions);
713  }
714  fBatchEnv->SetValue("NbToRead", (Double_t)nbEventToRead);
715  fBatchEnv->SetValue("LaunchDirectory", gSystem->WorkingDirectory());
716  if (fIncludes.Length()) {
717  fBatchEnv->SetValue("UserIncludes", fIncludes.Data());
718  }
719  if (fLibraries.Length()) {
720  fBatchEnv->SetValue("UserLibraries", fLibraries.Data());
721  }
722 
723  if (save) fBatchEnv->SaveLevel(kEnvUser);
724 }
725 
726 
727 
728 
733 
735 {
736  //Read the batch env file "filename" and initialise the analysis task using the
737  //informations in the file
738  //Returns kTRUE if all goes well
739 
740  Bool_t ok = kFALSE;
741 
742  OpenBatchInfoFile(filename);
743 
744  if (!GetAnalysisTask()) {
745  // we only look for the analysis task here if it has not already been set -
746  // see KVDataSetAnalyser::ReadBatchEnvFile, where if the dataset modifies the
747  // title of the analysis task, only the required dataset can be used to set the task
748  KVString val = fBatchEnv->GetValue("AnalysisTask", "");
749  SetAnalysisTask(nullptr);
750  if (val != "") {
751  if (!gDataSetManager) {
752  gDataSetManager = new KVDataSetManager;
753  gDataSetManager->Init();
754  }
755  SetAnalysisTask(gDataSetManager->GetAnalysisTaskAny(val.Data()));
756  }
757  else {
758  Error("ReadBatchEnvFile", "Name of analysis task not given");
759  return ok;
760  }
761  if (!GetAnalysisTask()) {
762  Error("ReadBatchEnvFile", "Analysis task \"%s\"not found for dataset %s",
763  val.Data(), gDataSet->GetName());
764  return ok;
765  }
766  }
767 
768  nbEventToRead = (Long64_t)fBatchEnv->GetValue("NbToRead", -1);
769  SetUserIncludes(fBatchEnv->GetValue("UserIncludes", ""));
770  SetUserLibraries(fBatchEnv->GetValue("UserLibraries", ""));
771 
772  //batch system
773  if (strcmp(fBatchEnv->GetValue("BatchSystem", ""), "")) {
774  fBatchSystem = gBatchSystemManager->GetBatchSystem(fBatchEnv->GetValue("BatchSystem", ""));
775  fBatchSystem->ReadBatchEnvFile(GetBatchInfoFile());
776  fBatchSystem->cd(); // make gBatchSystem point to it
777  fBatchSystem->SetAnalyser(this);
778  }
779 
780  //User files
781  if (fTask->WithUserClass()) {
782  fUserClass.name = fBatchEnv->GetValue("UserClass", "");
783  if (fUserClass.name.IsNull()) {
784  Error("ReadBatchEnvFile", "Name of user class not given");
785  fBatchEnv->Print();
786  return ok;
787  }
788  fUserClassOptions = fBatchEnv->GetValue("UserClassOptions", "");
789  fUserClass.dir_name = fBatchEnv->GetValue("UserClassDir", "");
790  fUserClass.imp_file = fBatchEnv->GetValue("UserClassImp", "");
791  if (fUserClass.imp_file.IsNull()) {
792  Error("ReadBatchEnvFile", "Name of user class implementation file not given");
793  return ok;
794  }
795  fUserClass.dec_file = fBatchEnv->GetValue("UserClassDec", "");
796  if (fUserClass.dec_file.IsNull()) {
797  Error("ReadBatchEnvFile", "Name of user class header file not given");
798  return ok;
799  }
800  fUserClassAlternativeBaseClass = fBatchEnv->GetValue("UserClassAlternativeBaseClass", "");
801 
802  //If current working directory is not the same as the launch directory,
803  //we have to copy the user's files here
804  if (!RunningInLaunchDirectory()) {
805  TString launchDir = fBatchEnv->GetValue("LaunchDirectory", gSystem->WorkingDirectory());
806  TString path_src, path_trg;
807  //copy user's implementation file
808  AssignAndDelete(path_trg, gSystem->ConcatFileName(gSystem->WorkingDirectory(), fUserClass.imp_file.Data()));
809  gSystem->CopyFile(fUserClass.full_path_imp(), path_trg);
810  //copy user's header file
811  AssignAndDelete(path_trg, gSystem->ConcatFileName(gSystem->WorkingDirectory(), fUserClass.dec_file.Data()));
812  gSystem->CopyFile(fUserClass.full_path_dec(), path_trg);
813  // change directory stored in UserClass
814  fUserClass.dir_name = ".";
815  }
816  }
817  else {
818  // a task without a user class may still need to pass options to the predefined analysis class
819  fUserClassOptions = fBatchEnv->GetValue("UserClassOptions", "");
820  }
821 
822  ok = kTRUE;
823 
824  return ok;
825 }
826 
827 
828 
829 
833 
835 {
836  //Returns kTRUE if current working directory is same as launch directory for batch job
837  //When not in batch mode, always returns kTRUE.
838  if (!BatchMode() || !fBatchEnv) return kTRUE;
839  TString launchDir = fBatchEnv->GetValue("LaunchDirectory", gSystem->WorkingDirectory());
840  return (launchDir == gSystem->WorkingDirectory());
841 }
842 
843 
844 
845 
847 
849 {
850  the_analyser->SetParent(this);
851  the_analyser->SetAnalysisTask(fTask);
852  the_analyser->SetNbEventToRead(GetNbEventToRead());
853  the_analyser->SetUserIncludes(fIncludes.Data());
854  the_analyser->SetUserLibraries(fLibraries.Data());
855 }
856 
857 
858 
864 
866 {
867  //In interactive mode, the data analysis task is performed by
868  //instanciating and initialising the KVDataAnalyser child class specified by the task,
869  //and then calling its Run() method.
870  //In batch mode, the job is submitted to the chosen batch system.
871 
872  KVString task_data_analyser = fTask->GetDataAnalyser();
873  Info("SubmitTask", "fTask->GetDataAnalyser()=%s", task_data_analyser.Data());
874  unique_ptr<KVDataAnalyser> the_analyser;
875  if (task_data_analyser == "UserClass") {
876  //the user-provided class is to be used as analyser
877  the_analyser.reset((KVDataAnalyser*)GetInstanceOfUserClass());
878  }
879  else {
880  the_analyser.reset(GetAnalyser(fTask->GetDataAnalyser()));
881  }
882  if (!the_analyser.get())
883  Fatal("SubmitTask", "the_analyser is 0x0, go to crash");
884 
885  set_up_analyser_for_task(the_analyser.get());
886 
887  if (fTask->WithUserClass()) {
888  the_analyser->SetUserClass(GetUserClass(), kFALSE);
889  the_analyser->SetUserClassOptions(fUserClassOptions);
890  }
891  else if (strcmp(fTask->GetUserBaseClass(), ""))
892  the_analyser->SetUserClass({fTask->GetUserBaseClass()}, kFALSE);
893  if (!BatchMode()) {
894  //when not in batch mode i.e. when submitting a task, we ask the user to supply
895  //any further information required by the task, and then ask whether to run in
896  //interactive or batch mode
897  the_analyser->CheckTaskVariables();
898  if (!fChoseRunMode) ChooseRunningMode();
899  }
900  the_analyser->SetBatchMode(BatchMode());
901  the_analyser->SetBatchName(GetBatchName());
902  the_analyser->SetBatchSystem(fBatchSystem);
903  the_analyser->SetProofMode(GetProofMode());
904  //set global pointer to analyser object which performs the analysis
905  //this allows e.g. user class to obtain information on the analysis task
906  gDataAnalyser = the_analyser.get();
907  the_analyser->Run();
908 }
909 
910 
911 
912 
919 
921 {
922  //Replace any 'special' symbols in "format" with their current values
923  //
924  // $Date : current date and time
925  // $User : name of user
926  // $UserClass : name of user's analysis class
927 
928  KVString tmp = format;
929  TDatime now;
930  KVString stDate = now.AsSQLString();
931  stDate.ReplaceAll(" ", "-");
932  tmp.ReplaceAll("$Date", stDate.Data());
933  if (fUserClass.name.Length()) tmp.ReplaceAll("$UserClass", fUserClass.name);
934  else if (fTask) tmp.ReplaceAll("$UserClass", fTask->GetDataAnalyser());
935  tmp.ReplaceAll("$User", gSystem->GetUserInfo()->fUser.Data());
936  return tmp;
937 }
938 
939 
940 
942 
944 {
945  static TString keywords = "Will be expanded: $Date, $User, $UserClass";
946  return keywords;
947 }
948 
949 
950 
951 
952 
953 
957 
959 {
960  // Returns full path to job submission directory for batch jobs.
961  // Returns current working directory for non-batch jobs.
962 
963  if (!BatchMode() || !fBatchEnv) return gSystem->WorkingDirectory();
964  return fBatchEnv->GetValue("LaunchDirectory", gSystem->WorkingDirectory());
965 }
966 
967 
968 
975 
977 {
978  // Use this method to get the full path to a file in the directory where the job was launched.
979  //
980  // When not using a batch system, this will just be the current working directory.
981  //
982  // If the job is actually running elsewhere, use this method to access a file in the launch directory.
983 
984  TString fullpath;
985  AssignAndDelete(fullpath, gSystem->ConcatFileName(GetLaunchDirectory(), f.Data()));
986  return fullpath;
987 }
988 
989 
990 
993 
995 {
996  // Returns full path to file used to store status of running batch jobs
997 
998  if (!BatchMode() || !fBatchEnv) return "";
999 
1000  static TString filename = "";
1001  TString statfile;
1002  statfile.Form("%s.status", gBatchSystem->GetJobName());
1003 
1004  TString launchDir = GetLaunchDirectory();
1005  AssignAndDelete(filename, gSystem->ConcatFileName(launchDir.Data(), statfile.Data()));
1006  return filename;
1007 }
1008 
1009 
1010 
1013 
1015 {
1016  // Update infos in batch status file
1017 
1018  if (!BatchMode() || !fBatchEnv) return;
1019 
1020  TEnv stats(GetBatchStatusFileName());
1021  stats.SetValue("TotalEvents", totev);
1022  stats.SetValue("EventsRead", evread);
1023  disk.Remove(TString::kTrailing, '\t');
1024  disk.Remove(TString::kTrailing, ' ');
1025  disk.Remove(TString::kTrailing, '\t');
1026  stats.SetValue("DiskUsed", disk.Data());
1027  stats.SaveLevel(kEnvLocal);
1028 }
1029 
1030 
1031 
1034 
1036 {
1037  // Delete batch status file (and backup - '.bak') for batch job
1038 
1039  if (!BatchMode() || !fBatchEnv) return;
1040  TString stats = GetBatchStatusFileName();
1041  gSystem->Unlink(stats);
1042  stats += ".bak";
1043  gSystem->Unlink(stats);
1044 }
1045 
1046 
1047 
1051 
1053 {
1054  // Returns kTRUE if the number of events coincides with the interval
1055  // set for status updates for the current data analysis task
1056  return (!(nevents % fTask->GetStatusUpdateInterval()) && nevents);
1057 }
1058 
1059 
1060 
1063 
1065 {
1066  // Print infos on events treated, disk usage, memory usage
1067 
1068  cout << " +++ " << nevents << " events processed +++ " << endl;
1069  ProcInfo_t pid;
1070  if (gSystem->GetProcInfo(&pid) == 0) {
1071  cout << " ------------- Process infos -------------" << endl;
1072  printf(" CpuSys = %f s. CpuUser = %f s. ResMem = %f MB VirtMem = %f MB\n",
1073  pid.fCpuSys, pid.fCpuUser, pid.fMemResident / 1024.,
1074  pid.fMemVirtual / 1024.);
1075  }
1076 }
1077 
1078 
1079 
1080 
1085 
1087 {
1088  //Ask user to choose between immediate or batch execution
1089  //If the choice is batch, we ask to choose a batch system and whether or not
1090  //to use the "multijobs" mode
1091 
1092  fChoseRunMode = kTRUE;
1093  KVString tmp;
1094  do {
1095  cout << endl << "Run in Interactive or Batch mode (I or B) ? : ";
1096  tmp.ReadLine(cin);
1097  }
1098  while (tmp != "i" && tmp != "I" && tmp != "b" && tmp != "B");
1099  tmp.ToUpper();
1100  //interactive mode - no more to do
1101  if (tmp == "I") {
1102  fBatchSystem = 0;
1103  return;
1104  }
1105  cout << endl << "Choose the batch system to use : " << endl;
1106  gBatchSystemManager->Print();
1107  do {
1108  cout << "(enter a number) : " << endl;
1109  tmp.ReadLine(cin);
1110  }
1111  while (!tmp.IsDigit());
1112  fBatchSystem = gBatchSystemManager->GetBatchSystem(tmp.Atoi());
1113  fBatchSystem->Clear();
1114 }
1115 
1116 
1117 
1118 
1122 
1124 {
1125  //Fill TList with list of files in current working directory.
1126  //If ls!=0 it is deleted beforehand
1127  if (*ls) delete (*ls);
1128  TSystemDirectory dir("LocDir", gSystem->WorkingDirectory());
1129  (*ls) = dir.GetListOfFiles();
1130 }
1131 
1132 
1133 
1134 
1139 
1141 {
1142  //Compare the two lists of files in the current working directory, before and after analysis;
1143  //and copy any files which were created during the analysis to the launch directory.
1144  //Files with the same names in the launch directory will be overwritten if they exist.
1145 
1146  if (!fWorkDirInit || !fWorkDirEnd) return;
1147  TString launchDir = fBatchEnv->GetValue("LaunchDirectory", gSystem->WorkingDirectory());
1148  TIter next_new_file(fWorkDirEnd);
1149  TObject* file;
1150  while ((file = next_new_file())) {
1151  if (!fWorkDirInit->FindObject(file->GetName())) {
1152  TString fname;
1153  fname.Form("%s", file->GetName());
1154  //ajout d une condition pour eviter le transfert des file*.so generes par les KVParticleCondition
1155  //et aussi les .d generes par les KVParticleCondition
1156  if (!(fname.BeginsWith("KVParticleCondition_") || fname.EndsWith(".so") || fname.EndsWith(".d") || fname.EndsWith(".pcm") || fname.EndsWith(".bak"))) {
1157  TString path_src, path_trg;
1158  AssignAndDelete(path_trg, gSystem->ConcatFileName(launchDir.Data(), file->GetName()));
1160  file->GetName()));
1161  Info("CopyAnalysisResultsToLaunchDirectory", "Copying analysis results file :\n%s ---> %s",
1162  path_src.Data(), path_trg.Data());
1163  //copy & overwrite any existing file in launch directory
1164  if (gSystem->CopyFile(path_src.Data(), path_trg.Data(), kTRUE) == 0) {
1165  Info("CopyAnalysisResultsToLaunchDirectory", "File copied correctly");
1166  }
1167  else {
1168  Info("CopyAnalysisResultsToLaunchDirectory", " **** ERROR copying file !!! ");
1169  }
1170  }
1171  }
1172  }
1173 }
1174 
1175 
1176 
1177 
1182 
1184 {
1185  // Store lots of useful information about the current version of KaliVeda,
1186  // ROOT, etc. etc. in a TEnv object which will be added to the TTree's
1187  // list of user infos (TTree::GetUserInfo).
1188 
1189  tt->GetUserInfo()->Add(new TEnv());
1190  TEnv* kvenv = (TEnv*)tt->GetUserInfo()->FindObject("TEnv");
1191 
1192 //----
1193  THashList* hh = gEnv->GetTable();
1194  KVString tamp;
1195  for (Int_t kk = 0; kk < hh->GetEntries(); kk += 1) {
1196  tamp.Form("%s", hh->At(kk)->GetName());
1197  if (tamp.BeginsWith("Plugin.")) {}
1198  else kvenv->SetValue(hh->At(kk)->GetName(), ((TEnvRec*)hh->At(kk))->GetValue(), kEnvUser);
1199  }
1200 
1201  kvenv->SetValue("KVBase::GetKVVersion()", KVBase::GetKVVersion(), kEnvUser);
1202  kvenv->SetValue("KVBase::GetKVBuildDate()", KVBase::GetKVBuildDate(), kEnvUser);
1203  kvenv->SetValue("KVBase::GetKVBuildUser()", KVBase::GetKVBuildUser(), kEnvUser);
1204  kvenv->SetValue("KVBase::GetKVSourceDir()", KVBase::GetKVSourceDir(), kEnvUser);
1205 
1206 #ifdef WITH_GIT_INFOS
1207  kvenv->SetValue("KVBase::gitBranch()", KVBase::gitBranch(), kEnvUser);
1208  kvenv->SetValue("KVBase::gitCommit()", KVBase::gitCommit(), kEnvUser);
1209 #endif
1210 
1211  kvenv->SetValue("gROOT->GetVersion()", gROOT->GetVersion(), kEnvUser);
1212 
1213  kvenv->SetValue("gSystem->GetBuildArch()", gSystem->GetBuildArch(), kEnvUser);
1214  kvenv->SetValue("gSystem->GetBuildCompiler()", gSystem->GetBuildCompiler(), kEnvUser);
1215  kvenv->SetValue("gSystem->GetBuildCompilerVersion()", gSystem->GetBuildCompilerVersion(), kEnvUser);
1216  kvenv->SetValue("gSystem->GetBuildNode()", gSystem->GetBuildNode(), kEnvUser);
1217  kvenv->SetValue("gSystem->GetBuildDir()", gSystem->GetBuildDir(), kEnvUser);
1218 
1219  kvenv->SetValue("gSystem->GetUserInfo()->fUser", gSystem->GetUserInfo()->fUser, kEnvUser);
1220  kvenv->SetValue("gSystem->HostName()", gSystem->HostName(), kEnvUser);
1221 
1222  if (fBatchEnv) {
1223  THashList* hh = fBatchEnv->GetTable();
1224  for (Int_t kk = 0; kk < hh->GetEntries(); kk += 1) {
1225  tamp.Form("%s", hh->At(kk)->GetName());
1226  if (!strcmp(kvenv->GetValue(hh->At(kk)->GetName(), "rien"), "rien"))
1227  kvenv->SetValue(hh->At(kk)->GetName(), ((TEnvRec*)hh->At(kk))->GetValue(), kEnvUser);
1228  }
1229  }
1230 
1231 
1232 }
1233 
1234 
1235 
1241 
1243 {
1244  //Set up and run data analysis task.
1245  //This allows to choose a dataset and a data analysis task and then execute the task or submit a batch job.
1246  //The behaviour of the data analyser object (base class KVDataAnalyser) can be modified by choosing
1247  //a plugin class corresponding to one of the plugins defined in $KVROOT/KVFiles/.kvrootrc.
1248 
1249  KVDataAnalyser* datan = 0;
1250  TString tmp(uri);
1251  if (tmp != "") {
1252  //got plugin ?
1253  TPluginHandler* ph = KVBase::LoadPlugin("KVDataAnalyser", uri);
1254  if (!ph)
1255  ::Warning("KVDataAnalyser::RunAnalyser", "No plugin %s found for KVDataAnalyser",
1256  uri);
1257  else
1258  datan = (KVDataAnalyser*) ph->ExecPlugin(0);
1259  }
1260  if (datan == 0)
1261  datan = new KVDataAnalyser;
1262  datan->RunMenus();
1263  delete datan;
1264 }
1265 
1266 
1267 
1272 
1274 {
1275  // Static method KVDataAnalyser::IsRunningBatchAnalysis()
1276  // Returns kTRUE if an analysis task is being performed in batch mode
1277  // Returns kFALSE if no analysis task is in interactive mode, or no analysis task running
1278 
1279  if (gDataAnalyser) return (gDataAnalyser->BatchMode() && gDataAnalyser->fBatchSystem);
1280  return kFALSE;
1281 }
1282 
1283 
1284 
1290 
1292 {
1293  // Create a KVNameValueList called "JobDescriptionList" and add it to
1294  // the TList. The parameters in the list describe the properties of the
1295  // current job. The TList pointer could be, for example, the address of
1296  // the TSelector::fInput list used by PROOF.
1297 
1298  KVNameValueList* jdl = new KVNameValueList("JobDescriptionList", "Job parameters");
1299 
1300  jdl->SetValue("AnalysisTask", fTask->GetType());
1301  jdl->SetValue("PROOFMode", GetProofMode());
1302 
1303  l->Add(jdl);
1304 }
1305 
1306 
1307 
1310 
1312 {
1313  // TO IMPLEMENT ?
1314 }
1315 
1316 
1317 
1320 
1322 {
1323  // TO IMPLEMENT ?
1324 }
1325 
1326 
1327 
1329 
1330 KVString KVDataAnalyser::UserClass::get_full_path(const KVString& file_name, const KVString& other_dir) const
1331 {
1332  KVString path;
1333  KVString dir = other_dir.IsNull() ? dir_name : other_dir;
1334  if(!dir.IsNull()) AssignAndDelete(path, gSystem->ConcatFileName(dir.Data(), file_name.Data()));
1335  return path;
1336 }
1337 
1338 
int Int_t
#define SafeDelete(p)
#define f(i)
bool Bool_t
char Char_t
constexpr Bool_t kFALSE
double Double_t
constexpr Bool_t kTRUE
R__EXTERN TEnv * gEnv
kEnvUser
kEnvLocal
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 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 Pixmap_t Pixmap_t PictureAttributes_t attr const char char ret_data h unsigned char height h Atom_t Int_t ULong_t ULong_t unsigned char prop_list Atom_t Atom_t Atom_t Time_t format
char name[80]
#define gROOT
char * Form(const char *fmt,...)
void AssignAndDelete(TString &target, char *tobedeleted)
R__EXTERN TSystem * gSystem
static const Char_t * GetKVBuildDate()
Returns KaliVeda build date.
Definition: KVBase.cpp:877
static const Char_t * gitCommit()
Returns last git commit of sources.
Definition: KVBase.cpp:947
static const Char_t * GetKVBuildUser()
Returns username of person who performed build.
Definition: KVBase.cpp:865
static const Char_t * gitBranch()
Returns git branch of sources.
Definition: KVBase.cpp:936
static Bool_t FindClassSourceFiles(const KVString &class_name, KVString &imp_file, KVString &dec_file, const KVString &dir_name=".")
Definition: KVBase.cpp:1072
static const Char_t * GetKVSourceDir()
Returns top-level directory of source tree used for build.
Definition: KVBase.cpp:912
static void PrintSplashScreen()
Prints welcome message and infos on version etc.
Definition: KVBase.cpp:1561
static TPluginHandler * LoadPlugin(const Char_t *base, const Char_t *uri="0")
Definition: KVBase.cpp:772
static const Char_t * GetKVVersion()
Returns KaliVeda version string.
Definition: KVBase.cpp:853
Handles list of all available batch systems for processing non-interactive data analysis tasks.
void Print(Option_t *opt="") const
KVBatchSystem * GetBatchSystem(const Char_t *name)
Get batch system by name.
void Clear(Option_t *opt="") override
virtual const Char_t * GetJobName() const
virtual void ReadBatchEnvFile(TEnv *)
Manager class which sets up and runs data analysis tasks.
const Char_t * GetACliCMode()
void DoStatusUpdate(Long64_t nevents) const
Print infos on events treated, disk usage, memory usage.
virtual TString ExpandAutoBatchName(const Char_t *format) const
void SetParent(KVDataAnalyser *da)
virtual void PostRunReset()
virtual void Run()
Check all task variables, then run analyser.
virtual void Reset()
virtual void AddJobDescriptionList(TList *)
virtual void WriteBatchEnvFile(const TString &, Bool_t sav=kTRUE)
void ChooseNbEventToRead()
Ask user to set number of events to read.
Bool_t RunningInLaunchDirectory()
void SetUserLibraries(const Char_t *libs=0)
virtual Bool_t CheckIfUserClassIsValid(const KVString &alternative_base_class="")
TString GetPathToFileInLaunchDirectory(const TString &) const
void WriteBatchInfo(TTree *)
virtual void RunMenus()
Run data analyser in menu-driven mode.
virtual Bool_t CheckTaskVariables()
Bool_t DoUserClassFilesExist()
const Char_t * GetLaunchDirectory() const
void SetAnalysisTask(KVDataAnalysisTask *at)
virtual const Char_t * GetRecognisedAutoBatchNameKeywords() const
virtual void set_up_analyser_for_task(KVDataAnalyser *the_analyser)
virtual Bool_t CheckStatusUpdateInterval(Long64_t nevents) const
virtual Bool_t CheckWhatToAnalyseAndHow()
virtual void SubmitTask()
void SetUserClass(const UserClass &kvs, Bool_t check=kTRUE)
const Char_t * GetBatchStatusFileName() const
Returns full path to file used to store status of running batch jobs.
virtual void ChooseWhatToAnalyse()
TO IMPLEMENT ?
KVDataAnalyser()
Default constructor.
static Bool_t fCleanAbort
flag to force abort of processing
static KVDataAnalyser * GetAnalyser(const Char_t *plugin)
static Bool_t IsRunningBatchAnalysis()
static void RunAnalyser(const Char_t *plugin="")
void ScanWorkingDirectory(TList **)
void ChooseUserClass()
Choose the user's analysis class.
void CopyAnalysisResultsToLaunchDirectory()
virtual Bool_t ReadBatchEnvFile(const TString &)
void DeleteBatchStatusFile() const
Delete batch status file (and backup - '.bak') for batch job.
void SetUserIncludes(const Char_t *incDirs=0)
virtual void ChooseWhatToDo()
TO IMPLEMENT ?
Bool_t BatchMode() const
void UpdateBatchStatusFile(Int_t totev, Int_t evread, TString disk) const
Update infos in batch status file.
KVBatchSystem * fBatchSystem
batch system to use for submission of job
TObject * GetInstanceOfUserClass(const KVString &alternative_base_class="")
void SetNbEventToRead(Long64_t nb=0)
Define and manage data analysis tasks.
virtual const Char_t * GetPrereq() const
Manage all datasets contained in a given data repository.
virtual Bool_t Init(KVDataRepository *=0)
KVDataAnalysisTask * GetAnalysisTaskAny(const Char_t *keywords) const
Handles lists of named parameters with different types, a list of KVNamedParameter objects.
void SetValue(const Char_t *name, value_type value)
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 Int_t GetEntries() const
virtual void SetOwner(Bool_t enable=kTRUE)
const char * AsSQLString() const
THashList * GetTable() const
virtual const char * GetValue(const char *name, const char *dflt) const
virtual void SetValue(const char *name, const char *value, EEnvLevel level=kEnvChange, const char *type=nullptr)
virtual void SaveLevel(EEnvLevel level)
TObject * At(Int_t idx) const override
const char * GetName() const override
const TString & GetString() const
virtual const char * GetName() const
virtual Bool_t InheritsFrom(const char *classname) const
Longptr_t ExecPlugin(int nargs)
Ssiz_t Length() const
Int_t Atoi() const
std::istream & ReadToDelim(std::istream &str, char delim='\n')
Bool_t EndsWith(const char *pat, ECaseCompare cmp=kExact) const
const char * Data() const
Bool_t IsDigit() const
void ToUpper()
TObjArray * Tokenize(const TString &delim) const
Bool_t BeginsWith(const char *s, ECaseCompare cmp=kExact) const
Bool_t IsNull() const
void Form(const char *fmt,...)
TString & Remove(EStripType s, char c)
Bool_t Contains(const char *pat, ECaseCompare cmp=kExact) const
TString & ReplaceAll(const char *s1, const char *s2)
std::istream & ReadLine(std::istream &str, Bool_t skipWhite=kTRUE)
virtual TList * GetListOfFiles() const
virtual const char * GetBuildNode() const
virtual const char * GetBuildCompilerVersion() const
virtual const char * GetBuildDir() const
virtual void AddIncludePath(const char *includePath)
virtual int CopyFile(const char *from, const char *to, Bool_t overwrite=kFALSE)
virtual const char * Getenv(const char *env)
virtual const char * GetIncludePath()
virtual char * ConcatFileName(const char *dir, const char *name)
virtual int Load(const char *module, const char *entry="", Bool_t system=kFALSE)
virtual UserGroup_t * GetUserInfo(const char *user=nullptr)
virtual int GetProcInfo(ProcInfo_t *info) const
virtual const char * HostName()
virtual const char * WorkingDirectory()
virtual const char * GetBuildCompiler() const
virtual const char * GetLibraries(const char *regexp="", const char *option="", Bool_t isRegexp=kTRUE)
virtual const char * GetBuildArch() const
virtual int Unlink(const char *name)
long long Long64_t
RooCmdArg ClassName(const char *name)
tuple file_name
void Error(const char *location, const char *fmt,...)
void Info(const char *location, const char *fmt,...)
void Fatal(const char *location, const char *fmt,...)
void Warning(const char *location, const char *fmt,...)
RooCmdArg BatchMode(std::string const &batchMode)
KVString get_full_path(const KVString &, const KVString &="") const
Long_t fMemVirtual
Float_t fCpuSys
Long_t fMemResident
Float_t fCpuUser
TString fUser
TLine l
auto * tt
ClassImp(TPyArg)