ATLAS Offline Software
Loading...
Searching...
No Matches
VolumeDumper.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
3 */
4
5#include "VolumeDumper.h"
7
8// Geant4
9#include "G4PhysicalVolumeStore.hh"
10#include "G4LogicalVolume.hh"
11
12// Gaudi
13#include "GaudiKernel/Bootstrap.h"
14#include "GaudiKernel/ISvcLocator.h"
15#include "GaudiKernel/IMessageSvc.h"
16
17namespace G4UA
18{
19
20//---------------------------------------------------------------------------
22 AthMessaging(Gaudi::svcLocator()->service<IMessageSvc>("MessageSvc"),
23 "VolumeDumper")
24{
25}
26
27//---------------------------------------------------------------------------
29{
30 ATH_MSG_INFO("Dumping G4PhysicalVolumeStore");
31 ATH_MSG_INFO("-----------------------------");
32
33 G4PhysicalVolumeStore* store = G4PhysicalVolumeStore::GetInstance();
34 std::set<std::pair<G4String, G4String>> volumes;
35
36 ATH_MSG_INFO("Size: " << store->size());
37
38 for (unsigned int i = 0; i < store->size(); i++) {
39 volumes.insert(
40 std::pair<G4String, G4String>(
41 (*store)[i]->GetName(), (*store)[i]->GetLogicalVolume()->GetName()
42 ));
43 }
44
45 for (auto& vol : volumes) {
46 std::cout << "short: " << G4DebuggingHelpers::ClassifyVolume(vol.first)
47 << " full: " << vol.first
48 << " logical: " << vol.second
49 << std::endl;
50 }
51
52 ATH_MSG_INFO("Finished dumbing G4PhysicalVolumeStore");
53 ATH_MSG_INFO("-----------------------------");
54}
55
56} // namespace G4UA
#define ATH_MSG_INFO(x)
AthMessaging(IMessageSvc *msgSvc, const std::string &name)
Constructor.
virtual void BeginOfEventAction(const G4Event *) override
const G4String ClassifyVolume(const G4String &nom)
=============================================================================