Geant4  10.03.p01
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
G4MultiSensitiveDetector Class Reference

#include <G4MultiSensitiveDetector.hh>

Inheritance diagram for G4MultiSensitiveDetector:
Collaboration 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)
 
G4int operator== (const G4VSensitiveDetector &right) const
 
G4int operator!= (const G4VSensitiveDetector &right) const
 
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 *aStep, G4TouchableHistory *ROhist)
 
virtual G4int GetCollectionID (G4int i) final
 

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

Definition at line 73 of file G4MultiSensitiveDetector.hh.

using G4MultiSensitiveDetector::sdsConstIter = sds_t::const_iterator

Definition at line 74 of file G4MultiSensitiveDetector.hh.

Constructor & Destructor Documentation

G4MultiSensitiveDetector::G4MultiSensitiveDetector ( G4String  name)

Definition at line 40 of file G4MultiSensitiveDetector.cc.

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

Here is the caller graph for this function:

G4MultiSensitiveDetector::G4MultiSensitiveDetector ( const G4MultiSensitiveDetector rhs)

Definition at line 55 of file G4MultiSensitiveDetector.cc.

56 : G4VSensitiveDetector(rhs) ,
57  fSensitiveDetectors(rhs.fSensitiveDetectors)
58 {
59  VDBG(3,GetName()<<" : Copy constructor called.");
60 }
G4VSensitiveDetector(G4String name)
#define VDBG(vl, msg)

Here is the call graph for this function:

G4MultiSensitiveDetector::~G4MultiSensitiveDetector ( )
virtual

Definition at line 49 of file G4MultiSensitiveDetector.cc.

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

Here is the call graph for this function:

Member Function Documentation

void G4MultiSensitiveDetector::AddSD ( G4VSensitiveDetector sd)
inline

Definition at line 80 of file G4MultiSensitiveDetector.hh.

80 { fSensitiveDetectors.push_back(sd); }

Here is the caller graph for this function:

void G4MultiSensitiveDetector::clear ( )
virtual

Reimplemented from G4VSensitiveDetector.

Definition at line 90 of file G4MultiSensitiveDetector.cc.

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

Definition at line 79 of file G4MultiSensitiveDetector.hh.

79 { fSensitiveDetectors.clear(); }

Here is the caller graph for this function:

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)
#define VDBG(vl, msg)

Here is the call graph for this function:

void G4MultiSensitiveDetector::DrawAll ( )
virtual

Reimplemented from G4VSensitiveDetector.

Definition at line 96 of file G4MultiSensitiveDetector.cc.

97 {
98  for ( auto sd : fSensitiveDetectors ) sd->DrawAll();
99 }
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 }
sdsConstIter G4MultiSensitiveDetector::GetBegin ( ) const
inline

Definition at line 77 of file G4MultiSensitiveDetector.hh.

77 { return fSensitiveDetectors.begin(); }
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 }
std::ostringstream G4ExceptionDescription
Definition: globals.hh:76
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
Definition: G4Exception.cc:41

Here is the call graph for this function:

sdsConstIter G4MultiSensitiveDetector::GetEnd ( ) const
inline

Definition at line 78 of file G4MultiSensitiveDetector.hh.

78 { return fSensitiveDetectors.end(); }
G4VSensitiveDetector* G4MultiSensitiveDetector::GetSD ( const int  i) const
inline

Definition at line 75 of file G4MultiSensitiveDetector.hh.

75 { return fSensitiveDetectors[i]; }
sds_t::size_type G4MultiSensitiveDetector::GetSize ( ) const
inline

Definition at line 76 of file G4MultiSensitiveDetector.hh.

76 { return fSensitiveDetectors.size(); }
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 }
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));
67  G4VSensitiveDetector::operator=(static_cast<const G4VSensitiveDetector&>(rhs));
68  fSensitiveDetectors = rhs.fSensitiveDetectors;
69  }
70  return *this;
71 }
G4VSensitiveDetector & operator=(const G4VSensitiveDetector &right)

Here is the call graph for this function:

void G4MultiSensitiveDetector::PrintAll ( )
virtual

Reimplemented from G4VSensitiveDetector.

Definition at line 102 of file G4MultiSensitiveDetector.cc.

103 {
104  for ( auto sd : fSensitiveDetectors ) sd->PrintAll();
105 }
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 }
G4double G4ParticleHPJENDLHEData::G4double result
bool G4bool
Definition: G4Types.hh:79
G4double GetTotalEnergyDeposit() const
#define VDBG(vl, msg)

Here is the call graph for this function:


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