Geant4 10.7.0
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 73 of file G4MultiSensitiveDetector.hh.

◆ sdsConstIter

using G4MultiSensitiveDetector::sdsConstIter = sds_t::const_iterator

Definition at line 74 of file G4MultiSensitiveDetector.hh.

Constructor & Destructor Documentation

◆ G4MultiSensitiveDetector() [1/2]

G4MultiSensitiveDetector::G4MultiSensitiveDetector ( G4String  name)

Definition at line 40 of file G4MultiSensitiveDetector.cc.

42{
43#ifdef MSDDEBUG
44 verboseLevel = 3;
45#endif
46 VDBG(1,"Creating G4MultiSenstiveDetector with name: "<<name);
47}
#define VDBG(vl, msg)

◆ G4MultiSensitiveDetector() [2/2]

G4MultiSensitiveDetector::G4MultiSensitiveDetector ( const G4MultiSensitiveDetector rhs)

Definition at line 55 of file G4MultiSensitiveDetector.cc.

57 fSensitiveDetectors(rhs.fSensitiveDetectors)
58{
59 VDBG(3,GetName()<<" : Copy constructor called.");
60}

◆ ~G4MultiSensitiveDetector()

G4MultiSensitiveDetector::~G4MultiSensitiveDetector ( )
virtual

Definition at line 49 of file G4MultiSensitiveDetector.cc.

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

Member Function Documentation

◆ AddSD()

void G4MultiSensitiveDetector::AddSD ( G4VSensitiveDetector sd)
inline

Definition at line 80 of file G4MultiSensitiveDetector.hh.

80{ fSensitiveDetectors.push_back(sd); }

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

◆ clear()

void G4MultiSensitiveDetector::clear ( )
virtual

Reimplemented from G4VSensitiveDetector.

Definition at line 90 of file G4MultiSensitiveDetector.cc.

91{
92 for ( auto sd : fSensitiveDetectors ) sd->clear();
93}

◆ ClearSDs()

void G4MultiSensitiveDetector::ClearSDs ( )
inline

Definition at line 79 of file G4MultiSensitiveDetector.hh.

79{ fSensitiveDetectors.clear(); }

Referenced by ~G4MultiSensitiveDetector().

◆ Clone()

G4VSensitiveDetector * G4MultiSensitiveDetector::Clone ( ) const
virtual

Reimplemented from G4VSensitiveDetector.

Definition at line 128 of file G4MultiSensitiveDetector.cc.

129{
130 VDBG(2,GetName()<<"Cloning an instance of G4MultiSensitiveDetector");
132 for ( auto sd : fSensitiveDetectors )
133 newInst->AddSD( sd->Clone() );
134 return newInst;
135}
void AddSD(G4VSensitiveDetector *sd)

◆ DrawAll()

void G4MultiSensitiveDetector::DrawAll ( )
virtual

Reimplemented from G4VSensitiveDetector.

Definition at line 96 of file G4MultiSensitiveDetector.cc.

97{
98 for ( auto sd : fSensitiveDetectors ) sd->DrawAll();
99}

◆ EndOfEvent()

void G4MultiSensitiveDetector::EndOfEvent ( G4HCofThisEvent )
virtual

Reimplemented from G4VSensitiveDetector.

Definition at line 82 of file G4MultiSensitiveDetector.cc.

83{
84 //SDManager is resposnsible for calling this since the granular SDs
85// are also registered
86 //for ( auto sd : fSensitiveDetectors ) sd->EndOfEvent(hcte);
87}

◆ GetBegin()

sdsConstIter G4MultiSensitiveDetector::GetBegin ( ) const
inline

Definition at line 77 of file G4MultiSensitiveDetector.hh.

77{ return fSensitiveDetectors.begin(); }

◆ GetCollectionID()

G4int G4MultiSensitiveDetector::GetCollectionID ( G4int  i)
finalprotectedvirtual

Reimplemented from G4VSensitiveDetector.

Definition at line 117 of file G4MultiSensitiveDetector.cc.

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

◆ GetEnd()

sdsConstIter G4MultiSensitiveDetector::GetEnd ( ) const
inline

Definition at line 78 of file G4MultiSensitiveDetector.hh.

78{ return fSensitiveDetectors.end(); }

◆ GetSD()

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

Definition at line 75 of file G4MultiSensitiveDetector.hh.

75{ return fSensitiveDetectors[i]; }

◆ GetSize()

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

Definition at line 76 of file G4MultiSensitiveDetector.hh.

76{ return fSensitiveDetectors.size(); }

◆ Initialize()

void G4MultiSensitiveDetector::Initialize ( G4HCofThisEvent )
virtual

Reimplemented from G4VSensitiveDetector.

Definition at line 74 of file G4MultiSensitiveDetector.cc.

75{
76 //SDManager is resposnsible for calling this since the granular SDs
77 // are also registered
78 //for ( auto sd : fSensitiveDetectors ) sd->Initialize(hcte);
79}

◆ operator=()

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

Definition at line 63 of file G4MultiSensitiveDetector.cc.

64{
65 if ( this != &rhs ) {
66 //G4VSensitiveDetector::operator=(static_cast<const G4VSensitiveDetector&>(rhs));
68 fSensitiveDetectors = rhs.fSensitiveDetectors;
69 }
70 return *this;
71}
G4VSensitiveDetector & operator=(const G4VSensitiveDetector &right)

◆ PrintAll()

void G4MultiSensitiveDetector::PrintAll ( )
virtual

Reimplemented from G4VSensitiveDetector.

Definition at line 102 of file G4MultiSensitiveDetector.cc.

103{
104 for ( auto sd : fSensitiveDetectors ) sd->PrintAll();
105}

◆ ProcessHits()

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

Implements G4VSensitiveDetector.

Definition at line 108 of file G4MultiSensitiveDetector.cc.

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

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