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

#include <G4VSensitiveDetector.hh>

+ Inheritance diagram for G4VSensitiveDetector:

Public Member Functions

 G4VSensitiveDetector (G4String name)
 
 G4VSensitiveDetector (const G4VSensitiveDetector &right)
 
G4VSensitiveDetectoroperator= (const G4VSensitiveDetector &right)
 
virtual ~G4VSensitiveDetector ()=default
 
G4bool operator== (const G4VSensitiveDetector &right) const
 
G4bool operator!= (const G4VSensitiveDetector &right) const
 
virtual void Initialize (G4HCofThisEvent *)
 
virtual void EndOfEvent (G4HCofThisEvent *)
 
virtual void clear ()
 
virtual void DrawAll ()
 
virtual void PrintAll ()
 
G4bool Hit (G4Step *aStep)
 
void SetROgeometry (G4VReadOutGeometry *value)
 
void SetFilter (G4VSDFilter *value)
 
G4int GetNumberOfCollections () const
 
G4String GetCollectionName (G4int id) const
 
void SetVerboseLevel (G4int vl)
 
void Activate (G4bool activeFlag)
 
G4bool isActive () const
 
G4String GetName () const
 
G4String GetPathName () const
 
G4String GetFullPathName () const
 
G4VReadOutGeometryGetROgeometry () const
 
G4VSDFilterGetFilter () const
 
virtual G4VSensitiveDetectorClone () const
 

Protected Member Functions

virtual G4bool ProcessHits (G4Step *aStep, G4TouchableHistory *ROhist)=0
 
virtual G4int GetCollectionID (G4int i)
 

Protected Attributes

G4CollectionNameVector collectionName
 
G4String SensitiveDetectorName
 
G4String thePathName
 
G4String fullPathName
 
G4int verboseLevel {0}
 
G4bool active {true}
 
G4VReadOutGeometryROgeometry {nullptr}
 
G4VSDFilterfilter {nullptr}
 

Detailed Description

Definition at line 49 of file G4VSensitiveDetector.hh.

Constructor & Destructor Documentation

◆ G4VSensitiveDetector() [1/2]

G4VSensitiveDetector::G4VSensitiveDetector ( G4String name)
explicit

Definition at line 33 of file G4VSensitiveDetector.cc.

34{
35 size_t sLast = name.rfind('/');
36 if (sLast == std::string::npos) { // detector name only
38 thePathName = "/";
39 }
40 else { // name conatin the directory path
42 SensitiveDetectorName.erase(0, sLast + 1);
44 thePathName.erase(sLast + 1);
45 if (thePathName[0] != '/') thePathName.insert(0, "/");
46 }
48}
const char * name(G4int ptype)

◆ G4VSensitiveDetector() [2/2]

G4VSensitiveDetector::G4VSensitiveDetector ( const G4VSensitiveDetector & right)

◆ ~G4VSensitiveDetector()

virtual G4VSensitiveDetector::~G4VSensitiveDetector ( )
virtualdefault

Member Function Documentation

◆ Activate()

void G4VSensitiveDetector::Activate ( G4bool activeFlag)
inline

Definition at line 104 of file G4VSensitiveDetector.hh.

104{ active = activeFlag; }

Referenced by G4SDStructure::Activate().

◆ clear()

virtual void G4VSensitiveDetector::clear ( )
inlinevirtual

◆ Clone()

G4VSensitiveDetector * G4VSensitiveDetector::Clone ( ) const
virtual

Reimplemented in G4MultiSensitiveDetector.

Definition at line 61 of file G4VSensitiveDetector.cc.

62{
64 msg << "Derived class does not implement cloning,\n"
65 << "but Clone method called.\n"
66 << "Cannot continue;";
67 G4Exception("G4VSensitiveDetector::Clone", "Det0010", FatalException, msg);
68 return nullptr;
69}
@ FatalException
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
std::ostringstream G4ExceptionDescription

Referenced by G4VUserDetectorConstruction::CloneSD().

◆ DrawAll()

virtual void G4VSensitiveDetector::DrawAll ( )
inlinevirtual

Reimplemented in G4MultiFunctionalDetector, and G4MultiSensitiveDetector.

Definition at line 75 of file G4VSensitiveDetector.hh.

75{}

◆ EndOfEvent()

virtual void G4VSensitiveDetector::EndOfEvent ( G4HCofThisEvent * )
inlinevirtual

Reimplemented in G4MultiFunctionalDetector, and G4MultiSensitiveDetector.

Definition at line 67 of file G4VSensitiveDetector.hh.

67{}

◆ GetCollectionID()

G4int G4VSensitiveDetector::GetCollectionID ( G4int i)
protectedvirtual

Reimplemented in G4MultiSensitiveDetector.

Definition at line 94 of file G4VSensitiveDetector.cc.

95{
98}
static G4SDManager * GetSDMpointer()
G4int GetCollectionID(G4String colName)
G4CollectionNameVector collectionName

◆ GetCollectionName()

G4String G4VSensitiveDetector::GetCollectionName ( G4int id) const
inline

Definition at line 102 of file G4VSensitiveDetector.hh.

102{ return collectionName[id]; }

Referenced by G4SDManager::AddNewDetector(), and G4HCtable::GetCollectionID().

◆ GetFilter()

G4VSDFilter * G4VSensitiveDetector::GetFilter ( ) const
inline

Definition at line 110 of file G4VSensitiveDetector.hh.

110{ return filter; }

◆ GetFullPathName()

G4String G4VSensitiveDetector::GetFullPathName ( ) const
inline

Definition at line 108 of file G4VSensitiveDetector.hh.

108{ return fullPathName; }

Referenced by G4VUserDetectorConstruction::CloneSD().

◆ GetName()

G4String G4VSensitiveDetector::GetName ( ) const
inline

Definition at line 106 of file G4VSensitiveDetector.hh.

106{ return SensitiveDetectorName; }

Referenced by G4SDManager::AddNewDetector(), G4SDStructure::AddNewDetector(), G4MultiSensitiveDetector::Clone(), G4VUserDetectorConstruction::CloneSD(), G4GDMLWriteStructure::ExportSD(), G4HCtable::GetCollectionID(), G4MultiSensitiveDetector::GetCollectionID(), G4VPrimitiveScorer::GetCollectionID(), G4PSCellCharge::Initialize(), G4PSCellFlux::Initialize(), G4PSCylinderSurfaceCurrent::Initialize(), G4PSFlatSurfaceCurrent::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(), G4SDStructure::ListTree(), G3DetTable::PrintAll(), G4PSCellCharge::PrintAll(), G4PSCellFlux::PrintAll(), G4PSCylinderSurfaceCurrent::PrintAll(), G4PSCylinderSurfaceFlux::PrintAll(), G4PSDoseDeposit::PrintAll(), G4PSEnergyDeposit::PrintAll(), G4PSFlatSurfaceCurrent::PrintAll(), G4PSFlatSurfaceFlux::PrintAll(), G4PSNofCollision::PrintAll(), G4PSNofStep::PrintAll(), G4PSPassageCellCurrent::PrintAll(), G4PSPassageCellFlux::PrintAll(), G4PSPassageTrackLength::PrintAll(), G4PSPopulation::PrintAll(), G4PSSphereSurfaceCurrent::PrintAll(), G4PSSphereSurfaceFlux::PrintAll(), G4PSTermination::PrintAll(), G4PSTrackCounter::PrintAll(), G4PSTrackLength::PrintAll(), G4PSVolumeFlux::PrintAll(), G4ASCIITreeSceneHandler::RequestPrimitives(), G4VUserDetectorConstruction::SetSensitiveDetector(), G4VUserDetectorConstruction::SetSensitiveDetector(), and G4VUserParallelWorld::SetSensitiveDetector().

◆ GetNumberOfCollections()

G4int G4VSensitiveDetector::GetNumberOfCollections ( ) const
inline

Definition at line 101 of file G4VSensitiveDetector.hh.

101{ return G4int(collectionName.size()); }
int G4int
Definition G4Types.hh:85

Referenced by G4SDManager::AddNewDetector(), and G4HCtable::GetCollectionID().

◆ GetPathName()

G4String G4VSensitiveDetector::GetPathName ( ) const
inline

Definition at line 107 of file G4VSensitiveDetector.hh.

107{ return thePathName; }

Referenced by G4SDManager::AddNewDetector().

◆ GetROgeometry()

G4VReadOutGeometry * G4VSensitiveDetector::GetROgeometry ( ) const
inline

◆ Hit()

G4bool G4VSensitiveDetector::Hit ( G4Step * aStep)
inline

Definition at line 82 of file G4VSensitiveDetector.hh.

83 {
84 G4TouchableHistory* ROhis = nullptr;
85 if (! isActive()) return false;
86 if (filter != nullptr) {
87 if (! (filter->Accept(aStep))) return false;
88 }
89 if (ROgeometry != nullptr) {
90 if (! (ROgeometry->CheckROVolume(aStep, ROhis))) return false;
91 }
92 return ProcessHits(aStep, ROhis);
93 }
virtual G4bool CheckROVolume(G4Step *, G4TouchableHistory *&)
virtual G4bool Accept(const G4Step *) const =0
virtual G4bool ProcessHits(G4Step *aStep, G4TouchableHistory *ROhist)=0

