FairRoot/PandaRoot
Functions
examples/fastsim/runReco.C File Reference

Go to the source code of this file.

Functions

int runReco (TString base="dsdsj_20k.evt", int nEvents=10)
 

Function Documentation

int runReco ( TString  base = "dsdsj_20k.evt",
int  nEvents = 10 
)

Definition at line 1 of file examples/fastsim/runReco.C.

References basiclibs(), ctime, DemoKalman, DemoPR, digiFile, Double_t, emcDigiFile, emcHdrFiller, emcHitProd, emcHitsToWaveform, emcMakeBump, emcMakeCluster, emcMakeDigi, emcMakeRecoHit, emcWaveformToDigi, fRun, Geane, inFile, iVerbose, nEvents, outFile, parFile, parInput1, parIo1, rtdb, rtime, timer, and TString.

2 {
3 
4  // ========================================================================
5  // Verbosity level (0=quiet, 1=event level, 2=track level, 3=debug)
6  Int_t iVerbose = 0;
7 
8  // Number of events to process
9  //Int_t nEvents = 2000; // process all events in input file
10  // Base File name
11  //TString base="Lambda";
12 
13  // Input file (MC events)
14  TString inFile = base+".mc.root";
15  //Parameter file
16  TString parFile = base+".param.root";
17  // Output file
18  TString outFile = base+".mcreco.root";
19 
20 
21 
22 // ---- Load libraries -------------------------------------------------
23  gROOT->LoadMacro("$VMCWORKDIR/gconfig/basiclibs.C");
24  basiclibs();
25  gSystem->Load("libgeant321");
26  gSystem->Load("libGeoBase");
27  gSystem->Load("libParBase");
28  gSystem->Load("libBase");
29  gSystem->Load("libPndData");
30  gSystem->Load("libField");
31  gSystem->Load("libPassive");
32  gSystem->Load("libMvd");
33  gSystem->Load("libEmc");
34  gSystem->Load("libDrcProp");
35  gSystem->Load("libDrc");
36  //gSystem->Load("libGen");
37  //gSystem->Load("libPGen");
38 
39  gSystem->Load("libTrkBase");
40  gSystem->Load("libGeane");
41  gSystem->Load("libgenfit");
42  gSystem->Load("libtrackrep");
43  gSystem->Load("libtpc");
44  gSystem->Load("libtpcreco");
45  gSystem->Load("librecotasks");
46 
47 gSystem->ListLibraries();
48 
49 
50 
51 // ------------------------------------------------------------------------
52 
53 // ----- Timer --------------------------------------------------------
54  TStopwatch timer;
55  timer.Start();
56  // ------------------------------------------------------------------------
57 
58  // Digitisation file (ascii)
59  TString digiFile = "emc.par";
60 
61 
62  // ----- Reco run -------------------------------------------
63  FairRunAna *fRun= new FairRunAna();
64  fRun->SetInputFile(inFile);
65  fRun->SetOutputFile(outFile);
66 
67  // ----- Prepare GEANE --------------------------------------------
68  // this will load Geant3 and execute setup macros to initialize geometry:
69  FairGeane *Geane = new FairGeane(inFile);
70 
71  // ------------------------------------------------------------------------
72  // ----- Parameter database --------------------------------------------
73  /*
74  FairRuntimeDb* rtdb = fRun->GetRuntimeDb();
75  FairParRootFileIo* parInput1 = new FairParRootFileIo();
76  parInput1->open(parFile.Data());
77  rtdb->setFirstInput(parInput1);
78 
79  rtdb->Print();
80 
81  // Set the field(if any) to Geane
82  Geane->SetField(fRun->GetField());
83  */
84  // ------------------------------------------------------------------------
85  // ----- Parameter database --------------------------------------------
86  TString emcDigiFile = gSystem->Getenv("VMCWORKDIR");
87  emcDigiFile += "/emc/";
88  emcDigiFile += digiFile;
89 
90  FairRuntimeDb* rtdb = fRun->GetRuntimeDb();
91  FairParRootFileIo* parInput1 = new FairParRootFileIo();
92  parInput1->open(parFile.Data());
93 
94  FairParAsciiFileIo* parIo1 = new FairParAsciiFileIo();
95  parIo1->open(emcDigiFile.Data(),"in");
96 
97  rtdb->setFirstInput(parInput1);
98  rtdb->setSecondInput(parIo1);
99  rtdb->Print();
100  // ----------------------------------------------------------
101 
102  fRun->LoadGeometry();
103  Geane->SetField(fRun->GetField());
104 
105  // ------------------------------------------------------------------------
106  // ----- Reco Sequence --------------------------------------------
107 
108  DemoPatternRecoTask* DemoPR = new DemoPatternRecoTask();
109  DemoPR->AddHitBranch(2,"PndTpcPoint");
110 // DemoPR->AddHitBranch(3,"MVDPoint");
111  DemoPR->SetPersistence();
112  //DemoPR->UseGeane();
113  fRun->AddTask(DemoPR);
114 
115  DemoKalmanTask* DemoKalman = new DemoKalmanTask();
116  DemoKalman->AddHitBranch(2,"PndTpcPoint");
117 // DemoKalman->AddHitBranch(3,"MVDPoint");
118  DemoKalman->SetPersistence();
119 // DemoKalman->SetSmooth(true);
120  fRun->AddTask(DemoKalman);
121 
122  // ----- EMC hit producers ---------------------------------
123  // The file name should be the same of the geometry file which was used for the simulation
124 
125 
127  fRun->AddTask(emcHitProd); // hit production
128 
130 //fRun->AddTask(emcMakeDigi); // fast digitization
131 
134  fRun->AddTask(emcHitsToWaveform); // full digitization
135  fRun->AddTask(emcWaveformToDigi); // full digitization
136 
138  fRun->AddTask(emcMakeCluster);
139 
141  fRun->AddTask(emcHdrFiller); // ECM header
142 
144  fRun->AddTask(emcMakeBump);
145 
147  fRun->AddTask(emcMakeRecoHit);
148 
149 
150 // ----------------------------
151 
152 
153 
154  DemoToolsTask* DemoTools = new DemoToolsTask();
155  fRun->AddTask(DemoTools);
156 
157 
158 // ----------------------------
159 
160 // V0Selector* V0Sel2 = new V0Selector();
161 // V0Sel2->SetTrackBranchName("Track");
162 // V0Sel2->SetV0BranchName("Lambda");
163 // V0Sel2->SetPositivePartMass(0.938272);
164 // V0Sel2->SetNegativePartMass(0.13957);
165 // V0Sel2->SetPersistence();
166 //fRun->AddTask(V0Sel2);
167 
168 
169 // LambdaStatTask* lambdaStat = new LambdaStatTask();
170 // lambdaStat->SetPersistence();
171 //fRun->AddTask(lambdaStat);
172 
173  // ----- Intialise and run --------------------------------------------
174  //fRun->SetStoreTraj(kFALSE);
175  fRun->Init();
176 
177  rtdb->print();
178  Geane->SetField(fRun->GetField());
179 
180  fRun->Run(0,nEvents);
181 
182  DemoKalman->WriteHistograms();
183  DemoTools->WriteHistograms();
184 
185  // ------------------------------------------------------------------------
186  // ----- Finish -------------------------------------------------------
187  timer.Stop();
188  Double_t rtime = timer.RealTime();
189  Double_t ctime = timer.CpuTime();
190  cout << endl << endl;
191  cout << "Macro finished succesfully." << endl;
192  cout << "Output file is " << outFile << endl;
193  cout << "Parameter file is " << parFile << endl;
194  cout << "Real time " << rtime << " s, CPU time " << ctime << " s" << endl;
195  cout << endl;
196  // ------------------------------------------------------------------------
197  return 0;
198 }
Takes list of PndEmcHits and creates PndEmcWaveform.
basiclibs()
Create PndEmcRecoHit from PndEmcBump.
PndEmcHitsToWaveform * emcHitsToWaveform
Definition: full_emc.C:60
PndHypDPatternRecoTask * DemoPR
TString outFile
Definition: hit_dirc.C:17
PndEmcMakeRecoHit * emcMakeRecoHit
PndHypDKalmanTask * DemoKalman
creates PndEmcHits from PndEmcPoints
TString digiFile
Definition: bump_emc.C:20
PndEmcMakeBump * emcMakeBump
Definition: bump_emc.C:63
TString emcDigiFile
Definition: bump_emc.C:45
PndEmcHdrFiller * emcHdrFiller
Definition: full_emc.C:68
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
PndEmcMakeCluster * emcMakeCluster
Definition: full_emc.C:65
Int_t nEvents
Definition: hit_dirc.C:11
TStopwatch timer
Definition: hit_dirc.C:51
FairRuntimeDb * rtdb
Definition: hit_dirc.C:66
PndEmcHitProducer * emcHitProd
Takes clusters and slits them up into bumps.
FairParRootFileIo * parInput1
Definition: hit_dirc.C:67
Double_t ctime
Definition: hit_dirc.C:114
PndEmcWaveformToDigi * emcWaveformToDigi
Definition: full_emc.C:61
FairParAsciiFileIo * parIo1
Definition: bump_emc.C:53
Task to cluster PndEmcDigis.
PndEmcMakeDigi * emcMakeDigi
Int_t iVerbose
Takes list of PndEmcWaveform and creates PndEmcDigi.
Double_t rtime
Definition: hit_dirc.C:113
Task to create Emc header.
Task to create PndEmcDigi from PndEmcHit.