FairRoot/PandaRoot
runMvdPidIdeal.C
Go to the documentation of this file.
1 {
2 // Macro to test PndMvdIdealTask: run runMvdSim.C before running
3 // this. PndMvdIdealTask writes likelihoods to PndMvdPidCand.
4 // This macro has been tested with rev 2503 so far.
5 
6  // ========================================================================
7  // Verbosity level (0=quiet, 1=event level, 2=track level, 3=debug)
8  Int_t iVerbose = 1;
9 
10  // Input file (MC events)
11  TString inFile = "Mvd_Test.root";
12  // Parameter file
13  TString parFile = "MvdParams.root";
14  // Output file
15  TString outFile = "MvdPidIdeal.root";
16  // Number of events to process
17  Int_t nEvents = 10000;
18 
19  // ----- Load libraries ------------------------------------------------
20  gROOT->Macro("$VMCWORKDIR/gconfig/rootlogon.C");
21  gROOT->Macro("$VMCWORKDIR/gconfig/rootlogon.C");
22 
23 
24  // --- Now choose concrete engines for the different tasks -------------
25  // ------------------------------------------------------------------------
26 
27 
28  // In general, the following parts need not be touched
29  // ========================================================================
30 
31 
32 
33 
34  // ----- Timer --------------------------------------------------------
35  TStopwatch timer;
36  timer.Start();
37  // ------------------------------------------------------------------------
38 
39 
40 
41  // ----- Reconstruction run -------------------------------------------
42  FairRunAna *fRun= new FairRunAna();
43  fRun->SetInputFile(inFile);
44  fRun->SetOutputFile(outFile);
45  // ------------------------------------------------------------------------
46 
47 
48 
49  // ----- Parameter database --------------------------------------------
50  FairRuntimeDb* rtdb = fRun->GetRuntimeDb();
51  FairParRootFileIo* parInput1 = new FairParRootFileIo();
52  parInput1->open(parFile.Data());
53  rtdb->setFirstInput(parInput1);
54  fRun->LoadGeometry();
55  // ------------------------------------------------------------------------
56 
57 
58 
59  // =========================================================================
60  // ====== Hit Producers ======
61  // =========================================================================
62 
63  // ----- MVD hit producer --------------------------------------------
65  fRun->AddTask(mvdpid);
66 
67  // ===== End of HitProducers =====
68  // =========================================================================
69 
70  // ----- Intialise and run --------------------------------------------
71  fRun->Init();
72  fRun->Run(0,nEvents-1);
73  // ------------------------------------------------------------------------
74 
75 
76 
77  // ----- Finish -------------------------------------------------------
78  timer.Stop();
79  Double_t rtime = timer.RealTime();
80  Double_t ctime = timer.CpuTime();
81  cout << endl << endl;
82  cout << "Macro finished succesfully." << endl;
83  cout << "Output file is " << outFile << endl;
84  cout << "Parameter file is " << parFile << endl;
85  cout << "Real time " << rtime << " s, CPU time " << ctime << " s" << endl;
86  cout << endl;
87  // ------------------------------------------------------------------------
88 
89 
90 }
FairParRootFileIo * parInput1
TString outFile
FairRuntimeDb * rtdb
TString inFile
PndMvdPidIdealTask * mvdpid
TString parFile
Double_t rtime
TStopwatch timer
FairRunAna * fRun
Int_t nEvents
Double_t
Double_t ctime
Int_t iVerbose