FairRoot/PandaRoot
tutorials/analysis/run_digi_tpccombi.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 = "points_tpccombi.root";
8 
9  // Parameter file
10  TString parFile = "params_tpccombi.root";
11 
12  // Output file
13  TString outFile = "digi_tpccombi.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  // ----- TPC digi producers ---------------------------------
57  PndTpcClusterizerTask* tpcClusterizer = new PndTpcClusterizerTask();
58  //tpcClusterizer->SetPersistence();
59  fRun->AddTask(tpcClusterizer);
60 
61  PndTpcDriftTask* tpcDrifter = new PndTpcDriftTask();
62  // tpcDrifter->SetPersistence();
63  tpcDrifter->SetDistort(false);
64  fRun->AddTask(tpcDrifter);
65 
66  PndTpcGemTask* tpcGem = new PndTpcGemTask();
67  //tpcGem->SetPersistence();
68  fRun->AddTask(tpcGem);
69 
70  PndTpcPadResponseTask* tpcPadResponse = new PndTpcPadResponseTask();
71  //tpcPadResponse->SetPersistence();
72  fRun->AddTask(tpcPadResponse);
73 
74  PndTpcElectronicsTask* tpcElec = new PndTpcElectronicsTask();
75  //tpcElec->SetPersistence();
76  fRun->AddTask(tpcElec);
77 
78  PndTpcClusterFinderTask* tpcCF = new PndTpcClusterFinderTask();
79  tpcCF->SetPersistence();
80  tpcCF->timeslice(20); // = 4 sample times = 100ns @ 40MHz
81  fRun->AddTask(tpcCF);
82 
83  // ----- MDV digi producers ---------------------------------
85  mvddigi->SetVerbose(iVerbose);
86  fRun->AddTask(mvddigi);
87 
89  mvdmccls->SetVerbose(iVerbose);
90  fRun->AddTask(mvdmccls);
91  // ----- EMC hit producers ---------------------------------
92  //PndEmcHitProducer* emcHitProd = new PndEmcHitProducer();
93  //fRun->AddTask(emcHitProd); // hit production
94 
95  //PndEmcMakeDigi* emcMakeDigi=new PndEmcMakeDigi();
96  //fRun->AddTask(emcMakeDigi); // fast digitization
97 
100  fRun->AddTask(emcHitsToWaveform); // full digitization
101  fRun->AddTask(emcWaveformToDigi); // full digitization
102 
104  fRun->AddTask(emcMakeCluster);
105 
107  fRun->AddTask(emcMakeBump);
108 
110  fRun->AddTask(emcHdrFiller); // ECM header
111 
112  // ----- TOF hit producers ---------------------------------
113  PndTofHitProducerIdeal* tofhit = new PndTofHitProducerIdeal();
114  tofhit->SetVerbose(iVerbose);
115  fRun->AddTask(tofhit);
116 
117  // ----- MDT hit producers ---------------------------------
119  mdtHitProd->SetPositionSmearing(.3); // position smearing [cm]
120  fRun->AddTask(mdtHitProd);
121 
123  fRun->AddTask(mdtTrkProd);
124 
125  // ----- DRC hit producers ---------------------------------
127  drchit->SetVerbose(iVerbose);
128  fRun->AddTask(drchit);
129 
130  // ----- GEM hit producers ---------------------------------
131  Int_t verboseLevel = 0;
132  PndGemDigitize* gemDigitize = new PndGemDigitize("GEM Digitizer", verboseLevel);
133  fRun->AddTask(gemDigitize);
134 
135  PndGemFindHits* gemFindHits = new PndGemFindHits("GEM Hit Finder", verboseLevel);
136  fRun->AddTask(gemFindHits);
137 
138  // ----- Intialise and run --------------------------------------------
139  fRun->Init();
140  fRun->Run(0, nEvents);
141 
142  rtdb->saveOutput();
143  rtdb->print();
144 
145  // ------------------------------------------------------------------------
146 
147  // ----- Finish -------------------------------------------------------
148 
149  timer.Stop();
150  Double_t rtime = timer.RealTime();
151  Double_t ctime = timer.CpuTime();
152  cout << endl << endl;
153  cout << "Macro finished succesfully." << endl;
154  cout << "Output file is " << outFile << endl;
155  cout << "Parameter file is " << parFile << endl;
156  cout << "Real time " << rtime << " s, CPU time " << ctime << " s" << endl;
157  cout << endl;
158  // ------------------------------------------------------------------------
159 
160 
161 }
Takes list of PndEmcHits and creates PndEmcWaveform.
PndMvdDigiTask * mvddigi
PndMdtTrkProducer * mdtTrkProd
PndMvdClusterTask * mvdmccls
PndEmcMakeCluster * emcMakeCluster
PndTpcDriftTask * tpcDrifter
FairParRootFileIo * parInput1
PndTpcClusterizerTask * tpcClusterizer
PndEmcMakeBump * emcMakeBump
FairParAsciiFileIo * parIo1
PndEmcHitsToWaveform * emcHitsToWaveform
Double_t
PndDrcHitProducerIdeal * drchit
PndTpcClusterFinderTask * tpcCF
PndTpcPadResponseTask * tpcPadResponse
Takes clusters and slits them up into bumps.
void SetVerbose(Int_t iVerbose)
Task to cluster PndEmcDigis.
PndGemFindHits * gemFindHits
PndEmcHdrFiller * emcHdrFiller
PndMdtHitProducerIdeal * mdtHitProd
PndTpcElectronicsTask * tpcElec
Int_t iVerbose
PndGemDigitize * gemDigitize
Takes list of PndEmcWaveform and creates PndEmcDigi.
PndTofHitProducerIdeal * tofhit
PndTpcGemTask * tpcGem
PndEmcWaveformToDigi * emcWaveformToDigi
FairRuntimeDb * rtdb
Task to create Emc header.
void SetPositionSmearing(Float_t res)
Set the smearing of the PndMdtHit position.