Geant4-11
Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | Private Attributes
G4MultiSensitiveDetector Class Reference

#include <G4MultiSensitiveDetector.hh>

Inheritance diagram for G4MultiSensitiveDetector:
G4VSensitiveDetector

Public Types

using sds_t = std::vector< G4VSensitiveDetector * >
 
using sdsConstIter = sds_t::const_iterator
 

Public Member Functions

void Activate (G4bool activeFlag)
 
void AddSD (G4VSensitiveDetector *sd)
 
virtual void clear ()
 
void ClearSDs ()
 
virtual G4VSensitiveDetectorClone () const
 
virtual void DrawAll ()
 
virtual void EndOfEvent (G4HCofThisEvent *)
 
 G4MultiSensitiveDetector (const G4MultiSensitiveDetector &rhs)
 
 G4MultiSensitiveDetector (G4String name)
 
sdsConstIter GetBegin () const
 
G4String GetCollectionName (G4int id) const
 
sdsConstIter GetEnd () const
 
G4VSDFilterGetFilter () const
 
G4String GetFullPathName () const
 
G4String GetName () const
 
G4int GetNumberOfCollections () const
 
G4String GetPathName () const
 
G4VReadOutGeometryGetROgeometry () const
 
G4VSensitiveDetectorGetSD (const int i) const
 
sds_t::size_type GetSize () const
 
G4bool Hit (G4Step *aStep)
 
virtual void Initialize (G4HCofThisEvent *)
 
G4bool isActive () const
 
G4bool operator!= (const G4VSensitiveDetector &right) const
 
G4MultiSensitiveDetectoroperator= (const G4MultiSensitiveDetector &rhs)
 
G4bool operator== (const G4VSensitiveDetector &right) const
 
virtual void PrintAll ()
 
void SetFilter (G4VSDFilter *value)
 
void SetROgeometry (G4VReadOutGeometry *value)
 
void SetVerboseLevel (G4int vl)
 
virtual ~G4MultiSensitiveDetector ()
 

Protected Member Functions

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

Protected Attributes

G4bool active
 
G4CollectionNameVector collectionName
 
G4VSDFilterfilter
 
G4String fullPathName
 
G4VReadOutGeometryROgeometry
 
G4String SensitiveDetectorName
 
G4String thePathName
 
G4int verboseLevel
 

Private Attributes

sds_t fSensitiveDetectors
 

Detailed Description

Definition at line 40 of file G4MultiSensitiveDetector.hh.

Member Typedef Documentation

◆ sds_t

Definition at line 77 of file G4MultiSensitiveDetector.hh.

◆ sdsConstIter

using G4MultiSensitiveDetector::sdsConstIter = sds_t::const_iterator

Definition at line 78 of file G4MultiSensitiveDetector.hh.

Constructor & Destructor Documentation

◆ G4MultiSensitiveDetector() [1/2]

G4MultiSensitiveDetector::G4MultiSensitiveDetector ( G4String  name)

Definition at line 42 of file G4MultiSensitiveDetector.cc.

44{
45#ifdef MSDDEBUG
46 verboseLevel = 3;
47#endif
48 VDBG(1, "Creating G4MultiSenstiveDetector with name: " << name);
49}
#define VDBG(vl, msg)
G4VSensitiveDetector(G4String name)
const char * name(G4int ptype)

References G4InuclParticleNames::name(), VDBG, and G4VSensitiveDetector::verboseLevel.

Referenced by Clone().

◆ G4MultiSensitiveDetector() [2/2]

G4MultiSensitiveDetector::G4MultiSensitiveDetector ( const G4MultiSensitiveDetector rhs)

Definition at line 57 of file G4MultiSensitiveDetector.cc.

61{
62 VDBG(3, GetName() << " : Copy constructor called.");
63}

References G4VSensitiveDetector::GetName(), and VDBG.

◆ ~G4MultiSensitiveDetector()

G4MultiSensitiveDetector::~G4MultiSensitiveDetector ( )
virtual

Definition at line 51 of file G4MultiSensitiveDetector.cc.

