|
10 | 10 |
|
11 | 11 | #if !defined(__CLING__) || defined(__ROOTCLING__) |
12 | 12 | #include <iostream> |
| 13 | +#include <vector> |
| 14 | +#include <string_view> |
| 15 | +#include "TFile.h" |
13 | 16 | #include "TPCCalibration/CalibPedestal.h" |
14 | 17 | #include "TPCCalibration/CalibRawBase.h" |
15 | 18 | #endif |
16 | 19 |
|
17 | | -void runPedestal(TString fileInfo, TString outputFileName = "", Int_t nevents = 100, Int_t adcMin = 0, Int_t adcMax = 1100, Int_t firstTimeBin = 0, Int_t lastTimeBin = 450, Int_t statisticsType = 0, uint32_t verbosity = 0, uint32_t debugLevel = 0, Int_t firstEvent = 0) |
| 20 | +void runPedestal(std::vector<std::string_view> fileInfos, TString outputFileName = "", Int_t nevents = 100, Int_t adcMin = 0, Int_t adcMax = 1100, Int_t firstTimeBin = 0, Int_t lastTimeBin = 450, Int_t statisticsType = 0, uint32_t verbosity = 0, uint32_t debugLevel = 0, Int_t firstEvent = 0) |
18 | 21 | { |
19 | 22 | using namespace o2::tpc; |
20 | 23 | CalibPedestal ped; //(PadSubset::Region); |
21 | 24 | ped.setADCRange(adcMin, adcMax); |
22 | | - ped.setupContainers(fileInfo, verbosity, debugLevel); |
23 | | - ped.setStatisticsType(CalibPedestal::StatisticsType(statisticsType)); |
| 25 | + ped.setStatisticsType(StatisticsType(statisticsType)); |
24 | 26 | ped.setTimeBinRange(firstTimeBin, lastTimeBin); |
25 | 27 |
|
26 | 28 | //ped.processEvent(); |
27 | 29 | //ped.resetData(); |
28 | 30 |
|
29 | 31 | CalibRawBase::ProcessStatus status = CalibRawBase::ProcessStatus::Ok; |
30 | | - //while (ped.processEvent()); |
31 | | - for (Int_t i = firstEvent; i < firstEvent + nevents; ++i) { |
32 | | - status = ped.processEvent(i); |
33 | | - cout << "Processing event " << i << " with status " << int(status) << '\n'; |
34 | | - if (status != CalibRawBase::ProcessStatus::Ok) { |
35 | | - break; |
| 32 | + |
| 33 | + for (const auto& fileInfo : fileInfos) { |
| 34 | + ped.setupContainers(fileInfo.data(), verbosity, debugLevel); |
| 35 | + |
| 36 | + for (Int_t i = firstEvent; i < firstEvent + nevents; ++i) { |
| 37 | + status = ped.processEvent(i); |
| 38 | + cout << "Processing event " << i << " with status " << int(status) << '\n'; |
| 39 | + if (status != CalibRawBase::ProcessStatus::Ok) { |
| 40 | + break; |
| 41 | + } |
36 | 42 | } |
37 | 43 | } |
38 | 44 | ped.analyse(); |
39 | 45 |
|
40 | | - cout << "Number of processed events: " << ped.getNumberOfProcessedEvents() << '\n'; |
41 | | - cout << "Status: " << int(status) << '\n'; |
42 | | - if (outputFileName.IsNull()) |
| 46 | + std::cout << "Number of processed events: " << ped.getNumberOfProcessedEvents() << '\n'; |
| 47 | + std::cout << "Status: " << int(status) << '\n'; |
| 48 | + if (outputFileName.IsNull()) { |
43 | 49 | outputFileName = "Pedestals.root"; |
| 50 | + } |
44 | 51 | ped.dumpToFile(outputFileName.Data()); |
45 | 52 |
|
46 | | - //const CalDet<float>& calPedestal = ped.getPedestal(); |
47 | | - //const CalDet<float>& calNoise = ped.getNoise(); |
48 | | - |
49 | | - //painter::Draw(calPedestal); |
50 | | - //painter::Draw(calNoise); |
51 | | - |
52 | | - //TCanvas *cPedestal = new TCanvas("cPedestal","Pedestal"); |
53 | | - //auto hPedestal = painter::getHistogram2D(calPedestal.getCalArray(0)); |
54 | | - //hPedestal->SetTitle("Pedestals"); |
55 | | - //hPedestal->Draw("colz"); |
56 | | - |
57 | | - //TCanvas *cNoise = new TCanvas("cNoise","Noise"); |
58 | | - //auto hNoise = painter::getHistogram2D(calNoise.getCalArray(0)); |
59 | | - //hNoise->SetTitle("Noise"); |
60 | | - //hNoise->Draw("colz"); |
61 | | - |
62 | | - cout << "To display the pedestals run: root.exe $calibMacroDir/drawNoiseAndPedestal.C'(\"" << outputFileName << "\")'\n"; |
| 53 | + std::cout << "To display the pedestals run: root.exe $calibMacroDir/drawNoiseAndPedestal.C'(\"" << outputFileName << "\")'\n"; |
63 | 54 | } |
0 commit comments