R3BROOT
R3B analysis software
Loading...
Searching...
No Matches
testNeulandQcal.C
Go to the documentation of this file.
1/******************************************************************************
2 * Copyright (C) 2019 GSI Helmholtzzentrum für Schwerionenforschung GmbH *
3 * Copyright (C) 2019-2025 Members of R3B Collaboration *
4 * *
5 * This software is distributed under the terms of the *
6 * GNU General Public Licence (GPL) version 3, *
7 * copied verbatim in the file "LICENSE". *
8 * *
9 * In applying this license GSI does not waive the privileges and immunities *
10 * granted to it by virtue of its status as an Intergovernmental Organization *
11 * or submit itself to any jurisdiction. *
12 ******************************************************************************/
13
15{
16 TStopwatch timer;
17 timer.Start();
18
19 TString outputFileName = "data_qcal.root"; // name of output file
20
21 // Create analysis run -------------------------------------------------------
22 FairRunAna* run = new FairRunAna();
23 run->SetOutputFile(outputFileName.Data());
24 // ---------------------------------------------------------------------------
25
26 // ----- Runtime DataBase info -----------------------------------------------
27 FairRuntimeDb* rtdb = run->GetRuntimeDb();
28 // ---------------------------------------------------------------------------
29
30 // ---------------------------------------------------------------------------
31 run->AddTask(new R3BNeulandQCalFiller());
32 // ---------------------------------------------------------------------------
33
34 // ---------------------------------------------------------------------------
36 pedpar->SetPlanes(1);
37 run->AddTask(pedpar);
38 // ---------------------------------------------------------------------------
39
40 // Initialize ----------------------------------------------------------------
41 FairLogger::GetLogger()->SetLogScreenLevel("info");
42 run->Init();
43 // ---------------------------------------------------------------------------
44
45 // Run -----------------------------------------------------------------------
46 run->Run(0, 10000);
47 rtdb->saveOutput();
48 // ---------------------------------------------------------------------------
49
50 timer.Stop();
51 Double_t rtime = timer.RealTime();
52 Double_t ctime = timer.CpuTime();
53 cout << endl << endl;
54 cout << "Real time " << rtime << " s, CPU time " << ctime << "s" << endl << endl;
55
56 R3BNeulandQCalPar* par = (R3BNeulandQCalPar*)rtdb->getContainer("NeulandQCalPar");
57 Bool_t failed = false;
58
59 for (Int_t i = 0; i < 100; i++)
60 if (par->GetParAt(1, i / 2 + 1, i % 2 + 1) != i + 100)
61 {
62 failed = true;
63 cout << "[" << 1 << ", " << i / 50 + 1 << ", " << i % 2 + 1 << "] Expected: " << i + 100 << " but value is "
64 << par->GetParAt(1, i / 2 + 1, i % 2 + 1) << endl;
65 }
66
67 if (failed)
68 cout << " Test failed! " << endl;
69 else
70 cout << " Test successful! " << endl;
71}
Int_t GetParAt(Int_t plane, Int_t bar, Int_t side)
Method to get the pedestal offset of a PMT.
void testNeulandQcal()