Skip to content

Commit 3b2a953

Browse files
Benedikt Volkelsawenzel
authored andcommitted
Actually log the mdium names
1 parent 22af3ca commit 3b2a953

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

MCStepLogger/include/MCStepLogger/StepInfo.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ struct StepLookups {
7272

7373
void insertVolName(int index, std::string const& s) { insertValueAt(index, s, volidtovolname); }
7474
void insertModuleName(int index, std::string const& s) { insertValueAt(index, s, volidtomodule); }
75+
void insertMediumName(int index, std::string const& s) { insertValueAt(index, s, volidtomedium); }
7576
std::string* getModuleAt(int index) const
7677
{
7778
if (index >= volidtomodule.size())

MCStepLogger/src/StepInfo.cxx

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,6 @@ StepInfo::StepInfo(TVirtualMC* mc)
6262
// try to resolve the module via external map
6363
// keep information in faster vector once looked up
6464
auto volname = mc->CurrentVolName();
65-
lookupstructures.insertVolName(volId, volname);
6665

6766
if (volnametomodulemap && volnametomodulemap->size() > 0 && volId >= 0) {
6867
if (lookupstructures.getModuleAt(volId) == nullptr) {
@@ -228,10 +227,14 @@ bool StepLookups::initGeoVolIdToVMCVolid(TVirtualMC* mc)
228227

229228
while (obj = voliter->Next()) {
230229
if (vol = dynamic_cast<TGeoVolume*>(obj)) {
230+
auto volIdVMC{mc->VolId(vol->GetName())};
231+
insertVolName(volIdVMC, vol->GetName());
232+
insertMediumName(volIdVMC, vol->GetMedium()->GetName());
233+
231234
if (geovolidtovmcvolid.size() <= vol->GetNumber()) {
232235
geovolidtovmcvolid.resize(vol->GetNumber() + 1, -1);
233236
}
234-
geovolidtovmcvolid[vol->GetNumber()] = mc->VolId(vol->GetName());
237+
geovolidtovmcvolid[vol->GetNumber()] = volIdVMC;
235238
}
236239
}
237240
return true;

0 commit comments

Comments
 (0)