FairRoot/PandaRoot
eta_c/run_digi_tpc_evt.C
Go to the documentation of this file.
1 {
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 = "evt_points_tpc.root";
8 
9  // Parameter file
10  TString parFile = "evt_params_tpc.root";
11 
12  // Output file
13  TString outFile = "evt_digi_tpc.root";
14 
15  // Number of events to process
16  Int_t nEvents = 0;
17 
18  TString mcMode = "TGeant3";
19  // ---- Load libraries -------------------------------------------------
20  gROOT->LoadMacro("$VMCWORKDIR/gconfig/rootlogon.C");
21  rootlogon();
22  TString sysFile = gSystem->Getenv("VMCWORKDIR");
23  // ------------------------------------------------------------------------
24 
25  // --- Now choose concrete engines for the different tasks -------------
26  // ------------------------------------------------------------------------
27 
28  // In general, the following parts need not be touched
29  // ========================================================================
30 
31  // ----- Timer --------------------------------------------------------
32  TStopwatch timer;
33  timer.Start();
34  // ------------------------------------------------------------------------
35 
36  // ----- Digitization run -------------------------------------------
37  FairRunAna *fRun= new FairRunAna();
38  fRun->SetInputFile(inFile);
39  fRun->SetOutputFile(outFile);
40 
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  // ----- TPC digi producers ---------------------------------
58  PndTpcClusterizerTask* tpcClusterizer = new PndTpcClusterizerTask();
59  if(mcMode=="TGeant3") tpcClusterizer->SetMereChargeConversion();
60  //tpcClusterizer->SetPersistence();
61  fRun->AddTask(tpcClusterizer);
62 
63  PndTpcDriftTask* tpcDrifter = new PndTpcDriftTask();
64  // tpcDrifter->SetPersistence();
65  tpcDrifter->SetDistort(false);
66  fRun->AddTask(tpcDrifter);
67 
68  PndTpcGemTask* tpcGem = new PndTpcGemTask();
69  //tpcGem->SetPersistence();
70  fRun->AddTask(tpcGem);
71 
72  PndTpcPadResponseTask* tpcPadResponse = new PndTpcPadResponseTask();
73  //tpcPadResponse->SetPersistence();
74  fRun->AddTask(tpcPadResponse);
75 
76  PndTpcElectronicsTask* tpcElec = new PndTpcElectronicsTask();
77  tpcElec->SetPersistence();
78  fRun->AddTask(tpcElec);
79 
80  PndTpcEvtTimeGenTask* evttimegen = new PndTpcEvtTimeGenTask();
81  evttimegen->SetPersistence();
82  evttimegen->SetEvtRate(1E7);
83  evttimegen->SetT0(0);
84  fRun->AddTask(evttimegen);
85 
86  PndTpcClusterFinderTask* tpcCF = new PndTpcClusterFinderTask();
87  //tpcCF->SetDigiPersistence(); // keep reference to digis in clusters
88  tpcCF->SetPersistence(); // keep Clusters
89  tpcCF->timeslice(10); //in samples
90  tpcCF->SetThreshold(1);
91  tpcCF->SetSingleDigiClusterAmpCut(0.);
92  tpcCF->SetClusterAmpCut(0.); // cut on mean digi amplitude
93  tpcCF->SetErrorPars(600.,400.);
94  tpcCF->SetSimpleClustering(); // use PndTpcClusterFinderSimple
95  fRun->AddTask(tpcCF);
96 
97  // ----- MDV digi producers ---------------------------------
99  mvddigi->SetVerbose(iVerbose);
100  fRun->AddTask(mvddigi);
101 
103  mvdmccls->SetVerbose(iVerbose);
104  fRun->AddTask(mvdmccls);
105 
106  // ----- EMC hit producers ---------------------------------
109  emcHitsToWaveform->SetStorageOfData(kFALSE);
110  emcWaveformToDigi->SetStorageOfData(kFALSE);
111  fRun->AddTask(emcHitsToWaveform); // full digitization
112  fRun->AddTask(emcWaveformToDigi); // full digitization
113 
115  fRun->AddTask(emcMakeCluster);
116 
118  fRun->AddTask(emcMakeBump);
119 
121  fRun->AddTask(emcHdrFiller); // ECM header
122 
123  // ----- MDT hit producers ---------------------------------
125  mdtHitProd->SetPositionSmearing(.3); // position smearing [cm]
126  fRun->AddTask(mdtHitProd);
127 
129  fRun->AddTask(mdtTrkProd);
130 
131  // ----- DRC hit producers ---------------------------------
133  drchit->SetVerbose(iVerbose);
134  fRun->AddTask(drchit);
135 
136  // ----- FTS hit producers ---------------------------------
138  //PndFtsHitProducerIdeal* ftsHitProducer = new PndFtsHitProducerIdeal();
139  //PndFtsHitProducerRealFull* ftsHitProducer = new PndFtsHitProducerRealFull();
140  fRun->AddTask(ftsHitProducer);
141 
142  // ----- GEM hit producers ---------------------------------
143  Int_t verboseLevel = 0;
144  PndGemDigitize* gemDigitize = new PndGemDigitize("GEM Digitizer", verboseLevel);
145  fRun->AddTask(gemDigitize);
146 
147  PndGemFindHits* gemFindHits = new PndGemFindHits("GEM Hit Finder", verboseLevel);
148  fRun->AddTask(gemFindHits);
149 
150  // ----- Intialise and run --------------------------------------------
151  fRun->Init();
152  fRun->Run(0, nEvents);
153 
154  rtdb->saveOutput();
155  rtdb->print();
156 
157  // ------------------------------------------------------------------------
158 
159  // ----- Finish -------------------------------------------------------
160 
161  timer.Stop();
162  Double_t rtime = timer.RealTime();
163  Double_t ctime = timer.CpuTime();
164  cout << endl << endl;
165  cout << "Macro finished succesfully." << endl;
166  cout << "Output file is " << outFile << endl;
167  cout << "Parameter file is " << parFile << endl;
168  cout << "Real time " << rtime << " s, CPU time " << ctime << " s" << endl;
169  cout << endl;
170  // ------------------------------------------------------------------------
171 
172 
173 }
Takes list of PndEmcHits and creates PndEmcWaveform.
Int_t nEvents
PndGemFindHits * gemFindHits
TStopwatch timer
PndTpcGemTask * tpcGem
int verboseLevel
Definition: Lars/runMvdSim.C:7
PndEmcHitsToWaveform * emcHitsToWaveform
Definition: full_emc.C:60
TString allDigiFile
PndEmcMakeBump * emcMakeBump
Definition: bump_emc.C:63
PndMvdStripClusterTask * mvdmccls
Definition: runclust.C:45
TString parFile
FairRuntimeDb * rtdb
PndEmcHdrFiller * emcHdrFiller
Definition: full_emc.C:68
TString mcMode
void SetStorageOfData(Bool_t val)
TString outFile
PndTpcClusterizerTask * tpcClusterizer
PndMdtHitProducerIdeal * mdtHitProd
Definition: hit_muo.C:162
PndDrcHitProducerReal * drchit
Definition: hit_dirc_draw.C:73
Double_t
PndEmcMakeCluster * emcMakeCluster
Definition: full_emc.C:65
TString sysFile
PndTpcPadResponseTask * tpcPadResponse
void SetStorageOfData(Bool_t val)
Takes clusters and slits them up into bumps.
void SetVerbose(Int_t iVerbose)
Double_t ctime
Definition: hit_dirc.C:114
PndGemDigitize * gemDigitize
PndEmcWaveformToDigi * emcWaveformToDigi
Definition: full_emc.C:61
Task to cluster PndEmcDigis.
PndTpcElectronicsTask * tpcElec
FairRunAna * fRun
PndTpcDriftTask * tpcDrifter
FairParRootFileIo * parInput1
Int_t iVerbose
PndMdtTrkProducer * mdtTrkProd
Definition: hit_muo.C:166
Takes list of PndEmcWaveform and creates PndEmcDigi.
PndMvdDigiTask * mvddigi
PndFtsHitProducerRealFast * ftsHitProducer
PndTpcClusterFinderTask * tpcCF
Double_t rtime
Definition: hit_dirc.C:113
TString inFile
Task to create Emc header.
void SetPositionSmearing(Float_t res)
Set the smearing of the PndMdtHit position.
FairParAsciiFileIo * parIo1