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

#include <G4VPrimitiveScorer.hh>

+ Inheritance diagram for G4VPrimitiveScorer:

Public Member Functions

 G4VPrimitiveScorer (G4String name, G4int depth=0)
 
virtual ~G4VPrimitiveScorer ()
 
G4int GetCollectionID (G4int)
 
virtual void Initialize (G4HCofThisEvent *)
 
virtual void EndOfEvent (G4HCofThisEvent *)
 
virtual void clear ()
 
virtual void DrawAll ()
 
virtual void PrintAll ()
 
void SetUnit (const G4String &unit)
 
const G4StringGetUnit () const
 
G4double GetUnitValue () const
 
void SetMultiFunctionalDetector (G4MultiFunctionalDetector *d)
 
G4MultiFunctionalDetectorGetMultiFunctionalDetector () const
 
G4String GetName () const
 
void SetFilter (G4VSDFilter *f)
 
G4VSDFilterGetFilter () const
 
void SetVerboseLevel (G4int vl)
 
G4int GetVerboseLevel () const
 
void SetNijk (G4int i, G4int j, G4int k)
 

Protected Member Functions

virtual G4bool ProcessHits (G4Step *, G4TouchableHistory *)=0
 
virtual G4int GetIndex (G4Step *)
 
void CheckAndSetUnit (const G4String &unit, const G4String &category)
 
G4VSolidComputeSolid (G4Step *aStep, G4int replicaIdx)
 
G4VSolidComputeCurrentSolid (G4Step *aStep)
 

Protected Attributes

G4String primitiveName
 
G4MultiFunctionalDetectordetector
 
G4VSDFilterfilter
 
G4int verboseLevel
 
G4int indexDepth
 
G4String unitName
 
G4double unitValue
 
G4int fNi
 
G4int fNj
 
G4int fNk
 

Friends

class G4MultiFunctionalDetector
 

Detailed Description

Definition at line 49 of file G4VPrimitiveScorer.hh.

Constructor & Destructor Documentation

◆ G4VPrimitiveScorer()

G4VPrimitiveScorer::G4VPrimitiveScorer ( G4String  name,
G4int  depth = 0 
)

Definition at line 38 of file G4VPrimitiveScorer.cc.

◆ ~G4VPrimitiveScorer()

G4VPrimitiveScorer::~G4VPrimitiveScorer ( )
virtual

Definition at line 43 of file G4VPrimitiveScorer.cc.

44{;}

Member Function Documentation

◆ CheckAndSetUnit()

void G4VPrimitiveScorer::CheckAndSetUnit ( const G4String unit,
const G4String category 
)
protected

Definition at line 77 of file G4VPrimitiveScorer.cc.

78 {
79 if ( G4UnitDefinition::GetCategory(unit) == category){
80 unitName = unit;
82 } else {
83 G4String msg = "Invalid unit ["+unit+"] (Current unit is [" +GetUnit()+"] ) requested for " + GetName();
84 G4Exception("G4VPrimitiveScorer::CheckAndSetUnit","Det0151",JustWarning,msg);
85 }
86}
@ JustWarning
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
Definition: G4Exception.cc:35
static G4double GetValueOf(const G4String &)
static G4String GetCategory(const G4String &)
G4String GetName() const
const G4String & GetUnit() const

Referenced by G4PSCellCharge::SetUnit(), G4PSCellFlux::SetUnit(), G4PSCylinderSurfaceCurrent::SetUnit(), G4PSCylinderSurfaceFlux::SetUnit(), G4PSDoseDeposit::SetUnit(), G4PSEnergyDeposit::SetUnit(), G4PSFlatSurfaceCurrent::SetUnit(), G4PSFlatSurfaceFlux::SetUnit(), G4PSMinKinEAtGeneration::SetUnit(), G4PSPassageCellFlux::SetUnit(), G4PSPassageTrackLength::SetUnit(), G4PSSphereSurfaceCurrent::SetUnit(), G4PSSphereSurfaceFlux::SetUnit(), and G4PSTrackLength::SetUnit().

◆ clear()

◆ ComputeCurrentSolid()

G4VSolid * G4VPrimitiveScorer::ComputeCurrentSolid ( G4Step aStep)
protected

Definition at line 118 of file G4VPrimitiveScorer.cc.

