Sensitive Detector implementation of the FANGS detector.
More...
#include <SensitiveDetector.h>
|
bool | step (G4Step *step, G4TouchableHistory *) override |
| Step processing method. More...
|
|
Sensitive Detector implementation of the FANGS detector.
Definition at line 38 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 55 of file SensitiveDetector.cc.
72 SensorTraversal& traversal =
m_tracks.top();
75 if (traversal.getTrackID() == 0) {
78 const G4ThreeVector preStepPos = preStep.GetPosition() / CLHEP::mm *
Unit::mm;
79 const G4ThreeVector preStepMom = preStep.GetMomentum() / CLHEP::MeV *
Unit::MeV;
81 const G4AffineTransform& localToGlobalTransform = preStep.GetTouchableHandle()->GetHistory()->GetTopTransform();
82 const G4ThreeVector localpreStepPos = localToGlobalTransform.TransformPoint(preStep.GetPosition()) / CLHEP::mm *
Unit::mm;
83 const double time = preStep.GetGlobalTime() / CLHEP::ns *
Unit::ns;
84 traversal.setInitial(trackID, ladderID, sensorID, pdgCode, isPrimary, preStepPos, localpreStepPos, preStepMom, time);
86 if (preStep.GetStepStatus() == fGeomBoundary) traversal.hasEntered();
89 const G4ThreeVector postStepPos = postStep.GetPosition() / CLHEP::mm *
Unit::mm;
90 const double length =
step->GetStepLength() / CLHEP::cm *
Unit::cm;
91 traversal.add(postStepPos, depEnergy, length);
94 bool isLeaving = (postStep.GetStepStatus() == fGeomBoundary);
95 if (isLeaving) traversal.hasLeft();
98 if (isLeaving || track.GetTrackStatus() >= fStopAndKill) {
99 bool contained = traversal.isContained();
102 if (saved && !contained) {
113 SensorTraversal& traversal =
m_tracks.top();
115 bool save = traversal.getDepEnergy() >
Unit::eV;
117 auto momEntry = vecToFloat(traversal.getEntryMomentum());
The documentation for this class was generated from the following files: