FairRoot/PandaRoot
runFit.C
Go to the documentation of this file.
2 {
3  // ========================================================================
4  // Verbosity level (0=quiet, 1=event level, 2=track level, 3=debug)
5  Int_t iVerbose = 0;
6 
7  parFile = path+parFile;
8  DigiFile = path+DigiFile;
9  RecoFile = path+RecoFile;
10  outFile = path+outFile;
11 
12 
13  // ---- Load libraries -------------------------------------------------
14  gROOT->Macro("$VMCWORKDIR/gconfig/rootlogon.C");
15  // ------------------------------------------------------------------------
16  // Output file
17 
18  // ----- Timer --------------------------------------------------------
19  TStopwatch timer;
20  timer.Start();
21  // ------------------------------------------------------------------------
22 
23  // ----- Reconstruction run -------------------------------------------
24  FairRunAna *fRun= new FairRunAna();
25  // fRun->SetInputFile(MCFile);
26  fRun->SetInputFile(DigiFile);
27  fRun->AddFriend(RecoFile);
28 
29  fRun->SetOutputFile(outFile);
30  // ------------------------------------------------------------------------
31 
32 
33  // ----- Parameter database --------------------------------------------
34  FairRuntimeDb* rtdb = fRun->GetRuntimeDb();
35  FairParRootFileIo* parInput1 = new FairParRootFileIo(kTRUE);
36  parInput1->open(parFile.Data(),"UPDATE");
37  rtdb->setFirstInput(parInput1);
38 
39  // ----- Default MVD hit producer --------------------------------------------
40 
41  TtCracowTask *fit = new TtCracowTask();
42  fRun->AddTask(fit);
43 
44  rtdb->setOutput(parInput1);
45  rtdb->print();
46 
47  // ----- Intialise and run --------------------------------------------
48  fRun->Init();
49 
50  fRun->Run(0,0);
51  // ------------------------------------------------------------------------
52 
53  rtdb->saveOutput();
54  rtdb->print();
55 
56  // ----- Finish -------------------------------------------------------
57  timer.Stop();
58  Double_t rtime = timer.RealTime();
59  Double_t ctime = timer.CpuTime();
60  cout << endl << endl;
61  cout << "Macro finished succesfully." << endl;
62  cout << "Output file is " << outFile << endl;
63  cout << "Parameter file is " << parFile << endl;
64  cout << "Real time " << rtime << " s, CPU time " << ctime << " s" << endl;
65  cout << endl;
66  // ------------------------------------------------------------------------
67 
68  return 0;
69 
70 }
TString RecoFile
TString outFile
Definition: hit_dirc.C:17
FairRunAna * fRun
Definition: hit_dirc.C:58
TString DigiFile
Double_t
TString parFile
Definition: hit_dirc.C:14
TStopwatch timer
Definition: hit_dirc.C:51
FairRuntimeDb * rtdb
Definition: hit_dirc.C:66
int runFit(TString parFile, TString DigiFile, TString RecoFile, TString outFile, TString path)
Definition: runFit.C:1
FairParRootFileIo * parInput1
Definition: hit_dirc.C:67
Double_t ctime
Definition: hit_dirc.C:114
Int_t iVerbose
Double_t rtime
Definition: hit_dirc.C:113