FairRoot/PandaRoot
runMvdTrackFinder.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 = "Mvd_TestNewVersion.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 = 10;
13  // ---- Load libraries -------------------------------------------------
14  gROOT->Macro("$VMCWORKDIR/gconfig/rootlogon.C");
15  gROOT->Macro("$VMCWORKDIR/gconfig/rootlogon.C");
16 
17  // ------------------------------------------------------------------------
18  // Output file
19  PndFileNameCreator creator(MCFile.Data());
20  TString DigiFile = creator.GetDigiFileName(false).c_str();
21  TString RecoFile = creator.GetRecoFileName(false).c_str();
22  // TString outFile = creator.GetTrackFindingFileName(false).c_str();
23  TString outFile = "Mvd_TestNewVersion_IdealTrackF.root";
24  std::cout << "DigiFile: " << DigiFile.Data()<< std::endl;
25  std::cout << "RecoFile: " << RecoFile.Data()<< std::endl;
26  std::cout << "TrackFinderFile: " << outFile.Data()<< std::endl;
27 
28  // --- Now choose concrete engines for the different tasks -------------
29  // ------------------------------------------------------------------------
30  // In general, the following parts need not be touched
31  // ========================================================================
32 
33  // ----- Timer --------------------------------------------------------
34  TStopwatch timer;
35  timer.Start();
36  // ------------------------------------------------------------------------
37 
38 
39 
40  // ----- Reconstruction run -------------------------------------------
41  FairRunAna *fRun= new FairRunAna();
42  fRun->SetInputFile(MCFile);
43  fRun->AddFriend(DigiFile);
44  fRun->AddFriend(RecoFile);
45 
46  fRun->SetOutputFile(outFile);
47  // ------------------------------------------------------------------------
48 
49 
50 
51  // ----- Parameter database --------------------------------------------
52  FairRuntimeDb* rtdb = fRun->GetRuntimeDb();
53  FairParRootFileIo* parInput1 = new FairParRootFileIo();
54 // FairParAsciiFileIo* parInput1 = new FairParAsciiFileIo();
55  parInput1->open(parFile.Data(),"in");
56  rtdb->setFirstInput(parInput1);
57  /*Bool_t kParameterMerged=kTRUE;
58  FairParRootFileIo* output=new FairParRootFileIo(kParameterMerged);
59  output->open(parOutFile);
60  rtdb->setOutput(output);
61 */ fRun->LoadGeometry();
62  // ------------------------------------------------------------------------
63 
64 
65 
66  // =========================================================================
67  // ====== Hit Producers ======
68  // =========================================================================
69 
70  // ----- MVD hit producer --------------------------------------------
71 
73  mvdTrackFinder->SetVerbose(iVerbose);
74  fRun->AddTask(mvdTrackFinder);
75 
76  FairParRootFileIo* output=new FairParRootFileIo(kTRUE);
77  output->open(parOutFile.Data());
78  rtdb->setOutput(output);
79  rtdb->print();
80  // ===== End of HitProducers =====
81  // =========================================================================
82  PndMvdGeoPar* geoPar = (PndMvdGeoPar*)(rtdb->getContainer("PndMvdGeoPar"));
83 
84  // ----- Intialise and run --------------------------------------------
85  fRun->Init();
86 
87  fRun->Run(0,nEvents);
88  // ------------------------------------------------------------------------
89 
90  rtdb->saveOutput();
91  rtdb->print();
92  // ----- Finish -------------------------------------------------------
93  timer.Stop();
94  Double_t rtime = timer.RealTime();
95  Double_t ctime = timer.CpuTime();
96  cout << endl << endl;
97  cout << "Macro finished succesfully." << endl;
98  cout << "Output file is " << outFile << endl;
99  cout << "Parameter file is " << parFile << endl;
100  cout << "Real time " << rtime << " s, CPU time " << ctime << " s" << endl;
101  cout << endl;
102  // ------------------------------------------------------------------------
103 
104 
105 }
TString RecoFile
PndMvdRiemannTrackFinderTask * mvdTrackFinder
PndMvdGeoPar * geoPar
TString outFile
Definition: hit_dirc.C:17
FairParRootFileIo * output
Definition: sim_emc_apd.C:120
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
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
PndMvdCreateDefaultApvMap * creator
Int_t iVerbose
TString MCFile
Double_t rtime
Definition: hit_dirc.C:113
TString parOutFile