FairRoot/PandaRoot
mvd/run_linkCreation.C
Go to the documentation of this file.
1 {
2  // ========================================================================
3  Int_t iVerbose = 0;
4  TString MCFile = "Mvd_Test.root";
5  TString parFile = "Mvd_Params.root";
6  Int_t nEvents = 1000000;
7  // ---- Load libraries -------------------------------------------------
8  gROOT->Macro("$VMCWORKDIR/gconfig/rootlogon.C");
9  // ------------------------------------------------------------------------
10  // Output file
11  PndFileNameCreator creator(MCFile.Data());
15 
16  TString outFile = "Mvd_Test_links.root";
17 
18  std::cout << "MCFile : " << MCFile.Data()<< std::endl;
19  std::cout << "DigiFile: " << DigiFile.Data()<< std::endl;
20  std::cout << "RecoFile: " << RecoFile.Data()<< std::endl;
21  std::cout << "FitFile: " << FitFile.Data() << std::endl;
22 
23  gSystem->Load("libMCMatch");
24  gSystem->Load("libMCMatchExamples");
25 
26 
27  // ----- Timer --------------------------------------------------------
28  TStopwatch timer;
29  timer.Start();
30  // ------------------------------------------------------------------------
31 
32 
33 
34  // ----- Reconstruction run -------------------------------------------
35  FairRunAna *fRun= new FairRunAna();
36 
37  fRun->SetInputFile(MCFile);
38  fRun->AddFriend(DigiFile);
39  fRun->AddFriend(RecoFile);
40  fRun->AddFriend(FitFile);
41 // fRun->AddFriend(PidFile);
42 
43  fRun->SetOutputFile(outFile);
44  // ------------------------------------------------------------------------
45 
46 
47 
48  // ----- Parameter database --------------------------------------------
49  FairRuntimeDb* rtdb = fRun->GetRuntimeDb();
50 
51  FairParRootFileIo* parInput1 = new FairParRootFileIo(kTRUE);
52  parInput1->open(parFile.Data(),"UPDATE");
53 
54  rtdb->setFirstInput(parInput1);
56  rtdb->setOutput(parInput1);
57  rtdb->print();
58 
59 
60  // ------------------------------------------------------------------------
61 
62 
63 
64  // =========================================================================
65  // ====== Hit Producers ======
66  // =========================================================================
67 
68  // ----- MVD hit producer --------------------------------------------
69 
70 
71  PndMCMatchCreatorTask* mcMatch = new PndMCMatchCreatorTask();
72  fRun->AddTask(mcMatch);
73 
74  PndMCTestPatterRecoQuality* mcTest = new PndMCTestPatternRecoQuality();
75  fRun->AddTask(mcTest);
76 
77  fRun->Init();
78  fRun->Run(0,nEvents);
79 
80  // ------------------------------------------------------------------------
81 
82 // rtdb->saveOutput();
83  // ----- Finish -------------------------------------------------------
84  timer.Stop();
85  Double_t rtime = timer.RealTime();
86  Double_t ctime = timer.CpuTime();
87  cout << endl << endl;
88  cout << "Macro finished succesfully." << endl;
89  cout << "Output file is " << outFile << endl;
90  cout << "Parameter file is " << parFile << endl;
91  cout << "Real time " << rtime << " s, CPU time " << ctime << " s" << endl;
92  cout << endl;
93  // ------------------------------------------------------------------------
94 
95 
96 }
TString parFile
FairRunAna * fRun
std::string GetDigiFileName(std::string addon="", bool cut=false)
Double_t rtime
TStopwatch timer
Int_t nEvents
FairRuntimeDb * rtdb
std::string GetRecoFileName(std::string addon="", bool cut=false)
A simple class which adds the corresponding file extensions to a given base class.
TString DigiFile
Double_t
Double_t ctime
std::string GetTrackFindingFileName(std::string addon="", bool cut=false)
TString outFile
PndMCMatchCreatorTask * mcMatch
PndMCTestPatterRecoQuality * mcTest
Int_t iVerbose
PndFileNameCreator creator(MCFile.Data())
Bool_t kParameterMerged
FairParRootFileIo * parInput1
TString MCFile
TString FitFile
TString RecoFile