FairRoot/PandaRoot
runLumi2bHitMerge.C
Go to the documentation of this file.
1 int runLumi2bHitMerge(const int nEvents=10, const int startEvent=0, TString storePath="tmpOutput", const int verboseLevel=5)
2 {
3  // ========================================================================
4  // Input file (Reco events)
5  TString RecoFile = storePath+"/Lumi_reco_";
6  RecoFile += startEvent;
7  RecoFile += ".root";
8  // Parameter file
9  TString parFile = storePath+"/Lumi_Params_";
10  parFile += startEvent;
11  parFile += ".root";
12 
13  // ---- Load libraries -------------------------------------------------
14  gROOT->Macro("$VMCWORKDIR/gconfig/rootlogon.C");
15  gSystem->Load("libSds");
16  gSystem->Load("libSdsReco");
17  gSystem->Load("libLmd");
18  gSystem->Load("libLmdReco");
19  gSystem->Load("libLmdTrk");
20  // ------------------------------------------------------------------------
21  // Output file
22  TString outFile = storePath+"/Lumi_recoMerged_";
23  outFile += startEvent;
24  outFile += ".root";
25 
26  std::cout << "RecoFile : " << RecoFile.Data()<< std::endl;
27  std::cout << "RecoMergedFile: " << outFile.Data()<< std::endl;
28  // --- Now choose concrete engines for the different tasks -------------
29  // ------------------------------------------------------------------------
30 
31 
32  // In general, the following parts need not be touched
33  // ========================================================================
34 
35 
36 
37 
38  // ----- Timer --------------------------------------------------------
39  TStopwatch timer;
40  timer.Start();
41  // ------------------------------------------------------------------------
42 
43 
44 
45  // ----- Reconstruction run -------------------------------------------
46  FairRunAna *fRun= new FairRunAna();
47  fRun->SetInputFile(RecoFile);
48  fRun->SetOutputFile(outFile);
49  // ------------------------------------------------------------------------
50 
51 
52 
53  // ----- Parameter database --------------------------------------------
54  FairRuntimeDb* rtdb = fRun->GetRuntimeDb();
55  FairParRootFileIo* parInput1 = new FairParRootFileIo(kTRUE);
56  parInput1->open(parFile.Data(),"UPDATE");
57 // FairParAsciiFileIo* parInput1 = new FairParAsciiFileIo();
58 // parInput1->open(parFile.Data(),"in");
59  rtdb->setFirstInput(parInput1);
60  /*Bool_t kParameterMerged=kTRUE;
61  FairParRootFileIo* output=new FairParRootFileIo(kParameterMerged);
62  output->open(parOutFile);
63  rtdb->setOutput(output);
64 */
65 // fRun->LoadGeometry();
66  // ------------------------------------------------------------------------
67 
68 
69 
70  // =========================================================================
71  // ====== Hit Producers ======
72  // =========================================================================
73 
74  // ----- MVD hit producer --------------------------------------------
75 
76  PndLmdHitMergeTask* lmdmccls = new PndLmdHitMergeTask();
77  lmdmccls->SetVerbose(verboseLevel);
78  fRun->AddTask(lmdmccls);
79 
80  // PndMvdPixelClusterTask* mvdClusterizer = new PndMvdPixelClusterTask(chargecut, MCFile);//, slx, sly, sthreshold, snoise);
81  // mvdClusterizer->SetVerbose(verboseLevel);
82  // fRun->AddTask(mvdClusterizer);
83 
84 // FairParRootFileIo* output=new FairParRootFileIo(kTRUE);
85 // output->open(parOutFile.Data());
86 // rtdb->setOutput(output);
87  rtdb->setOutput(parInput1);
88  rtdb->print();
89  // ===== End of HitProducers =====
90  // =========================================================================
91 // PndMvdGeoPar* geoPar = (PndMvdGeoPar*)(rtdb->getContainer("PndMvdGeoPar"));
92 
93  // ----- Intialise and run --------------------------------------------
94  fRun->Init();
95 
96  fRun->Run(0,nEvents);
97  // ------------------------------------------------------------------------
98 
99  rtdb->saveOutput();
100  rtdb->print();
101  // ----- Finish -------------------------------------------------------
102  timer.Stop();
103  Double_t rtime = timer.RealTime();
104  Double_t ctime = timer.CpuTime();
105  cout << endl << endl;
106  cout << "Macro finished succesfully." << endl;
107  cout << "Output file is " << outFile << endl;
108  cout << "Parameter file is " << parFile << endl;
109  cout << "Real time " << rtime << " s, CPU time " << ctime << " s" << endl;
110  cout << endl;
111  // ------------------------------------------------------------------------
112 
113 
114  return 0;
115 }
int runLumi2bHitMerge(const int nEvents=10, const int startEvent=0, TString storePath="tmpOutput", const int verboseLevel=5)
int verboseLevel
Definition: Lars/runMvdSim.C:7
TString RecoFile
TString outFile
Definition: hit_dirc.C:17
Int_t startEvent
TString storePath
virtual InitStatus Init()
FairRunAna * fRun
Definition: hit_dirc.C:58
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
Double_t rtime
Definition: hit_dirc.C:113