Skip to content

Commit 8263996

Browse files
tklemenzknopers8
authored andcommitted
TPC CalDetPublisher: fetch std::unordered_map objects from CCDB + add ZS calibration file check (#746)
1 parent 860fb3b commit 8263996

3 files changed

Lines changed: 301 additions & 48 deletions

File tree

Modules/TPC/include/TPC/CalDetPublisher.h

Lines changed: 34 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,16 +20,25 @@
2020
#include "QualityControl/PostProcessingInterface.h"
2121

2222
#include <boost/property_tree/ptree_fwd.hpp>
23+
#include <map>
2324

2425
class TCanvas;
26+
class TPaveText;
2527

2628
namespace o2::quality_control_modules::tpc
2729
{
2830

2931
/// \brief Valid CalDet objects
3032
/// This struct contains the valid CalDet objects to be fetched from the CCDB
31-
enum struct outputType { Pedestal,
32-
Noise
33+
enum struct outputCalPad { Pedestal,
34+
Noise
35+
};
36+
37+
/// \brief Valid vectors of CalDet objects
38+
/// This struct contains the valid std::unordered_maps of CalDet objects to be fetched from the CCDB
39+
enum struct outputCalPadMap { NoPe,
40+
Pulser,
41+
CE
3342
};
3443

3544
/// \brief Quality Control task for the calibration data of the TPC
@@ -68,9 +77,30 @@ class CalDetPublisher final : public quality_control::postprocessing::PostProces
6877

6978
private:
7079
std::vector<std::string> mOutputList{}; ///< list of CalDet objects to be processed
80+
std::vector<std::string> mOutputListMap{}; ///< list of vectors of CalDet objects to be processed
7181
std::vector<std::vector<std::unique_ptr<TCanvas>>> mCalDetCanvasVec{}; ///< vector containing a vector of summary canvases for every CalDet object
72-
std::vector<std::vector<std::string>> mMetaKeys{}; ///< vector containing metaData keys; objects can have more than one key
73-
std::vector<std::vector<std::string>> mMetaValues{}; ///< vector containing metaData values
82+
std::vector<long> mTimestamps{}; ///< timestamps to look for specific data in the CCDB
83+
std::vector<std::map<std::string, std::string>> mLookupMaps{}; ///< meta data to look for data in the CCDB
84+
std::vector<std::map<std::string, std::string>> mStoreMaps{}; ///< meta data to be stored with the output in the QCDB
85+
bool mCheckZSCalib; ///< shall the calib data used for ZS be compared to the latest pedestal and noise files
86+
bool mCheckZSPrereq = true; ///< is pedestal and noise in the outputList in the config file
87+
std::unique_ptr<o2::tpc::CalDet<float>> mRefPedestal; ///< reference pedestal file used for ZS at the moment
88+
std::unique_ptr<o2::tpc::CalDet<float>> mRefNoise; ///< reference noise file used for ZS at the moment
89+
long mInitRefCalibTimestamp; ///< timestamp of the pedestal/noise map used at init of the task
90+
long mInitRefPedestalTimestamp; ///< timestamp of the pedestal data used at init of the task
91+
long mInitRefNoiseTimestamp; ///< timestamp of the noise data used at init of the task
92+
TPaveText* mNewZSCalibMsg = nullptr; ///< badge to indicate the necessity to upload new calibration data for ZS
93+
94+
std::unordered_map<std::string, std::vector<int>> mRanges{ ///< histogram ranges configurable via config file
95+
{ "Pedestals", {} },
96+
{ "Noise", {} },
97+
{ "PulserQtot", {} },
98+
{ "PulserT0", {} },
99+
{ "PulserWidth", {} },
100+
{ "CEQtot", {} },
101+
{ "CET0", {} },
102+
{ "CEWidth", {} }
103+
};
74104
};
75105

76106
} // namespace o2::quality_control_modules::tpc

Modules/TPC/run/tpcQCCalDetPublisher.json

Lines changed: 53 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,26 +28,77 @@
2828
"className": "o2::quality_control_modules::tpc::CalDetPublisher",
2929
"moduleName": "QcTPC",
3030
"detectorName": "TPC",
31-
"outputList": [
31+
"valid_outputCalPadMaps_comment" : [ "CE", "Pulser" ],
32+
"outputCalPadMaps": [
33+
"CE",
34+
"Pulser"
35+
],
36+
"outputCalPads_comment" : [ "Put all CalPad objects you want to look at in the list. The name has to be the same one as on the CCDB.",
37+
"valid outputCalPads: 'Pedestal', 'Noise'" ],
38+
"outputCalPads": [
3239
"Pedestal",
3340
"Noise"
3441
],
35-
"metaData": [
42+
"timestamps_comment": [ "Put the timestamp of the corresponding file you want to look for in the timestamps array.",
43+
"You can either put a timestamp for every object or leave the array empty to take the latest file from the CCDB.",
44+
"An empty array to get the the latest version will be the main use case.",
45+
"The array is mapped to the output objects sequentially",
46+
"If you want to pick the latest file in the CCDB manually, you can use -1."
47+
],
48+
"timestamps": [
49+
],
50+
"lookupMetaData_comment": [ "With this array you can filter your search via meta data.",
51+
"The array is mapped sequentially to the output objects.",
52+
"If you leave only one entry in the array this is used for all objects in outputCalPadMaps and outputCalPads.",
53+
"If you want no meta data simply remove 'keys' and 'values' completely and leave only {}",
54+
"Every entry above (outputCalPads.size() + outputCalPadMaps.size()) is ignored.",
55+
"The keys and values that are set by default are only there to serve as an example."
56+
],
57+
"lookupMetaData": [
58+
{
59+
}
60+
],
61+
"storeMetaData_comment": "For how-to, see 'lookupMetaData_comment'.",
62+
"storeMetaData": [
63+
{
64+
},
3665
{
3766
"keys": [ "key1", "key2" ],
3867
"values": [ "value1", "value2" ]
3968
},
4069
{
4170
"keys": [ "key" ],
4271
"values": [ "value" ]
72+
},
73+
{
4374
}
4475
],
76+
"histogramRanges_comment" : [ "nBins", "min", "max" ],
77+
"histogramRanges": [
78+
{ "Pedestals" : [ "240", "0", "120" ] },
79+
{ "Noise" : [ "200", "0", "2" ] },
80+
{ "PulserQtot" : [ "600", "0", "300" ] },
81+
{ "PulserT0" : [ "100", "239", "240" ] },
82+
{ "PulserWidth" : [ "100", "0", "1" ] },
83+
{ "CEQtot" : [ "600", "0", "300" ] },
84+
{ "CET0" : [ "200", "400", "500" ] },
85+
{ "CEWidth" : [ "100", "0", "1" ] }
86+
],
87+
"checkZSCalibration": {
88+
"check": "true",
89+
"initRefCalibTimestamp": "-1",
90+
"initRefPedestalTimestamp": "-1",
91+
"initRefNoiseTimestamp": "-1"
92+
},
4593
"initTrigger": [
4694
"once"
4795
],
96+
"updateTrigger_comment": "To trigger on a specific file being updated, use e.g. 'newobject:ccdb:TPC/Calib/Noise'",
4897
"updateTrigger": [
4998
"once"
5099
],
100+
"stopTrigger_comment": [ "To keep the task running until it is stopped manually set the trigger on the update of a non-existing object, e.g. 'newobject:ccdb:TPC/ThisDoesNotExist'",
101+
"There will be a end of run trigger implemented so the above workaround can be abandoned later." ],
51102
"stopTrigger": [
52103
"once"
53104
]

0 commit comments

Comments
 (0)