FairRoot/PandaRoot
full_tmpWaveform_emc.C
Go to the documentation of this file.
1 {
2  // Macro created 20/09/2006 by S.Spataro
3  // It loads a simulation file and digitize hits for EMC
4 
5  // Verbosity level (0=quiet, 1=event level, 2=track level, 3=debug)
6  Int_t iVerbose = 0; // just forget about it, for the moment
7 
8  // Input file (MC events)
9  TString inFile = "sim_emc.root";
10 
11  // Number of events to process
12  Int_t nEvents = 0; // if 0 all the vents will be processed
13 
14  // Parameter file
15  TString parFile = "simparams.root"; // at the moment you do not need it
16 
17  // Digitisation file (ascii)
18  TString digiFile = "emc.par";
19 
20  // Output file
21  TString outFile = "full_tmpWaveform_emc.root";
22 
23  // Loading libraries
24  // If the macro gives error messages in loading libraries, please check the path of the libs and put it by hands
25 
26  gROOT->LoadMacro("$VMCWORKDIR/gconfig/rootlogon.C");
27  gROOT->LoadMacro("$VMCWORKDIR/gconfig/basiclibs.C");
28  rootlogon();
29  basiclibs();
30 
31  // ----- Timer --------------------------------------------------------
32  TStopwatch timer;
33  timer.Start();
34  // ------------------------------------------------------------------------
35 
36  // ----- Reconstruction run -------------------------------------------
37  FairRunAna *fRun= new FairRunAna();
38  fRun->SetInputFile(inFile);
39  fRun->SetOutputFile(outFile);
40 
41  // ----- Parameter database --------------------------------------------
42  TString emcDigiFile = gSystem->Getenv("VMCWORKDIR");
43  emcDigiFile += "/macro/params/";
44  emcDigiFile += digiFile;
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(emcDigiFile.Data(),"in");
52 
53  rtdb->setFirstInput(parInput1);
54  rtdb->setSecondInput(parIo1);
55  // ----------------------------------------------------------
56 
57  fRun->LoadGeometry();
58  // ------------------------------------------------------------------------
59 
60 
61  PndGlobalEvtTask* pndGlobalEvtTask = new PndGlobalEvtTask();
62  fRun->AddTask(pndGlobalEvtTask);
63 
64  // ----- EMC hit producers ---------------------------------
65  // The file name should be the same of the geometry file which was used for the simulation
66 
68  fRun->AddTask(emcHitProd); // hit production
69 
71  // fRun->AddTask(emcMakeDigi); // fast digitization
72 
73  PndEmcHitsToTmpWaveform* emcHitsToTmpWaveform= new PndEmcHitsToTmpWaveform(iVerbose);
75  fRun->AddTask(emcHitsToTmpWaveform); // full digitization
76  fRun->AddTask(emcTmpWaveformToDigi); // full digitization
77 
79  fRun->AddTask(emcMakeCluster);
80 
82  fRun->AddTask(emcHdrFiller); // ECM header
83 
85  fRun->AddTask(emcMakeBump);
86 
88  fRun->AddTask(emcMakeRecoHit);
89 
90  // ----- Intialise and run --------------------------------------------
91  cout << "fRun->Init()" << endl;
92  fRun->Init();
93  fRun->Run(0,nEvents);
94  // ------------------------------------------------------------------------
95 
96 
97  // ----- Finish -------------------------------------------------------
98  timer.Stop();
99  Double_t rtime = timer.RealTime();
100  Double_t ctime = timer.CpuTime();
101  cout << endl << endl;
102  cout << "Macro finished successfully." << endl;
103  cout << "Output file is " << outFile << endl;
104  cout << "Parameter file is " << parFile << endl;
105  cout << "Real time " << rtime << " s, CPU time " << ctime << " s" << endl;
106  cout << endl;
107  // ------------------------------------------------------------------------
108 
109 }
currently not used, not in CMakeLists.txt
FairParRootFileIo * parInput1
PndEmcMakeDigi * emcMakeDigi
PndGlobalEvtTask * pndGlobalEvtTask
basiclibs()
Create PndEmcRecoHit from PndEmcBump.
PndEmcMakeRecoHit * emcMakeRecoHit
TString digiFile
creates PndEmcHits from PndEmcPoints
TString inFile
PndEmcTmpWaveformToDigi * emcTmpWaveformToDigi
PndEmcMakeCluster * emcMakeCluster
TString parFile
PndEmcHitsToTmpWaveform * emcHitsToTmpWaveform
TStopwatch timer
Double_t
TString outFile
FairRuntimeDb * rtdb
PndEmcHitProducer * emcHitProd
Takes clusters and slits them up into bumps.
FairParAsciiFileIo * parIo1
Double_t ctime
Definition: hit_dirc.C:114
Task to cluster PndEmcDigis.
FairRunAna * fRun
TString emcDigiFile
Int_t iVerbose
PndEmcHdrFiller * emcHdrFiller
Double_t rtime
Definition: hit_dirc.C:113
Int_t nEvents
Task to create Emc header.
Task to create PndEmcDigi from PndEmcHit.
PndEmcMakeBump * emcMakeBump