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

#include <G4MultiFunctionalDetector.hh>

+ Inheritance diagram for G4MultiFunctionalDetector:

Public Member Functions

 G4MultiFunctionalDetector (G4String)
 
G4bool RegisterPrimitive (G4VPrimitiveScorer *)
 
G4bool RemovePrimitive (G4VPrimitiveScorer *)
 
G4int GetNumberOfPrimitives () const
 
G4VPrimitiveScorerGetPrimitive (G4int id) const
 
virtual ~G4MultiFunctionalDetector ()
 
virtual void Initialize (G4HCofThisEvent *)
 
virtual void EndOfEvent (G4HCofThisEvent *)
 
virtual void clear ()
 
virtual void DrawAll ()
 
virtual void PrintAll ()
 
- Public Member Functions inherited from G4VSensitiveDetector
 G4VSensitiveDetector (G4String name)
 
 G4VSensitiveDetector (const G4VSensitiveDetector &right)
 
virtual ~G4VSensitiveDetector ()
 
G4VSensitiveDetectoroperator= (const G4VSensitiveDetector &right)
 
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 *, G4TouchableHistory *)
 
- Protected Member Functions inherited from G4VSensitiveDetector
virtual G4bool ProcessHits (G4Step *aStep, G4TouchableHistory *ROhist)=0
 
virtual G4int GetCollectionID (G4int i)
 

Protected Attributes

std::vector< G4VPrimitiveScorer * > primitives
 
- Protected Attributes inherited from G4VSensitiveDetector
G4CollectionNameVector collectionName
 
G4String SensitiveDetectorName
 
G4String thePathName
 
G4String fullPathName
 
G4int verboseLevel
 
G4bool active
 
G4VReadOutGeometryROgeometry
 
G4VSDFilterfilter
 

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.

◆ ~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

Member Function Documentation

◆ 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}

◆ 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}

◆ 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}

◆ GetNumberOfPrimitives()

G4int G4MultiFunctionalDetector::GetNumberOfPrimitives ( ) const
inline

Definition at line 60 of file G4MultiFunctionalDetector.hh.

61 {
62 return G4int(primitives.size());
63 }
int G4int
Definition: G4Types.hh:85

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

◆ GetPrimitive()

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

Definition at line 64 of file G4MultiFunctionalDetector.hh.

64{ return primitives[id]; }

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

◆ 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}

◆ 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}

◆ 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

◆ 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
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
Definition: G4Exception.cc:59
std::ostringstream G4ExceptionDescription
Definition: G4Exception.hh:40
#define G4endl
Definition: G4ios.hh:57
static G4SDManager * GetSDMpointer()
Definition: G4SDManager.cc:38
void AddNewCollection(G4String SDname, G4String DCname)
Definition: G4SDManager.cc:94
void SetMultiFunctionalDetector(G4MultiFunctionalDetector *d)
G4String GetName() const
G4CollectionNameVector collectionName

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

Member Data Documentation

◆ primitives


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