FairRoot/PandaRoot
tutorials/charmonium/jul10/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  // ----- Intialise and run --------------------------------------------
77  fRun->Init();
78  fRun->Run(0, nEvents);
79 
80  rtdb->saveOutput();
81  rtdb->print();
82 
83  // ------------------------------------------------------------------------
84 
85  // ----- Finish -------------------------------------------------------
86 
87  timer.Stop();
88  Double_t rtime = timer.RealTime();
89  Double_t ctime = timer.CpuTime();
90  cout << endl << endl;
91  cout << "Macro finished succesfully." << endl;
92  cout << "Output file is " << outFile << endl;
93  cout << "Parameter file is " << parFile << endl;
94  cout << "Real time " << rtime << " s, CPU time " << ctime << " s" << endl;
95  cout << endl;
96  // ------------------------------------------------------------------------
97 
98 
99 }
TString outFile
Definition: hit_dirc.C:17
TString allDigiFile
Definition: hit_muo.C:36
void SetTrackOutBranchName(const TString &name)
FairGeane * Geane
FairRunAna * fRun
Definition: hit_dirc.C:58
TString sysFile
TString inSimFile
Double_t
TString parFile
Definition: hit_dirc.C:14
Int_t nEvents
Definition: hit_dirc.C:11
TStopwatch timer
Definition: hit_dirc.C:51
PndLheTrackFitter * trackFitter
static void Init(Int_t MapVersion)
FairRuntimeDb * rtdb
Definition: hit_dirc.C:66
TString inDigiFile
FairParRootFileIo * parInput1
Definition: hit_dirc.C:67
Double_t ctime
Definition: hit_dirc.C:114
FairParAsciiFileIo * parIo1
Definition: bump_emc.C:53
PndLheHitsMaker * trackMS
PndLheTrackFinder * trackFinder
void SetTrackInBranchName(const TString &name)
Int_t iVerbose
PndRecoKalmanTask * recoKalman
Double_t rtime
Definition: hit_dirc.C:113