FairRoot/PandaRoot
detectors/hyp/Alicia/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 = "Bup_hypFSG41TXm.root";//sim_piTr.root";//sim_pidC.root";
9  Int_t nEvents = 420;//50000;
10  TString parFile="Bup_hypFS1TG4Xmparams.root";//PiTrparams.root";//pidparams.root";
11  TString RecoFile = "output_hitbup.root";//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("libtrackrep");
28  gSystem->Load("librazhyp");
29  gSystem->Load("libHyp");
30 
31 // ----- Timer --------------------------------------------------------
32  TStopwatch timer;
33  timer.Start();
34 
35  // ------------------------------------------------------------------------
36 
37  // ----- Reconstruction run -------------------------------------------
38 
39  FairRunAna *fRun= new FairRunAna();
40  fRun->SetInputFile(inFile.Data());
41  fRun->AddFriend(RecoFile);
42 /*fRun->AddFile(inFile2.Data());
43  fRun->AddFile(inFile3.Data());
44  fRun->AddFile(inFile4.Data());*/
45  //fRun->AddFile(inFile5.Data());
46  fRun->SetOutputFile(outFile.Data());
47 
48 // ------------------------------------------------------------------------
49  // ----- Prepare GEANE --------------------------------------------
50  // this will load Geant3 and execute setup macros to initialize geometry:
51  //
52  FairGeane *Geane = new FairGeane();
53  //fRun->AddTask(Geane);
54  fRun->AddTask(Geane);
55  // ----- Parameter database --------------------------------------------
56 
57  FairRuntimeDb* rtdb = fRun->GetRuntimeDb();
58  FairParRootFileIo* parInput1 = new FairParRootFileIo();
59  parInput1->open(parFile.Data());
60 
62  rtdb->setFirstInput(parInput1);
63 
64  //fRun->LoadGeometry();
65  // ------------------------------------------------------------------------
66 
67  //Geane->SetField(fRun->GetField());
68 
69  // =========================================================================
70  // ====== Reco Sequence ======
71  // =========================================================================
72 
74  DemoPR->AddHitBranch(2,"HypHit");
75  //DemoPR->AddHitBranch(2,"PndTpcPoint");
76  //DemoPR->UseMVD(kTRUE);
77  //DemoPR->AddHitBranch(3,"MVDHit");
78  DemoPR->SetPersistence();
79  DemoPR->UseGeane();
80  //DemoPR->SetHitFL(kTRUE);//starting fit values from first hit in HYP
81  //DemoPR->SetVtxAbsName("Absorber14_");
82  fRun->AddTask(DemoPR);
83 
85  DemoKalman->AddHitBranch(2,"HypHit");
86  //DemoKalman->AddHitBranch(2,"PndTpcPoint");
87  //DemoKalman->UseMVD(kTRUE);
88  //DemoKalman->AddHitBranch(3,"MVDHit");
89  DemoKalman->SetPersistence();
90 
91  fRun->AddTask(DemoKalman);
92 
93 
94 
95  // =========================================================================
96 
97 
98  // ----- Intialise and run --------------------------------------------
99  fRun->Init();
100 
101 
102  fRun->Run(0,nEvents);
103 
104  DemoKalman->WriteHistograms(outFile.Data());
105 
106  // ----- Finish -------------------------------------------------------
107  timer.Stop();
108  Double_t rtime = timer.RealTime();
109  Double_t ctime = timer.CpuTime();
110  cout << endl << endl;
111  cout << "Macro finished succesfully." << endl;
112  cout << "Output file is " << outFile << endl;
113  cout << "Parameter file is " << parFile << endl;
114  cout << "Real time " << rtime << " s, CPU time " << ctime << " s" << endl;
115  cout << endl;
116  // ------------------------------------------------------------------------
117 
118 
119 }
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)