FairRoot/PandaRoot
lut/fillLut.C
Go to the documentation of this file.
1 int fillLut(Int_t nEvents = 0, TString inFile = "simlut.root", TString parFile1="parlut.root", TString lutFile = "luttab.root"){
2  // Verbosity level (0=quiet, 1=event level, 2=track level, 3=debug)
3  Int_t iVerbose = 0;
4 
5  // ----- Timer --------------------------------------------------------
6  TStopwatch timer;
7  timer.Start();
8 
9  // ----- Reconstruction run -------------------------------------------
10  FairRunAna *fRun= new FairRunAna();
11  fRun->SetInputFile(inFile);
12  //fRun->SetOutputFile(inFile+"_out");
13  fRun->SetOutputFile(inFile+"_digi.root");
14  fRun->SetUseFairLinks(kTRUE);
15 
16  // ----- Parameter database --------------------------------------------
17  FairRuntimeDb* rtdb = fRun->GetRuntimeDb();
18  FairParRootFileIo* parInput1 = new FairParRootFileIo();
19  parInput1->open(parFile1.Data());
20  rtdb->setFirstInput(parInput1);
21 
22  // ----- DRC Digitization stage ----------------------------------------
23  PndDrcDigiTask* drcdigi = new PndDrcDigiTask(iVerbose);
24  drcdigi->SetChargeSharing(kFALSE);
25  fRun->AddTask(drcdigi);
26 
27  // ----- Hit finder ----------------------------------------------------
28  PndDrcHitFinder* hitfind = new PndDrcHitFinder(iVerbose);
29  fRun->AddTask(hitfind);
30 
31  // ----- Fill look-up table --------------------------------------------
32  PndDrcLutFill* filllut = new PndDrcLutFill(iVerbose+1,lutFile);
33  fRun->AddTask(filllut);
34 
35  // ----- Intialise and run --------------------------------------------
36  fRun->Init();
37  fRun->Run(0,nEvents);
38 
39  // ----- Finish -------------------------------------------------------
40  timer.Stop();
41  Double_t rtime = timer.RealTime();
42  Double_t ctime = timer.CpuTime();
43  cout << endl << endl;
44  cout << "Macro finished succesfully." << endl;
45  cout << "Output file is " << inFile+"_out" << endl;
46  cout << "Parameter file is " << parFile1 << endl;
47  cout << "Real time " << rtime << " s, CPU time " << ctime << " s" << endl;
48  cout << endl;
49 
50  return 0;
51 }
void SetChargeSharing(Bool_t ct=0)
int fillLut(Int_t nEvents=0, TString inFile="simlut.root", TString parFile1="parlut.root", TString lutFile="luttab.root")
Definition: lut/fillLut.C:1
FairRunAna * fRun
Definition: hit_dirc.C:58
TString inFile
Definition: hit_dirc.C:8
PndDrcHitFinder * hitfind
Definition: hit_dirc.C:97
Double_t
PndDrcDigiTask * drcdigi
Definition: hit_dirc.C:91
Int_t nEvents
Definition: hit_dirc.C:11
TStopwatch timer
Definition: hit_dirc.C:51
FairRuntimeDb * rtdb
Definition: hit_dirc.C:66
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