52{
53 VDBG(2, GetName() << " : Destructing G4MultiSensitiveDetector");
54 ClearSDs();
55}

References ClearSDs(), G4VSensitiveDetector::GetName(), and VDBG.

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().

◆ AddSD()

void G4MultiSensitiveDetector::AddSD ( G4VSensitiveDetector sd)
inline

Definition at line 87 of file G4MultiSensitiveDetector.hh.

87{ fSensitiveDetectors.push_back(sd); }

References fSensitiveDetectors.

Referenced by Clone(), and G4VUserDetectorConstruction::SetSensitiveDetector().

◆ clear()

void G4MultiSensitiveDetector::clear ( )
virtual

Reimplemented from G4VSensitiveDetector.

Definition at line 93 of file G4MultiSensitiveDetector.cc.

94{
95 for(auto sd : fSensitiveDetectors)
96 sd->clear();
97}

References fSensitiveDetectors.

◆ ClearSDs()

void G4MultiSensitiveDetector::ClearSDs ( )
inline

Definition at line 86 of file G4MultiSensitiveDetector.hh.

86{ fSensitiveDetectors.clear(); }

References fSensitiveDetectors.

Referenced by ~G4MultiSensitiveDetector().

◆ Clone()

G4VSensitiveDetector * G4MultiSensitiveDetector::Clone ( ) const
virtual

Reimplemented from G4VSensitiveDetector.

Definition at line 136 of file G4MultiSensitiveDetector.cc.

137{
138 VDBG(2, GetName() << "Cloning an instance of G4MultiSensitiveDetector");
139 G4MultiSensitiveDetector* newInst =
141 for(auto sd : fSensitiveDetectors)
142 newInst->AddSD(sd->Clone());
143 return newInst;
144}
void AddSD(G4VSensitiveDetector *sd)

References AddSD(), fSensitiveDetectors, G4MultiSensitiveDetector(), G4VSensitiveDetector::GetName(), and VDBG.

◆ DrawAll()

void G4MultiSensitiveDetector::DrawAll ( )
virtual

Reimplemented from G4VSensitiveDetector.

Definition at line 99 of file G4MultiSensitiveDetector.cc.

100{
101 for(auto sd : fSensitiveDetectors)
102 sd->DrawAll();
103}

References fSensitiveDetectors.

◆ EndOfEvent()

void G4MultiSensitiveDetector::EndOfEvent ( G4HCofThisEvent )
virtual

Reimplemented from G4VSensitiveDetector.

Definition at line 86 of file G4MultiSensitiveDetector.cc.

87{
88 // SDManager is resposnsible for calling this since the granular SDs
89 // are also registered
90 // for ( auto sd : fSensitiveDetectors ) sd->EndOfEvent(hcte);
91}

◆ GetBegin()

sdsConstIter G4MultiSensitiveDetector::GetBegin ( ) const
inline

Definition at line 84 of file G4MultiSensitiveDetector.hh.

84{ return fSensitiveDetectors.begin(); }

References fSensitiveDetectors.

◆ GetCollectionID()

G4int G4MultiSensitiveDetector::GetCollectionID ( G4int  i)
finalprotectedvirtual

Reimplemented from G4VSensitiveDetector.

Definition at line 121 of file G4MultiSensitiveDetector.cc.

122{
124 msg << GetName()
125 << " : This method cannot be called for an instance of type "
126 "G4MultiSensitiveDetector."
127 << " First retrieve a contained G4VSensitiveDetector with. i.e. GetSD "
128 "and then "
129 << " call this method.";
130 G4Exception("G4MultiSensitiveDetector::GetCollectionID", "Det0011",
131 FatalException, msg);
132 return -1;
133}
@ 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, G4Exception(), and G4VSensitiveDetector::GetName().

◆ GetCollectionName()

G4String G4VSensitiveDetector::GetCollectionName ( G4int  id) const
inlineinherited

◆ GetEnd()

sdsConstIter G4MultiSensitiveDetector::GetEnd ( ) const
inline

Definition at line 85 of file G4MultiSensitiveDetector.hh.

