GGS(GenericGEANT4Simulation)Software
2.7.0
|
A multiple sensitive detector. More...
#include <GGSMultiSensitiveDetector.h>
Public Member Functions | |
GGSMultiSensitiveDetector (G4String name) | |
Constructor. | |
~GGSMultiSensitiveDetector () | |
Destructor. | |
void | AddSensitiveDetector (G4VSensitiveDetector *sd) |
Adds a new sensitive detector to the multidetector. More... | |
G4VSensitiveDetector * | GetSensitiveDetector (const G4String &sdName) |
Retrieves a detector. More... | |
const std::vector < G4VSensitiveDetector * > & | GetListOfSensitiveDetectors () |
Retrieves a list of sensitive detectors collected into this object. More... | |
G4bool | ProcessHits (G4Step *, G4TouchableHistory *) |
Empty method. More... | |
void | clear () |
Calls clear for all the detectors in the multidetector. | |
void | Activate (G4bool activeFlag) |
Enables or disables the multidetector. More... | |
void | SetROgeometry (G4VReadOutGeometry *value) |
Calls SetROgeometry for all the detectors in the multidetector. | |
void | SetFilter (G4VSDFilter *value) |
Calls SetFilter for all the detectors in the multidetector. | |
A multiple sensitive detector.
This class groups many sensitive detectors so that assigning it to a logical volume is equivalent to assign multiple sensitive detectors. This class inherits from G4VSensitiveDetector; it is mandatory to register it to the G4SDManager singleton by calling G4SDManager::AddNewDetector and to assign it to the logical volume. Also the sd it contains must be registered into the G4SDManager. A typical code pattern:
GGSMultiSensitiveDetector *multiSD = new GGSMultiSensitiveDetector(name); // Create the multi SD G4SDManager::GetSDMpointer()->AddNewDetector(multiSD); // Register it logVol->SetSensitiveDetector(multiSD); // Assign to logical volume
MySD1 *sd1 = new MySD1(sd1Name); // Create sd1 G4SDManager::GetSDMpointer()->AddNewDetector(sd1); // Register it multiSD->AddSensitiveDetector(sd1); // Assign to multiSD
MySD2 *sd2 = new MySD2(sd2Name); // Create sd2 G4SDManager::GetSDMpointer()->AddNewDetector(sd2); // Register it multiSD->AddSensitiveDetector(sd2); // Assign to multiSD
Definition at line 39 of file GGSMultiSensitiveDetector.h.
void GGSMultiSensitiveDetector::Activate | ( | G4bool | activeFlag | ) |
Enables or disables the multidetector.
It will call Activate(activeFlag) for all the detectors.
activeFlag | Flag for activation/deactivation |
void GGSMultiSensitiveDetector::AddSensitiveDetector | ( | G4VSensitiveDetector * | sd | ) |
Adds a new sensitive detector to the multidetector.
sd | The detector to add. |
Definition at line 22 of file GGSMultiSensitiveDetector.cpp.
|
inline |
Retrieves a list of sensitive detectors collected into this object.
Definition at line 64 of file GGSMultiSensitiveDetector.h.
G4VSensitiveDetector * GGSMultiSensitiveDetector::GetSensitiveDetector | ( | const G4String & | sdName | ) |
Retrieves a detector.
sdName | The name of the desired detector. |
Definition at line 26 of file GGSMultiSensitiveDetector.cpp.
G4bool GGSMultiSensitiveDetector::ProcessHits | ( | G4Step * | aStep, |
G4TouchableHistory * | |||
) |
Empty method.
This method is called by the non-virtual Hits method. It simply dispatches the Hits call to the single sensitive detectors.
Definition at line 36 of file GGSMultiSensitiveDetector.cpp.