FairRoot/PandaRoot
emc/run_linkCreation.C
Go to the documentation of this file.
1 {
2  // ========================================================================
3  Int_t iVerbose = 0;
4  TString MCFile = "emc_complete.root";
5  TString parFile = "simparams.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_emc.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  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(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  PndMCTestEmcClusterCompare* mcTestEmc = new PndMCTestEmcClusterCompare();
75  fRun->AddTask(mcTestEmc);
76 
77  fRun->Init();
78 
79  fRun->Run(startEvent,stopEvent);
80 
81 
82  // ------------------------------------------------------------------------
83 
84 // rtdb->saveOutput();
85  // ----- Finish -------------------------------------------------------
86  timer.Stop();
87  Double_t rtime = timer.RealTime();
88  Double_t ctime = timer.CpuTime();
89  cout << endl << endl;
90  cout << "Macro finished succesfully." << endl;
91  cout << "Output file is " << outFile << endl;
92  cout << "Parameter file is " << parFile << endl;
93  cout << "Real time " << rtime << " s, CPU time " << ctime << " s" << endl;
94  cout << endl;
95  // ------------------------------------------------------------------------
96 
97 
98 }
PndMCTestEmcClusterCompare * mcTestEmc
TString RecoFile
Bool_t kParameterMerged
Definition: sim_emc_apd.C:113
TString outFile
Definition: hit_dirc.C:17
PndMCMatchCreatorTask * mcMatch
Int_t startEvent
FairRunAna * fRun
Definition: hit_dirc.C:58
TString DigiFile
Int_t stopEvent
Double_t
TString parFile
Definition: hit_dirc.C:14
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
TString PidFile
Int_t iVerbose
TString MCFile
Double_t rtime
Definition: hit_dirc.C:113