119{
120 G4StepPoint* preStep= aStep->GetPreStepPoint();
121 // The only difference: did not know the replica number
122 G4int replicaIdx = (static_cast<const G4TouchableHistory*>(preStep->GetTouchable()))
123 ->GetReplicaNumber(indexDepth);
124
125 return ComputeSolid(aStep, replicaIdx);
126}
int G4int
Definition: G4Types.hh:85
const G4VTouchable * GetTouchable() const
G4StepPoint * GetPreStepPoint() const
G4VSolid * ComputeSolid(G4Step *aStep, G4int replicaIdx)

Referenced by G4PSCylinderSurfaceCurrent::ProcessHits(), G4PSCylinderSurfaceFlux::ProcessHits(), and G4PSSphereSurfaceCurrent::ProcessHits().

◆ ComputeSolid()

G4VSolid * G4VPrimitiveScorer::ComputeSolid ( G4Step aStep,
G4int  replicaIdx 
)
protected

Definition at line 90 of file G4VPrimitiveScorer.cc.

91{
92 G4VSolid* solid = nullptr;
93 G4StepPoint* preStep= aStep->GetPreStepPoint();
94
95 auto physVol = preStep->GetPhysicalVolume();
96 G4VPVParameterisation* physParam = physVol->GetParameterisation();
97
98 if(physParam)
99 { // for parameterized volume
100 if(replicaIdx<0)
101 {
103 desc << "Incorrect replica number --- GetReplicaNumber : " << replicaIdx << G4endl;
104 G4Exception("G4VPrimitiveScorer::ComputeSolid","DetPS0001",JustWarning,desc);
105 // replicaIdx= 0; // You must ensure that it's in range !!!
106 }
107 solid = physParam->ComputeSolid(replicaIdx, physVol);
108 solid->ComputeDimensions(physParam,replicaIdx,physVol);
109 }
110 else
111 { // for ordinary volume
112 solid = physVol->GetLogicalVolume()->GetSolid();
113 }
114
115 return solid;
116}
std::ostringstream G4ExceptionDescription
Definition: G4Exception.hh:40
#define G4endl
Definition: G4ios.hh:57
G4VPhysicalVolume * GetPhysicalVolume() const
virtual G4VSolid * ComputeSolid(const G4int, G4VPhysicalVolume *)
virtual void ComputeDimensions(G4VPVParameterisation *p, const G4int n, const G4VPhysicalVolume *pRep)
Definition: G4VSolid.cc:125

Referenced by ComputeCurrentSolid(), G4PSCellFlux::ComputeVolume(), G4PSDoseDeposit::ComputeVolume(), and G4PSPassageCellFlux::ComputeVolume().

◆ DrawAll()

◆ EndOfEvent()

◆ GetCollectionID()

◆ GetFilter()

G4VSDFilter * G4VPrimitiveScorer::GetFilter ( ) const
inline

Definition at line 106 of file G4VPrimitiveScorer.hh.

107 { return filter; }

Referenced by G4VScoringMesh::List(), and G4VScoringMesh::SetFilter().

◆ GetIndex()

G4int G4VPrimitiveScorer::GetIndex ( G4Step aStep)
protectedvirtual

Reimplemented in G4PSCellCharge3D, G4PSCellFlux3D, G4PSCylinderSurfaceCurrent3D, G4PSCylinderSurfaceFlux3D, G4PSDoseDeposit3D, G4PSEnergyDeposit3D, G4PSFlatSurfaceCurrent3D, G4PSFlatSurfaceFlux3D, G4PSMinKinEAtGeneration3D, G4PSNofCollision3D, G4PSNofSecondary3D, G4PSNofStep3D, G4PSPassageCellCurrent3D, G4PSPassageCellFlux3D, G4PSPassageTrackLength3D, G4PSPopulation3D, G4PSSphereSurfaceCurrent3D, G4PSSphereSurfaceFlux3D, G4PSStepChecker3D, G4PSTermination3D, G4PSTrackCounter3D, G4PSTrackLength3D, and G4PSVolumeFlux3D.

Definition at line 70 of file G4VPrimitiveScorer.cc.

71{
72 G4StepPoint* preStep = aStep->GetPreStepPoint();
74 return th->GetReplicaNumber(indexDepth);
75}
G4int GetReplicaNumber(G4int depth=0) const

Referenced by G4PSCellCharge::ProcessHits(), G4PSCellFlux::ProcessHits(), G4PSCylinderSurfaceCurrent::ProcessHits(), G4PSCylinderSurfaceFlux::ProcessHits(), G4PSDoseDeposit::ProcessHits(), G4PSEnergyDeposit::ProcessHits(), G4PSFlatSurfaceCurrent::ProcessHits(), G4PSFlatSurfaceFlux::ProcessHits(), G4PSMinKinEAtGeneration::ProcessHits(), G4PSNofCollision::ProcessHits(), G4PSNofSecondary::ProcessHits(), G4PSNofStep::ProcessHits(), G4PSPassageCellCurrent::ProcessHits(), G4PSPassageCellFlux::ProcessHits(), G4PSPassageTrackLength::ProcessHits(), G4PSPopulation::ProcessHits(), G4PSSphereSurfaceCurrent::ProcessHits(), G4PSSphereSurfaceFlux::ProcessHits(), G4PSStepChecker::ProcessHits(), G4PSTermination::ProcessHits(), G4PSTrackCounter::ProcessHits(), G4PSTrackLength::ProcessHits(), and G4PSVolumeFlux::ProcessHits().

◆ GetMultiFunctionalDetector()

◆ GetName()

G4String G4VPrimitiveScorer::GetName ( ) const
inline

Definition at line 102 of file G4VPrimitiveScorer.hh.

103 { return primitiveName; }

Referenced by CheckAndSetUnit(), G4VScoringMesh::GetPrimitiveScorer(), G4PSCellCharge::Initialize(), G4PSCellFlux::Initialize(), G4PSCylinderSurfaceCurrent::Initialize(), G4PSCylinderSurfaceFlux::Initialize(), G4PSDoseDeposit::Initialize(), G4PSEnergyDeposit::Initialize(), G4PSFlatSurfaceCurrent::Initialize(), G4PSFlatSurfaceFlux::Initialize(), G4PSMinKinEAtGeneration::Initialize(), G4PSNofCollision::Initialize(), G4PSNofSecondary::Initialize(), G4PSNofStep::Initialize(), G4PSPassageCellCurrent::Initialize(), G4PSPassageCellFlux::Initialize(), G4PSPassageTrackLength::Initialize(), G4PSPopulation::Initialize(), G4PSSphereSurfaceCurrent::Initialize(), G4PSSphereSurfaceFlux::Initialize(), G4PSTermination::Initialize(), G4PSTrackCounter::Initialize(), G4PSTrackLength::Initialize(), G4PSVolumeFlux::Initialize(), G4VScoringMesh::List(), G4PSCellCharge::PrintAll(), G4PSCellFlux::PrintAll(), G4PSCylinderSurfaceCurrent::PrintAll(), G4PSCylinderSurfaceFlux::PrintAll(), G4PSDoseDeposit::PrintAll(), G4PSEnergyDeposit::PrintAll(), G4PSFlatSurfaceCurrent::PrintAll(), G4PSFlatSurfaceFlux::PrintAll(), G4PSMinKinEAtGeneration::PrintAll(), G4PSNofCollision::PrintAll(), G4PSNofSecondary::PrintAll(), G4PSNofStep::PrintAll(), G4PSPassageCellCurrent::PrintAll(), G4PSPassageCellFlux::PrintAll(), G4PSPassageTrackLength::PrintAll(), G4PSPopulation::PrintAll(), G4PSSphereSurfaceCurrent::PrintAll(), G4PSSphereSurfaceFlux::PrintAll(), G4PSTermination::PrintAll(), G4PSTrackCounter::PrintAll(), G4PSTrackLength::PrintAll(), G4PSVolumeFlux::PrintAll(), G4MultiFunctionalDetector::RegisterPrimitive(), G4MultiFunctionalDetector::RemovePrimitive(), G4VScoringMesh::SetFilter(), G4VScoringMesh::SetPrimitiveScorer(), G4PSCylinderSurfaceCurrent::SetUnit(), G4PSCylinderSurfaceFlux::SetUnit(), G4PSFlatSurfaceCurrent::SetUnit(), G4PSFlatSurfaceFlux::SetUnit(), G4PSNofCollision::SetUnit(), G4PSNofSecondary::SetUnit(), G4PSNofStep::SetUnit(), G4PSPassageCellCurrent::SetUnit(), G4PSPopulation::SetUnit(), G4PSSphereSurfaceCurrent::SetUnit(), G4PSSphereSurfaceFlux::SetUnit(), G4PSTermination::SetUnit(), and G4PSTrackCounter::SetUnit().

◆ GetUnit()

◆ GetUnitValue()

◆ GetVerboseLevel()

G4int G4VPrimitiveScorer::GetVerboseLevel ( ) const
inline

Definition at line 110 of file G4VPrimitiveScorer.hh.

111 { return verboseLevel; }

◆ Initialize()

◆ PrintAll()

◆ ProcessHits()

◆ SetFilter()

void G4VPrimitiveScorer::SetFilter ( G4VSDFilter f)
inline

Definition at line 104 of file G4VPrimitiveScorer.hh.

105 { filter = f; }

Referenced by G4VScoringMesh::SetFilter().

◆ SetMultiFunctionalDetector()

void G4VPrimitiveScorer::SetMultiFunctionalDetector ( G4MultiFunctionalDetector d)
inline

◆ SetNijk()

void G4VPrimitiveScorer::SetNijk ( G4int  i,
G4int  j,
G4int  k 
)
inline

Definition at line 131 of file G4VPrimitiveScorer.hh.

132 { fNi = i; fNj = j; fNk = k; }

Referenced by G4VScoringMesh::SetPrimitiveScorer().

◆ SetUnit()

void G4VPrimitiveScorer::SetUnit ( const G4String unit)
inline

Definition at line 80 of file G4VPrimitiveScorer.hh.

80{ unitName = unit; }

Referenced by G4VScoringMesh::SetCurrentPSUnit().

◆ SetVerboseLevel()

void G4VPrimitiveScorer::SetVerboseLevel ( G4int  vl)
inline

Definition at line 108 of file G4VPrimitiveScorer.hh.

109 { verboseLevel = vl; }

Friends And Related Function Documentation

◆ G4MultiFunctionalDetector

friend class G4MultiFunctionalDetector
friend

Definition at line 51 of file G4VPrimitiveScorer.hh.

Member Data Documentation

◆ detector

◆ filter

G4VSDFilter* G4VPrimitiveScorer::filter
protected

Definition at line 90 of file G4VPrimitiveScorer.hh.

Referenced by GetFilter(), and SetFilter().

◆ fNi

◆ fNj

G4int G4VPrimitiveScorer::fNj
protected

Definition at line 129 of file G4VPrimitiveScorer.hh.

Referenced by G4PSCellCharge3D::G4PSCellCharge3D(), G4PSCellFlux3D::G4PSCellFlux3D(), G4PSCylinderSurfaceCurrent3D::G4PSCylinderSurfaceCurrent3D(), G4PSCylinderSurfaceFlux3D::G4PSCylinderSurfaceFlux3D(), G4PSDoseDeposit3D::G4PSDoseDeposit3D(), G4PSEnergyDeposit3D::G4PSEnergyDeposit3D(), G4PSFlatSurfaceCurrent3D::G4PSFlatSurfaceCurrent3D(), G4PSFlatSurfaceFlux3D::G4PSFlatSurfaceFlux3D(), G4PSMinKinEAtGeneration3D::G4PSMinKinEAtGeneration3D(), G4PSNofCollision3D::G4PSNofCollision3D(), G4PSNofSecondary3D::G4PSNofSecondary3D(), G4PSNofStep3D::G4PSNofStep3D(), G4PSPassageCellCurrent3D::G4PSPassageCellCurrent3D(), G4PSPassageCellFlux3D::G4PSPassageCellFlux3D(), G4PSPassageTrackLength3D::G4PSPassageTrackLength3D(), G4PSPopulation3D::G4PSPopulation3D(), G4PSSphereSurfaceCurrent3D::G4PSSphereSurfaceCurrent3D(), G4PSSphereSurfaceFlux3D::G4PSSphereSurfaceFlux3D(), G4PSStepChecker3D::G4PSStepChecker3D(), G4PSTermination3D::G4PSTermination3D(), G4PSTrackCounter3D::G4PSTrackCounter3D(), G4PSTrackLength3D::G4PSTrackLength3D(), G4PSVolumeFlux3D::G4PSVolumeFlux3D(), G4PSCellCharge3D::GetIndex(), G4PSCellFlux3D::GetIndex(), G4PSCylinderSurfaceCurrent3D::GetIndex(), G4PSCylinderSurfaceFlux3D::GetIndex(), G4PSDoseDeposit3D::GetIndex(), G4PSEnergyDeposit3D::GetIndex(), G4PSFlatSurfaceCurrent3D::GetIndex(), G4PSFlatSurfaceFlux3D::GetIndex(), G4PSMinKinEAtGeneration3D::GetIndex(), G4PSNofCollision3D::GetIndex(), G4PSNofSecondary3D::GetIndex(), G4PSNofStep3D::GetIndex(), G4PSPassageCellCurrent3D::GetIndex(), G4PSPassageCellFlux3D::GetIndex(), G4PSPassageTrackLength3D::GetIndex(), G4PSPopulation3D::GetIndex(), G4PSSphereSurfaceCurrent3D::GetIndex(), G4PSSphereSurfaceFlux3D::GetIndex(), G4PSStepChecker3D::GetIndex(), G4PSTermination3D::GetIndex(), G4PSTrackCounter3D::GetIndex(), G4PSTrackLength3D::GetIndex(), G4PSVolumeFlux3D::GetIndex(), and SetNijk().

◆ fNk

G4int G4VPrimitiveScorer::fNk
protected

Definition at line 129 of file G4VPrimitiveScorer.hh.

Referenced by G4PSCellCharge3D::G4PSCellCharge3D(), G4PSCellFlux3D::G4PSCellFlux3D(), G4PSCylinderSurfaceCurrent3D::G4PSCylinderSurfaceCurrent3D(), G4PSCylinderSurfaceFlux3D::G4PSCylinderSurfaceFlux3D(), G4PSDoseDeposit3D::G4PSDoseDeposit3D(), G4PSEnergyDeposit3D::G4PSEnergyDeposit3D(), G4PSFlatSurfaceCurrent3D::G4PSFlatSurfaceCurrent3D(), G4PSFlatSurfaceFlux3D::G4PSFlatSurfaceFlux3D(), G4PSMinKinEAtGeneration3D::G4PSMinKinEAtGeneration3D(), G4PSNofCollision3D::G4PSNofCollision3D(), G4PSNofSecondary3D::G4PSNofSecondary3D(), G4PSNofStep3D::G4PSNofStep3D(), G4PSPassageCellCurrent3D::G4PSPassageCellCurrent3D(), G4PSPassageCellFlux3D::G4PSPassageCellFlux3D(), G4PSPassageTrackLength3D::G4PSPassageTrackLength3D(), G4PSPopulation3D::G4PSPopulation3D(), G4PSSphereSurfaceCurrent3D::G4PSSphereSurfaceCurrent3D(), G4PSSphereSurfaceFlux3D::G4PSSphereSurfaceFlux3D(), G4PSStepChecker3D::G4PSStepChecker3D(), G4PSTermination3D::G4PSTermination3D(), G4PSTrackCounter3D::G4PSTrackCounter3D(), G4PSTrackLength3D::G4PSTrackLength3D(), G4PSVolumeFlux3D::G4PSVolumeFlux3D(), G4PSCellCharge3D::GetIndex(), G4PSCellFlux3D::GetIndex(), G4PSCylinderSurfaceCurrent3D::GetIndex(), G4PSCylinderSurfaceFlux3D::GetIndex(), G4PSDoseDeposit3D::GetIndex(), G4PSEnergyDeposit3D::GetIndex(), G4PSFlatSurfaceCurrent3D::GetIndex(), G4PSFlatSurfaceFlux3D::GetIndex(), G4PSMinKinEAtGeneration3D::GetIndex(), G4PSNofCollision3D::GetIndex(), G4PSNofSecondary3D::GetIndex(), G4PSNofStep3D::GetIndex(), G4PSPassageCellCurrent3D::GetIndex(), G4PSPassageCellFlux3D::GetIndex(), G4PSPassageTrackLength3D::GetIndex(), G4PSPopulation3D::GetIndex(), G4PSSphereSurfaceCurrent3D::GetIndex(), G4PSSphereSurfaceFlux3D::GetIndex(), G4PSStepChecker3D::GetIndex(), G4PSTermination3D::GetIndex(), G4PSTrackCounter3D::GetIndex(), G4PSTrackLength3D::GetIndex(), G4PSVolumeFlux3D::GetIndex(), and SetNijk().

◆ indexDepth

◆ primitiveName

G4String G4VPrimitiveScorer::primitiveName
protected

Definition at line 88 of file G4VPrimitiveScorer.hh.

Referenced by GetCollectionID(), and GetName().

◆ unitName

◆ unitValue

◆ verboseLevel

G4int G4VPrimitiveScorer::verboseLevel
protected

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