Geant4-11
Public Member Functions | Protected Member Functions | Protected Attributes
G4MultiFunctionalDetector Class Reference

#include <G4MultiFunctionalDetector.hh>

Inheritance diagram for G4MultiFunctionalDetector:
G4VSensitiveDetector

Public Member Functions

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

Protected Member Functions

virtual G4int GetCollectionID (G4int i)
 
virtual G4bool ProcessHits (G4Step *, G4TouchableHistory *)
 

Protected Attributes

G4bool active
 
G4CollectionNameVector collectionName
 
G4VSDFilterfilter
 
G4String fullPathName
 
std::vector< G4VPrimitiveScorer * > primitives
 
G4VReadOutGeometryROgeometry
 
G4String SensitiveDetectorName
 
G4String thePathName
 
G4int verboseLevel
 

Detailed Description

Definition at line 47 of file G4MultiFunctionalDetector.hh.

Constructor & Destructor Documentation

◆ G4MultiFunctionalDetector()

G4MultiFunctionalDetector::G4MultiFunctionalDetector ( G4String  name)

Definition at line 37 of file G4MultiFunctionalDetector.cc.

39{
40 ;
41}
G4VSensitiveDetector(G4String name)
const char * name(G4int ptype)

◆ ~G4MultiFunctionalDetector()

G4MultiFunctionalDetector::~G4MultiFunctionalDetector ( )
virtual

Definition at line 43 of file G4MultiFunctionalDetector.cc.

44{
45 for(auto pr : primitives)
46 delete pr;
47 primitives.clear();
48}
std::vector< G4VPrimitiveScorer * > primitives

References primitives.

Member Function Documentation

◆ Activate()

void G4VSensitiveDetector::Activate ( G4bool  activeFlag)
inlineinherited

Definition at line 148 of file G4VSensitiveDetector.hh.

148{ active = activeFlag; }

References G4VSensitiveDetector::active.

Referenced by G4SDStructure::Activate(), and export_G4VSensitiveDetector().

◆ clear()

void G4MultiFunctionalDetector::clear ( )
virtual

Reimplemented from G4VSensitiveDetector.

Definition at line 123 of file G4MultiFunctionalDetector.cc.

124{
125 for(auto pr : primitives)
126 {
127 pr->clear();
128 }
129}

References primitives.

◆ Clone()

G4VSensitiveDetector * G4VSensitiveDetector::Clone ( ) const
virtualinherited

Reimplemented in G4MultiSensitiveDetector.

Definition at line 69 of file G4VSensitiveDetector.cc.

70{
72 msg << "Derived class does not implement cloning,\n"
73 << "but Clone method called.\n"
74 << "Cannot continue;";
75 G4Exception("G4VSensitiveDetector::Clone", "Det0010", FatalException, msg);
76 return nullptr;
77}
@ FatalException
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
Definition: G4Exception.cc:35
std::ostringstream G4ExceptionDescription
Definition: G4Exception.hh:40

References FatalException, and G4Exception().

Referenced by G4VUserDetectorConstruction::CloneSD().

◆ DrawAll()

void G4MultiFunctionalDetector::DrawAll ( )
virtual

Reimplemented from G4VSensitiveDetector.

Definition at line 131 of file G4MultiFunctionalDetector.cc.

132{
133 for(auto pr : primitives)
134 {
135 pr->DrawAll();
136 }
137}

References primitives.

◆ EndOfEvent()

void G4MultiFunctionalDetector::EndOfEvent ( G4HCofThisEvent HC)
virtual

Reimplemented from G4VSensitiveDetector.

Definition at line 115 of file G4MultiFunctionalDetector.cc.

116{
117 for(auto pr : primitives)
118 {
119 pr->EndOfEvent(HC);
120 }
121}

References primitives.

◆ GetCollectionID()

G4int G4VSensitiveDetector::GetCollectionID ( G4int  i)
protectedvirtualinherited

◆ GetCollectionName()

G4String G4VSensitiveDetector::GetCollectionName ( G4int  id) const
inlineinherited

◆ GetFilter()

G4VSDFilter * G4VSensitiveDetector::GetFilter ( ) const
inlineinherited

Definition at line 154 of file G4VSensitiveDetector.hh.

154{ return filter; }

References G4VSensitiveDetector::filter.

◆ GetFullPathName()

