2626#include " TPCBase/CalDet.h"
2727#include " DataFormatsTPC/LtrCalibData.h"
2828
29- namespace o2
30- {
31- namespace tpc
29+ namespace o2 ::tpc
3230{
3331// forward declarations
3432class ParameterDetector ;
@@ -40,6 +38,7 @@ class ParameterGEM;
4038enum class CDBType {
4139 CalPedestal, // /< Pedestal calibration
4240 CalNoise, // /< Noise calibration
41+ CalPedestalNoise, // /< Pedestal and Noise calibration
4342 CalPulser, // /< Pulser calibration
4443 CalCE, // /< Laser CE calibration
4544 CalPadGainFull, // /< Full pad gain calibration
@@ -59,9 +58,10 @@ enum class CDBIntervention {
5958};
6059
6160// / Storage name in CCDB for each calibration and parameter type
62- const std::unordered_map<CDBType, std::string> CDBTypeMap{
61+ const std::unordered_map<CDBType, const std::string> CDBTypeMap{
6362 {CDBType::CalPedestal, " TPC/Calib/Pedestal" },
6463 {CDBType::CalNoise, " TPC/Calib/Noise" },
64+ {CDBType::CalPedestalNoise, " TPC/Calib/PedestalNoise" },
6565 {CDBType::CalPulser, " TPC/Calib/Pulser" },
6666 {CDBType::CalCE, " TPC/Calib/CE" },
6767 {CDBType::CalPadGainFull, " TPC/Calib/PadGainFull" },
@@ -94,6 +94,8 @@ const std::unordered_map<CDBIntervention, std::string> CDBInterventionMap{
9494class CDBInterface
9595{
9696 public:
97+ using CalPadMapType = std::unordered_map<std::string, CalPad>;
98+
9799 CDBInterface (const CDBInterface&) = delete ;
98100
99101 // / Create instance of singleton
@@ -243,6 +245,9 @@ inline T& CDBInterface::getObjectFromCDB(std::string_view path)
243245{
244246 static auto & cdb = o2::ccdb::BasicCCDBManager::instance ();
245247 auto * object = cdb.get <T>(path.data ());
248+ if (!object) {
249+ LOGP (fatal, " Could not get {} from cdb" , path);
250+ }
246251 return *object;
247252}
248253
@@ -263,7 +268,7 @@ inline T& CDBInterface::getSpecificObjectFromCDB(std::string_view path, long tim
263268
264269template CalPad& CDBInterface::getSpecificObjectFromCDB (const std::string_view path, long timestamp, const std::map<std::string, std::string>& metaData);
265270template std::vector<CalPad>& CDBInterface::getSpecificObjectFromCDB (const std::string_view path, long timestamp, const std::map<std::string, std::string>& metaData);
266- template std::unordered_map<std::string, o2::tpc::CalPad> & CDBInterface::getSpecificObjectFromCDB (const std::string_view path, long timestamp, const std::map<std::string, std::string>& metaData);
271+ template CDBInterface::CalPadMapType & CDBInterface::getSpecificObjectFromCDB (const std::string_view path, long timestamp, const std::map<std::string, std::string>& metaData);
267272template LtrCalibData& CDBInterface::getSpecificObjectFromCDB (const std::string_view path, long timestamp, const std::map<std::string, std::string>& metaData);
268273
269274// / \class CDBStorage
@@ -305,6 +310,11 @@ class CDBStorage
305310 mMetaData [" Comment" ] = comment;
306311 }
307312
313+ void setRunNumber (int run)
314+ {
315+ mMetaData [" runNumber" ] = std::to_string (run);
316+ }
317+
308318 template <typename T>
309319 void storeObject (T* obj, CDBType const type, MetaData_t const & metadata, long start, long end)
310320 {
@@ -322,9 +332,9 @@ class CDBStorage
322332 storeObject (obj, type, mMetaData , start, end);
323333 }
324334
325- void uploadNoiseAndPedestal (std::string_view fileName, long first = -1 , long last = - 1 );
326- void uploadGainMap (std::string_view fileName, bool isFull = true , long first = -1 , long last = - 1 );
327- void uploadPulserOrCEData (CDBType type, std::string_view fileName, long first = -1 , long last = - 1 );
335+ void uploadNoiseAndPedestal (std::string_view fileName, long first = -1 , long last = 99999999999999 );
336+ void uploadGainMap (std::string_view fileName, bool isFull = true , long first = -1 , long last = 99999999999999 );
337+ void uploadPulserOrCEData (CDBType type, std::string_view fileName, long first = -1 , long last = 99999999999999 );
328338
329339 private:
330340 bool checkMetaData (MetaData_t metaData) const ;
@@ -335,7 +345,6 @@ class CDBStorage
335345 MetaData_t mMetaData ;
336346};
337347
338- } // namespace tpc
339- } // namespace o2
348+ } // namespace o2::tpc
340349
341350#endif
0 commit comments