85{ return fSensitiveDetectors.end(); }

References fSensitiveDetectors.

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

References G4VSensitiveDetector::SensitiveDetectorName.

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

◆ GetPathName()

G4String G4VSensitiveDetector::GetPathName ( ) const
inlineinherited

◆ GetROgeometry()

G4VReadOutGeometry * G4VSensitiveDetector::GetROgeometry ( ) const
inlineinherited

◆ GetSD()

G4VSensitiveDetector * G4MultiSensitiveDetector::GetSD ( const int  i) const
inline

Definition at line 79 of file G4MultiSensitiveDetector.hh.

80 {
81 return fSensitiveDetectors[i];
82 }

References fSensitiveDetectors.

◆ GetSize()

sds_t::size_type G4MultiSensitiveDetector::GetSize ( ) const
inline

Definition at line 83 of file G4MultiSensitiveDetector.hh.

83{ return fSensitiveDetectors.size(); }

References fSensitiveDetectors.

◆ Hit()

G4bool G4VSensitiveDetector::Hit ( G4Step aStep)
inlineinherited

◆ Initialize()

void G4MultiSensitiveDetector::Initialize ( G4HCofThisEvent )
virtual

Reimplemented from G4VSensitiveDetector.

Definition at line 79 of file G4MultiSensitiveDetector.cc.

80{
81 // SDManager is resposnsible for calling this since the granular SDs
82 // are also registered
83 // for ( auto sd : fSensitiveDetectors ) sd->Initialize(hcte);
84}

◆ 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=()

G4MultiSensitiveDetector & G4MultiSensitiveDetector::operator= ( const G4MultiSensitiveDetector rhs)

Definition at line 65 of file G4MultiSensitiveDetector.cc.

67{
68 if(this != &rhs)
69 {
70 // G4VSensitiveDetector::operator=(static_cast<const
71 // G4VSensitiveDetector&>(rhs));
73 static_cast<const G4VSensitiveDetector&>(rhs));
75 }
76 return *this;
77}
G4VSensitiveDetector & operator=(const G4VSensitiveDetector &right)

References fSensitiveDetectors, and G4VSensitiveDetector::operator=().

◆ 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 G4MultiSensitiveDetector::PrintAll ( )
virtual

Reimplemented from G4VSensitiveDetector.

Definition at line 105 of file G4MultiSensitiveDetector.cc.

106{
107 for(auto sd : fSensitiveDetectors)
108 sd->PrintAll();
109}

References fSensitiveDetectors.

◆ ProcessHits()

G4bool G4MultiSensitiveDetector::ProcessHits ( G4Step aStep,
G4TouchableHistory ROhist 
)
protectedvirtual

Implements G4VSensitiveDetector.

Definition at line 111 of file G4MultiSensitiveDetector.cc.

112{
113 VDBG(2, GetName() << " : Called processHits: " << aStep
114 << " with Edep: " << aStep->GetTotalEnergyDeposit());
115 G4bool result = true;
116 for(auto sd : fSensitiveDetectors)
117 result &= sd->Hit(aStep);
118 return result;
119}
bool G4bool
Definition: G4Types.hh:86
G4double GetTotalEnergyDeposit() const

References fSensitiveDetectors, G4VSensitiveDetector::GetName(), G4Step::GetTotalEnergyDeposit(), and VDBG.

◆ 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

Definition at line 147 of file G4VSensitiveDetector.hh.

147{ verboseLevel = vl; }

References G4VSensitiveDetector::verboseLevel.

Referenced by export_G4VSensitiveDetector().

Field Documentation

◆ active

G4bool G4VSensitiveDetector::active
protectedinherited

◆ collectionName

G4CollectionNameVector G4VSensitiveDetector::collectionName
protectedinherited

◆ filter

G4VSDFilter* G4VSensitiveDetector::filter
protectedinherited

◆ fSensitiveDetectors

sds_t G4MultiSensitiveDetector::fSensitiveDetectors
private

◆ fullPathName

G4String G4VSensitiveDetector::fullPathName
protectedinherited

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