FairRoot/PandaRoot
runMvdRiemannTrackFinder.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  // Input file (MC events)
6  TString MCFile = "Mvd_Test.root";
7  // Parameter file
8  TString parFile = "Mvd_Params.root";
9  // Parameter output file
10  TString parOutFile = "Mvd_Params.root";
11  // Number of events to process
12  Int_t nEvents = 100;
13  // ---- Load libraries -------------------------------------------------
14  gROOT->Macro("$VMCWORKDIR/gconfig/rootlogon.C");
15  //gROOT->Macro("$VMCWORKDIR/gconfig/rootlogon.C");
16  gROOT->Macro("$VMCWORKDIR/gconfig/rootlogon.C");
17 
18 
19  gSystem->Load("libriemann");
20 
21  // ------------------------------------------------------------------------
22  // Output file
23  PndFileNameCreator creator(MCFile.Data());
24  TString DigiFile = creator.GetDigiFileName(false).c_str();
25  TString RecoFile = creator.GetRecoFileName(false).c_str();
26  TString outFile = creator.GetTrackFindingFileName(false).c_str();
27 
28  std::cout << "DigiFile: " << DigiFile.Data()<< std::endl;
29  std::cout << "RecoFile: " << RecoFile.Data()<< std::endl;
30  std::cout << "TrackFinderFile: " << outFile.Data()<< std::endl;
31 
32  // --- Now choose concrete engines for the different tasks -------------
33  // ------------------------------------------------------------------------
34  // In general, the following parts need not be touched
35  // ========================================================================
36 
37  // ----- Timer --------------------------------------------------------
38  TStopwatch timer;
39  timer.Start();
40  // ------------------------------------------------------------------------
41 
42 
43 
44  // ----- Reconstruction run -------------------------------------------
45  FairRunAna *fRun= new FairRunAna();
46  fRun->SetInputFile(RecoFile);
47 // fRun->AddFriend(DigiFile);
48 // fRun->AddFriend(RecoFile);
49 
50  fRun->SetOutputFile(outFile);
51  // ------------------------------------------------------------------------
52 
53 
54 
55  // ----- Parameter database --------------------------------------------
56  FairRuntimeDb* rtdb = fRun->GetRuntimeDb();
57 
58  FairParRootFileIo* parInput1 = new FairParRootFileIo(kTRUE);
59  parInput1->open(parFile.Data(),"UPDATE");
60 // FairParAsciiFileIo* parInput1 = new FairParAsciiFileIo();
61 // parInput1->open(parFile.Data(),"in");
62 
63  rtdb->setFirstInput(parInput1);
65 // FairParRootFileIo* output=new FairParRootFileIo(kParameterMerged);
66 // output->open(parOutFile.Data(),"RECREATE");
67  // ------------------------------------------------------------------------
68 
69 
70 
71  // =========================================================================
72  // ====== Hit Producers ======
73  // =========================================================================
74 
75  // ----- MVD hit producer --------------------------------------------
76 
78  mvdTrackFinder->SetVerbose(iVerbose);
79  mvdTrackFinder->SetMaxDist(0.05);
80  fRun->AddTask(mvdTrackFinder);
81 
82 // FairParRootFileIo* output=new FairParRootFileIo(kTRUE);
83 // output->open(parOutFile.Data());
84  rtdb->setOutput(parInput1);
85  rtdb->print();
86  // ===== End of HitProducers =====
87  // =========================================================================
88  // PndMvdGeoPar* geoPar = (PndMvdGeoPar*)(rtdb->getContainer("PndMvdGeoPar"));
89 
90  // ----- Intialise and run --------------------------------------------
91  fRun->Init();
92 
93  fRun->Run(0,nEvents);
94  // fRun->Run(96,97);
95  // ------------------------------------------------------------------------
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
PndMvdRiemannTrackFinderTask * mvdTrackFinder
Bool_t kParameterMerged
Definition: sim_emc_apd.C:113
TString outFile
Definition: hit_dirc.C:17
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