FairRoot/PandaRoot
run_ana_complete.C
Go to the documentation of this file.
2  // ========================================================================
3 
4  gROOT->LoadMacro("$VMCWORKDIR/gconfig/rootlogon.C");
5  rootlogon();
6 
7  Int_t iVerbose = 0;
8 
10  std::cout << creator.GetParFileName() << std::endl;
11  std::cout << creator.GetSimFileName() << std::endl;
12  std::cout << creator.GetDigiFileName() << std::endl;
13  std::cout << creator.GetRecoFileName() << std::endl;
14  std::cout << creator.GetCustomFileName("blubb")<< std::endl;
15 
16 
17  TString MCFile = creator.GetSimFileName();
18  TString parFile = creator.GetParFileName() ;
19  Int_t nEvents =0;
20  // ---- Load libraries -------------------------------------------------
21 
22  gROOT->Macro("$VMCWORKDIR/gconfig/rootlogon.C");
23  // ------------------------------------------------------------------------
24  // Output file
25 // PndFileNameCreator creator(MCFile.Data());
26  TString DigiFile = creator.GetDigiFileName();
27  TString RecoFile = creator.GetRecoFileName();
28 // TString FitFile = creator.GetTrackFindingFileName(false).c_str();
29 
30  TString outFile = creator.GetCustomFileName("ana");
31 
32  std::cout << "MCFile : " << MCFile.Data()<< std::endl;
33  std::cout << "DigiFile: " << DigiFile.Data()<< std::endl;
34  std::cout << "RecoFile: " << RecoFile.Data()<< std::endl;
35 // std::cout << "FitFile: " << FitFile.Data() << std::endl;
36 
37  gSystem->Load("libMCMatch");
38  gSystem->Load("libMCMatchExamples");
39 
40 
41  // ----- Timer --------------------------------------------------------
42  TStopwatch timer;
43  timer.Start();
44  // ------------------------------------------------------------------------
45 
46 
47 
48  // ----- Reconstruction run -------------------------------------------
49  FairRunAna *fRun= new FairRunAna();
50 
51  fRun->SetInputFile(MCFile);
52  fRun->AddFriend(DigiFile);
53  fRun->AddFriend(RecoFile);
54 // fRun->AddFriend(FitFile);
55 // fRun->AddFriend(PidFile);
56 
57  fRun->SetOutputFile(outFile);
58  // ------------------------------------------------------------------------
59 
60 
61 
62  // ----- Parameter database --------------------------------------------
63  FairRuntimeDb* rtdb = fRun->GetRuntimeDb();
64 
65  FairParRootFileIo* parInput1 = new FairParRootFileIo(kTRUE);
66  parInput1->open(parFile.Data(),"UPDATE");
67 
68  rtdb->setFirstInput(parInput1);
70  rtdb->setOutput(parInput1);
71  rtdb->print();
72 
73 
74  // ------------------------------------------------------------------------
75 
76 
77 
78  // =========================================================================
79  // ====== Hit Producers ======
80  // =========================================================================
81 
82 
83 
84  PndMCMatchCreatorTask* mcMatch = new PndMCMatchCreatorTask();
85  mcMatch->SetVerbose(1);
86  fRun->AddTask(mcMatch);
87 
88  PndMCIdealTrackFinder* idealtrackfinder = new PndMCIdealTrackFinder();
89  fRun->AddTask(idealtrackfinder);
90 
91  //PndMCMatchSelectorTask* mcSelect = new PndMCMatchSelectorTask("MVDRiemannTrackCand","MCTrack");
92  //fRun->AddTask(mcSelect);
93 
94  // PndMCTestHitCompare* hitmatch = new PndMCTestHitCompare();
95  // fRun->AddTask(hitmatch);
96 
97  // PndMvdTrackFinderAnaTask* mvdTrackFinderAna = new PndMvdTrackFinderAnaTask();
98  // fRun->AddTask(mvdTrackFinderAna);
99 
100  PndMCTestLambdaLambdaBar* lambdalambdabar = new PndMCTestLambdaLambdaBar();
101  fRun->AddTask(lambdalambdabar);
102 
103 
104  // PndMCTestPatternRecoQuality* recoquality = new PndMCTestPatternRecoQuality();
105  // fRun->AddTask(recoquality);
106 
107  // PndTestTask* testtask = new PndTestTask();
108  //fRun->AddTask(testtask);
109 
110  fRun->Init();
111  fRun->Run(0,nEvents);
112 
113  // ------------------------------------------------------------------------
114 
115 // rtdb->saveOutput();
116  // ----- Finish -------------------------------------------------------
117  timer.Stop();
118  Double_t rtime = timer.RealTime();
119  Double_t ctime = timer.CpuTime();
120  cout << endl << endl;
121  cout << "Macro finished succesfully." << endl;
122  cout << "Output file is " << outFile << endl;
123  cout << "Parameter file is " << parFile << endl;
124  cout << "Real time " << rtime << " s, CPU time " << ctime << " s" << endl;
125  cout << endl;
126  // ------------------------------------------------------------------------
127 
128 
129 }
run_ana_complete(TString FileName="test")
TString RecoFile
Bool_t kParameterMerged
Definition: sim_emc_apd.C:113
TString outFile
Definition: hit_dirc.C:17
PndMCMatchCreatorTask * mcMatch
TString FileName
FairRunAna * fRun
Definition: hit_dirc.C:58
TString DigiFile
A simple class which adds the corresponding file extensions to a given base class.
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
PndMvdCreateDefaultApvMap * creator
Int_t iVerbose
TString MCFile
Double_t rtime
Definition: hit_dirc.C:113