Skip to content

Commit

Permalink
fix(sim): Change and move log level for multiple sensitive volumes wi…
Browse files Browse the repository at this point in the history
…th same name

Both the transport engines and FairRoot allow registering
of multiple nodes with the same volume/same volume name (copy mechanism).
However currently such workflow logs errors from `FairVolumeList::addVolume()`,
which in turn is called by `FairModule::AddSensitiveVolume()`.

Since the `FairVolumeList::addVolume()` returns nullpointer
in such cases, the commit moves `LOG` and changes it severity
from `LOG(error)` in `FairVolumeList::addVolume()`
to `LOG(debug)` in `FairModule::AddSensitiveVolume()`.

Fixes the issue #1595.
  • Loading branch information
karabowi committed Dec 18, 2024
1 parent 23a39ba commit ee84b67
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 2 additions & 0 deletions fairroot/base/sim/FairModule.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -282,6 +282,8 @@ void FairModule::AddSensitiveVolume(TGeoVolume* vol)

auto addedVol = vList->addVolume(std::make_unique<FairVolume>(volName, fNbOfVolumes));
if (!addedVol) {
LOG(debug) << "FairVolumeList element: " << vol->GetName() << " VolId : " << vol->getVolumeId()
<< " already defined " << vol_found->getVolumeId() << "// vol = " << vol;
return;
}
++fNbOfVolumes;
Expand Down
2 changes: 0 additions & 2 deletions fairroot/base/sim/FairVolumeList.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,6 @@ FairVolume* FairVolumeList::addVolume(std::unique_ptr<FairVolume> vol)
auto vol_found = findObject(vol->GetName());

if (vol_found) {
LOG(error) << "FairVolumeList element: " << vol->GetName() << " VolId : " << vol->getVolumeId()
<< " already defined " << vol_found->getVolumeId();
return nullptr;
}

Expand Down

0 comments on commit ee84b67

Please sign in to comment.