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

#include <G4CellScorerStore.hh>

+ Inheritance diagram for G4CellScorerStore:

Public Member Functions

 G4CellScorerStore ()
 
virtual ~G4CellScorerStore ()
 
virtual G4VCellScorerGetCellScore (const G4GeometryCell &gCell)
 
void SetAutoScorerCreate ()
 
G4CellScorerAddCellScorer (const G4GeometryCell &gCell)
 
G4CellScorerAddCellScorer (G4VPhysicalVolume &vol, G4int repnum=0)
 
const G4MapGeometryCellCellScorerGetMapGeometryCellCellScorer () const
 
void DeleteAllScorers ()
 
- Public Member Functions inherited from G4VCellScorerStore
 G4VCellScorerStore ()
 
virtual ~G4VCellScorerStore ()
 
virtual G4VCellScorerGetCellScore (const G4GeometryCell &gCell)=0
 

Detailed Description

Definition at line 59 of file G4CellScorerStore.hh.

Constructor & Destructor Documentation

◆ G4CellScorerStore()

G4CellScorerStore::G4CellScorerStore ( )

Definition at line 40 of file G4CellScorerStore.cc.

40 :
41 fAutoCreate(false)
42{
43 G4cout << "--------------------------------------------------------" << G4endl
44 << "WARNING: Class <G4CellScorerStore> is now obsolete |" << G4endl
45 << " and will be removed starting from next Geant4 |" << G4endl
46 << " major release. Please, consider switching to |" << G4endl
47 << " general purpose scoring functionality. |" << G4endl
48 << "--------------------------------------------------------"
49 << G4endl;
50}
#define G4endl
Definition: G4ios.hh:52
G4DLLIMPORT std::ostream G4cout

◆ ~G4CellScorerStore()

G4CellScorerStore::~G4CellScorerStore ( )
virtual

Definition at line 52 of file G4CellScorerStore.cc.

53{}

Member Function Documentation

◆ AddCellScorer() [1/2]

G4CellScorer * G4CellScorerStore::AddCellScorer ( const G4GeometryCell gCell)

Definition at line 71 of file G4CellScorerStore.cc.

72 {
73 G4CellScorer *cs = 0;
74 cs = new G4CellScorer;
75 if (!cs) {
76 G4Exception("G4CellScorerStore::AddCellScorer","Event0801",FatalException,
77 "failed to create G4CellScorer!");
78 }
79 fMapGeometryCellCellScorer[gCell] = cs;
80 return cs;
81}
@ FatalException
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
Definition: G4Exception.cc:41

Referenced by GetCellScore().

◆ AddCellScorer() [2/2]

G4CellScorer * G4CellScorerStore::AddCellScorer ( G4VPhysicalVolume vol,
G4int  repnum = 0 
)

Definition at line 59 of file G4CellScorerStore.cc.

60 {
61 G4CellScorer *cs = 0;
62 cs = new G4CellScorer;
63 if (!cs) {
64 G4Exception("G4CellScorerStore::AddCellScorer","Event0801",FatalException,
65 "failed to create G4CellScorer!");
66 }
67 fMapGeometryCellCellScorer[G4GeometryCell(vol, repnum)] = cs;
68 return cs;
69}

◆ DeleteAllScorers()

void G4CellScorerStore::DeleteAllScorers ( )

Definition at line 102 of file G4CellScorerStore.cc.

102 {
103 for(G4MapGeometryCellCellScorer::iterator it =
104 fMapGeometryCellCellScorer.begin();
105 it!=fMapGeometryCellCellScorer.end();
106 ++it){
107 delete it->second;
108 }
109 fMapGeometryCellCellScorer.clear();
110}

◆ GetCellScore()

G4VCellScorer * G4CellScorerStore::GetCellScore ( const G4GeometryCell gCell)
virtual

Implements G4VCellScorerStore.

Definition at line 87 of file G4CellScorerStore.cc.

88 {
89 G4VCellScorer *cs=0;
90 G4MapGeometryCellCellScorer::iterator it = fMapGeometryCellCellScorer.find(gCell);
91 if (it != fMapGeometryCellCellScorer.end()) {
92 cs = (*it).second;
93 }
94 else {
95 if (fAutoCreate) {
96 cs = AddCellScorer(gCell);
97 }
98 }
99 return cs;
100}
G4CellScorer * AddCellScorer(const G4GeometryCell &gCell)

◆ GetMapGeometryCellCellScorer()

const G4MapGeometryCellCellScorer & G4CellScorerStore::GetMapGeometryCellCellScorer ( ) const

Definition at line 83 of file G4CellScorerStore.cc.

83 {
84 return fMapGeometryCellCellScorer;
85}

◆ SetAutoScorerCreate()

void G4CellScorerStore::SetAutoScorerCreate ( )

Definition at line 55 of file G4CellScorerStore.cc.

55 {
56 fAutoCreate = true;
57}

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