Skip to content
Snippets Groups Projects
Commit d4b9f5d7 authored by John Kenneth Anders's avatar John Kenneth Anders
Browse files

Merge branch '21.0-improve-volumeDumper' into '21.0'

adds logical volume printout as well

See merge request atlas/athena!22111
...@@ -7,6 +7,7 @@ ...@@ -7,6 +7,7 @@
// Geant4 // Geant4
#include "G4PhysicalVolumeStore.hh" #include "G4PhysicalVolumeStore.hh"
#include "G4LogicalVolume.hh"
// Gaudi // Gaudi
#include "GaudiKernel/Bootstrap.h" #include "GaudiKernel/Bootstrap.h"
...@@ -30,17 +31,22 @@ void VolumeDumper::BeginOfEventAction(const G4Event*) ...@@ -30,17 +31,22 @@ void VolumeDumper::BeginOfEventAction(const G4Event*)
ATH_MSG_INFO("-----------------------------"); ATH_MSG_INFO("-----------------------------");
G4PhysicalVolumeStore* store = G4PhysicalVolumeStore::GetInstance(); G4PhysicalVolumeStore* store = G4PhysicalVolumeStore::GetInstance();
std::set<G4String> volumes; std::set<std::pair<G4String, G4String>> volumes;
ATH_MSG_INFO("Size: " << store->size()); ATH_MSG_INFO("Size: " << store->size());
for (unsigned int i = 0; i < store->size(); i++) { for (unsigned int i = 0; i < store->size(); i++) {
volumes.insert((*store)[i]->GetName()); volumes.insert(
std::pair<G4String, G4String>(
(*store)[i]->GetName(), (*store)[i]->GetLogicalVolume()->GetName()
));
} }
for (auto& vol : volumes) { for (auto& vol : volumes) {
std::cout << "short: " << G4DebuggingHelpers::ClassifyVolume(vol) std::cout << "short: " << G4DebuggingHelpers::ClassifyVolume(vol.first)
<< " full: " << vol << std::endl; << " full: " << vol.first
<< " logical: " << vol.second
<< std::endl;
} }
ATH_MSG_INFO("Finished dumbing G4PhysicalVolumeStore"); ATH_MSG_INFO("Finished dumbing G4PhysicalVolumeStore");
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment