FairRoot/PandaRoot
digi_all.C
Go to the documentation of this file.
1 int digi_all() {
2  // ========================================================================
3  // Verbosity level (0=quiet, 1=event level, 2=track level, 3=debug)
4  Int_t iVerbose = 0;
5 
6  // Input file (MC events)
7  TString inFile = "points_global.root";
8 
9  // Parameter file
10  TString parFile = "params_global.root";
11 
12  // Output file
13  TString outFile = "digi_global.root";
14 
15  // Number of events to process
16  Int_t nEvents = 0;
17 
18  // ---- Load libraries -------------------------------------------------
19  gROOT->LoadMacro("$VMCWORKDIR/gconfig/rootlogon.C");
20  rootlogon();
21  TString sysFile = gSystem->Getenv("VMCWORKDIR");
22  // ------------------------------------------------------------------------
23 
24  // --- Now choose concrete engines for the different tasks -------------
25  // ------------------------------------------------------------------------
26 
27  // In general, the following parts need not be touched
28  // ========================================================================
29 
30  // ----- Timer --------------------------------------------------------
31  TStopwatch timer;
32  timer.Start();
33  // ------------------------------------------------------------------------
34 
35  // ----- Digitization run -------------------------------------------
36  FairRunAna *fRun= new FairRunAna();
37  fRun->SetInputFile(inFile);
38  fRun->SetOutputFile(outFile);
39 
40  // ------------------------------------------------------------------------
41 
42  // ----- Parameter database --------------------------------------------
43  TString allDigiFile = sysFile+"/macro/params/all.par";
44 
45  FairRuntimeDb* rtdb = fRun->GetRuntimeDb();
46  FairParRootFileIo* parInput1 = new FairParRootFileIo();
47  parInput1->open(parFile.Data());
48 
49  FairParAsciiFileIo* parIo1 = new FairParAsciiFileIo();
50  parIo1->open(allDigiFile.Data(),"in");
51 
52  rtdb->setFirstInput(parInput1);
53  rtdb->setSecondInput(parIo1);
54  // ------------------------------------------------------------------------
55 
56  // ################################################################## MVD
57  // ----- MDV digi producer ----------------------------------------
59  mvddigi->SetVerbose(iVerbose);
60  fRun->AddTask(mvddigi);
61  // ----- MDV cluster producer -----------------------------------
62  Double_t chargecut = 5000., pixelrad=1.8; // one day this will move to the parameter db.
64  mvdmccls->SetVerbose(iVerbose);
65  fRun->AddTask(mvdmccls);
66 
67  /*// ----- MDV strip digi producer --------------------------------
68  PndMvdStripHitProducer* mvdHitProd = new PndMvdStripHitProducer();
69  mvdHitProd->SetVerbose(iVerbose);
70  fRun->AddTask(mvdHitProd);
71  // ----- MDV hybrid digi producer -------------------------------
72  PndMvdHybridHitProducer* mvdPixProd = new PndMvdHybridHitProducer();
73  mvdPixProd->SetVerbose(iVerbose);
74  fRun->AddTask(mvdPixProd);
75  // ----- MVD strip cluster task ---------------------------------
76  Double_t chargecut = 5000.
77  PndMvdStripClusterTask* mvdmccls = new PndMvdStripClusterTask(chargecut, inFile);
78  mvdmccls->SetVerbose(iVerbose);
79  fRun->AddTask(mvdmccls);
80  // ----- MVD pixel cluster task ---------------------------------
81  PndMvdPixelClusterTask* mvdClusterizer = new PndMvdPixelClusterTask(1.8, inFile);
82  mvdClusterizer->SetVerbose(iVerbose);
83  fRun->AddTask(mvdClusterizer);*/
84  // ################################################################## STT
86  //PndSttHitProducerRealFast* sttHitProducer = new PndSttHitProducerRealFast();
87  fRun->AddTask(sttHitProducer);
88  // ################################################################## GEM
89  // ----- GEM digi producer --------------------------------------
90  Int_t verboseLevel = 0;
91  PndGemDigitize* gemDigitize = new PndGemDigitize("GEM Digitizer", verboseLevel);
92  fRun->AddTask(gemDigitize);
93  // ----- GEM hit producer ---------------------------------------
94  PndGemFindHits* gemFindHits = new PndGemFindHits("GEM Hit Finder", verboseLevel);
95  fRun->AddTask(gemFindHits);
96  // ##################################################################
97 
98  // ----- Intialise and run --------------------------------------------
99  fRun->Init();
100  fRun->Run(0, nEvents);
101 
102  rtdb->saveOutput();
103  rtdb->print();
104  // ------------------------------------------------------------------------
105 
106  // ----- Finish -------------------------------------------------------
107  timer.Stop();
108  Double_t rtime = timer.RealTime();
109  Double_t ctime = timer.CpuTime();
110  cout << endl << endl;
111  cout << "Macro finished succesfully." << endl;
112  cout << "Output file is " << outFile << endl;
113  cout << "Parameter file is " << parFile << endl;
114  cout << "Real time " << rtime << " s, CPU time " << ctime << " s" << endl;
115  cout << endl;
116  // ------------------------------------------------------------------------
117 
118 
119  return 0;
120 }
PndGemFindHits * gemFindHits
int verboseLevel
Definition: Lars/runMvdSim.C:7
TString outFile
Definition: hit_dirc.C:17
Double_t chargecut
Definition: runclust.C:44
TString inFile
Definition: hit_dirc.C:8
PndMvdStripClusterTask * mvdmccls
Definition: runclust.C:45
int digi_all()
Definition: digi_all.C:1
PndSttHitProducerRealFast * sttHitProducer
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 SetVerbose(Int_t iVerbose)
FairParRootFileIo * parInput1
Definition: hit_dirc.C:67
Double_t ctime
Definition: hit_dirc.C:114
PndGemDigitize * gemDigitize
FairParAsciiFileIo * parIo1
Definition: bump_emc.C:53
Int_t iVerbose
PndMvdDigiTask * mvddigi
Double_t rtime
Definition: hit_dirc.C:113