FairRoot/PandaRoot
Lars/runMvdDigi.C
Go to the documentation of this file.
1 {
2  // ----- Timer --------------------------------------------------------
3  TStopwatch timer;
4  timer.Start();
5 
6  // Verbosity level (0=quiet, 1=event level, 2=track level, 3=debug)
7  Int_t iVerbose = 0;
8  Int_t nEvents = 20000;
9  gROOT->Macro("$VMCWORKDIR/gconfig/rootlogon.C");
10 
11  // Input file (MC events)
12  TString inFile = "../data/Lars/MvdDtsSim.root";
13  // Parameter file
14  TString parFile = "../data/Lars/MvdDtsParams.root";
15  TString digiparFile = gSystem->Getenv("VMCWORKDIR");
16  digiparFile += "/macro/mvd/Lars/mvd.dts.par";
17 
18 
19  // In general, the following parts need not be touched
20  // ========================================================================
21  // Output file
22  PndFileNameCreator creator(inFile.Data());
23  TString outFile = creator.GetDigiFileName().c_str();
24  std::cout << "DigiFileName: " << outFile.Data() << std::endl;
25 
26  // ----- Reconstruction run -------------------------------------------
27  FairRunAna *fRun= new FairRunAna();
28  fRun->SetInputFile(inFile);
29  fRun->SetOutputFile(outFile);
30 
31 
32  // ----- Parameter database --------------------------------------------
33  FairRuntimeDb* rtdb = fRun->GetRuntimeDb();
34  FairParRootFileIo* parInput1 = new FairParRootFileIo(kTRUE);
35  parInput1->open(parFile.Data(),"UPDATE");
36  rtdb->setFirstInput(parInput1);
37 // Bool_t kParameterMerged=kTRUE;
38 // FairParRootFileIo* output=new FairParRootFileIo(kParameterMerged);
39 // output->open(parOutFile);
40 // rtdb->setOutput(output);
41  FairParAsciiFileIo* parInput2 = new FairParAsciiFileIo();
42  parInput2->open(digiparFile.Data(),"in");
43  rtdb->setSecondInput(parInput2);
44 
45  fRun->LoadGeometry();
46 
47 
48  // ----- Digitization ---------------------------------------
50  mvdStripProd->SetVerbose(iVerbose);
51  fRun->AddTask(mvdStripProd);
52 
53 
54 // PndMvdNoiseProducer* mvdNoiseMaker = new PndMvdNoiseProducer();
55 // mvdNoiseMaker->SetVerbose(iVerbose);
56 // fRun->AddTask(mvdNoiseMaker);
57 
58 
59 // FairParRootFileIo* output=new FairParRootFileIo(kTRUE);
60 // output->open(parOutFile.Data());
61 // rtdb->setOutput(output);
62  rtdb->setOutput(parInput1);
63  rtdb->print();
64  // ===== End of HitProducers =====
65  // =========================================================================
66 // PndMvdGeoPar* geoPar = (PndMvdGeoPar*)(rtdb->getContainer("PndMvdGeoPar"));
67 
68  // ----- Intialise and run --------------------------------------------
69  fRun->Init();
70 
71  fRun->Run(0,nEvents);
72 
73  rtdb->saveOutput();
74  rtdb->print();
75 
76  // ----- Finish -------------------------------------------------------
77  timer.Stop();
78  Double_t rtime = timer.RealTime();
79  Double_t ctime = timer.CpuTime();
80  cout << endl << endl;
81  cout << "Macro finished succesfully." << endl;
82  cout << "Output file is " << outFile << endl;
83  cout << "Parameter file is " << parFile << endl;
84  cout << "Real time " << rtime << " s, CPU time " << ctime << " s\a\a" << endl;
85  cout << endl;
86 
87 }
Hit Producer Task for strip detectors.
TString outFile
Definition: hit_dirc.C:17
PndMvdStripHitProducer * mvdStripProd
FairRunAna * fRun
Definition: hit_dirc.C:58
TString inFile
Definition: hit_dirc.C:8
A simple class which adds the corresponding file extensions to a given base class.
Double_t
TString parFile
Definition: hit_dirc.C:14
Int_t nEvents
Definition: hit_dirc.C:11
TStopwatch timer
Definition: hit_dirc.C:51
FairRuntimeDb * rtdb
Definition: hit_dirc.C:66
FairParAsciiFileIo * parInput2
Definition: conMvdDigi.C:26
FairParRootFileIo * parInput1
Definition: hit_dirc.C:67
Double_t ctime
Definition: hit_dirc.C:114
PndMvdCreateDefaultApvMap * creator
Int_t iVerbose
Double_t rtime
Definition: hit_dirc.C:113
TString digiparFile