FairRoot/PandaRoot
run_linking_llbar_evtgen.C
Go to the documentation of this file.
1 {
2  // ========================================================================
3  Int_t iVerbose = 0;
4  TString MCFile = "llbar_sim_evtgen.root";
5  TString parFile = "llbar_params_evtgen.root";
6  Int_t nEvents = 5000;
7  // ---- Load libraries -------------------------------------------------
8 
9  gROOT->Macro("$VMCWORKDIR/gconfig/rootlogon.C");
10  // ------------------------------------------------------------------------
11  // Output file
12 // PndFileNameCreator creator(MCFile.Data());
13  TString DigiFile = "llbar_digi_evtgen.root";
14  TString RecoFile = "llbar_reco_evtgen.root";
15 // TString FitFile = creator.GetTrackFindingFileName(false).c_str();
16 
17  TString outFile = "llbar_links_evtgen.root";
18 
19  std::cout << "MCFile : " << MCFile.Data()<< std::endl;
20  std::cout << "DigiFile: " << DigiFile.Data()<< std::endl;
21  std::cout << "RecoFile: " << RecoFile.Data()<< std::endl;
22 // std::cout << "FitFile: " << FitFile.Data() << std::endl;
23 
24  gSystem->Load("libMCMatch");
25  gSystem->Load("libMCMatchExamples");
26 
27 
28  // ----- Timer --------------------------------------------------------
29  TStopwatch timer;
30  timer.Start();
31  // ------------------------------------------------------------------------
32 
33 
34 
35  // ----- Reconstruction run -------------------------------------------
36  FairRunAna *fRun= new FairRunAna();
37 
38  fRun->SetInputFile(MCFile);
39  fRun->AddFriend(DigiFile);
40  fRun->AddFriend(RecoFile);
41 // fRun->AddFriend(FitFile);
42 // fRun->AddFriend(PidFile);
43 
44  fRun->SetOutputFile(outFile);
45  // ------------------------------------------------------------------------
46 
47 
48 
49  // ----- Parameter database --------------------------------------------
50  FairRuntimeDb* rtdb = fRun->GetRuntimeDb();
51 
52  FairParRootFileIo* parInput1 = new FairParRootFileIo(kTRUE);
53  parInput1->open(parFile.Data(),"UPDATE");
54 
55  rtdb->setFirstInput(parInput1);
57  rtdb->setOutput(parInput1);
58  rtdb->print();
59 
60 
61  // ------------------------------------------------------------------------
62 
63 
64 
65  // =========================================================================
66  // ====== Hit Producers ======
67  // =========================================================================
68 
69  // ----- MVD hit producer --------------------------------------------
70 
71 
72  PndMCMatchCreatorTask* mcMatch = new PndMCMatchCreatorTask();
73  fRun->AddTask(mcMatch);
74 
75  //PndMCMatchSelectorTask* mcSelect = new PndMCMatchSelectorTask("MVDRiemannTrackCand","MCTrack");
76  //fRun->AddTask(mcSelect);
77 
78  PndMCTestHitCompare* hitmatch = new PndMCTestHitCompare();
79  fRun->AddTask(hitmatch);
80 
81  fRun->Init();
82  fRun->Run(0,nEvents);
83 
84  // ------------------------------------------------------------------------
85 
86 // rtdb->saveOutput();
87  // ----- Finish -------------------------------------------------------
88  timer.Stop();
89  Double_t rtime = timer.RealTime();
90  Double_t ctime = timer.CpuTime();
91  cout << endl << endl;
92  cout << "Macro finished succesfully." << endl;
93  cout << "Output file is " << outFile << endl;
94  cout << "Parameter file is " << parFile << endl;
95  cout << "Real time " << rtime << " s, CPU time " << ctime << " s" << endl;
96  cout << endl;
97  // ------------------------------------------------------------------------
98 
99 
100 }
TString RecoFile
Bool_t kParameterMerged
Definition: sim_emc_apd.C:113
TString outFile
Definition: hit_dirc.C:17
PndMCMatchCreatorTask * mcMatch
PndMCTestHitCompare * hitmatch
FairRunAna * fRun
Definition: hit_dirc.C:58
TString DigiFile
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
Int_t iVerbose
TString MCFile
Double_t rtime
Definition: hit_dirc.C:113