Geant4 10.7.0
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
G4tgrSolidBoolean Class Reference

#include <G4tgrSolidBoolean.hh>

+ Inheritance diagram for G4tgrSolidBoolean:

Public Member Functions

 G4tgrSolidBoolean (const std::vector< G4String > &wl)
 
 ~G4tgrSolidBoolean ()
 
const G4tgrSolidGetSolid (G4int ii) const
 
const G4StringGetRelativeRotMatName () const
 
G4ThreeVector GetRelativePlace () const
 
- Public Member Functions inherited from G4tgrSolid
 G4tgrSolid ()
 
 G4tgrSolid (const std::vector< G4String > &wl)
 
virtual ~G4tgrSolid ()
 
const G4StringGetName () const
 
const G4StringGetType () const
 
const std::vector< std::vector< G4double > * > GetSolidParams () const
 
virtual const G4StringGetRelativeRotMatName () const
 
virtual G4ThreeVector GetRelativePlace () const
 

Friends

std::ostream & operator<< (std::ostream &, const G4tgrSolidBoolean &)
 

Additional Inherited Members

- Protected Attributes inherited from G4tgrSolid
G4String theName
 
G4String theType
 
std::vector< std::vector< G4double > * > theSolidParams
 

Detailed Description

Definition at line 44 of file G4tgrSolidBoolean.hh.

Constructor & Destructor Documentation

◆ G4tgrSolidBoolean()

G4tgrSolidBoolean::G4tgrSolidBoolean ( const std::vector< G4String > &  wl)

Definition at line 39 of file G4tgrSolidBoolean.cc.

40{
41 // :SOLID/:VOLU VOLU UNION/SUBS/INTERS VOLU1 VOLU2 ROTM POSX POSY POSZ
42
43 if(wl.size() != 9)
44 {
45 G4tgrUtils::DumpVS(wl, "G4tgrSolidBoolean::G4tgrSolidBoolean()");
46 G4Exception("G4tgrSolidBoolean::G4tgrSolidBoolean()", "InvalidInput",
47 FatalException, "Line read with less or more than 9 words.");
48 }
49
50 //---------- Set name
52
54 const G4tgrSolid* sol1 = volmgr->FindSolid(G4tgrUtils::GetString(wl[3]));
55 if(sol1 == nullptr)
56 {
57 sol1 = volmgr->FindVolume(G4tgrUtils::GetString(wl[3]), 1)->GetSolid();
58 }
59 const G4tgrSolid* sol2 = volmgr->FindSolid(G4tgrUtils::GetString(wl[4]));
60 if(sol2 == nullptr)
61 {
62 sol2 = volmgr->FindVolume(G4tgrUtils::GetString(wl[4]), 1)->GetSolid();
63 }
64 theSolids.push_back(sol1);
65 theSolids.push_back(sol2);
66
67 //---------- Set relative placement and rotation matrix
68 theRelativeRotMatName = G4tgrUtils::GetString(wl[5]);
69 theRelativePlace =
72 //---------- Set solid type
73 G4String wl2 = wl[2];
74 for(std::size_t ii = 0; ii < wl2.length(); ++ii)
75 {
76 wl2[ii] = toupper(wl2[ii]);
77 }
78 theType = "Boolean_" + wl2;
79
80#ifdef G4VERBOSE
82 {
83 G4cout << " Created " << *this << G4endl;
84 }
85#endif
86
88}
@ FatalException
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
Definition: G4Exception.cc:35
CLHEP::Hep3Vector G4ThreeVector
#define G4endl
Definition: G4ios.hh:57
G4GLOB_DLL std::ostream G4cout
static G4int GetVerboseLevel()
G4String theType
Definition: G4tgrSolid.hh:68
G4String theName
Definition: G4tgrSolid.hh:66
static G4String GetString(const G4String &str)
Definition: G4tgrUtils.cc:173
static void DumpVS(const std::vector< G4String > &wl, const char *msg)
Definition: G4tgrUtils.cc:153
static G4double GetDouble(const G4String &str, G4double unitval=1.)
Definition: G4tgrUtils.cc:198
G4tgrVolume * FindVolume(const G4String &volname, G4bool exists=false)
G4tgrSolid * FindSolid(const G4String &name, G4bool exists=false)
void RegisterMe(G4tgrSolid *vol)
static G4tgrVolumeMgr * GetInstance()
G4tgrSolid * GetSolid() const
Definition: G4tgrVolume.hh:86

◆ ~G4tgrSolidBoolean()

G4tgrSolidBoolean::~G4tgrSolidBoolean ( )

Definition at line 91 of file G4tgrSolidBoolean.cc.

92{
93}

Member Function Documentation

◆ GetRelativePlace()

G4ThreeVector G4tgrSolidBoolean::GetRelativePlace ( ) const
virtual

Reimplemented from G4tgrSolid.

Definition at line 102 of file G4tgrSolidBoolean.cc.

103{
104 return theRelativePlace;
105}

Referenced by G4tgbVolume::FindOrConstructG4Solid().

◆ GetRelativeRotMatName()

const G4String & G4tgrSolidBoolean::GetRelativeRotMatName ( ) const
virtual

Reimplemented from G4tgrSolid.

Definition at line 96 of file G4tgrSolidBoolean.cc.

97{
98 return theRelativeRotMatName;
99}

◆ GetSolid()

const G4tgrSolid * G4tgrSolidBoolean::GetSolid ( G4int  ii) const
inline

Definition at line 74 of file G4tgrSolidBoolean.hh.

75{
76 if((ii != 0) && (ii != 1))
77 {
78 std::ostringstream message;
79 message << "Only two G4tgrSolids (0,1) possible ! Asking for... " << ii;
80 G4Exception("G4tgrSolidBoolean::GetSolid()", "InvalidInput", FatalException,
81 message);
82 }
83 return theSolids[ii];
84}

Referenced by G4tgbVolume::FindOrConstructG4Solid().

Friends And Related Function Documentation

◆ operator<<

std::ostream & operator<< ( std::ostream &  os,
const G4tgrSolidBoolean sol 
)
friend

Definition at line 108 of file G4tgrSolidBoolean.cc.

109{
110 os << "G4tgrSolidBoolean= " << sol.theName << " of type " << sol.theType
111 << " PARAMS: ";
112 if(sol.theSolidParams.size() != 0)
113 {
114 std::vector<G4double> solpar = *(sol.theSolidParams[0]);
115 for(std::size_t ii = 0; ii < solpar.size(); ++ii)
116 {
117 os << solpar[ii] << " ";
118 }
119 }
120 os << G4endl;
121
122 return os;
123}

The documentation for this class was generated from the following files: