FairRoot/PandaRoot
tutorials/charmonium/jul10/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  emcHitsToWaveform->SetStorageOfData(kFALSE);
101  emcWaveformToDigi->SetStorageOfData(kFALSE);
102  fRun->AddTask(emcHitsToWaveform); // full digitization
103  fRun->AddTask(emcWaveformToDigi); // full digitization
104 
106  fRun->AddTask(emcMakeCluster);
107 
109  fRun->AddTask(emcMakeBump);
110 
112  fRun->AddTask(emcHdrFiller); // ECM header
113 
114  // ----- TOF hit producers ---------------------------------
115  PndTofHitProducerIdeal* tofhit = new PndTofHitProducerIdeal();
116  tofhit->SetVerbose(iVerbose);
117  fRun->AddTask(tofhit);
118 
119  // ----- MDT hit producers ---------------------------------
121  mdtHitProd->SetPositionSmearing(.3); // position smearing [cm]
122  fRun->AddTask(mdtHitProd);
123 
125  fRun->AddTask(mdtTrkProd);
126 
127  // ----- DRC hit producers ---------------------------------
129  drchit->SetVerbose(iVerbose);
130  fRun->AddTask(drchit);
131 
132  // ----- GEM hit producers ---------------------------------
133  Int_t verboseLevel = 0;
134  PndGemDigitize* gemDigitize = new PndGemDigitize("GEM Digitizer", verboseLevel);
135  fRun->AddTask(gemDigitize);
136 
137  PndGemFindHits* gemFindHits = new PndGemFindHits("GEM Hit Finder", verboseLevel);
138  fRun->AddTask(gemFindHits);
139 
140  // ----- Intialise and run --------------------------------------------
141  fRun->Init();
142  fRun->Run(0, nEvents);
143 
144  rtdb->saveOutput();
145  rtdb->print();
146 
147  // ------------------------------------------------------------------------
148 
149  // ----- Finish -------------------------------------------------------
150 
151  timer.Stop();
152  Double_t rtime = timer.RealTime();
153  Double_t ctime = timer.CpuTime();
154  cout << endl << endl;
155  cout << "Macro finished succesfully." << endl;
156  cout << "Output file is " << outFile << endl;
157  cout << "Parameter file is " << parFile << endl;
158  cout << "Real time " << rtime << " s, CPU time " << ctime << " s" << endl;
159  cout << endl;
160  // ------------------------------------------------------------------------
161 
162 
163 }
Takes list of PndEmcHits and creates PndEmcWaveform.
PndTpcDriftTask * tpcDrifter
PndEmcMakeCluster * emcMakeCluster
PndMvdClusterTask * mvdmccls
PndEmcWaveformToDigi * emcWaveformToDigi
PndTpcClusterFinderTask * tpcCF
PndEmcHitsToWaveform * emcHitsToWaveform
PndTpcElectronicsTask * tpcElec
void SetStorageOfData(Bool_t val)
Double_t
PndMdtTrkProducer * mdtTrkProd
PndEmcHdrFiller * emcHdrFiller
PndDrcHitProducerIdeal * drchit
PndTpcPadResponseTask * tpcPadResponse
void SetStorageOfData(Bool_t val)
Takes clusters and slits them up into bumps.
void SetVerbose(Int_t iVerbose)
PndMdtHitProducerIdeal * mdtHitProd
FairParRootFileIo * parInput1
PndTofHitProducerIdeal * tofhit
Task to cluster PndEmcDigis.
Int_t iVerbose
Takes list of PndEmcWaveform and creates PndEmcDigi.
FairParAsciiFileIo * parIo1
PndTpcClusterizerTask * tpcClusterizer
Task to create Emc header.
void SetPositionSmearing(Float_t res)
Set the smearing of the PndMdtHit position.