FairRoot/PandaRoot
timeordered/run_digi_sttcombi_timebased.C
Go to the documentation of this file.
2 {
3  // ========================================================================
4  // Verbosity level (0=quiet, 1=event level, 2=track level, 3=debug)
5  Int_t iVerbose = 0;
6 
7  TString inFile = "Mvd_Sim.root";
8 
9 
10 
11  // Number of events to process
12  Int_t nEvents = 100;
13 
14  TString sysFile = gSystem->Getenv("VMCWORKDIR");
15  // ------------------------------------------------------------------------
16 
17  // Output file
18  PndFileNameCreator creator(inFile.Data());
19  TString parFile = creator.GetParFileName().c_str();
20  TString outFile = creator.GetDigiFileName("timebased").c_str();
21  std::cout << "DigiFileName: " << outFile.Data() << std::endl;
22 
23  // --- Now choose concrete engines for the different tasks -------------
24  // ------------------------------------------------------------------------
25 
26  // In general, the following parts need not be touched
27  // ========================================================================
28 
29  // ----- Timer --------------------------------------------------------
30  TStopwatch timer;
31  timer.Start();
32  // ------------------------------------------------------------------------
33 
34  // ----- Digitization run -------------------------------------------
35  FairRunAna *fRun= new FairRunAna();
36  fRun->SetInputFile(inFile);
37  fRun->SetOutputFile(outFile);
38  fRun->SetEventMeanTime(50);
39  fRun->SetBeamTime(400, 2000);
40  fRun->SetUseFairLinks(kTRUE);
41  // ------------------------------------------------------------------------
42 
43  // ----- Parameter database --------------------------------------------
44  TString allDigiFile = sysFile+"/macro/params/all.par";
45 
46  FairRuntimeDb* rtdb = fRun->GetRuntimeDb();
47  FairParRootFileIo* parInput1 = new FairParRootFileIo();
48  parInput1->open(parFile.Data());
49 
50  FairParAsciiFileIo* parIo1 = new FairParAsciiFileIo();
51  parIo1->open(allDigiFile.Data(),"in");
52 
53  rtdb->setFirstInput(parInput1);
54  rtdb->setSecondInput(parIo1);
55  // ------------------------------------------------------------------------
56 
57  // ----- STT digi producers ---------------------------------
59  sttHitProducer->RunTimeBased();
60  fRun->AddTask(sttHitProducer);
61 
62  PndSttHitSorterTask* sttSorter = new PndSttHitSorterTask(5000, 50, "STTHit", "STTSortedHits", "PndSTT");
63  fRun->AddTask(sttSorter);
64 
65  // ----- MDV digi producers ---------------------------------
67  mvddigi->RunTimeBased();
68  mvddigi->SetVerbose(iVerbose);
69  fRun->AddTask(mvddigi);
70 
71 
72  // ----- EMC hit producers ---------------------------------
75  emcHitsToWaveform->SetStorageOfData(kTRUE);
76  //emcWaveformToDigi->SetStorageOfData(kFALSE);
77  fRun->AddTask(emcHitsToWaveform); // full digitization
78  fRun->AddTask(emcWaveformToDigi); // full digitization
79 
80  // ----- SciT hit producers ---------------------------------
82  tofhit->SetVerbose(iVerbose);
83  fRun->AddTask(tofhit);
84 
85  // ----- MDT hit producers ---------------------------------
87  mdtHitProd->SetPositionSmearing(.3); // position smearing [cm]
88  fRun->AddTask(mdtHitProd);
89 
90  // ----- DRC hit producers ---------------------------------
92  drchit->SetVerbose(iVerbose);
93  fRun->AddTask(drchit);
94  // ----- GEM hit producers ---------------------------------
95  Int_t verboseLevel = 0;
96  PndGemDigitize* gemDigitize = new PndGemDigitize("GEM Digitizer", verboseLevel);
97  fRun->AddTask(gemDigitize);
98 
99  // ----- FTS hit producers ---------------------------------
101  ftsHitProducer->RunTimeBased();
102  //PndFtsHitProducerIdeal* ftsHitProducer = new PndFtsHitProducerIdeal();
103  //PndFtsHitProducerRealFull* ftsHitProducer = new PndFtsHitProducerRealFull();
104 // fRun->AddTask(ftsHitProducer);
105 
106  PndFtsHitSorterTask* ftsSorter = new PndFtsHitSorterTask(5000, 50, "FTSHit", "FTSSortedHits", "PndFTS");
107 // fRun->AddTask(ftsSorter);
108  // ----- Ftof hit producers ---------------------------------
110  ftofhit->SetVerbose(iVerbose);
111  fRun->AddTask(ftofhit);
112  // ----- Intialise and run --------------------------------------------
113  fRun->Init();
114  fRun->Run(0, nEvents);
115 
116  rtdb->saveOutput();
117  rtdb->print();
118 
119  // ------------------------------------------------------------------------
120 
121  // ----- Finish -------------------------------------------------------
122 
123  timer.Stop();
124  Double_t rtime = timer.RealTime();
125  Double_t cputime = timer.CpuTime();
126  cout << endl << endl;
127  cout << "Macro finished succesfully." << endl;
128  cout << "Output file is " << outFile << endl;
129  cout << "Parameter file is " << parFile << endl;
130  cout << "Real time " << rtime << " s, CPU time " << cputime << " s" << endl;
131  cout << endl;
132  // ------------------------------------------------------------------------
133 
134  return 0;
135 }
Takes list of PndEmcHits and creates PndEmcWaveform.
int verboseLevel
Definition: Lars/runMvdSim.C:7
PndEmcHitsToWaveform * emcHitsToWaveform
Definition: full_emc.C:60
TString outFile
Definition: hit_dirc.C:17
PndSttHitProducerRealFast * sttHitProducer
TString allDigiFile
Definition: hit_muo.C:36
PndFtofHitProducerIdeal * tofhit
Definition: hit_ftof.C:68
FairRunAna * fRun
Definition: hit_dirc.C:58
TString inFile
Definition: hit_dirc.C:8
void SetStorageOfData(Bool_t val)
PndMdtHitProducerIdeal * mdtHitProd
Definition: hit_muo.C:162
PndDrcHitProducerReal * drchit
Definition: hit_dirc_draw.C:73
TString sysFile
A simple class which adds the corresponding file extensions to a given base class.
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
PndFtofHitProducerIdeal * ftofhit
PndGemDigitize * gemDigitize
PndEmcWaveformToDigi * emcWaveformToDigi
Definition: full_emc.C:61
FairParAsciiFileIo * parIo1
Definition: bump_emc.C:53
PndMvdCreateDefaultApvMap * creator
Int_t iVerbose
Takes list of PndEmcWaveform and creates PndEmcDigi.
PndMvdDigiTask * mvddigi
PndFtsHitProducerRealFast * ftsHitProducer
Double_t rtime
Definition: hit_dirc.C:113
void SetPositionSmearing(Float_t res)
Set the smearing of the PndMdtHit position.