Referenced by G4ParallelWorldProcess::AtRestDoIt(), G4ParallelWorldScoringProcess::AtRestDoIt(), G4FastSimHitMaker::make(), GFlashHitMaker::make(), G4ParallelWorldProcess::PostStepDoIt(), G4ParallelWorldScoringProcess::PostStepDoIt(), G4ScoreSplittingProcess::PostStepDoIt(), and G4SteppingManager::Stepping().

◆ Initialize()

virtual void G4VSensitiveDetector::Initialize ( G4HCofThisEvent * )
inlinevirtual

Reimplemented in G4MultiFunctionalDetector, and G4MultiSensitiveDetector.

Definition at line 66 of file G4VSensitiveDetector.hh.

66{}

◆ isActive()

G4bool G4VSensitiveDetector::isActive ( ) const
inline

Definition at line 105 of file G4VSensitiveDetector.hh.

105{ return active; }

Referenced by G4VGFlashSensitiveDetector::Hit(), Hit(), and G4SDStructure::ListTree().

◆ operator!=()

G4bool G4VSensitiveDetector::operator!= ( const G4VSensitiveDetector & right) const

Definition at line 89 of file G4VSensitiveDetector.cc.

90{
91 return (this != &right);
92}

◆ operator=()

G4VSensitiveDetector & G4VSensitiveDetector::operator= ( const G4VSensitiveDetector & right)

Definition at line 71 of file G4VSensitiveDetector.cc.

72{
73 if (this == &right) return *this;
78 active = right.active;
79 ROgeometry = right.ROgeometry;
80 filter = right.filter;
81 return *this;
82}

◆ operator==()

G4bool G4VSensitiveDetector::operator== ( const G4VSensitiveDetector & right) const

Definition at line 84 of file G4VSensitiveDetector.cc.

85{
86 return (this == &right);
87}

◆ PrintAll()

virtual void G4VSensitiveDetector::PrintAll ( )
inlinevirtual

Reimplemented in G4MultiFunctionalDetector, and G4MultiSensitiveDetector.

Definition at line 76 of file G4VSensitiveDetector.hh.

76{}

◆ ProcessHits()

virtual G4bool G4VSensitiveDetector::ProcessHits ( G4Step * aStep,
G4TouchableHistory * ROhist )
protectedpure virtual

Implemented in G4MultiFunctionalDetector, and G4MultiSensitiveDetector.

Referenced by Hit().

◆ SetFilter()

void G4VSensitiveDetector::SetFilter ( G4VSDFilter * value)
inline

Definition at line 99 of file G4VSensitiveDetector.hh.

99{ filter = value; }

◆ SetROgeometry()

void G4VSensitiveDetector::SetROgeometry ( G4VReadOutGeometry * value)
inline

Definition at line 96 of file G4VSensitiveDetector.hh.

96{ ROgeometry = value; }

◆ SetVerboseLevel()

void G4VSensitiveDetector::SetVerboseLevel ( G4int vl)
inline

Definition at line 103 of file G4VSensitiveDetector.hh.

103{ verboseLevel = vl; }

Member Data Documentation

◆ active

G4bool G4VSensitiveDetector::active {true}
protected

Definition at line 141 of file G4VSensitiveDetector.hh.

141{true};

Referenced by Activate(), isActive(), and operator=().

◆ collectionName

G4CollectionNameVector G4VSensitiveDetector::collectionName
protected

◆ filter

G4VSDFilter* G4VSensitiveDetector::filter {nullptr}
protected

Definition at line 143 of file G4VSensitiveDetector.hh.

143{nullptr};

Referenced by GetFilter(), Hit(), operator=(), and SetFilter().

◆ fullPathName

G4String G4VSensitiveDetector::fullPathName
protected

◆ ROgeometry

G4VReadOutGeometry* G4VSensitiveDetector::ROgeometry {nullptr}
protected

Definition at line 142 of file G4VSensitiveDetector.hh.

142{nullptr};

Referenced by GetROgeometry(), Hit(), operator=(), and SetROgeometry().

◆ SensitiveDetectorName

◆ thePathName

G4String G4VSensitiveDetector::thePathName
protected

◆ verboseLevel

G4int G4VSensitiveDetector::verboseLevel {0}
protected

Definition at line 140 of file G4VSensitiveDetector.hh.

140{0};

Referenced by operator=(), and SetVerboseLevel().


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