FairRoot
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
run_digi_reco_proof.C
Go to the documentation of this file.
1 void run_digi_reco_proof(Int_t nofFiles, TString mcEngine = "TGeant3")
2 {
4  // logger->SetLogFileName("MyLog.log");
5  // logger->SetLogToScreen(kTRUE);
6  // logger->SetLogToFile(kTRUE);
7  logger->SetLogVerbosityLevel("LOW");
8  // logger->SetLogFileLevel("DEBUG4");
9  // logger->SetLogScreenLevel("DEBUG");
10 
11  TString workDir = gSystem->WorkingDirectory();
12 
13  // Verbosity level (0=quiet, 1=event level, 2=track level, 3=debug)
14  Int_t iVerbose = 0; // just forget about it, for the moment
15 
16  // Input file (MC events)
17  // TString inFile = "data/testrun_";
18  // inFile = inFile + mcEngine + ".root";
19 
20  // Parameter file
21  // TString parFile = "data/testparams_";
22  // parFile = parFile + mcEngine + ".root";
23 
24  // Output file
25  TString outFile = Form("data/testDiRePr_%df_", nofFiles);
26  if (nofFiles == 1)
27  outFile = "data/testDiRePr_";
28  outFile = outFile + mcEngine + ".root";
29 
30  // ----- Timer --------------------------------------------------------
31  TStopwatch timer;
32 
33  // ----- Reconstruction run -------------------------------------------
34  FairRunAnaProof* fRun = new FairRunAnaProof("workers=4");
35  TString inFile = Form("file://%s/data/testrun_%s_f%d.root", workDir.Data(), mcEngine.Data(), 0);
36  if (nofFiles == 1)
37  inFile = Form("file://%s/data/testrun_%s.root", workDir.Data(), mcEngine.Data());
38  FairFileSource* fFileSource = new FairFileSource(inFile);
39  fRun->SetSource(fFileSource);
40  for (Int_t ifile = 1; ifile < nofFiles; ifile++)
41  fFileSource->AddFile(Form("file://%s/data/testrun_%s_f%d.root", workDir.Data(), mcEngine.Data(), ifile));
42 
43  fRun->SetSink(new FairRootFileSink(outFile));
44  fRun->SetProofOutputStatus("merge");
45 
46  FairRuntimeDb* rtdb = fRun->GetRuntimeDb();
47  FairParRootFileIo* parInput1 = new FairParRootFileIo();
48 
49  TList* fnamelist = new TList();
50 
51  if (nofFiles == 1)
52  fnamelist->Add(new TObjString(Form("%s/data/testparams_%s.root", workDir.Data(), mcEngine.Data())));
53  else
54  for (Int_t ifile = 0; ifile < nofFiles; ifile++)
55  fnamelist->Add(new TObjString(Form("%s/data/testpar_%s_f%d.root", workDir.Data(), mcEngine.Data(), ifile)));
56 
57  cout << "PAR LIST CREATED" << endl;
58  parInput1->open(fnamelist);
59 
60  rtdb->setFirstInput(parInput1);
61 
63  fRun->AddTask(digiTask);
64 
66  fRun->AddTask(hitProducer);
67 
68  fRun->Init();
69 
70  cout << "... Init done" << endl;
71  timer.Start();
72  fRun->Run();
73 
74  // ----- Finish -------------------------------------------------------
75 
76  cout << endl << endl;
77 
78  // Extract the maximal used memory an add is as Dart measurement
79  // This line is filtered by CTest and the value send to CDash
80  FairSystemInfo sysInfo;
81  Float_t maxMemory = sysInfo.GetMaxMemory();
82  cout << "<DartMeasurement name=\"MaxMemory\" type=\"numeric/double\">";
83  cout << maxMemory;
84  cout << "</DartMeasurement>" << endl;
85 
86  timer.Stop();
87  Double_t rtime = timer.RealTime();
88  Double_t ctime = timer.CpuTime();
89 
90  Float_t cpuUsage = ctime / rtime;
91  cout << "<DartMeasurement name=\"CpuLoad\" type=\"numeric/double\">";
92  cout << cpuUsage;
93  cout << "</DartMeasurement>" << endl;
94 
95  cout << endl << endl;
96  cout << "Output file is " << outFile << endl;
97  cout << "Real time " << rtime << " s, CPU time " << ctime << "s" << endl << endl;
98  cout << "Macro finished successfully." << endl;
99 
100  // ------------------------------------------------------------------------
101 }
list of container factories
Definition: FairRuntimeDb.h:24
void run_digi_reco_proof(Int_t nofFiles, TString mcEngine="TGeant3")
void SetSink(FairSink *tempSink)
Definition: FairRun.h:84
void Run(Int_t NStart=0, Int_t NStop=0)
Float_t GetMaxMemory()
static FairLogger * GetLogger()
Definition: FairLogger.cxx:39
FairRuntimeDb * GetRuntimeDb(void)
Definition: FairRun.h:80
virtual void AddTask(FairTask *t)
Definition: FairRun.cxx:70
Bool_t open(const Text_t *fname, Option_t *option="READ", const Text_t *ftitle="", Int_t compress=1)
void SetProofOutputStatus(TString outStat)
StepLogger logger
void SetLogVerbosityLevel(const char *verbosity)
Definition: FairLogger.h:87
virtual void SetSource(FairSource *tempSource)
Bool_t setFirstInput(FairParIo *)