Sensitive Detector implementation of the CLAWS detector.
More...
#include <SensitiveDetector.h>
|
bool | step (G4Step *step, G4TouchableHistory *) override |
| Step processing method. More...
|
|
Sensitive Detector implementation of the CLAWS detector.
Definition at line 39 of file SensitiveDetector.h.
◆ ProcessHits()
bool ProcessHits |
( |
G4Step * |
aStep, |
|
|
G4TouchableHistory * |
aROhist |
|
) |
| |
|
inlineprivatevirtualinherited |
Check if recording hits is enabled and if so call step() and set the correct MCParticle flag.
Called by Geant4 for each step inside the sensitive volumes attached
Definition at line 98 of file SensitiveDetectorBase.h.
◆ registerMCParticleRelation() [1/2]
◆ registerMCParticleRelation() [2/2]
Register an relation involving MCParticles.
All Relations which point from an MCParticle to something have to be registered with addMCParticleRelation() because the index of the MCParticles might change at the end of the event. During simulation, the TrackID should be used as index of the MCParticle
- Parameters
-
name | Name of the relation to register |
ignoreAction | |
Definition at line 24 of file SensitiveDetectorBase.cc.
◆ setActive()
static void setActive |
( |
bool |
activeStatus | ) |
|
|
inlinestaticinherited |
Enable/Disable all Sensitive Detectors.
By default, all sensitive detectors won't create hits to make it possible to use the Geant4 Navigator for non-simulation purposes. Only during simulation the sensitive detectors will be enabled to record hits
- Parameters
-
activeStatus | bool to indicate wether hits should be recorded |
Definition at line 54 of file SensitiveDetectorBase.h.
◆ step()
bool step |
( |
G4Step * |
step, |
|
|
G4TouchableHistory * |
|
|
) |
| |
|
overrideprotectedvirtual |
Step processing method.
- Parameters
-
step | the G4Step with the current step information |
- Returns
- true if a Hit has been created, false if the hit was ignored
Implements SensitiveDetectorBase.
Definition at line 62 of file SensitiveDetector.cc.
87 SensorTraversal& traversal =
m_tracks.top();
90 if (traversal.getTrackID() == 0) {
93 const G4ThreeVector preStepPos = preStep.GetPosition() / CLHEP::mm *
Unit::mm;
94 const G4ThreeVector preStepMom = preStep.GetMomentum() / CLHEP::MeV *
Unit::MeV;
95 const double time = preStep.GetGlobalTime() / CLHEP::ns *
Unit::ns;
96 traversal.setInitial(trackID, ladderID, sensorID, pdgCode, isPrimary, preStepPos, preStepMom, time);
98 if (preStep.GetStepStatus() == fGeomBoundary) traversal.hasEntered();
102 const G4ThreeVector postStepPos = postStep.GetPosition() / CLHEP::mm *
Unit::mm;
103 const double length =
step->GetStepLength() / CLHEP::cm *
Unit::cm;
104 traversal.add(postStepPos, depEnergy, visibleEnergy, length);
107 bool isLeaving = (postStep.GetStepStatus() == fGeomBoundary);
108 if (isLeaving) traversal.hasLeft();
111 if (isLeaving || track.GetTrackStatus() >= fStopAndKill) {
112 bool contained = traversal.isContained();
115 if (saved && !contained) {
126 SensorTraversal& traversal =
m_tracks.top();
128 bool save = traversal.getDepEnergy() >
Unit::eV;
130 auto momEntry = vecToFloat(traversal.getEntryMomentum());
The documentation for this class was generated from the following files: