Geant4-11
Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | Static Private Attributes
G4tgrRotationMatrixFactory Class Reference

#include <G4tgrRotationMatrixFactory.hh>

Public Member Functions

G4tgrRotationMatrixAddRotMatrix (const std::vector< G4String > &wl)
 
void DumpRotmList ()
 
G4tgrRotationMatrixFindRotMatrix (const G4String &rotm)
 
std::vector< G4tgrRotationMatrix * > GetRotMatList () const
 
const G4mstgrrotmGetRotMatMap () const
 

Static Public Member Functions

static G4tgrRotationMatrixFactoryGetInstance ()
 

Private Member Functions

 G4tgrRotationMatrixFactory ()
 
 ~G4tgrRotationMatrixFactory ()
 

Private Attributes

std::vector< G4tgrRotationMatrix * > theTgrRotMatList
 
G4mstgrrotm theTgrRotMats
 

Static Private Attributes

static G4ThreadLocal G4tgrRotationMatrixFactorytheInstance = nullptr
 

Detailed Description

Definition at line 45 of file G4tgrRotationMatrixFactory.hh.

Constructor & Destructor Documentation

◆ G4tgrRotationMatrixFactory()

G4tgrRotationMatrixFactory::G4tgrRotationMatrixFactory ( )
private

Definition at line 49 of file G4tgrRotationMatrixFactory.cc.

50{
51}

Referenced by GetInstance().

◆ ~G4tgrRotationMatrixFactory()

G4tgrRotationMatrixFactory::~G4tgrRotationMatrixFactory ( )
private

Definition at line 54 of file G4tgrRotationMatrixFactory.cc.

55{
56 for(auto cite = theTgrRotMats.cbegin(); cite != theTgrRotMats.cend(); ++cite)
57 {
58 delete(*cite).second;
59 }
60 theTgrRotMats.clear();
61 delete theInstance;
62}
static G4ThreadLocal G4tgrRotationMatrixFactory * theInstance

References theInstance, and theTgrRotMats.

Member Function Documentation

◆ AddRotMatrix()

G4tgrRotationMatrix * G4tgrRotationMatrixFactory::AddRotMatrix ( const std::vector< G4String > &  wl)

Definition at line 65 of file G4tgrRotationMatrixFactory.cc.

67{
68 //---------- Check for miminum number of words read
69 if(wl.size() != 5 && wl.size() != 8 && wl.size() != 11)
70 {
71 G4tgrUtils::DumpVS(wl, "G4tgrRotationMatrixFactory::AddRotMatrix()");
72 G4Exception("G4tgrRotationMatrixFactory::AddRotMatrix()", "InvalidMatrix",
73 FatalException, "Line should have 5, 8 or 11 words !");
74 }
75
76#ifdef G4VERBOSE
78 {
79 G4cout << " G4tgrRotationMatrixFactory::AddRotMatrix() - Adding: " << wl[1]
80 << G4endl;
81 }
82#endif
83 //---------- Look if rotation matrix exists
85 {
86 G4String ErrMessage = "Rotation matrix repeated... " + wl[1];
87 G4Exception("G4tgrRotationMatrixFactory::AddRotMatrix()", "InvalidInput",
88 FatalException, ErrMessage);
89 }
90
92 theTgrRotMats[rotm->GetName()] = rotm;
93 theTgrRotMatList.push_back(rotm);
94
95 return rotm;
96}
@ FatalException
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
Definition: G4Exception.cc:35
#define G4endl
Definition: G4ios.hh:57
G4GLOB_DLL std::ostream G4cout
static G4int GetVerboseLevel()
std::vector< G4tgrRotationMatrix * > theTgrRotMatList
G4tgrRotationMatrix * FindRotMatrix(const G4String &rotm)
const G4String & GetName()
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

References G4tgrUtils::DumpVS(), FatalException, FindRotMatrix(), G4cout, G4endl, G4Exception(), G4tgrRotationMatrix::GetName(), G4tgrUtils::GetString(), G4tgrMessenger::GetVerboseLevel(), theTgrRotMatList, and theTgrRotMats.

Referenced by G4tgrLineProcessor::ProcessLine().

◆ DumpRotmList()

void G4tgrRotationMatrixFactory::DumpRotmList ( )

Definition at line 114 of file G4tgrRotationMatrixFactory.cc.

115{
116 G4cout << " @@@@@@@@@@@@@@@@ DUMPING G4tgrRotationMatrix's List " << G4endl;
117 for(auto cite = theTgrRotMats.cbegin(); cite != theTgrRotMats.cend(); ++cite)
118 {
119 G4cout << " ROTM: " << (*cite).second->GetName() << G4endl;
120 }
121}

References G4cout, G4endl, and theTgrRotMats.

Referenced by G4tgrVolumeMgr::DumpSummary().

◆ FindRotMatrix()

G4tgrRotationMatrix * G4tgrRotationMatrixFactory::FindRotMatrix ( const G4String rotm)

Definition at line 99 of file G4tgrRotationMatrixFactory.cc.

101{
102 G4tgrRotationMatrix* rotm = nullptr;
103
104 G4mstgrrotm::const_iterator cite = theTgrRotMats.find(name);
105 if(cite != theTgrRotMats.cend())
106 {
107 rotm = (*cite).second;
108 }
109
110 return rotm;
111}
const char * name(G4int ptype)

References G4InuclParticleNames::name(), and theTgrRotMats.

Referenced by AddRotMatrix().

◆ GetInstance()

G4tgrRotationMatrixFactory * G4tgrRotationMatrixFactory::GetInstance ( )
static

◆ GetRotMatList()

std::vector< G4tgrRotationMatrix * > G4tgrRotationMatrixFactory::GetRotMatList ( ) const
inline

Definition at line 59 of file G4tgrRotationMatrixFactory.hh.

60 {
61 return theTgrRotMatList;
62 }

References theTgrRotMatList.

Referenced by G4tgrVolumeMgr::DumpSummary().

◆ GetRotMatMap()

const G4mstgrrotm & G4tgrRotationMatrixFactory::GetRotMatMap ( ) const
inline

Definition at line 58 of file G4tgrRotationMatrixFactory.hh.

58{ return theTgrRotMats; }

References theTgrRotMats.

Referenced by G4tgbRotationMatrixMgr::CopyRotMats().

Field Documentation

◆ theInstance

G4ThreadLocal G4tgrRotationMatrixFactory * G4tgrRotationMatrixFactory::theInstance = nullptr
staticprivate

Definition at line 74 of file G4tgrRotationMatrixFactory.hh.

Referenced by GetInstance(), and ~G4tgrRotationMatrixFactory().

◆ theTgrRotMatList

std::vector<G4tgrRotationMatrix*> G4tgrRotationMatrixFactory::theTgrRotMatList
private

Definition at line 76 of file G4tgrRotationMatrixFactory.hh.

Referenced by AddRotMatrix(), and GetRotMatList().

◆ theTgrRotMats

G4mstgrrotm G4tgrRotationMatrixFactory::theTgrRotMats
private

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