FairRoot/PandaRoot
rungenfit.C
Go to the documentation of this file.
1 {
2 
3  // ========================================================================
4  // Verbosity level (0=quiet, 1=event level, 2=track level, 3=debug)
5  Int_t iVerbose = 1;
6 
7  // Number of events to process
8  Int_t nEvents = 0; // process all events in input file
9 
10  // Output file
11  TString outFile = "testgenfit.root";
12 
13  TString inFile = "testrun.root";
14  TString inFile2 = "testdigi.root";
15  TString inFile3 = "testreco.root";
16  TString parFile = "testparams.root";
17 
18 // // ---- Load libraries -------------------------------------------------
19 // gROOT->LoadMacro("$VMCWORKDIR/gconfig/rootlogon.C");
20 // rootlogon();
21 // // ------------------------------------------------------------------------
22 
23  // ----- Timer --------------------------------------------------------
24  TStopwatch timer;
25  timer.Start();
26  // ------------------------------------------------------------------------
27 
28  // ----- Reco run -------------------------------------------
29  FairRunAna *fRun= new FairRunAna();
30  fRun->SetInputFile(inFile);
31  fRun->SetOutputFile(outFile);
32  fRun->AddFriend(inFile2);
33  fRun->AddFriend(inFile3);
34 
35  // ----- Prepare GEANE --------------------------------------------
36  // this will load Geant3 and execute setup macros to initialize geometry:
37  FairGeane *Geane = new FairGeane();
38  fRun->AddTask(Geane);
39  // ------------------------------------------------------------------------
40 
41  // ------------------------------------------------------------------------
42  // ----- Parameter database --------------------------------------------
43  FairRuntimeDb* rtdb = fRun->GetRuntimeDb();
44  FairParRootFileIo* parInput1 = new FairParRootFileIo();
45  parInput1->open(parFile.Data());
46  rtdb->setFirstInput(parInput1);
47 
48  // ------------------------------------------------------------------------
49  // ----- Reco Sequence --------------------------------------------
50  int whichhit = 2; // 1 = use hit; 2 = use helixhit
51 
52  if(whichhit == 1){
53  // use hit
54  PndSttPatternRecoTask* STTPR = new PndSttPatternRecoTask(iVerbose);
55  }
56  else if(whichhit == 2){
57  // use helixhit
58  PndSttPatternRecoTask2* STTPR = new PndSttPatternRecoTask2(iVerbose);
59  }
60 
61  fRun->AddTask(STTPR);
62 
63  if(whichhit == 1){
64  // use hit
65  PndSttKalmanTask* RecoHitPro = new PndSttKalmanTask();
66  }
67  else if(whichhit == 2){
68  // use helixhit
69  PndSttKalmanTask2*RecoHitPro = new PndSttKalmanTask2();
70  }
71 
72  fRun->AddTask(RecoHitPro);
73 
74  // ----- Intialise and run --------------------------------------------
75  fRun->Init();
76 
77  rtdb->print();
78 
79  fRun->Run(0,nEvents);
80 
81  // ------------------------------------------------------------------------
82  // ----- Finish -------------------------------------------------------
83  timer.Stop();
84  Double_t rtime = timer.RealTime();
85  Double_t ctime = timer.CpuTime();
86  cout << endl << endl;
87  cout << "Macro finished succesfully." << endl;
88  cout << "Output file is " << outFile << endl;
89  cout << "Parameter file is " << parFile << endl;
90  cout << "Real time " << rtime << " s, CPU time " << ctime << " s" << endl;
91  cout << endl;
92  // ------------------------------------------------------------------------
93 }
TString outFile
Definition: hit_dirc.C:17
FairGeane * Geane
FairRunAna * fRun
Definition: hit_dirc.C:58
TString inFile
Definition: hit_dirc.C:8
Double_t
TString parFile
Definition: hit_dirc.C:14
TString inFile2
Definition: rungenfit.C:14
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
TString inFile3
Definition: sim_ftof.C:16
Int_t iVerbose
int whichhit
Definition: rungenfit.C:50
Double_t rtime
Definition: hit_dirc.C:113