FairRoot/PandaRoot
Functions
digi_mvd.C File Reference

Go to the source code of this file.

Functions

int digi_mvd ()
 

Function Documentation

int digi_mvd ( )

Definition at line 1 of file digi_mvd.C.

References ctime, digiFile, Double_t, emcDigiFile, fRun, inFile, iVerbose, mvddigi, outFile, parFile, parInput1, parIo1, rootlogon(), rtdb, rtime, PndBlackBoxTask::SetVerbose(), timer, and TString.

2 {
3  // Macro created 20/09/2006 by S.Spataro
4  // It loads a simulation file and digitize hits for EMC
5 
6  gROOT->LoadMacro("$VMCWORKDIR/gconfig/rootlogon.C");
7  rootlogon();
8 
9  // Verbosity level (0=quiet, 1=event level, 2=track level, 3=debug)
10  Int_t iVerbose =3; // just forget about it, for the moment
11 
12  // Input file (MC events)
13  TString inFile = "sim_mvd.root";
14 
15  // Parameter file
16  TString parFile = "simparams.root"; // at the moment you do not need it
17 
18  // Digitisation file (ascii)
19  TString digiFile = "all.par";
20 
21  // Output file
22  TString outFile = "digi_mvd.root";
23 
24  // ----- Timer --------------------------------------------------------
25  TStopwatch timer;
26 
27  // ----- Reconstruction run -------------------------------------------
28  FairRunAna *fRun= new FairRunAna();
29  fRun->SetInputFile(inFile);
30  fRun->SetOutputFile(outFile);
31 
32  // ----- Parameter database --------------------------------------------
33  TString emcDigiFile = gSystem->Getenv("VMCWORKDIR");
34  emcDigiFile += "/macro/params/";
35  emcDigiFile += digiFile;
36 
37  FairRuntimeDb* rtdb = fRun->GetRuntimeDb();
38  FairParRootFileIo* parInput1 = new FairParRootFileIo();
39  parInput1->open(parFile.Data());
40 
41  FairParAsciiFileIo* parIo1 = new FairParAsciiFileIo();
42  parIo1->open(emcDigiFile.Data(),"in");
43 
44  rtdb->setFirstInput(parInput1);
45  rtdb->setSecondInput(parIo1);
46 
47 
48  // ----- EMC hit producers ---------------------------------
49  // The file name should be the same of the geometry file which was used for the simulation
50 
51 // PndEmcHitsToWaveform* emcHitsToWaveform= new PndEmcHitsToWaveform(iVerbose);
52 // emcHitsToWaveform->SetStorageOfData(kFALSE);
53 // PndEmcWaveformToDigi* emcWaveformToDigi=new PndEmcWaveformToDigi(iVerbose);
54 // fRun->AddTask(emcHitsToWaveform); // full digitization
55 // fRun->AddTask(emcWaveformToDigi); // full digitization
56 
57 // PndSttHitProducerRealFast* sttHitProducer = new PndSttHitProducerRealFast();
58 // fRun->AddTask(sttHitProducer);
59 
60 // PndDchDigiProducer* digiProducer= new PndDchDigiProducer();
61 // fRun->AddTask(digiProducer);
62 // PndDchCylinderHitProducer* cylHitProducer= new PndDchCylinderHitProducer();
63 // fRun->AddTask(cylHitProducer);
64 //
66  mvddigi->SetVerbose(iVerbose);
67  fRun->AddTask(mvddigi);
68 
69 // PndTofHitProducerIdeal* tofhit = new PndTofHitProducerIdeal();
70 // tofhit->SetVerbose(iVerbose);
71 // fRun->AddTask(tofhit);
72 //
73 // PndMdtHitProducerIdeal* mdtHitProd = new PndMdtHitProducerIdeal();
74 // mdtHitProd->SetPositionSmearing(0.2); // position smearing [cm]
75 // fRun->AddTask(mdtHitProd);
76 
77 // PndGemDigitize* gemDigitize = new PndGemDigitize("GEM Digitizer", iVerbose);
78 // fRun->AddTask(gemDigitize);
79 //
80 // PndGemFindHits* gemFindHits = new PndGemFindHits("GEM Hit Finder", iVerbose);
81 // fRun->AddTask(gemFindHits);
82 
83 
84  // ----- Intialise and run --------------------------------------------
85  fRun->Init();
86 
87  timer.Start();
88  fRun->Run();
89 
90  // ----- Finish -------------------------------------------------------
91  timer.Stop();
92  Double_t rtime = timer.RealTime();
93  Double_t ctime = timer.CpuTime();
94  cout << endl << endl;
95  cout << "Macro finished successfully." << endl;
96  cout << "Output file is " << outFile << endl;
97  cout << "Parameter file is " << parFile << endl;
98  cout << "Real time " << rtime << " s, CPU time " << ctime << " s" << endl;
99  cout << endl;
100  // ------------------------------------------------------------------------
101  cout << " Test passed" << endl;
102  cout << " All ok " << endl;
103 
104  return 0;
105 }
TString outFile
Definition: hit_dirc.C:17
TString digiFile
Definition: bump_emc.C:20
TString emcDigiFile
Definition: bump_emc.C:45
FairRunAna * fRun
Definition: hit_dirc.C:58
TString inFile
Definition: hit_dirc.C:8
Double_t
TString parFile
Definition: hit_dirc.C:14
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
Double_t ctime
Definition: hit_dirc.C:114
FairParAsciiFileIo * parIo1
Definition: bump_emc.C:53
Int_t iVerbose
PndMvdDigiTask * mvddigi
Double_t rtime
Definition: hit_dirc.C:113