FairRoot/PandaRoot
hit_ftof.C
Go to the documentation of this file.
1 {
2 
3  // ========================================================================
4  // Verbosity level (0=quiet, 1=event level, 2=track level, 3=debug)
5  Int_t iVerbose = 1;
6 
7  // Input file (MC events)
8 
9  TString inFile = "test.root";
10 
11  // Number of events to process
12  Int_t nEvents = 0;
13 
14 
15  // Parameter file
16  TString parFile = "simparams.root";
17 
18  // Output file
19  TString outFile = "hit_ftof.root";
20 
21 
22 
23  // ---- Load libraries -------------------------------------------------
24  gROOT->LoadMacro("$VMCWORKDIR/gconfig/rootlogon.C");
25  rootlogon();
26 
27  //gSystem->Load("libSciT");
28  // gSystem->Load("librazhyp");
29  // gSystem->Load("libHyp");
30  // gSystem->Load("libTof");
31 
32  // ------------------------------------------------------------------------
33 
34 
35  // ----- Timer --------------------------------------------------------
36  TStopwatch timer;
37  timer.Start();
38  // ------------------------------------------------------------------------
39 
40 
41 
42  // ----- Reconstruction run -------------------------------------------
43  FairRunAna *fRun= new FairRunAna();
44  fRun->SetInputFile(inFile);
45  fRun->SetOutputFile(outFile);
46  // ------------------------------------------------------------------------
47 
48 
49 
50  // ----- Parameter database --------------------------------------------
51  FairRuntimeDb* rtdb = fRun->GetRuntimeDb();
52  FairParRootFileIo* parInput1 = new FairParRootFileIo();
53  parInput1->open(parFile.Data());
54 
55  rtdb->setFirstInput(parInput1);
56 
57  //fRun->LoadGeometry();
58  // ------------------------------------------------------------------------
59 
60 
61 
62  // =========================================================================
63  // ====== Hit Producers ======
64  // =========================================================================
65 
66  // ----- TOF hit producer --------------------------------------------
67 
69  tofhit->SetVerbose(iVerbose);
70  fRun->AddTask(tofhit);
71 
72 
73  // ===== End of HitProducers =====
74  // =========================================================================
75 
76  // ----- Intialise and run --------------------------------------------
77  fRun->Init();
78  fRun->Run(0,nEvents);
79  // ------------------------------------------------------------------------
80 
81 
82 
83  // ----- Finish -------------------------------------------------------
84  timer.Stop();
85  Double_t rtime = timer.RealTime();
86  Double_t ctime = timer.CpuTime();
87  cout << endl << endl;
88  cout << "Macro finished succesfully." << endl;
89  cout << "Output file is " << outFile << endl;
90  cout << "Parameter file is " << parFile << endl;
91  cout << "Real time " << rtime << " s, CPU time " << ctime << " s" << endl;
92  cout << endl;
93  // ------------------------------------------------------------------------
94 
95 
96 }
TString outFile
Definition: hit_dirc.C:17
PndFtofHitProducerIdeal * tofhit
Definition: hit_ftof.C:68
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
Int_t iVerbose
Double_t rtime
Definition: hit_dirc.C:113