9#include <beast/plume/simulation/SensitiveDetector.h>
10#include <beast/plume/dataobjects/PlumeSimHit.h>
11#include <beast/plume/dataobjects/PlumeHit.h>
13#include <framework/datastore/StoreArray.h>
14#include <framework/datastore/RelationArray.h>
20#define _USE_MATH_DEFINES
34 Simulation::SensitiveDetectorBase(
"PlumeSensitiveDetector",
Const::invalidDetector)
96 const G4Track& track = *
step->GetTrack();
97 const G4StepPoint& preStepPoint = *
step->GetPreStepPoint();
98 const G4StepPoint& postStepPoint = *
step->GetPostStepPoint();
111 G4ThreeVector preStepPointPosition = preStepPoint.GetPosition();
112 G4ThreeVector trackMomentum = track.GetMomentum();
124 G4TouchableHandle theTouchable = preStepPoint.GetTouchableHandle();
125 G4ThreeVector worldDirection = preStepPoint.GetMomentumDirection();
126 G4ThreeVector localDirection = theTouchable->GetHistory()->GetTopTransform().TransformAxis(worldDirection);
128 if (localDirection.z() < 0.) {
135 if (localDirection.x() < 0. && localDirection.y() > 0.) {
137 }
else if (localDirection.x() < 0. && localDirection.y() < 0.) {
139 }
else if (localDirection.x() > 0. && localDirection.y() < 0.) {
141 }
else if (localDirection.x() > 0. && localDirection.y() > 0.) {
143 }
else if (localDirection.x() < 0. && localDirection.y() == 0.) {
145 }
else if (localDirection.x() > 0. && localDirection.y() == 0.) {
147 }
else if (localDirection.x() == 0. && localDirection.y() > 0.) {
149 }
else if (localDirection.x() == 0. && localDirection.y() < 0.) {
153 G4ThreeVector localINPosition = theTouchable->GetHistory()->GetTopTransform().TransformPoint(preStepPointPosition);
167 if (track.GetNextVolume() != track.GetVolume() || track.GetTrackStatus() >= fStopAndKill) {
169 G4ThreeVector postStepPointPosition = postStepPoint.GetPosition();
174 G4ThreeVector localOUTPosition = preStepPoint.GetTouchableHandle()->GetHistory()->GetTopTransform().TransformPoint(
175 postStepPointPosition);
This class provides a set of constants for the framework.
Class PlumeSimHit - Geant4 simulated hit for the PLUME detector.
Low-level class to create/modify relations between StoreArrays.
void add(index_type from, index_type to, weight_type weight=1.0)
Add a new element to the relation.
static void registerMCParticleRelation(const std::string &name, RelationArray::EConsolidationAction ignoreAction=RelationArray::c_negativeWeight)
Register an relation involving MCParticles.
bool registerInDataStore(DataStore::EStoreFlags storeFlags=DataStore::c_WriteOut)
Register the object/array in the DataStore.
Accessor to arrays stored in the data store.
T * appendNew()
Construct a new T object at the end of the array.
float current_trackVertex_z
track production vertex z coordinates in G4 ref
float current_posIN_v
incoming track position v in sensor ref, in mm
float current_posIN_u
incoming track position u in sensor ref, in mm
float current_momentum_z
incoming track momentum, z coordinates in G4 ref, in GeV
float current_posIN_y
incoming track position y in G4 ref, in mm
float current_momentum_y
incoming track momentum, y coordinates in G4 ref, in GeV
float current_posOUT_w
outcoming track position w in sensor ref, in mm
float current_energyDep
deposited energy in MeV
float current_trackVertex_x
track production vertex x coordinates in G4 ref
float current_posOUT_z
outcoming track position z in sensor ref, in mm
float current_posOUT_v
outcoming track position v in sensor ref, in mm
float current_posIN_z
incoming track position z in G4 ref, in mm
float current_thetaAngle
local (sensor ref) theta angle, out of sensor plane, in degree
float current_posOUT_u
outcoming track position u in sensor ref, in mm
float current_globalTime
global time
float current_momentum_x
incoming track momentum, x coordinates in G4 ref, in GeV
float current_trackVertex_y
track production vertex y coordinates in G4 ref
int current_sensorID
sensor ID
int current_trackID
track ID
float current_posOUT_y
outcoming track position y in sensor ref, in mm
float current_posIN_x
incoming track position x in G4 ref, in mm
float current_phiAngle
local (sensor ref) phi angle, in sensor plane, in degree
int current_pdgID
particle PDG id
float current_nielDep
non ionizing deposited energy
~SensitiveDetector()
Destructor.
float current_posIN_w
incoming track position w in sensor ref, in mm
SensitiveDetector()
Constructor.
bool step(G4Step *step, G4TouchableHistory *) override
Step processing method.
float current_posOUT_x
outcoming track position x in sensor ref, in mm
double atan(double a)
atan for double
Abstract base class for different kinds of events.