Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
PHG4DisplayAction.cc
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file PHG4DisplayAction.cc
1 #include "PHG4DisplayAction.h"
2 
3 #include <Geant4/G4LogicalVolume.hh>
4 #include <Geant4/G4VPhysicalVolume.hh>
5 
7 {
8  int iret = 0;
9  if (int chk = CheckVolume(physvol))
10  {
11  ApplyVisAttributes(physvol);
12  if (chk == CheckReturnCodes::ABORT)
13  {
14  iret = -1;
15  return iret;
16  }
17  }
18  G4LogicalVolume* logvol = physvol->GetLogicalVolume();
19  int nDaughters = logvol->GetNoDaughters();
20  if (nDaughters > 0)
21  {
22  for (int i = 0; i < nDaughters; ++i)
23  {
24  G4VPhysicalVolume* daughtervol = logvol->GetDaughter(i);
25  //G4LogicalVolume* logicdaughter = daughtervol->GetLogicalVolume();
26 
27  if (FindVolumes(daughtervol))
28  {
29  iret = -1;
30  return iret;
31  }
32  }
33  }
34  return iret;
35 }