ATLAS Offline Software
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 
17 namespace 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
store
StoreGateSvc * store
Definition: fbtTestBasics.cxx:69
G4DebuggingHelper.h
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
G4DebuggingHelpers::ClassifyVolume
const G4String ClassifyVolume(const G4String &nom)
Definition: G4DebuggingHelper.cxx:74
G4UA
for nSW
Definition: CalibrationDefaultProcessing.h:19
G4UA::VolumeDumper::VolumeDumper
VolumeDumper()
Definition: VolumeDumper.cxx:21
VolumeDumper.h
lumiFormat.i
int i
Definition: lumiFormat.py:92
AthMessaging
Class to provide easy MsgStream access and capabilities.
Definition: AthMessaging.h:55
G4UA::VolumeDumper::BeginOfEventAction
virtual void BeginOfEventAction(const G4Event *) override
Definition: VolumeDumper.cxx:28
Gaudi
=============================================================================
Definition: CaloGPUClusterAndCellDataMonitorOptions.h:273