6 #include <utl/Particle.h>
7 #include <utl/ParticleCases.h>
9 #include <utl/Segment.h>
10 #include <utl/Plane.h>
11 #include <utl/Point.h>
12 #include <utl/GeometryUtilities.h>
13 #include <utl/PhysicalConstants.h>
15 #include <mdet/MDetector.h>
16 #include <mdet/Counter.h>
19 #include <G4TouchableHistory.hh>
21 #include <G4SystemOfUnits.hh>
22 #include <G4RunManager.hh>
23 #include <G4OpticalPhoton.hh>
26 namespace G4StationSimulatorOG {
29 G4VSensitiveDetector(name),
31 dynamic_cast<
G4StationSimulator&>(fwk::RunController::GetInstance().GetModule(
"G4StationSimulatorOG"))
40 if (step->GetTrack()->GetDefinition() == G4OpticalPhoton::OpticalPhotonDefinition())
44 G4VPhysicalVolume*
const currentPhysVol = step->GetPreStepPoint()->GetPhysicalVolume();
46 G4VPhysicalVolume*
const motherPhysVol = step->GetPreStepPoint()->GetTouchableHandle()->GetVolume(1);
49 const G4int stripId = currentPhysVol->GetCopyNo();
50 const G4int moduleId = motherPhysVol->GetCopyNo();
53 const int particleId = step->GetTrack()->GetDefinition()->GetPDGEncoding();
54 const double stepLen = step->GetStepLength() * (
utl::m /
CLHEP::m);
78 if (step->GetPreStepPoint()->GetStepStatus() == fGeomBoundary) {
83 const double kineticEnergy = step->GetTrack()->GetKineticEnergy() * (
utl::MeV /
CLHEP::MeV);
84 const auto direction = To<utl::Vector>(step->GetPreStepPoint()->GetMomentumDirection(), cs, 1);
85 const utl::Particle injectedParticle(particleId, type, position, direction, time, 1, kineticEnergy);
113 if (!counter.HasModule(moduleId))
147 const double pathLen = onScint + onManifold;
156 const double particleDelay = time.GetInterval();
158 for (
unsigned int n = 0; n < nSPE; ++n) {
void SetFirstStepInVolume(const bool b)
void AddEnergyDepositMuons(const double edep)
const Module & GetModule(const int mId) const
Retrieve by id a constant module.
bool HasScintillator(const int sId) const
unsigned int ComputeSPENumber(double x, double l, double e) const
Computes a number of SPE given the impinging distance, the length of the track and the energy of the ...
void MakeScintillator(const int sId)
const mdet::Counter & GetDetectorUMDCounter() const
Describes a particle for Simulation.
utl::CoordinateSystemPtr GetLocalCoordinateSystem() const
Local system based on position and configured rotations.
const Fiber & GetFiberFor(const Component &c) const
Linking between fibers, scintillators, channels and pixels.
double Distance(const Line &line1, const Line &line2)
mevt::Counter & GetEventUMDCounter() const
Scintillator & GetScintillator(const int sId)
Actual muon-sensitive objects.
Scintillator level event data.
boost::shared_ptr< const CoordinateTransformer > CoordinateSystemPtr
Shared pointer for coordinate systems.
Class describing a Plane object.
void AddInjectedParticle(const size_t modId, const size_t pixId, const utl::Particle &injectedParticle) const
G4StationSimulator & fG4StationSimulator
double abs(const SVector< n, T > &v)
virtual G4bool ProcessHits(G4Step *const step, G4TouchableHistory *const rOhist) override
void AddEnergyDeposit(const double edep)
Root detector of the muon detector hierarchy.
constexpr double kSpeedOfLight
Scintillator level simulation data.
A TimeInterval is used to represent time elapsed between two events.
void MakeModule(const int mId)
class that handles Geant4 SD Station simulation adopted from G4TankSimulator
G4UMDScintStripAction(const G4String &name)
Geant4 Tracking user action class.
double ComputeDecayDelay() const
Computes a delay due to decay process.
double ComputeDecayDelay() const
Computes a delay due to decay process.
bool GetFirstStepInVolume() const
Optical mdet::Fiber used to conect mdet::Scintillator to mdet::Pixel.
const Scintillator & GetScintillator(int sId) const
Direct accesor by id.
bool HasAnalogicTrace() const
void AddUMDPhoton(const size_t modId, const size_t pixId, const double peTime) const
ScintillatorSimData & GetSimData()
double GetRefractionIndex() const
The refraction (or refractive) index of the fiber.
double GetOnManifoldLength() const
The length of the fiber along the path that joins the scintillator to its pixel on the PMT...
bool OnlyMuonsInUMD() const