File indexing completed on 2025-08-06 08:19:20
0001 #include "PHG4DisplayAction.h"
0002
0003 #include <Geant4/G4LogicalVolume.hh>
0004 #include <Geant4/G4VPhysicalVolume.hh>
0005
0006
0007 int PHG4DisplayAction::FindVolumes(G4VPhysicalVolume* physvol)
0008 {
0009 int iret = 0;
0010 if (int chk = CheckVolume(physvol))
0011 {
0012 ApplyVisAttributes(physvol);
0013 if (chk == CheckReturnCodes::ABORT)
0014 {
0015 iret = -1;
0016 return iret;
0017 }
0018 }
0019 G4LogicalVolume* logvol = physvol->GetLogicalVolume();
0020 int nDaughters = logvol->GetNoDaughters();
0021 if (nDaughters > 0)
0022 {
0023 for (int i = 0; i < nDaughters; ++i)
0024 {
0025 G4VPhysicalVolume* daughtervol = logvol->GetDaughter(i);
0026
0027
0028 if (FindVolumes(daughtervol))
0029 {
0030 iret = -1;
0031 return iret;
0032 }
0033 }
0034 }
0035 return iret;
0036 }