FairRoot/PandaRoot
Functions
TB_gem_digi.C File Reference

Go to the source code of this file.

Functions

Int_t TB_gem_digi (Int_t nEvents=1000, Int_t anaEv=1000, Int_t nofC=1000, Int_t cWid=10, Int_t nStations=3, int verboseLevel=0)
 

Function Documentation

Int_t TB_gem_digi ( Int_t  nEvents = 1000,
Int_t  anaEv = 1000,
Int_t  nofC = 1000,
Int_t  cWid = 10,
Int_t  nStations = 3,
int  verboseLevel = 0 
)

Definition at line 4 of file TB_gem_digi.C.

References allDigiFile, ctime, Double_t, fRun, gemDigitize, MCFile, nEvents, outFile, parFile, parInput1, parIo1, rtdb, rtime, PndGemDigitize::RunTimeBased(), PndGemDigitize::SetRealisticResponse(), sysFile, timer, TString, and verboseLevel.

5 {
6  if ( nStations != 3 && nStations != 4 ) {
7  cout << "WRONG number of stations (" << nStations << "), only 3 or 4 allowed." << endl;
8  return;
9  }
10 
11  TString sysFile = gSystem->Getenv("VMCWORKDIR");
12 
13  // Input file (MC events)
14  TString baseName;
15  baseName.Form("Gem_MvdStt_%dStations_DPM_n%d",nStations,nEvents);
16 
17  TString MCFile = baseName + ".root";
18  TString parFile = baseName + "_par.root";
19  TString outFile = baseName + Form("_digiSorted_a%d_c%dx%d.root",anaEv,nofC,cWid);
20 
21  std::cout << "Output File: " << outFile.Data()<< std::endl;
22 
23  // ----- Timer --------------------------------------------------------
24  TStopwatch timer;
25  timer.Start();
26 
27 
28  // ----- Reconstruction run -------------------------------------------
29  FairRunAna *fRun= new FairRunAna();
30  fRun->SetInputFile(MCFile);
31  fRun->SetOutputFile(outFile);
32 
33  fRun->SetEventMeanTime(50);
34 
35  // ----- Parameter database --------------------------------------------
36  TString allDigiFile = sysFile+"/macro/params/gem_3Stations.digi.par";
37  if ( nStations == 4 ) allDigiFile = sysFile+"/macro/params/gem_4Stations.digi.par";
38 
39  FairRuntimeDb* rtdb = fRun->GetRuntimeDb();
40  FairParRootFileIo* parInput1 = new FairParRootFileIo();
41  parInput1->open(parFile.Data());
42 
43  FairParAsciiFileIo* parIo1 = new FairParAsciiFileIo();
44  parIo1->open(allDigiFile.Data(),"in");
45 
46  rtdb->setFirstInput(parInput1);
47  rtdb->setSecondInput(parIo1);
48  // ------------------------------------------------------------------------
49 
50  // ----- GEM Digitizer -----------------------------------------------
51  PndGemDigitize* gemDigitize = new PndGemDigitize("GEM Digitizer", verboseLevel);
52  gemDigitize->SetRealisticResponse();
53  gemDigitize->RunTimeBased();
54  fRun->AddTask(gemDigitize);
55 
56  PndGemDigiSorterTask* gemSorter = new PndGemDigiSorterTask(nofC, cWid, "GEMDigi", "GEMDigiSorted", "PndGEM");
57  fRun->AddTask(gemSorter);
58 
59  // ----- Intialise and run --------------------------------------------
60  fRun->Init();
61  fRun->Run(0,anaEv);//nEvents);
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 succesfully." << 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 }
int verboseLevel
Definition: Lars/runMvdSim.C:7
TString outFile
Definition: hit_dirc.C:17
void RunTimeBased(Bool_t bt=kTRUE)
TString allDigiFile
Definition: hit_muo.C:36
FairRunAna * fRun
Definition: hit_dirc.C:58
TString sysFile
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
void SetRealisticResponse(Bool_t bt=kTRUE)
FairParRootFileIo * parInput1
Definition: hit_dirc.C:67
Double_t ctime
Definition: hit_dirc.C:114
PndGemDigitize * gemDigitize
FairParAsciiFileIo * parIo1
Definition: bump_emc.C:53
TString MCFile
Double_t rtime
Definition: hit_dirc.C:113