G4String G4VSensitiveDetector::GetFullPathName ( ) const
inlineinherited

◆ GetName()

G4String G4VSensitiveDetector::GetName ( ) const
inlineinherited

Definition at line 150 of file G4VSensitiveDetector.hh.

150{ return SensitiveDetectorName; }

References G4VSensitiveDetector::SensitiveDetectorName.

Referenced by G4SDManager::AddNewDetector(), G4SDStructure::AddNewDetector(), G4MultiSensitiveDetector::Clone(), G4VUserDetectorConstruction::CloneSD(), export_G4VSensitiveDetector(), G4GDMLWriteStructure::ExportSD(), G4MultiSensitiveDetector::G4MultiSensitiveDetector(), G4MultiSensitiveDetector::GetCollectionID(), G4VPrimitiveScorer::GetCollectionID(), G4HCtable::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(), 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(), G3DetTable::PrintAll(), G4MultiSensitiveDetector::ProcessHits(), G4ASCIITreeSceneHandler::RequestPrimitives(), G4VUserDetectorConstruction::SetSensitiveDetector(), G4VUserParallelWorld::SetSensitiveDetector(), and G4MultiSensitiveDetector::~G4MultiSensitiveDetector().

◆ GetNumberOfCollections()

G4int G4VSensitiveDetector::GetNumberOfCollections ( ) const
inlineinherited

Definition at line 139 of file G4VSensitiveDetector.hh.

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

References G4VSensitiveDetector::collectionName.

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

◆ GetNumberOfPrimitives()

G4int G4MultiFunctionalDetector::GetNumberOfPrimitives ( ) const
inline

Definition at line 60 of file G4MultiFunctionalDetector.hh.

61 {
62 return G4int(primitives.size());
63 }

References primitives.

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

◆ GetPathName()

G4String G4VSensitiveDetector::GetPathName ( ) const
inlineinherited

◆ GetPrimitive()

G4VPrimitiveScorer * G4MultiFunctionalDetector::GetPrimitive ( G4int  id) const
inline

Definition at line 64 of file G4MultiFunctionalDetector.hh.

64{ return primitives[id]; }

References primitives.

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

◆ GetROgeometry()

G4VReadOutGeometry * G4VSensitiveDetector::GetROgeometry ( ) const
inlineinherited

◆ Hit()

G4bool G4VSensitiveDetector::Hit ( G4Step aStep)
inlineinherited

◆ Initialize()

void G4MultiFunctionalDetector::Initialize ( G4HCofThisEvent HC)
virtual

Reimplemented from G4VSensitiveDetector.

Definition at line 107 of file G4MultiFunctionalDetector.cc.

108{
109 for(auto pr : primitives)
110 {
111 pr->Initialize(HC);
112 }
113}

References primitives.

◆ isActive()

G4bool G4VSensitiveDetector::isActive ( ) const
inlineinherited

◆ operator!=()

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

Definition at line 99 of file G4VSensitiveDetector.cc.

100{
101 return (this != &right);
102}

◆ operator==()

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

Definition at line 94 of file G4VSensitiveDetector.cc.

95{
96 return (this == &right);
97}

◆ PrintAll()

void G4MultiFunctionalDetector::PrintAll ( )
virtual

Reimplemented from G4VSensitiveDetector.

Definition at line 139 of file G4MultiFunctionalDetector.cc.

140{
141 for(auto pr : primitives)
142 {
143 pr->PrintAll();
144 }
145}

References primitives.

◆ ProcessHits()

G4bool G4MultiFunctionalDetector::ProcessHits ( G4Step aStep,
G4TouchableHistory aTH 
)
protectedvirtual

Implements G4VSensitiveDetector.

Definition at line 50 of file G4MultiFunctionalDetector.cc.

52{
53 if(aStep->GetStepLength() > 0. || aStep->GetTotalEnergyDeposit() > 0.)
54 {
55 for(auto pr : primitives)
56 {
57 pr->HitPrimitive(aStep, aTH);
58 }
59 }
60 return true;
61}
G4double GetStepLength() const
G4double GetTotalEnergyDeposit() const

References G4Step::GetStepLength(), G4Step::GetTotalEnergyDeposit(), and primitives.

◆ RegisterPrimitive()

G4bool G4MultiFunctionalDetector::RegisterPrimitive ( G4VPrimitiveScorer aPS)

