Public Member Functions | Private Attributes | List of all members
EDepSim::SDFactory Class Reference

#include <EDepSimSDFactory.hh>

Public Member Functions

 SDFactory (G4String type)
 Build a factory to build sensitive detectors specified by "type". More...
 
virtual ~SDFactory ()
 
G4VSensitiveDetector * GetSD (G4String name)
 
G4VSensitiveDetector * MakeSD (G4String name)
 

Private Attributes

G4String fType
 The type of sensitive detector that this will build. More...
 

Detailed Description

Definition at line 15 of file EDepSimSDFactory.hh.

Constructor & Destructor Documentation

EDepSim::SDFactory::SDFactory ( G4String  type)

Build a factory to build sensitive detectors specified by "type".

Definition at line 7 of file EDepSimSDFactory.cc.

8  : fType(type) {}
G4String fType
The type of sensitive detector that this will build.
EDepSim::SDFactory::~SDFactory ( )
virtual

Definition at line 11 of file EDepSimSDFactory.cc.

11 {}

Member Function Documentation

G4VSensitiveDetector * EDepSim::SDFactory::GetSD ( G4String  name)

Get pointer to a sensitive detector built by this factory, but return null if the detector doesn't exist.

Definition at line 13 of file EDepSimSDFactory.cc.

13  {
14  return G4SDManager::GetSDMpointer()->FindSensitiveDetector(name);
15 }
static QCString name
Definition: declinfo.cpp:673
G4VSensitiveDetector * EDepSim::SDFactory::MakeSD ( G4String  name)

Get pointer to a sensitive detector built by this factory, and create a new sensitive detector if required.

Definition at line 17 of file EDepSimSDFactory.cc.

17  {
18  G4VSensitiveDetector* sd = GetSD(name);
19  if (!sd) {
20  if (fType == "segment") {
21  sd = new EDepSim::SegmentSD(name);
22  }
23  else {
24  EDepSimError("No such sensitive detector " << name);
25  EDepSimThrow("sensitive detector type not implemented");
26  }
27  G4SDManager::GetSDMpointer()->AddNewDetector(sd);
28  }
29  return sd;
30 }
static QCString name
Definition: declinfo.cpp:673
G4VSensitiveDetector * GetSD(G4String name)
#define EDepSimThrow(message)
Print an error message, and then throw an exception.
G4String fType
The type of sensitive detector that this will build.
#define EDepSimError(outStream)
Definition: EDepSimLog.hh:503

Member Data Documentation

G4String EDepSim::SDFactory::fType
private

The type of sensitive detector that this will build.

Definition at line 31 of file EDepSimSDFactory.hh.


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