FairRoot/PandaRoot
Functions
runGemSmearing.C File Reference

Go to the source code of this file.

Functions

int runGemSmearing (Int_t nEvents=10, int verboseLevel=0)
 

Function Documentation

int runGemSmearing ( Int_t  nEvents = 10,
int  verboseLevel = 0 
)

Definition at line 1 of file runGemSmearing.C.

References ctime, Double_t, fRun, PndGemSmearingTask::Init(), MCFile, mvdirec, nEvents, outFile, parFile, parInput1, rtdb, rtime, timer, TString, and verboseLevel.

2 {
3  // ========================================================================
4  // Verbosity level (0=quiet, 1=event level, 2=track level, 3=debug)
5 // Int_t iVerbose = 1;
6  // Input file (MC events)
7  TString MCFile = "Gem_Test.root";
8  // Parameter file
9  TString parFile = "GemParams.root";
10  // Parameter output file
11  // TString parOutFile = "MvdParams.root";
12  // Number of events to process
13 // Int_t nEvents = 100;
14  // ------------------------------------------------------------------------
15  // Output file
16  TString outFile = "Gem_Test_Smeared.root";
17 
18  std::cout << "RecoFile: " << outFile.Data()<< std::endl;
19 
20  // ----- Timer --------------------------------------------------------
21  TStopwatch timer;
22  timer.Start();
23 
24 
25  // ----- Reconstruction run -------------------------------------------
26  FairRunAna *fRun= new FairRunAna();
27  fRun->SetInputFile(MCFile);
28  fRun->SetOutputFile(outFile);
29 
30 
31  // ----- Parameter database --------------------------------------------
32  FairRuntimeDb* rtdb = fRun->GetRuntimeDb();
33  FairParRootFileIo* parInput1 = new FairParRootFileIo();
34  parInput1->open(parFile.Data());
35  //FairParAsciiFileIo* parInput2 = new FairParAsciiFileIo();
36  //TString stsDigiFile = gSystem->Getenv("VMCWORKDIR");
37  //stsDigiFile += "/parameters/sts/sts_digi_new_standard.par";
38  //parInput2->open(stsDigiFile.Data(),"in");
39  rtdb->setFirstInput(parInput1);
40  //rtdb->setSecondInput(parInput2);
41  fRun->LoadGeometry();
42 
43 
44  // ----- Ideal Track Producers ---------------------------------------
45  PndGemSmearingTask* mvdirec = new PndGemSmearingTask(0.1,0.1,0.05);
46  mvdirec->SetVerbose(verboseLevel);
47  fRun->AddTask(mvdirec);
48 
49 
50  // ----- Intialise and run --------------------------------------------
51  fRun->Init();
52  fRun->Run(0,nEvents);
53 
54 
55  // ----- Finish -------------------------------------------------------
56  timer.Stop();
57  Double_t rtime = timer.RealTime();
58  Double_t ctime = timer.CpuTime();
59  cout << endl << endl;
60  cout << "Macro finished succesfully." << endl;
61  cout << "Output file is " << outFile << endl;
62  cout << "Parameter file is " << parFile << endl;
63  cout << "Real time " << rtime << " s, CPU time " << ctime << " s" << endl;
64  cout << endl;
65 
66  return 0;
67 }
int verboseLevel
Definition: Lars/runMvdSim.C:7
TString outFile
Definition: hit_dirc.C:17
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
FairRuntimeDb * rtdb
Definition: hit_dirc.C:66
FairParRootFileIo * parInput1
Definition: hit_dirc.C:67
Double_t ctime
Definition: hit_dirc.C:114
PndHypIdealRecoTask * mvdirec
Definition: hit_hyp.C:65
TString MCFile
Double_t rtime
Definition: hit_dirc.C:113
virtual InitStatus Init()