Definition at line 63 of file G4MultiFunctionalDetector.cc.

64{
65 for(auto pr : primitives)
66 {
67 if(pr == aPS)
68 {
70 ED << "Primitive <" << aPS->GetName() << "> is already defined in <"
71 << SensitiveDetectorName << ">." << G4endl
72 << "Method RegisterPrimitive() is ignored." << G4endl;
73 G4Exception("G4MultiFunctionalDetector::RegisterPrimitive", "Det0101",
74 JustWarning, ED);
75 return false;
76 }
77 }
78 primitives.push_back(aPS);
81 if(G4SDManager::GetSDMpointer()->FindSensitiveDetector(SensitiveDetectorName,
82 false))
83 {
84 // This G4MultiFunctionalDetector has already been registered to
85 // G4SDManager. Make sure this new primitive is registered as well.
87 aPS->GetName());
88 }
89 return true;
90}
@ JustWarning
#define G4endl
Definition: G4ios.hh:57
void AddNewCollection(G4String SDname, G4String DCname)
Definition: G4SDManager.cc:94
void SetMultiFunctionalDetector(G4MultiFunctionalDetector *d)
G4String GetName() const

References G4SDManager::AddNewCollection(), G4VSensitiveDetector::collectionName, G4endl, G4Exception(), G4VPrimitiveScorer::GetName(), G4SDManager::GetSDMpointer(), G4CollectionNameVector::insert(), JustWarning, primitives, G4VSensitiveDetector::SensitiveDetectorName, and G4VPrimitiveScorer::SetMultiFunctionalDetector().

Referenced by G4VScoringMesh::SetPrimitiveScorer().

◆ RemovePrimitive()

G4bool G4MultiFunctionalDetector::RemovePrimitive ( G4VPrimitiveScorer aPS)

Definition at line 92 of file G4MultiFunctionalDetector.cc.

93{
94 auto pr = std::find(primitives.begin(), primitives.end(), aPS);
95 if(pr != primitives.end())
96 {
97 primitives.erase(pr);
98 aPS->SetMultiFunctionalDetector(nullptr);
99 return true;
100 }
101 G4cerr << "Primitive <" << aPS->GetName() << "> is not defined in <"
102 << SensitiveDetectorName << ">." << G4endl
103 << "Method RemovePrimitive() is ignored." << G4endl;
104 return false;
105}
G4GLOB_DLL std::ostream G4cerr

References G4cerr, G4endl, G4VPrimitiveScorer::GetName(), primitives, G4VSensitiveDetector::SensitiveDetectorName, and G4VPrimitiveScorer::SetMultiFunctionalDetector().

◆ SetFilter()

void G4VSensitiveDetector::SetFilter ( G4VSDFilter value)
inlineinherited

Definition at line 135 of file G4VSensitiveDetector.hh.

135{ filter = value; }

References G4VSensitiveDetector::filter.

◆ SetROgeometry()

void G4VSensitiveDetector::SetROgeometry ( G4VReadOutGeometry value)
inlineinherited

Definition at line 133 of file G4VSensitiveDetector.hh.

133{ ROgeometry = value; }

References G4VSensitiveDetector::ROgeometry.

Referenced by export_G4VSensitiveDetector().

◆ SetVerboseLevel()

void G4VSensitiveDetector::SetVerboseLevel ( G4int  vl)
inlineinherited

Field Documentation

◆ active

G4bool G4VSensitiveDetector::active
protectedinherited

◆ collectionName

G4CollectionNameVector G4VSensitiveDetector::collectionName
protectedinherited

◆ filter

G4VSDFilter* G4VSensitiveDetector::filter
protectedinherited

◆ fullPathName

G4String G4VSensitiveDetector::fullPathName
protectedinherited

◆ primitives

std::vector<G4VPrimitiveScorer*> G4MultiFunctionalDetector::primitives
protected

◆ ROgeometry

G4VReadOutGeometry* G4VSensitiveDetector::ROgeometry
protectedinherited

◆ SensitiveDetectorName

G4String G4VSensitiveDetector::SensitiveDetectorName
protectedinherited

◆ thePathName

G4String G4VSensitiveDetector::thePathName
protectedinherited

◆ verboseLevel

G4int G4VSensitiveDetector::verboseLevel
protectedinherited

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