FairRoot/PandaRoot
mvd/TimeOrderedSim/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 = 10;
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  PndMCMatchCreatorTask* mcMatch = new PndMCMatchCreatorTask();
71  fRun->AddTask(mcMatch);
72 
73 // PndMCTestDataCrawler* mcMatch = new PndMCTestDataCrawler();
74 // fRun->AddTask(mcMatch);
75 
76  //PndMCTestPatterRecoQuality* mcTest = new PndMCTestPatternRecoQuality();
77 // PndMCTestHitCompare* mcTest = new PndMCTestHitCompare();
78 // fRun->AddTask(mcTest);
79 
80  fRun->Init();
81  fRun->Run(0,nEvents);
82 
83  // ------------------------------------------------------------------------
84 
85 // rtdb->saveOutput();
86  // ----- Finish -------------------------------------------------------
87  timer.Stop();
88  Double_t rtime = timer.RealTime();
89  Double_t ctime = timer.CpuTime();
90  cout << endl << endl;
91  cout << "Macro finished succesfully." << endl;
92  cout << "Output file is " << outFile << endl;
93  cout << "Parameter file is " << parFile << endl;
94  cout << "Real time " << rtime << " s, CPU time " << ctime << " s" << endl;
95  cout << endl;
96  // ------------------------------------------------------------------------
97 
98 
99 }
std::string GetDigiFileName(std::string addon="", bool cut=false)
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
FairParRootFileIo * parInput1
std::string GetTrackFindingFileName(std::string addon="", bool cut=false)
FairRuntimeDb * rtdb
PndFileNameCreator creator(MCFile.Data())
Int_t iVerbose
PndMCMatchCreatorTask * mcMatch