FairRoot/PandaRoot
runMvdKalmanTask.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 = 3;
5  // Input file (MC events)
6  TString MCFile = "MvdTpc_Pions.root";
7  // Parameter file
8  TString parFile = "MvdParams.root";
9  // Parameter output file
10  // TString parOutFile = "MvdParams.root";
11  // Number of events to process
12  Int_t nEvents = 5;
13  // ---- Load libraries -------------------------------------------------
14  gROOT->Macro("$VMCWORKDIR/gconfig/rootlogon.C");
15 
16  //gROOT->Macro("$VMCWORKDIR/gconfig/rootlogon.C");
17  gROOT->Macro("$VMCWORKDIR/gconfig/rootlogon.C");
18 
19  //gSystem->Load("libGeane");
20  // ------------------------------------------------------------------------
21  // Output file
22  PndFileNameCreator creator(MCFile.Data());
23  TString DigiFile = creator.GetDigiFileName(false).c_str();
24  TString RecoFile = creator.GetRecoFileName(false).c_str();
25  TString TrackFile = creator.GetTrackFindingFileName(false).c_str();
26  TString outFile = creator.GetKalmanFileName(false).c_str();
27 
28  std::cout << "DigiFile: " << DigiFile.Data()<< std::endl;
29  std::cout << "RecoFile: " << RecoFile.Data()<< std::endl;
30  std::cout << "TrackFinderFile: " << TrackFile.Data()<< std::endl;
31  std::cout << "KalmanFile: " << outFile.Data() << std::endl;
32  // --- Now choose concrete engines for the different tasks -------------
33  // ------------------------------------------------------------------------
34 
35 
36  // In general, the following parts need not be touched
37  // ========================================================================
38 
39 
40 
41 
42  // ----- Timer --------------------------------------------------------
43  TStopwatch timer;
44  timer.Start();
45  // ------------------------------------------------------------------------
46 
47 
48 
49  // ----- Reconstruction run -------------------------------------------
50  FairRunAna *fRun= new FairRunAna();
51  fRun->SetInputFile(MCFile);
52  fRun->AddFriend(DigiFile);
53  fRun->AddFriend(RecoFile);
54  fRun->AddFriend(TrackFile);
55 
56  fRun->SetOutputFile(outFile);
57  // ------------------------------------------------------------------------
58 
59  // THIS IS STRONGLY NEEDED
60  FairGeane *Geane = new FairGeane(MCFile);
62 
63  // ----- Parameter database --------------------------------------------
64  FairRuntimeDb* rtdb = fRun->GetRuntimeDb();
65  FairParRootFileIo* parInput1 = new FairParRootFileIo();
66 // FairParAsciiFileIo* parInput1 = new FairParAsciiFileIo();
67  parInput1->open(parFile.Data(),"UPDATE");
68  rtdb->setFirstInput(parInput1);
69  /*Bool_t kParameterMerged=kTRUE;
70  FairParRootFileIo* output=new FairParRootFileIo(kParameterMerged);
71  output->open(parOutFile);
72  rtdb->setOutput(output);
73 */ fRun->LoadGeometry();
74  // ------------------------------------------------------------------------
75 
76  PndLheKalmanTask* lheKalman = new PndLheKalmanTask();
77  lheKalman->SetVerbose(iVerbose);
78  lheKalman->SetGeane(kTRUE);
79 
80  lheKalman->SetSmooth(kFALSE);
81  lheKalman->SetNumIterations(3);
82  fRun->AddTask(lheKalman);
83 
84 
85  rtdb->print();
86  // ===== End of HitProducers =====
87  // =========================================================================
88  // PndMvdGeoPar* geoPar = (PndMvdGeoPar*)(rtdb->getContainer("PndMvdGeoPar"));
89 
90  // ----- Intialise and run --------------------------------------------
91  fRun->Init();
92  Geane->SetField(fRun->GetField());
93  fRun->Run(0,nEvents);
94  // ------------------------------------------------------------------------
95  // TFile histos("MvdKalmanHistos.root","READ");
96 
97 // rtdb->saveOutput();
98  rtdb->print();
99  // ----- Finish -------------------------------------------------------
100  timer.Stop();
101  Double_t rtime = timer.RealTime();
102  Double_t ctime = timer.CpuTime();
103  cout << endl << endl;
104  cout << "Macro finished succesfully." << endl;
105  cout << "Output file is " << outFile << endl;
106  cout << "Parameter file is " << parFile << endl;
107  cout << "Real time " << rtime << " s, CPU time " << ctime << " s" << endl;
108  cout << endl;
109  // ------------------------------------------------------------------------
110 
111 
112 }
TString RecoFile
TString outFile
Definition: hit_dirc.C:17
Emc geometry mapper.
Definition: PndEmcMapper.h:22
FairGeane * Geane
FairRunAna * fRun
Definition: hit_dirc.C:58
TString DigiFile
A simple class which adds the corresponding file extensions to a given base class.
Double_t
TString parFile
Definition: hit_dirc.C:14
PndEmcMapper * emcMap
Int_t nEvents
Definition: hit_dirc.C:11
TStopwatch timer
Definition: hit_dirc.C:51
FairRuntimeDb * rtdb
Definition: hit_dirc.C:66
TString TrackFile
PndLheKalmanTask * lheKalman
FairParRootFileIo * parInput1
Definition: hit_dirc.C:67
Double_t ctime
Definition: hit_dirc.C:114
PndMvdCreateDefaultApvMap * creator
Int_t iVerbose
TString MCFile
Double_t rtime
Definition: hit_dirc.C:113
static PndEmcMapper * Instance()