FairRoot/PandaRoot
hit.C
Go to the documentation of this file.
1 int hit(Int_t nEvents = 0, TString inFile = "sim.root", TString parFile="par.root", TString inDigi = "digi.root", TString outFile = "hit.root", Int_t timeBased=0){
2  Int_t verbose = 0;
3 
4  // ----- Timer --------------------------------------------------------
5  TStopwatch timer;
6  timer.Start();
7 
8  // ----- Reconstruction run -------------------------------------------
9  FairRunAna *fRun= new FairRunAna();
10  fRun->SetGenerateRunInfo(kFALSE);
11  fRun->SetInputFile(inFile);
12  fRun->AddFriend(inDigi);
13  fRun->SetOutputFile(outFile);
14  fRun->SetUseFairLinks(kTRUE);
15  if(timeBased) fRun->RunWithTimeStamps();
16 
17  // ----- Parameter database --------------------------------------------
18  FairRuntimeDb* rtdb = fRun->GetRuntimeDb();
19  FairParRootFileIo* parInput = new FairParRootFileIo();
20 
21  if(parFile=="batch"){
22  TList* parlist = new TList();
23  for(Int_t i=0; i<4; i++) parlist->Add(new TObjString(Form("par_b%d.root",i)));
24  parInput->open(parlist);
25  }else{
26  parInput->open(parFile.Data());
27  }
28  rtdb->setFirstInput(parInput);
29 
30  // ----- DRC hit producer --------------------------------------------
32  fRun->AddTask(hitfind);
33 
34  // ----- Initialize and run -------------------------------------------
35  fRun->Init();
36  fRun->Run(0,nEvents);
37 
38  // ----- Finish -------------------------------------------------------
39  timer.Stop();
40  Double_t rtime = timer.RealTime();
41  Double_t ctime = timer.CpuTime();
42  cout << endl << endl;
43  cout << "Macro finished succesfully." << endl;
44  cout << "Output file is " << outFile << endl;
45  cout << "Parameter file is " << parFile << endl;
46  cout << "Real time " << rtime << " s, CPU time " << ctime << " s" << endl;
47  cout << endl;
48  return 0;
49 }
Int_t i
Definition: run_full.C:25
TString outFile
Definition: hit_dirc.C:17
#define verbose
TString inFile
Definition: hit_dirc.C:8
FairRunAna * fRun
Definition: hit_dirc.C:58
PndDrcHitFinder * hitfind
Definition: hit_dirc.C:97
Double_t
TString parFile
Definition: hit_dirc.C:14
Int_t nEvents
Definition: hit_dirc.C:11
TStopwatch timer
Definition: hit_dirc.C:51
FairRuntimeDb * rtdb
Definition: hit_dirc.C:66
Double_t ctime
Definition: hit_dirc.C:114
int hit(Int_t nEvents=0, TString inFile="sim.root", TString parFile="par.root", TString inDigi="digi.root", TString outFile="hit.root", Int_t timeBased=0)
Definition: hit.C:1
FairParAsciiFileIo * parInput
Double_t rtime
Definition: hit_dirc.C:113