Geant4 9.6.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 51 of file G4tgrSolidBoolean.hh.

Constructor & Destructor Documentation

◆ G4tgrSolidBoolean()

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

Definition at line 44 of file G4tgrSolidBoolean.cc.

45{
46 // :SOLID/:VOLU VOLU UNION/SUBS/INTERS VOLU1 VOLU2 ROTM POSX POSY POSZ
47
48 if( wl.size() != 9 )
49 {
50 G4tgrUtils::DumpVS(wl, "G4tgrSolidBoolean::G4tgrSolidBoolean()");
51 G4Exception("G4tgrSolidBoolean::G4tgrSolidBoolean()", "InvalidInput",
52 FatalException, "Line read with less or more than 9 words.");
53 }
54
55 //---------- Set name
57
59 const G4tgrSolid* sol1 = volmgr->FindSolid( G4tgrUtils::GetString( wl[3] ));
60 if( !sol1 )
61 {
62 sol1 = volmgr->FindVolume( G4tgrUtils::GetString( wl[3] ), 1)->GetSolid();
63 }
64 const G4tgrSolid* sol2 = volmgr->FindSolid( G4tgrUtils::GetString( wl[4] ));
65 if( !sol2 )
66 {
67 sol2 = volmgr->FindVolume( G4tgrUtils::GetString( wl[4] ), 1)->GetSolid();
68 }
69 theSolids.push_back( sol1 );
70 theSolids.push_back( sol2 );
71
72 //---------- Set relative placement and rotation matrix
73 theRelativeRotMatName = G4tgrUtils::GetString( wl[5] );
74 theRelativePlace = G4ThreeVector( G4tgrUtils::GetDouble(wl[6]),
76 G4tgrUtils::GetDouble(wl[8]) );
77 //---------- Set solid type
78 G4String wl2 = wl[2];
79 for( size_t ii = 0; ii < wl2.length(); ii++ )
80 {
81 wl2[ii] = toupper( wl2[ii] );
82 }
83 theType = "Boolean_" + wl2;
84
85#ifdef G4VERBOSE
87 {
88 G4cout << " Created " << *this << G4endl;
89 }
90#endif
91
93}
@ FatalException
CLHEP::Hep3Vector G4ThreeVector
#define G4endl
Definition: G4ios.hh:52
G4DLLIMPORT std::ostream G4cout
static G4int GetVerboseLevel()
G4String theType
Definition: G4tgrSolid.hh:75
G4String theName
Definition: G4tgrSolid.hh:73
static G4String GetString(const G4String &str)
Definition: G4tgrUtils.cc:178
static void DumpVS(const std::vector< G4String > &wl, const char *msg)
Definition: G4tgrUtils.cc:156
static G4double GetDouble(const G4String &str, G4double unitval=1.)
Definition: G4tgrUtils.cc:203
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:92
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
Definition: G4Exception.cc:41

◆ ~G4tgrSolidBoolean()

G4tgrSolidBoolean::~G4tgrSolidBoolean ( )

Definition at line 97 of file G4tgrSolidBoolean.cc.

98{
99}

Member Function Documentation

◆ GetRelativePlace()

G4ThreeVector G4tgrSolidBoolean::GetRelativePlace ( ) const
virtual

Reimplemented from G4tgrSolid.

Definition at line 110 of file G4tgrSolidBoolean.cc.

111{
112 return theRelativePlace;
113}

Referenced by G4tgbVolume::FindOrConstructG4Solid().

◆ GetRelativeRotMatName()

const G4String & G4tgrSolidBoolean::GetRelativeRotMatName ( ) const
virtual

Reimplemented from G4tgrSolid.

Definition at line 103 of file G4tgrSolidBoolean.cc.

104{
105 return theRelativeRotMatName;
106}

◆ GetSolid()

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

Definition at line 82 of file G4tgrSolidBoolean.hh.

83{
84 if((ii != 0) && (ii != 1))
85 {
86 G4String ErrMessage = "Only two G4tgrSolids (0,1) possible ! Asking for... "
87 + ii;
88 G4Exception("G4tgrSolidBoolean::GetSolid()", "InvalidInput",
89 FatalException, ErrMessage);
90 }
91 return theSolids[ii];
92}

Referenced by G4tgbVolume::FindOrConstructG4Solid().

Friends And Related Function Documentation

◆ operator<<

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

Definition at line 117 of file G4tgrSolidBoolean.cc.

118{
119 os << "G4tgrSolidBoolean= " << sol.theName << " of type " << sol.theType
120 << " PARAMS: ";
121 if( sol.theSolidParams.size() != 0 )
122 {
123 std::vector<G4double> solpar = *(sol.theSolidParams[0]);
124 for( size_t ii = 0; ii < solpar.size(); ii++)
125 {
126 os << solpar[ii] << " " ;
127 }
128 }
129 os << G4endl;
130
131 return os;
132}

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