Geant4 9.6.0
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 ()
 
const G4VSensitiveDetectoroperator= (const G4VSensitiveDetector &right)
 
G4int operator== (const G4VSensitiveDetector &right) const
 
G4int 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
 

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 48 of file G4MultiFunctionalDetector.hh.

Constructor & Destructor Documentation

◆ G4MultiFunctionalDetector()

G4MultiFunctionalDetector::G4MultiFunctionalDetector ( G4String  name)

◆ ~G4MultiFunctionalDetector()

G4MultiFunctionalDetector::~G4MultiFunctionalDetector ( )
virtual

Definition at line 42 of file G4MultiFunctionalDetector.cc.

43{;}

Member Function Documentation

◆ clear()

void G4MultiFunctionalDetector::clear ( )
virtual

Reimplemented from G4VSensitiveDetector.

Definition at line 117 of file G4MultiFunctionalDetector.cc.

118{
119 G4int nPrim = primitives.size();
120 for(G4int iPrim=0;iPrim<nPrim;iPrim++)
121 { primitives[iPrim]->clear(); }
122}
int G4int
Definition: G4Types.hh:66
std::vector< G4VPrimitiveScorer * > primitives

◆ DrawAll()

void G4MultiFunctionalDetector::DrawAll ( )
virtual

Reimplemented from G4VSensitiveDetector.

Definition at line 124 of file G4MultiFunctionalDetector.cc.

125{
126 G4int nPrim = primitives.size();
127 for(G4int iPrim=0;iPrim<nPrim;iPrim++)
128 { primitives[iPrim]->DrawAll(); }
129}

◆ EndOfEvent()

void G4MultiFunctionalDetector::EndOfEvent ( G4HCofThisEvent HC)
virtual

Reimplemented from G4VSensitiveDetector.

Definition at line 110 of file G4MultiFunctionalDetector.cc.

111{
112 G4int nPrim = primitives.size();
113 for(G4int iPrim=0;iPrim<nPrim;iPrim++)
114 { primitives[iPrim]->EndOfEvent(HC); }
115}

◆ GetNumberOfPrimitives()

G4int G4MultiFunctionalDetector::GetNumberOfPrimitives ( ) const
inline

Definition at line 62 of file G4MultiFunctionalDetector.hh.

63 { return primitives.size(); }

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

◆ GetPrimitive()

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

Definition at line 64 of file G4MultiFunctionalDetector.hh.

65 { return primitives[id]; }

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

◆ Initialize()

void G4MultiFunctionalDetector::Initialize ( G4HCofThisEvent HC)
virtual

Reimplemented from G4VSensitiveDetector.

Definition at line 103 of file G4MultiFunctionalDetector.cc.

104{
105 G4int nPrim = primitives.size();
106 for(G4int iPrim=0;iPrim<nPrim;iPrim++)
107 { primitives[iPrim]->Initialize(HC); }
108}

◆ PrintAll()

void G4MultiFunctionalDetector::PrintAll ( )
virtual

Reimplemented from G4VSensitiveDetector.

Definition at line 131 of file G4MultiFunctionalDetector.cc.

132{
133 G4int nPrim = primitives.size();
134 for(G4int iPrim=0;iPrim<nPrim;iPrim++)
135 { primitives[iPrim]->PrintAll(); }
136}

◆ ProcessHits()

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

Implements G4VSensitiveDetector.

Definition at line 45 of file G4MultiFunctionalDetector.cc.

46{
47 if(aStep->GetStepLength()>0. || aStep->GetTotalEnergyDeposit()>0.){
48 G4int nPrim = primitives.size();
49 for(G4int iPrim=0;iPrim<nPrim;iPrim++)
50 {
51 primitives[iPrim]->HitPrimitive(aStep,aTH);
52 }
53 }
54 return true;
55}
G4double GetStepLength() const
G4double GetTotalEnergyDeposit() const

◆ RegisterPrimitive()

G4bool G4MultiFunctionalDetector::RegisterPrimitive ( G4VPrimitiveScorer aPS)

Definition at line 57 of file G4MultiFunctionalDetector.cc.

58{
59 G4int nPrim = primitives.size();
60 for(G4int iPrim=0;iPrim<nPrim;iPrim++)
61 {
62 if(primitives[iPrim]==aPS)
63 {
65 ED << "Primitive <" << aPS->GetName() << "> is already defined in <" << SensitiveDetectorName
66 << ">." << G4endl << "Method RegisterPrimitive() is ignored." << G4endl;
67 G4Exception("G4MultiFunctionalDetector::RegisterPrimitive","Det0101",
68 JustWarning,ED);
69 return false;
70 }
71 }
72 primitives.push_back(aPS);
75 if(G4SDManager::GetSDMpointer()->FindSensitiveDetector(SensitiveDetectorName,false))
76 {
77 // This G4MultiFunctionalDetector has already been registered to G4SDManager.
78 // Make sure this new primitive is registered as well.
80 }
81 return true;
82}
@ JustWarning
#define G4endl
Definition: G4ios.hh:52
static G4SDManager * GetSDMpointer()
Definition: G4SDManager.cc:40
void AddNewCollection(G4String SDname, G4String DCname)
Definition: G4SDManager.cc:88
void SetMultiFunctionalDetector(G4MultiFunctionalDetector *d)
G4String GetName() const
G4CollectionNameVector collectionName
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
Definition: G4Exception.cc:41
std::ostringstream G4ExceptionDescription
Definition: globals.hh:76

Referenced by G4VScoringMesh::SetPrimitiveScorer().

◆ RemovePrimitive()

G4bool G4MultiFunctionalDetector::RemovePrimitive ( G4VPrimitiveScorer aPS)

Definition at line 84 of file G4MultiFunctionalDetector.cc.

85{
86 std::vector<G4VPrimitiveScorer*>::iterator iterPS;
87 std::vector<G4String>::iterator iterName = collectionName.begin();
88 for(iterPS=primitives.begin();iterPS!=primitives.end();iterPS++)
89 {
90 if(*iterPS==aPS)
91 {
92 primitives.erase(iterPS);
94 return true;
95 }
96 iterName++;
97 }
98 G4cerr << "Primitive <" << aPS->GetName() << "> is not defined in <" << SensitiveDetectorName
99 << ">." << G4endl << "Method RemovePrimitive() is ignored." << G4endl;
100 return false;
101}
G4DLLIMPORT std::ostream G4cerr

Member Data Documentation

◆ primitives

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

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