FairRoot/PandaRoot
detectors/disc/reco.C
Go to the documentation of this file.
1 int reco()
2 {
3  // Macro created 20/09/2006 by S.Spataro
4  // It loads a digi file and performs tracking
5 
6  // Verbosity level (0=quiet, 1=event level, 2=track level, 3=debug)
7  Int_t iVerbose = 0; // just forget about it, for the moment
8 
9  // Number of events to process
10  Int_t nEvents = 0; // if 0 all the vents will be processed
11 
12  // Parameter file
13  TString parFile = "simparams.root"; // at the moment you do not need it
14 
15  // Digitisation file (ascii)
16  TString digiFile = "all.par";
17 
18  // Output file
19  TString outFile = "reco.root";
20 
21  // ----- Timer --------------------------------------------------------
22  TStopwatch timer;
23  // ------------------------------------------------------------------------
24 
25  // ----- Reconstruction run -------------------------------------------
26  FairRunAna *fRun= new FairRunAna();
27  fRun->SetInputFile("sim.root");
28  fRun->AddFriend("digi.root");
29  fRun->SetOutputFile(outFile);
30  fRun->SetGenerateRunInfo(kFALSE);
31  fRun->SetUseFairLinks(kTRUE);
32  FairGeane *Geane = new FairGeane();
33  fRun->AddTask(Geane);
34 
35  // ----- Parameter database --------------------------------------------
36  TString emcDigiFile = gSystem->Getenv("VMCWORKDIR");
37  emcDigiFile += "/macro/params/";
38  emcDigiFile += digiFile;
39 
40  FairRuntimeDb* rtdb = fRun->GetRuntimeDb();
41  FairParRootFileIo* parInput1 = new FairParRootFileIo();
42  parInput1->open(parFile.Data());
43 
44  FairParAsciiFileIo* parIo1 = new FairParAsciiFileIo();
45  parIo1->open(emcDigiFile.Data(),"in");
46 
47  rtdb->setFirstInput(parInput1);
48  rtdb->setSecondInput(parIo1);
49 
50 
52  fRun->AddTask(disc_dirc);
53 
54  // ----- Intialise and run --------------------------------------------
56  cout << "fRun->Init()" << endl;
57  fRun->Init();
58 
59  timer.Start();
60  fRun->Run(0,nEvents);
61  // ------------------------------------------------------------------------
62 
63 
64  // ----- Finish -------------------------------------------------------
65  timer.Stop();
66  Double_t rtime = timer.RealTime();
67  Double_t ctime = timer.CpuTime();
68  cout << endl << endl;
69  cout << "Macro finished successfully." << endl;
70  cout << "Output file is " << outFile << endl;
71  cout << "Parameter file is " << parFile << endl;
72  cout << "Real time " << rtime << " s, CPU time " << ctime << " s" << endl;
73  cout << endl;
74  // ------------------------------------------------------------------------
75  cout << " Test passed" << endl;
76  cout << " All ok " << endl;
77  return 0;
78 }
TString outFile
Definition: hit_dirc.C:17
TString digiFile
Definition: bump_emc.C:20
TString emcDigiFile
Definition: bump_emc.C:45
FairGeane * Geane
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
static void Init(Int_t MapVersion)
FairRuntimeDb * rtdb
Definition: hit_dirc.C:66
FairParRootFileIo * parInput1
Definition: hit_dirc.C:67
Double_t ctime
Definition: hit_dirc.C:114
FairParAsciiFileIo * parIo1
Definition: bump_emc.C:53
int reco()
Int_t iVerbose
Double_t rtime
Definition: hit_dirc.C:113