Skip to content

Commit

Permalink
make sure to handle properly the case when no object can be found in …
Browse files Browse the repository at this point in the history
…QCDB (#2436)
  • Loading branch information
Barthelemy authored Sep 24, 2024
1 parent a2716d8 commit 9ef5296
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 7 deletions.
2 changes: 1 addition & 1 deletion Modules/EMCAL/src/FECRateVisualization.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ void FECRateVisualization::update(Trigger t, framework::ServiceRegistryRef servi

auto& qcdb = services.get<quality_control::repository::DatabaseInterface>();
auto mo = qcdb.retrieveMO("EMC/MO/CellTrendingDetailEMCAL", "CellTrendingDetailEMCAL", t.timestamp, t.activity);
TTree* datatree = static_cast<TTree*>(mo->getObject());
TTree* datatree = mo ? static_cast<TTree*>(mo->getObject()) : nullptr;
if (!datatree) {
ILOG(Error, Support) << "Tree not found" << ENDM;
return;
Expand Down
3 changes: 2 additions & 1 deletion Modules/ITS/src/TrendingTaskITSCluster.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,9 @@ void TrendingTaskITSCluster::trendValues(const Trigger& t, repository::DatabaseI
if (dataSource.type == "repository") {
// auto mo = qcdb.retrieveMO(dataSource.path, dataSource.name);
auto mo = qcdb.retrieveMO(dataSource.path, "", t.timestamp, t.activity);
if (mo == nullptr)
if (mo == nullptr) {
continue;
}
if (!count) {
std::map<std::string, std::string> entryMetadata = mo->getMetadataMap(); // full list of metadata as a map
mMetaData.runNumber = std::stoi(entryMetadata[metadata_keys::runNumber]); // get and set run number
Expand Down
3 changes: 2 additions & 1 deletion Modules/ITS/src/TrendingTaskITSError.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -113,8 +113,9 @@ void TrendingTaskITSError::trendValues(const Trigger& t, repository::DatabaseInt
// cast to whatever it needs.
if (dataSource.type == "repository") {
auto mo = qcdb.retrieveMO(dataSource.path, dataSource.name, t.timestamp, t.activity);
if (mo == nullptr)
if (mo == nullptr) {
continue;
}
if (!count) {
std::map<std::string, std::string> entryMetadata = mo->getMetadataMap(); // full list of metadata as a map
mMetaData.runNumber = std::stoi(entryMetadata[metadata_keys::runNumber]); // get and set run number
Expand Down
3 changes: 2 additions & 1 deletion Modules/ITS/src/TrendingTaskITSFEE.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,9 @@ void TrendingTaskITSFEE::trendValues(const Trigger& t, repository::DatabaseInter
// cast to whatever it needs.
if (dataSource.type == "repository") {
auto mo = qcdb.retrieveMO(dataSource.path, dataSource.name, t.timestamp, t.activity);
if (mo == nullptr)
if (mo == nullptr) {
continue;
}
if (!count) {
std::map<std::string, std::string> entryMetadata = mo->getMetadataMap(); // full list of metadata as a map
mMetaData.runNumber = std::stoi(entryMetadata[metadata_keys::runNumber]); // get and set run number
Expand Down
3 changes: 2 additions & 1 deletion Modules/ITS/src/TrendingTaskITSFhr.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -120,8 +120,9 @@ void TrendingTaskITSFhr::trendValues(const Trigger& t, repository::DatabaseInter

// auto mo = qcdb.retrieveMO(dataSource.path, dataSource.name);
auto mo = qcdb.retrieveMO(dataSource.path, "", timestamp, t.activity);
if (mo == nullptr)
if (mo == nullptr) {
continue;
}
if (!count) {
std::map<std::string, std::string> entryMetadata = mo->getMetadataMap(); // full list of metadata as a map
mMetaData.runNumber = std::stoi(entryMetadata[metadata_keys::runNumber]); // get and set run number
Expand Down
3 changes: 2 additions & 1 deletion Modules/ITS/src/TrendingTaskITSThr.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,9 @@ void TrendingTaskITSThr::trendValues(const Trigger& t, repository::DatabaseInter
if (dataSource.type == "repository") {
// auto mo = qcdb.retrieveMO(dataSource.path, dataSource.name);
auto mo = qcdb.retrieveMO(dataSource.path, "", t.timestamp, t.activity);
if (mo == nullptr)
if (mo == nullptr) {
continue;
}
if (!count) {
std::map<std::string, std::string> entryMetadata = mo->getMetadataMap(); // full list of metadata as a map
mMetaData.runNumber = std::stoi(entryMetadata[metadata_keys::runNumber]); // get and set run number
Expand Down
3 changes: 2 additions & 1 deletion Modules/ITS/src/TrendingTaskITSTracks.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,9 @@ void TrendingTaskITSTracks::trendValues(const Trigger& t, repository::DatabaseIn
if (dataSource.type == "repository") {
// auto mo = qcdb.retrieveMO(dataSource.path, dataSource.name);
auto mo = qcdb.retrieveMO(dataSource.path, "", t.timestamp, t.activity);
if (mo == nullptr)
if (mo == nullptr) {
continue;
}
if (!count) {
std::map<std::string, std::string> entryMetadata = mo->getMetadataMap(); // full list of metadata as a map
mMetaData.runNumber = std::stoi(entryMetadata[metadata_keys::runNumber]); // get and set run number
Expand Down

0 comments on commit 9ef5296

Please sign in to comment.