FairRoot/PandaRoot
run_linkCreation_sttcombi.C
Go to the documentation of this file.
1 {
2  // ========================================================================
3  Int_t iVerbose = 0;
4  TString MCFile = "points_sttcombi.root";
5  TString parFile = "params_sttcombi.root";
6  //Int_t nEvents = 10;
7  Int_t startEvent = 0;
8  Int_t stopEvent = 10;
9  // ---- Load libraries -------------------------------------------------
10  gROOT->Macro("$VMCWORKDIR/gconfig/rootlogon.C");
11  // ------------------------------------------------------------------------
12  // Output file
13 
14  TString DigiFile = "digi_sttcombi.root";
15  TString RecoFile = "reco_sttcombi.root";
16  TString PidFile = "pid_sttcombi.root";
17  TString outFile = "links_sttcombi.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 << "PidFile: " << PidFile.Data() << std::endl;
23 
24  gSystem->Load("libMCMatch");
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(PidFile);
41 
42  fRun->SetOutputFile(outFile);
43  // ------------------------------------------------------------------------
44 
45 
46 
47  // ----- Parameter database --------------------------------------------
48  FairRuntimeDb* rtdb = fRun->GetRuntimeDb();
49 
50  FairParRootFileIo* parInput1 = new FairParRootFileIo(kTRUE);
51  parInput1->open(parFile.Data(),"UPDATE");
52 
53  rtdb->setFirstInput(parInput1);
55  rtdb->setOutput(parInput1);
56  rtdb->print();
57 
58 
59  // ------------------------------------------------------------------------
60 
61 
62 
63  // =========================================================================
64  // ====== Hit Producers ======
65  // =========================================================================
66 
67  // ----- MVD hit producer --------------------------------------------
68 
69 
70  PndMCMatchCreatorTask* mcMatch = new PndMCMatchCreatorTask();
71  fRun->AddTask(mcMatch);
72 
73  fRun->Init();
74 
75  fRun->Run(startEvent,stopEvent);
76 
77 
78  // ------------------------------------------------------------------------
79 
80 // rtdb->saveOutput();
81  // ----- Finish -------------------------------------------------------
82  timer.Stop();
83  Double_t rtime = timer.RealTime();
84  Double_t ctime = timer.CpuTime();
85  cout << endl << endl;
86  cout << "Macro finished succesfully." << endl;
87  cout << "Output file is " << outFile << endl;
88  cout << "Parameter file is " << parFile << endl;
89  cout << "Real time " << rtime << " s, CPU time " << ctime << " s" << endl;
90  cout << endl;
91  // ------------------------------------------------------------------------
92 
93 
94 }
Int_t stopEvent
Int_t startEvent
TString RecoFile
TString MCFile
Bool_t kParameterMerged
FairRunAna * fRun
TStopwatch timer
Double_t rtime
Double_t
FairRuntimeDb * rtdb
TString parFile
FairParRootFileIo * parInput1
TString DigiFile
TString outFile
TString PidFile
Double_t ctime
PndMCMatchCreatorTask * mcMatch
Int_t iVerbose