Skip to content

Commit c093a2f

Browse files
Executable to retrieve the CCDB entries for the Milestone Week 2 (#5406)
* Executable to retrieve the CCDB entries for the Milestone Week 2 Adding also a fix for the TOF macro to generate the CCDB DCSconfig entry. clang Use BasicCCDBManager instead of CcdbApi * fixes (#29) Co-authored-by: shahoian <ruben.shahoyan@cern.ch> * Forgotten CMakeLists * Install file with CCDB objects sizes and rates Co-authored-by: Ruben Shahoyan <shahor02@users.noreply.github.com> Co-authored-by: shahoian <ruben.shahoyan@cern.ch>
1 parent e8e9523 commit c093a2f

File tree

8 files changed

+420
-22
lines changed

8 files changed

+420
-22
lines changed

Detectors/Calibration/CMakeLists.txt

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -41,19 +41,6 @@ o2_add_executable(ccdb-populator-workflow
4141
O2::DetectorsCalibration
4242
O2::DataFormatsTOF
4343
O2::CCDB)
44-
45-
install(FILES testMacros/populateCCDB.C
46-
DESTINATION share/macro/)
47-
48-
o2_add_test_root_macro(testMacros/populateCCDB.C
49-
PUBLIC_LINK_LIBRARIES O2::CCDB
50-
O2::Framework)
51-
52-
o2_add_executable(populate-ccdb
53-
COMPONENT_NAME calibration
54-
SOURCES testMacros/populateCCDB.cxx
55-
PUBLIC_LINK_LIBRARIES ROOT::MathCore
56-
O2::Framework
57-
O2::CCDB)
5844

5945
add_subdirectory(workflow)
46+
add_subdirectory(testMacros)
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# Copyright CERN and copyright holders of ALICE O2. This software is distributed
2+
# under the terms of the GNU General Public License v3 (GPL Version 3), copied
3+
# verbatim in the file "COPYING".
4+
#
5+
# See http://alice-o2.web.cern.ch/license for full licensing information.
6+
#
7+
# In applying this license CERN does not waive the privileges and immunities
8+
# granted to it by virtue of its status as an Intergovernmental Organization or
9+
# submit itself to any jurisdiction.
10+
11+
install(FILES populateCCDB.C
12+
retrieveFromCCDB.C
13+
DESTINATION share/macro/)
14+
15+
install(FILES cdbSizeV0.txt
16+
DESTINATION share/Detectors/Calibration/data)
17+
18+
o2_add_test_root_macro(populateCCDB.C
19+
PUBLIC_LINK_LIBRARIES O2::CCDB
20+
O2::Framework)
21+
22+
o2_add_test_root_macro(retrieveFromCCDB.C
23+
PUBLIC_LINK_LIBRARIES O2::CCDB
24+
O2::Framework)
25+
26+
o2_add_executable(populate-ccdb
27+
COMPONENT_NAME calibration
28+
SOURCES populateCCDB.cxx
29+
PUBLIC_LINK_LIBRARIES ROOT::MathCore
30+
O2::Framework
31+
O2::CCDB)
32+
33+
o2_add_executable(retrieve-from-ccdb
34+
COMPONENT_NAME calibration
35+
SOURCES retrieveFromCCDB.cxx
36+
PUBLIC_LINK_LIBRARIES ROOT::MathCore
37+
O2::Framework
38+
O2::CCDB)
Lines changed: 232 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,232 @@
1+
2+
#CDB path FileSize (Run2) Validity (s) DCS data To Remove Comment
3+
4+
ITS/Align/Data 500000 1.00E+09
5+
ITS/Calib/NoiseMap 10000000 28800
6+
ITS/Calib/DeadMap 10000000 28800
7+
ITS/Calib/Params 10000 1.00E+09
8+
9+
MFT/Align/Data 500000 1.00E+09
10+
MFT/Calib/NoiseMap 3000000 28800
11+
MFT/Calib/DeadMap 3000000 28800
12+
MFT/Calib/Params 10000 1.00E+09
13+
14+
TPC/Calib/IDC 12500000 0.25
15+
TPC/Align/Data 2704 1.00E+09
16+
TPC/Calib/Pulser 3813733 28800
17+
TPC/Calib/CE 4927547 28800
18+
TPC/Calib/PadNoise 1343329 28800
19+
TPC/Calib/Pedestals 1919841 28800
20+
TPC/Calib/PadGainFactor 12591 28800 x
21+
TPC/Calib/GainFactorDedx 1878278 28800
22+
TPC/Calib/TimeGain 61545 3600
23+
TPC/Calib/AltroConfig 1176942 1.00E+09
24+
TPC/Calib/ClusterParam 37299 1.00E+09
25+
TPC/Calib/CorrectionMapsRef 12768345 1.00E+09
26+
TPC/Calib/CorrectionMaps 17884255 60
27+
TPC/Calib/GasComposition 9093114 28800 x Is used for anchored simulation to account for material budget
28+
TPC/Calib/HighVoltage 2384797 600 x
29+
TPC/Calib/IonTail 3893405 1.00E+09 ? Much smaller ion tain with GEMs, should be corrected in CRU or cluster finder
30+
TPC/Calib/LaserTracks 11115 1.00E+09 ? Not clear yet if this will be needed in the CCDB
31+
TPC/Calib/Mapping 30129 1.00E+09 ? Not clear yet
32+
TPC/Calib/PadTime0 1996850 28800 ? Not clear yet if this will be needed
33+
TPC/Calib/Parameters 4777 28800
34+
TPC/Calib/PidResponse 387664 1.00E+09 ? Not clear yet if this will be needed, perhaps merged with TimeGain?
35+
TPC/Calib/RecoParam 1070 1.00E+09
36+
TPC/Calib/Temperature 29282 6 00 x
37+
TPC/Calib/TimeDrift 1323 600
38+
39+
TPC/Config/GasComposition 1220 600 x The Config part was for the Run1/2 DCS export. I guess this can be removed.
40+
TPC/Config/HighVoltageStat 783 600 x The Config part was for the Run1/2 DCS export. I guess this can be removed.
41+
TPC/Config/HighVoltage 3714 600 x The Config part was for the Run1/2 DCS export. I guess this can be removed.
42+
TPC/Config/Temperature 5719 600 x The Config part was for the Run1/2 DCS export. I guess this can be removed.
43+
44+
TRD/Align/Data 28767 1.00E+09
45+
TRD/Calib/ChamberExB 1925 600
46+
TRD/Calib/ChamberGainFactor 2036 600
47+
TRD/Calib/ChamberStatus 472 600 TBD: shorter validity of chamber status due to SEUs?
48+
TRD/Calib/ChamberT0 1416 600
49+
TRD/Calib/ChamberVdrift 1927 600
50+
TRD/Calib/DCS 124655 60
51+
TRD/Calib/DetNoise 362 600
52+
TRD/Calib/Krypton 3085409 1.00E+09
53+
TRD/Calib/LocalGainFactor 1817327 3600 x No longer used in Run 3
54+
TRD/Calib/LocalT0 16487 600 Will this be used?
55+
TRD/Calib/LocalVdrift 17075 600 Will this be used?
56+
TRD/Calib/MonitoringData 8959 600
57+
TRD/Calib/PadNoise 1668099 28800
58+
TRD/Calib/PadStatus 15881 28800
59+
TRD/Calib/PHQ 193161 28800 What PID data will be needed?
60+
TRD/Calib/PIDLQ1D 44294 28800
61+
TRD/Calib/PIDLQ 446116 28800
62+
TRD/Calib/PIDNN 378784 28800
63+
TRD/Calib/PIDThresholds 1115 28800
64+
TRD/Calib/PRFWidth 17725 28800
65+
TRD/Calib/RecoParam 958 1.00E+09
66+
TRD/Calib/TrapConfig 3017386 1.00E+09 Actual TRAPconfig data (blob) is large and stable
67+
TRD/Calib/TrapConfig 28800 1.e9 Used TRAPconfig is pointer to data blob
68+
TRD/Calib/trd_chamberStatus 5298 3600 needs merging with TRD/Calib/ChamberStatus
69+
TRD/Calib/trd_envTemp 38434 600
70+
TRD/Calib/trd_gaschromatographCO2 537 600 Still used?
71+
TRD/Calib/trd_gaschromatographN2 543 600
72+
TRD/Calib/trd_gaschromatographXe 544 600
73+
TRD/Calib/trd_gasCO2 507 600
74+
TRD/Calib/trd_gasH2O 655 600
75+
TRD/Calib/trd_gasO2 620 600
76+
TRD/Calib/trd_gasOverpressure 526 600
77+
TRD/Calib/trd_goofieCO2 516 600 Still used?
78+
TRD/Calib/trd_goofieGain 583 600
79+
TRD/Calib/trd_goofieHv 514 600
80+
TRD/Calib/trd_goofieN2 514 600
81+
TRD/Calib/trd_goofiePeakArea 592 600
82+
TRD/Calib/trd_goofiePeakPos 587 600
83+
TRD/Calib/trd_goofiePressure 528 600
84+
TRD/Calib/trd_goofieTemp 582 600
85+
TRD/Calib/trd_goofieVelocity 525 600
86+
TRD/Calib/trd_hvAnodeImon 7748686 28800 HV currents / voltages needs further discussion
87+
TRD/Calib/trd_hvAnodeUmon 43528 28800
88+
TRD/Calib/trd_hvDriftImon 59798 28800
89+
TRD/Calib/trd_hvDriftUmon 36353 28800
90+
TRD/Calib/TrkAttach 12516 28800
91+
92+
TOF/Align/Data 79624 1.00E+09
93+
TOF/Calib/ConfigNoise 299 28800
94+
TOF/Calib/Config 371 1.00E+09
95+
TOF/Calib/CTPLatency 241 28800
96+
TOF/Calib/DeltaBCOffset 252 600
97+
TOF/Calib/FineSlewing 10027254 28800
98+
TOF/Calib/HW 26678 600
99+
TOF/Calib/Noise 26680 3600
100+
TOF/Calib/ParOffline 751933 28800
101+
TOF/Calib/ParOnlineDelay 540738 28800
102+
TOF/Calib/ParOnline 32043 28800
103+
TOF/Calib/Problematic 2921 28800
104+
TOF/Calib/Pulser 26688 28800
105+
TOF/Calib/ReadoutEfficiency 17555 28800
106+
TOF/Calib/RecoParam 384 1.00E+09
107+
TOF/Calib/RunParams 517 28800
108+
TOF/Calib/Status 7807 600
109+
TOF/Calib/T0FillOnlineCalib 276 28800
110+
TOF/Calib/T0Fill 231 28800
111+
112+
EMC/Align/Data 1185 1.00E+09
113+
EMC/Calib/BadChannels 4633 1.00E+09
114+
EMC/Calib/Data 4621 28800
115+
EMC/Calib/Mapping 9327 1.00E+09
116+
EMC/Calib/PeakFinder 17239 1.00E+09
117+
EMC/Calib/Pedestals 70701 28800
118+
EMC/Calib/RecoParam 1800 1.00E+09
119+
EMC/Calib/SimParam 309 1.00E+09
120+
EMC/Calib/Time 2777 28800
121+
EMC/Calib/Trigger 370 28800
122+
EMC/Config/Preprocessor 355 28800
123+
EMC/Config/Temperature 1603 600
124+
125+
PHS/Align/Data 618 1.00E+09
126+
PHS/Calib/GainPedestals 131459 28800
127+
PHS/Calib/BadChannels 1124 1.00E+09
128+
PHS/Calib/RecoParam 528 1.00E+09
129+
PHS/Calib/Mapping 73643 1.00E+09
130+
PHS/Calib/Time 10000 1.00E+09
131+
132+
CPV/Align/Data 618 1.00E+09
133+
CPV/Calib/GainPedestals 131459 28800
134+
CPV/Calib/BadChannels 1124 1.00E+09
135+
CPV/Calib/RecoParam 528 1.00E+09
136+
CPV/Calib/Mapping 73643 1.00E+09
137+
CPV/Calib/Time 10000 1.00E+09
138+
139+
HMP/Align/Data 538 1.00E+09
140+
HMP/Calib/RecoParam 403 1.00E+09
141+
HMP/Calib/Masked 3450 28800
142+
HMP/Calib/NoiseMap 159104 28800
143+
HMP/Calib/DaqSig 3450 28800
144+
HMP/Calib/Nmean 2804 28800
145+
HMP/Calib/QeMap 7797 28800
146+
HMP/Calib/Qthre 2320 28800
147+
148+
MCH/Align/Baseline 6465 1.00E+09
149+
MCH/Align/Data 19696 1.00E+09
150+
MCH/Calib/Pedestals 6743530 28800
151+
MCH/Calib/BPEVO 258083 1.00E+09
152+
MCH/Calib/Capacitances 7304542 1.00E+09
153+
MCH/Calib/Config 72271 28800
154+
MCH/Calib/Gains 9876740 28800
155+
MCH/Calib/HV 9011 600
156+
MCH/Calib/LV 7765 600
157+
MCH/Calib/MappingData 1202122 1.00E+09
158+
MCH/Calib/MappingRunData 94374 28800
159+
MCH/Calib/Neighbours 10912490 1.00E+09
160+
MCH/Calib/OccupancyMap 207825 28800
161+
MCH/Calib/RecoParam 589 1.00E+09
162+
MCH/Calib/RejectList 2159 28800
163+
164+
MID/Align/Data 19696 1.00E+09 Did not exist in Run2 (it was for MCH). Might exist in Run3, but not clear yet
165+
MID/Calib/RegionalTriggerBoardMasks 1511 1.00E+09 yes
166+
MID/Calib/RegionalTriggerConfig 1533 1.00E+09 To be modified
167+
MCH/Calib/LocalTriggerBoardMasks 1358 1.00E+09
168+
MID/Calib/GlobalTriggerBoardMasks 548 1.00E+09 yes
169+
MID/Calib/GlobalTriggerCrateConfig 499 1.00E+09 To be modified
170+
MID/Calib/TriggerDCS 33209 28800 yes
171+
MID/Calib/TriggerEfficiency 12461 28800
172+
MID/Calib/TriggerLut 48262 28800 yes
173+
MID/Calib/TriggerScalers 41283 28800
174+
175+
ZDC/Align/Data 404 1.00E+09 yes ? Never used in Run1-2 reconstruction nor simulation!
176+
ZDC/Calib/ChMap 698 28800 will be modified
177+
ZDC/Calib/EnergyCalib 303 28800 will be modified
178+
ZDC/Calib/LaserCalib 534 28800 ? Never used in Run1-2 (to be checked with Pietro)
179+
ZDC/Calib/MBCalib 17455 28800 x
180+
ZDC/Calib/Pedestals 1454 28800 will be modified
181+
ZDC/Calib/RecoParam 1250 1.00E+09 x In the end it wasn not used in reconstruction
182+
ZDC/Calib/SaturationCalib 281 28800 x
183+
ZDC/Calib/TDCCalib 357 28800 will be modified
184+
ZDC/Calib/TowerCalib 277 28800 will be modified
185+
186+
187+
FT0/Align/Data 335 1.00E+09
188+
FT0/Calib/ChargeEqualization 285 3600
189+
FT0/Calib/LightYields 501 1.00E+09
190+
FT0/Calib/PMGains 647 3600
191+
FT0/Calib/PMTrends 3209 3600
192+
FT0/Calib/PulseShapes 625 3600
193+
FT0/Calib/RecoParam 360 1.00E+09
194+
FT0/Calib/Saturation 21443 3600
195+
FT0/Calib/Thresholds 653 1.00E+09
196+
FT0/Calib/TimeDelays 491 28800
197+
FT0/Calib/TimeSlewing 103205 3600
198+
199+
FV0/Align/Data 335 1.00E+09
200+
FV0/Calib/ChargeEqualization 285 3600
201+
FV0/Calib/LightYields 501 1.00E+09
202+
FV0/Calib/PMGains 647 3600
203+
FV0/Calib/PMTrends 3209 3600
204+
FV0/Calib/PulseShapes 625 3600
205+
FV0/Calib/RecoParam 360 1.00E+09
206+
FV0/Calib/Saturation 21443 3600
207+
FV0/Calib/Thresholds 653 1.00E+09
208+
FV0/Calib/TimeDelays 491 28800
209+
FV0/Calib/TimeSlewing 103205 3600
210+
211+
FDD/Align/Data 335 1.00E+09
212+
FDD/Calib/ChargeEqualization 285 3600
213+
FDD/Calib/LightYields 501 1.00E+09
214+
FDD/Calib/PMGains 647 3600
215+
FDD/Calib/PMTrends 3209 3600
216+
FDD/Calib/PulseShapes 625 3600
217+
FDD/Calib/RecoParam 360 1.00E+09
218+
FDD/Calib/Saturation 21443 3600
219+
FDD/Calib/Thresholds 653 1.00E+09
220+
FDD/Calib/TimeDelays 491 28800
221+
FDD/Calib/TimeSlewing 103205 3600
222+
223+
GRP/GRP/Data 1760 3600
224+
GRP/GRP/LHCData 235537 600
225+
GRP/Calib/LHCClockPhase 369 60
226+
GRP/Calib/MeanVertex 321 600
227+
GRP/Calib/RecoParam 920 1.00E+09
228+
GRP/CTP/Aliases 558 28800
229+
GRP/CTP/Config 4908 28800
230+
GRP/CTP/CTPtiming 699 28800
231+
GRP/CTP/Scalers 104057 600
232+
GRP/CTP/LTUConfig 401 28800

Detectors/Calibration/testMacros/populateCCDB.cxx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ namespace bpo = boost::program_options;
2121
bool initOptionsAndParse(bpo::options_description& options, int argc, char* argv[], bpo::variables_map& vm)
2222
{
2323
options.add_options()(
24-
"host", bpo::value<std::string>()->default_value("ccdb-test.cern.ch:8080"), "CCDB server")(
24+
"ccdb-server,s", bpo::value<std::string>()->default_value("ccdb-test.cern.ch:8080"), "CCDB server")(
2525
"in-file-name,n", bpo::value<std::string>()->default_value("cdbSizeV0.txt"), "File name with list of CCDB entries to upload")(
2626
"help,h", "Produce help message.");
2727

@@ -55,7 +55,7 @@ int main(int argc, char* argv[])
5555

5656
// call populate "macro"
5757
auto& inputFile = vm["in-file-name"].as<std::string>();
58-
auto& ccdbHost = vm["host"].as<std::string>();
58+
auto& ccdbHost = vm["ccdb-server"].as<std::string>();
5959
populateCCDB(inputFile, ccdbHost);
6060

6161
return (0);
Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
#if !defined(__CLING__) || defined(__ROOTCLING__)
2+
3+
#include <string>
4+
#include <chrono>
5+
#include <iostream>
6+
#include <string>
7+
#include <fstream>
8+
#include <vector>
9+
#include <unistd.h>
10+
#include "Framework/Logger.h"
11+
#include "CCDB/BasicCCDBManager.h"
12+
#include <pthread.h>
13+
#include <thread>
14+
#include <mutex>
15+
#endif
16+
#include "populateCCDB.C"
17+
18+
using CcdbManager = o2::ccdb::BasicCCDBManager;
19+
20+
// macro to populate the CCDB emulating the rates that we expect for
21+
// Run 3, as read (in terms of size and rate) from an external file
22+
23+
void retrieve(const std::vector<CCDBObj>& objs, float procTimeSec, std::mutex& mtx, std::atomic<int>& n, size_t tfID);
24+
25+
void retrieveFromCCDB(int maxTFs = 8, float procTimeSec = 10.,
26+
const std::string& fname = "cdbSizeV0.txt",
27+
const std::string& ccdbHost = "http://localhost:8080" /*"http://ccdb-test.cern.ch:8080"*/,
28+
bool allowCaching = true)
29+
{
30+
auto& mgr = CcdbManager::instance();
31+
mgr.setURL(ccdbHost.c_str()); // or http://localhost:8080 for a local installation
32+
mgr.setCaching(allowCaching);
33+
auto objs = readObjectsList(fname);
34+
if (objs.empty()) {
35+
return;
36+
}
37+
std::mutex ccdb_mtx;
38+
std::atomic<int> nTFs{0};
39+
size_t tfID = 0;
40+
while (1) {
41+
if (nTFs < maxTFs) {
42+
std::thread th(retrieve, std::cref(objs), procTimeSec, std::ref(ccdb_mtx), std::ref(nTFs), tfID++);
43+
th.detach();
44+
LOG(INFO) << nTFs << " TFs currently in processing";
45+
} else {
46+
usleep(long(procTimeSec * (0.01e6)));
47+
}
48+
}
49+
}
50+
51+
void retrieve(const std::vector<CCDBObj>& objs, float procTimeSec, std::mutex& mtx, std::atomic<int>& n, size_t tfID)
52+
{
53+
// function to retrieve the CCDB objects and wait some (TF processing) time
54+
// to avoid all treads starting to read at the same time, we randomize the time of reading within the allocated processing time
55+
56+
n++;
57+
auto& mgr = CcdbManager::instance();
58+
float tfrac = gRandom->Rndm();
59+
usleep(long(procTimeSec * tfrac * 1e6));
60+
for (auto& o : objs) {
61+
auto now = std::chrono::system_clock::now();
62+
auto now_ms = std::chrono::time_point_cast<std::chrono::milliseconds>(now);
63+
auto timeStamp = now_ms.time_since_epoch();
64+
mtx.lock();
65+
std::vector<uint8_t>* ob = mgr.getForTimeStamp<std::vector<uint8_t>>(o.path, timeStamp.count());
66+
mtx.unlock();
67+
LOG(INFO) << "Retrieved object " << o.path << " of size " << ob->size() << " Bytes"
68+
<< " for TF " << tfID;
69+
if (!mgr.isCachingEnabled()) { // we can delete object only when caching is disabled
70+
delete ob;
71+
}
72+
}
73+
usleep(long(procTimeSec * (1. - tfrac) * 1e6));
74+
n--;
75+
}

0 commit comments

Comments
 (0)