FairRoot/PandaRoot
QAmacro_drc_2.C
Go to the documentation of this file.
1 #include "../auxi.C"
3 {
4  cout << "QA module for the DRC digitization." << endl;
5 
6  Int_t nEvents = 10;
7  TString inFile = "sim.root";
8  TString parFile="par.root";
9  TString outFile = "digi.root";
10  Int_t timeBased=1;
11  Double_t eventRate=50;
12  Double_t deadTime=5;
13 
14  Int_t verbose = 0;
15 
16  // ----- Timer --------------------------------------------------------
17  TStopwatch timer;
18  timer.Start();
19 
20  // ----- Reconstruction run -------------------------------------------
21  FairRunAna *fRun= new FairRunAna();
22  fRun->SetGenerateRunInfo(kFALSE);
23  fRun->SetInputFile(inFile);
24  fRun->SetOutputFile(outFile);
25  if(timeBased) fRun->SetEventMeanTime(eventRate);
26 
27  // ----- Parameter database --------------------------------------------
28  FairRuntimeDb* rtdb = fRun->GetRuntimeDb();
29  FairParRootFileIo* parInput = new FairParRootFileIo();
30  parInput->open(parFile.Data());
31  rtdb->setFirstInput(parInput);
32 
33  if(parFile=="batch"){
34  TList* parlist = new TList();
35  for(Int_t i=0; i<4; i++) parlist->Add(new TObjString(Form("par_b%d.root",i)));
36  parInput->open(parlist);
37  }else{
38  parInput->open(parFile.Data());
39  }
40  rtdb->setFirstInput(parInput);
41 
42  // ----- DRC Digitization stage ----------------------------------------
44  drcdigi->SetChargeSharing(kFALSE);
45  drcdigi->SetDeadTime(deadTime); //5 ns
46  drcdigi->SetTimeResolution(0.4); //0.4 ns
47  if(timeBased) drcdigi->RunTimeBased();
48  fRun->AddTask(drcdigi);
49 
50  // ----- Initialize and run -------------------------------------------
51  fRun->Init();
52  fRun->Run(0,nEvents);
53 
54  cout << " Test passed" << endl;
55  cout << " All ok " << endl;
56 
57  // Bool_t fTest=kFALSE;
58  // if (fTest){
59  // cout << " Test passed" << endl;
60  // cout << " All ok " << endl;
61  // }else{
62  // cout << " Test Failed" << endl;
63  // cout << " Not Ok " << endl;
64  // }
65 
67  return 0;
68 }
69 
void SetChargeSharing(Bool_t ct=0)
Int_t i
Definition: run_full.C:25
TString outFile
Definition: hit_dirc.C:17
#define verbose
void SetDeadTime(Double_t var)
TString inFile
Definition: hit_dirc.C:8
void CloseGeoManager()
Definition: QA/auxi.C:11
FairRunAna * fRun
Definition: hit_dirc.C:58
Double_t
TString parFile
Definition: hit_dirc.C:14
PndDrcDigiTask * drcdigi
Definition: hit_dirc.C:91
Int_t nEvents
Definition: hit_dirc.C:11
TStopwatch timer
Definition: hit_dirc.C:51
FairRuntimeDb * rtdb
Definition: hit_dirc.C:66
int QAmacro_drc_2()
Definition: QAmacro_drc_2.C:2
void SetTimeResolution(Double_t var)
FairParAsciiFileIo * parInput