FairRoot/PandaRoot
runMvdLHETrackFinder.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_D+D-_10G.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 = 1000;
13  // ---- Load libraries -------------------------------------------------
14  gROOT->LoadMacro("$VMCWORKDIR/gconfig/rootlogon.C");
15  rootlogon();
16  //gROOT->Macro("$VMCWORKDIR/gconfig/rootlogon.C");
17  gROOT->Macro("$VMCWORKDIR/gconfig/rootlogon.C");
18 
19 
20  gSystem->Load("libriemann");
21 
22  // ------------------------------------------------------------------------
23  // Output file
24  PndFileNameCreator creator(MCFile.Data());
28 
29  std::cout << "DigiFile: " << DigiFile.Data()<< std::endl;
30  std::cout << "RecoFile: " << RecoFile.Data()<< std::endl;
31  std::cout << "TrackFinderFile: " << outFile.Data()<< std::endl;
32 
33  // --- Now choose concrete engines for the different tasks -------------
34  // ------------------------------------------------------------------------
35  // In general, the following parts need not be touched
36  // ========================================================================
37 
38  // ----- Timer --------------------------------------------------------
39  TStopwatch timer;
40  timer.Start();
41  // ------------------------------------------------------------------------
42 
43 
44 
45  // ----- Reconstruction run -------------------------------------------
46  FairRunAna *fRun= new FairRunAna();
47  fRun->SetInputFile(MCFile);
48  fRun->AddFriend(DigiFile);
49  fRun->AddFriend(RecoFile);
50 
51  fRun->SetOutputFile(outFile);
52  // ------------------------------------------------------------------------
53 
54 
55 
56  // ----- Parameter database --------------------------------------------
57  FairRuntimeDb* rtdb = fRun->GetRuntimeDb();
58 
59  FairParRootFileIo* parInput1 = new FairParRootFileIo(kTRUE);
60  parInput1->open(parFile.Data(),"UPDATE");
61 // FairParAsciiFileIo* parInput1 = new FairParAsciiFileIo();
62 // parInput1->open(parFile.Data(),"in");
63 
64  rtdb->setFirstInput(parInput1);
66 // FairParRootFileIo* output=new FairParRootFileIo(kParameterMerged);
67 // output->open(parOutFile.Data(),"RECREATE");
68  // ------------------------------------------------------------------------
69 
70 
71 
72  // ----- LHETRACK ---------------------------------
73 
74  PndLheHitsMaker* trackMS = new PndLheHitsMaker("Tracking routine");
75  trackMS->SetTpcMode(2); // 0 OFF, 1 TpcPoint, 2 TpcCluster // TpcPoint smearing [cm], if negative no smearing
76 // trackMS->SetSttMode(3); // 0 OFF, 1 SttPoint, 2 SttHit, (3) SttHelixHit // SttPoint smearing [cm], if negative no smearing
77  trackMS->SetMvdMode(2); // 0 OFF, 1 MVDPoint, 2 MVDHit // MVDPoint smearing [cm], if negative no smearing
78  trackMS->SetVerbose(3);
79  fRun->AddTask(trackMS);
80 
81  PndLheTrackFinder* trackFinder = new PndLheTrackFinder();
82  fRun->AddTask(trackFinder);
83 
84  PndLheTrackFitter* trackFitter = new PndLheTrackFitter("fitting");
85  fRun->AddTask(trackFitter);
86 
87  PndLhePidMaker* pidMaker = new PndLhePidMaker("pid");
88  pidMaker->SetGeanePro(kFALSE); // Switch ON Geane propagation
89  pidMaker->SetDebugMode(kTRUE); // Debug ntuples
90  fRun->AddTask(pidMaker);
91 
92 /* PndMvdRiemannTrackFinderTask* mvdTrackFinder = new PndMvdRiemannTrackFinderTask();
93  mvdTrackFinder->SetVerbose(iVerbose);
94  mvdTrackFinder->SetMaxDist(0.05);
95  fRun->AddTask(mvdTrackFinder);
96 */
97 // FairParRootFileIo* output=new FairParRootFileIo(kTRUE);
98 // output->open(parOutFile.Data());
99  rtdb->setOutput(parInput1);
100  rtdb->print();
101  // ===== End of HitProducers =====
102  // =========================================================================
103  PndMvdGeoPar* geoPar = (PndMvdGeoPar*)(rtdb->getContainer("PndMvdGeoPar"));
104 
105  // ----- Intialise and run --------------------------------------------
106  fRun->Init();
107 
108  fRun->Run(0,nEvents);
109  // fRun->Run(96,97);
110  // ------------------------------------------------------------------------
111 
112  rtdb->saveOutput();
113  rtdb->print();
114  // ----- Finish -------------------------------------------------------
115  timer.Stop();
116  Double_t rtime = timer.RealTime();
117  Double_t ctime = timer.CpuTime();
118  cout << endl << endl;
119  cout << "Macro finished succesfully." << endl;
120  cout << "Output file is " << outFile << endl;
121  cout << "Parameter file is " << parFile << endl;
122  cout << "Real time " << rtime << " s, CPU time " << ctime << " s" << endl;
123  cout << endl;
124  // ------------------------------------------------------------------------
125 
126 
127 }
Double_t rtime
TString parFile
TString DigiFile
TString RecoFile
std::string GetDigiFileName(std::string addon="", bool cut=false)
TString outFile
FairParRootFileIo * parInput1
FairRuntimeDb * rtdb
Int_t nEvents
PndMvdGeoPar * geoPar
Bool_t kParameterMerged
FairRunAna * fRun
Definition: hit_dirc.C:58
std::string GetRecoFileName(std::string addon="", bool cut=false)
A simple class which adds the corresponding file extensions to a given base class.
Double_t
TStopwatch timer
Definition: hit_dirc.C:51
PndLheTrackFitter * trackFitter
std::string GetTrackFindingFileName(std::string addon="", bool cut=false)
PndLhePidMaker * pidMaker
PndLheHitsMaker * trackMS
PndLheTrackFinder * trackFinder
PndFileNameCreator creator(MCFile.Data())
TString MCFile
Int_t iVerbose
Double_t ctime
TString parOutFile