FairRoot
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
run_digi_reco_one.C
Go to the documentation of this file.
1 void run_digi_reco_one(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/testDiReOne_");
26  outFile = outFile + mcEngine + ".root";
27 
28  // ----- Timer --------------------------------------------------------
29  TStopwatch timer;
30 
31  // ----- Reconstruction run -------------------------------------------
32  FairRunAna* fRun = new FairRunAna();
33  TString inFile = Form("file://%s/data/testrun_%s_f%d.root", workDir.Data(), mcEngine.Data(), 0);
34  FairFileSource* fFileSource = new FairFileSource(inFile);
35  fRun->SetSource(fFileSource);
36 
37  fRun->SetSink(new FairRootFileSink(outFile));
38 
39  FairRuntimeDb* rtdb = fRun->GetRuntimeDb();
40  FairParRootFileIo* parInput1 = new FairParRootFileIo();
41 
42  TList* fnamelist = new TList();
43 
44  Int_t ifile = 0;
45  TString parFile = Form("%s/data/testpar_%s_f%d.root", workDir.Data(), mcEngine.Data(), ifile);
46 
47  cout << "PAR LIST CREATED" << endl;
48  // parInput1->open(fnamelist);
49  parInput1->open(parFile.Data());
50 
51  rtdb->setFirstInput(parInput1);
52 
54  fRun->AddTask(digiTask);
55 
57  fRun->AddTask(hitProducer);
58 
59  fRun->Init();
60 
61  timer.Start();
62  fRun->Run();
63 
64  // ----- Finish -------------------------------------------------------
65 
66  cout << endl << endl;
67 
68  // Extract the maximal used memory an add is as Dart measurement
69  // This line is filtered by CTest and the value send to CDash
70  FairSystemInfo sysInfo;
71  Float_t maxMemory = sysInfo.GetMaxMemory();
72  cout << "<DartMeasurement name=\"MaxMemory\" type=\"numeric/double\">";
73  cout << maxMemory;
74  cout << "</DartMeasurement>" << endl;
75 
76  timer.Stop();
77  Double_t rtime = timer.RealTime();
78  Double_t ctime = timer.CpuTime();
79 
80  Float_t cpuUsage = ctime / rtime;
81  cout << "<DartMeasurement name=\"CpuLoad\" type=\"numeric/double\">";
82  cout << cpuUsage;
83  cout << "</DartMeasurement>" << endl;
84 
85  cout << endl << endl;
86  cout << "Output file is " << outFile << endl;
87  cout << "Parameter file is " << parFile << endl;
88  cout << "Real time " << rtime << " s, CPU time " << ctime << "s" << endl << endl;
89  cout << "Macro finished successfully." << endl;
90 
91  // ------------------------------------------------------------------------
92 }
list of container factories
Definition: FairRuntimeDb.h:24
void Init()
Definition: FairRunAna.cxx:127
void run_digi_reco_one(TString mcEngine="TGeant3")
void Run(Int_t NStart=0, Int_t NStop=0)
Definition: FairRunAna.cxx:275
void SetSink(FairSink *tempSink)
Definition: FairRun.h:84
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)
virtual void SetSource(FairSource *tempSource)
Definition: FairRunAna.h:70
StepLogger logger
void SetLogVerbosityLevel(const char *verbosity)
Definition: FairLogger.h:87
Bool_t setFirstInput(FairParIo *)