FairRoot/PandaRoot
detectors/hyp/runReco.C
Go to the documentation of this file.
1 {
2 
3  // ========================================================================
4 
5 
6 // Verbosity level (0=quiet, 1=event level, 2=track level, 3=debug)
7  Int_t iVerbose = 1;//iVerbose = 3
8  TString inFile = "sim_piTr.root";//sim_pidC.root";
9  Int_t nEvents = 0;//50000;
10  TString parFile="PiTrparams.root";//pidparams.root";
11  TString RecoFile = "hypIdealreco.root";
12  //hypIdealPidreco.root";
13  TString outFile = "HypIdrecdos2.root";//HypPidIdrecdos2.root";
14 
15  // --- Now choose concrete engines for the different tasks -------------
16  // ------------------------------------------------------------------------
17 
18 
19  // In general, the following parts need not be touched
20  // ========================================================================
21 
22  // ---- Load libraries -------------------------------------------------
23 
24  gROOT->Macro("$VMCWORKDIR/gconfig/rootlogon.C");
25  rootlogon();
26 
27  gSystem->Load("libHyp");
28 
29 // ----- Timer --------------------------------------------------------
30  TStopwatch timer;
31  timer.Start();
32 
33  // ------------------------------------------------------------------------
34 
35  // ----- Reconstruction run -------------------------------------------
36 
37  FairRunAna *fRun= new FairRunAna();
38  fRun->SetInputFile(inFile.Data());
39  fRun->AddFriend(RecoFile);
40 /*fRun->AddFile(inFile2.Data());
41  fRun->AddFile(inFile3.Data());
42  fRun->AddFile(inFile4.Data());*/
43  //fRun->AddFile(inFile5.Data());
44  fRun->SetOutputFile(outFile.Data());
45 
46 // ------------------------------------------------------------------------
47  // ----- Prepare GEANE --------------------------------------------
48  // this will load Geant3 and execute setup macros to initialize geometry:
49  //
50  FairGeane *Geane = new FairGeane();
51  //fRun->AddTask(Geane);
52  fRun->AddTask(Geane);
53  // ----- Parameter database --------------------------------------------
54 
55  FairRuntimeDb* rtdb = fRun->GetRuntimeDb();
56  FairParRootFileIo* parInput1 = new FairParRootFileIo();
57  parInput1->open(parFile.Data());
58 
60  rtdb->setFirstInput(parInput1);
61 
62  //fRun->LoadGeometry();
63  // ------------------------------------------------------------------------
64 
65  //Geane->SetField(fRun->GetField());
66 
67  // =========================================================================
68  // ====== Reco Sequence ======
69  // =========================================================================
70 
72  DemoPR->AddHitBranch(2,"HypHit");
73  //DemoPR->AddHitBranch(2,"PndTpcPoint");
74  //DemoPR->UseMVD(kTRUE);
75  //DemoPR->AddHitBranch(3,"MVDHit");
76  DemoPR->SetPersistence();
77  DemoPR->UseGeane();
78  //DemoPR->SetHitFL(kTRUE);//starting fit values from first hit in HYP
79 
80  fRun->AddTask(DemoPR);
81 
83  DemoKalman->AddHitBranch(2,"HypHit");
84  //DemoKalman->AddHitBranch(2,"PndTpcPoint");
85  //DemoKalman->UseMVD(kTRUE);
86  //DemoKalman->AddHitBranch(3,"MVDHit");
87  DemoKalman->SetPersistence();
88 
89  fRun->AddTask(DemoKalman);
90 
91 
92 
93  // =========================================================================
94 
95 
96  // ----- Intialise and run --------------------------------------------
97  fRun->Init();
98 
99 
100  fRun->Run(0,nEvents);
101 
102  DemoKalman->WriteHistograms(outFile.Data());
103 
104  // ----- Finish -------------------------------------------------------
105  timer.Stop();
106  Double_t rtime = timer.RealTime();
107  Double_t ctime = timer.CpuTime();
108  cout << endl << endl;
109  cout << "Macro finished succesfully." << endl;
110  cout << "Output file is " << outFile << endl;
111  cout << "Parameter file is " << parFile << endl;
112  cout << "Real time " << rtime << " s, CPU time " << ctime << " s" << endl;
113  cout << endl;
114  // ------------------------------------------------------------------------
115 
116 
117 }
TString RecoFile
void SetPersistence(Bool_t opt=kTRUE)
Bool_t kParameterMerged
Definition: sim_emc_apd.C:113
PndHypDPatternRecoTask * DemoPR
TString outFile
Definition: hit_dirc.C:17
PndHypDKalmanTask * DemoKalman
void SetPersistence(Bool_t opt=kTRUE)
FairGeane * Geane
FairRunAna * fRun
Definition: hit_dirc.C:58
TString inFile
Definition: hit_dirc.C:8
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
void AddHitBranch(unsigned int detId, const TString &m)
void WriteHistograms(const TString &filename)
Int_t iVerbose
Double_t rtime
Definition: hit_dirc.C:113
void AddHitBranch(unsigned int detId, const TString &m)