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

#include <G4MultiSensitiveDetector.hh>

+ Inheritance diagram for G4MultiSensitiveDetector:

Public Types

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

Public Member Functions

 G4MultiSensitiveDetector (G4String name)
 
 G4MultiSensitiveDetector (const G4MultiSensitiveDetector &rhs)
 
virtual ~G4MultiSensitiveDetector ()
 
G4MultiSensitiveDetectoroperator= (const G4MultiSensitiveDetector &rhs)
 
virtual void Initialize (G4HCofThisEvent *)
 
virtual void EndOfEvent (G4HCofThisEvent *)
 
virtual void clear ()
 
virtual void DrawAll ()
 
virtual void PrintAll ()
 
virtual G4VSensitiveDetectorClone () const
 
G4VSensitiveDetectorGetSD (const int i) const
 
sds_t::size_type GetSize () const
 
sdsConstIter GetBegin () const
 
sdsConstIter GetEnd () const
 
void ClearSDs ()
 
void AddSD (G4VSensitiveDetector *sd)
 
- 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 *aStep, G4TouchableHistory *ROhist)
 
virtual G4int GetCollectionID (G4int i) final
 
virtual G4bool ProcessHits (G4Step *aStep, G4TouchableHistory *ROhist)=0
 
virtual G4int GetCollectionID (G4int i)
 

Additional Inherited Members

- Protected Attributes inherited from G4VSensitiveDetector
G4CollectionNameVector collectionName
 
G4String SensitiveDetectorName
 
G4String thePathName
 
G4String fullPathName
 
G4int verboseLevel
 
G4bool active
 
G4VReadOutGeometryROgeometry
 
G4VSDFilterfilter
 

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)

◆ G4MultiSensitiveDetector() [2/2]

G4MultiSensitiveDetector::G4MultiSensitiveDetector ( const G4MultiSensitiveDetector rhs)

Definition at line 57 of file G4MultiSensitiveDetector.cc.

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

◆ ~G4MultiSensitiveDetector()

G4MultiSensitiveDetector::~G4MultiSensitiveDetector ( )
virtual

Definition at line 51 of file G4MultiSensitiveDetector.cc.

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

Member Function Documentation

◆ AddSD()

void G4MultiSensitiveDetector::AddSD ( G4VSensitiveDetector sd)
inline

Definition at line 87 of file G4MultiSensitiveDetector.hh.

87{ fSensitiveDetectors.push_back(sd); }

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}

◆ ClearSDs()

void G4MultiSensitiveDetector::ClearSDs ( )
inline

Definition at line 86 of file G4MultiSensitiveDetector.hh.

86{ fSensitiveDetectors.clear(); }

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)

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

◆ 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(); }

◆ 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:59
std::ostringstream G4ExceptionDescription
Definition: G4Exception.hh:40

◆ GetEnd()

sdsConstIter G4MultiSensitiveDetector::GetEnd ( ) const
inline

Definition at line 85 of file G4MultiSensitiveDetector.hh.

85{ return fSensitiveDetectors.end(); }

◆ GetSD()

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

Definition at line 79 of file G4MultiSensitiveDetector.hh.

80 {
81 return fSensitiveDetectors[i];
82 }

◆ GetSize()

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

Definition at line 83 of file G4MultiSensitiveDetector.hh.

83{ return fSensitiveDetectors.size(); }

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

◆ 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));
74 fSensitiveDetectors = rhs.fSensitiveDetectors;
75 }
76 return *this;
77}
G4VSensitiveDetector & operator=(const G4VSensitiveDetector &right)

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

◆ 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

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