FairRoot/PandaRoot
tutorials/analysis/run_reco_tpccombi.C
Go to the documentation of this file.
1 {
2  // ========================================================================
3  // Verbosity level (0=quiet, 1=event level, 2=track level, 3=debug)
4  Int_t iVerbose = 0;
5 
6  // Input file
7  TString inDigiFile = "digi_tpccombi.root";
8  TString inSimFile = "points_tpccombi.root";
9 
10  // Parameter file
11  TString parFile = "params_tpccombi.root";
12 
13  // Output file
14  TString outFile = "reco_tpccombi.root";
15 
16  // Number of events to process
17  Int_t nEvents = 0;
18 
19  // ---- Load libraries -------------------------------------------------
20  gROOT->LoadMacro("$VMCWORKDIR/gconfig/rootlogon.C");
21  rootlogon();
22  TString sysFile = gSystem->Getenv("VMCWORKDIR");
23  // ------------------------------------------------------------------------
24  // In general, the following parts need not be touched
25  // ========================================================================
26 
27  // ----- Timer --------------------------------------------------------
28  TStopwatch timer;
29  timer.Start();
30  // ------------------------------------------------------------------------
31 
32  // ----- Digitization run -------------------------------------------
33  FairRunAna *fRun= new FairRunAna();
34  fRun->SetInputFile(inDigiFile);
35  fRun->AddFriend(inSimFile);
36  fRun->SetOutputFile(outFile);
37  FairGeane *Geane = new FairGeane();
38  fRun->AddTask(Geane);
39  // ------------------------------------------------------------------------
40 
41  // ----- Parameter database --------------------------------------------
42  TString allDigiFile = sysFile+"/macro/params/all.par";
43 
44  FairRuntimeDb* rtdb = fRun->GetRuntimeDb();
45  FairParRootFileIo* parInput1 = new FairParRootFileIo();
46  parInput1->open(parFile.Data());
47 
48  FairParAsciiFileIo* parIo1 = new FairParAsciiFileIo();
49  parIo1->open(allDigiFile.Data(),"in");
50 
51  rtdb->setFirstInput(parInput1);
52  rtdb->setSecondInput(parIo1);
53  // ------------------------------------------------------------------------
54  // ----- LHETRACK ---------------------------------
55 
56  PndLheHitsMaker* trackMS = new PndLheHitsMaker("Tracking routine");
57  trackMS->SetTpcMode(2); // 0 OFF, 1 TpcPoint, 2 TpcCluster // TpcPoint smearing [cm], if negative no smearing
58  trackMS->SetMvdMode(2); // 0 OFF, 1 MVDPoint, 2 MVDHit // MVDPoint smearing [cm], if negative no smearing
59  trackMS->SetGemMode(2); // 0 OFF, 1 GEMPoint, 2 GEMHit // GEMPoint smearing [cm], if negative no smearing
60  fRun->AddTask(trackMS);
61 
62  PndLheTrackFinder* trackFinder = new PndLheTrackFinder();
63  //PndLheTrackFinderIdeal* trackFinder = new PndLheTrackFinderIdeal();
64  fRun->AddTask(trackFinder);
65 
66  PndLheTrackFitter* trackFitter = new PndLheTrackFitter("fitting");
67  fRun->AddTask(trackFitter);
68 
70  recoKalman->SetTrackInBranchName("LheTrack");
71  recoKalman->SetTrackOutBranchName("LheGenTrack");
72  //recoKalman->SetNumIterations(3);
73  fRun->AddTask(recoKalman);
74 
75  //PndLheKalmanTask* lheKalman = new PndLheKalmanTask();
76  //lheKalman->SetVerbose(0);
77  // //lheKalman->SetNumIterations(3);
78  //fRun->AddTask(lheKalman);
79 
80  // ----- Intialise and run --------------------------------------------
81  fRun->Init();
83  fRun->Run(0, nEvents);
84 
85  rtdb->saveOutput();
86  rtdb->print();
87 
88  // ------------------------------------------------------------------------
89 
90  // ----- Finish -------------------------------------------------------
91 
92  timer.Stop();
93  Double_t rtime = timer.RealTime();
94  Double_t ctime = timer.CpuTime();
95  cout << endl << endl;
96  cout << "Macro finished succesfully." << endl;
97  cout << "Output file is " << outFile << endl;
98  cout << "Parameter file is " << parFile << endl;
99  cout << "Real time " << rtime << " s, CPU time " << ctime << " s" << endl;
100  cout << endl;
101  // ------------------------------------------------------------------------
102 
103 
104 }
PndRecoKalmanTask * recoKalman
FairParAsciiFileIo * parIo1
PndEmcMapper * emcMap
PndLheTrackFinder * trackFinder
Emc geometry mapper.
Definition: PndEmcMapper.h:22
PndLheTrackFitter * trackFitter
void SetTrackOutBranchName(const TString &name)
FairParRootFileIo * parInput1
Double_t
PndLheHitsMaker * trackMS
void SetTrackInBranchName(const TString &name)
Int_t iVerbose
FairRuntimeDb * rtdb
static PndEmcMapper * Instance()