@@ -122,12 +122,6 @@ class CDBInterface
122122 // / \return gain map object
123123 const CalPad& getGainMap ();
124124
125- // / Return any CalPad object
126- // /
127- // / The function returns the CalPad object stored at the given path in the CCDB
128- // / \return CalPad object
129- const CalPad& getCalPad (const std::string_view path);
130-
131125 // / Return the Detector parameters
132126 // /
133127 // / The function checks if the object is already loaded and returns it
@@ -156,6 +150,17 @@ class CDBInterface
156150 // / \return GEM parameters
157151 const ParameterGEM& getParameterGEM ();
158152
153+ // / Return a CalPad object form the CCDB
154+ // / Deprecated
155+ const CalPad& getCalPad (const std::string_view path);
156+
157+ // / Return any templated object
158+ // /
159+ // / The function returns the object stored at the given path, timestamp and metaData in the CCDB
160+ // / \return object
161+ template <typename T>
162+ T& getSpecificObjectFromCDB (const std::string_view path, long timestamp = -1 , const std::map<std::string, std::string>& metaData = std::map<std::string, std::string>());
163+
159164 // / Set noise and pedestal object from file
160165 // /
161166 // / This assumes that the objects are stored under the name
@@ -238,6 +243,25 @@ inline T& CDBInterface::getObjectFromCDB(std::string_view path)
238243 return *object;
239244}
240245
246+ // / Get a CalPad object stored in templated formats from the CCDB.
247+ // / @tparam T
248+ // / @param path
249+ // / @param timestamp
250+ // / @param metaData
251+ // / @return The object from the CCDB, ownership is transferred to the caller.
252+ // / @todo Consider removing in favour of calling directly the manager::get method.
253+ template <typename T>
254+ inline T& CDBInterface::getSpecificObjectFromCDB (std::string_view path, long timestamp, const std::map<std::string, std::string>& metaData)
255+ {
256+ static auto & cdb = o2::ccdb::BasicCCDBManager::instance ();
257+ auto * object = cdb.getSpecific <T>(path.data (), timestamp, metaData);
258+ return *object;
259+ }
260+
261+ template CalPad& CDBInterface::getSpecificObjectFromCDB (const std::string_view path, long timestamp, const std::map<std::string, std::string>& metaData);
262+ template std::vector<CalPad>& CDBInterface::getSpecificObjectFromCDB (const std::string_view path, long timestamp, const std::map<std::string, std::string>& metaData);
263+ 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);
264+
241265// / \class CDBStorage
242266// / Simple interface to store TPC CCDB types. Also provide interface functions to upload data from
243267// / a file.
0 commit comments