OMSim
Geant4 for IceCube optical module studies
Loading...
Searching...
No Matches
simulations/wavepid/include/OMSimSensitiveDetector.hh
Go to the documentation of this file.
1
5#pragma once
6
7#include "G4VSensitiveDetector.hh"
8#include "G4ThreeVector.hh"
9#include "OMSimPMTResponse.hh"
10
11#include <vector>
12#include <string>
13
14class G4Step;
15class G4Track;
16class G4TouchableHistory;
18
23enum class DetectorType {
24 PMT,
29};
30
35struct PhotonInfo {
36 G4int eventID;
37 G4double globalTime;
38 G4double localTime;
39 G4double trackLength;
40 G4double kineticEnergy;
41 G4double wavelength;
42 G4ThreeVector globalPosition;
43 G4ThreeVector localPosition;
44 G4ThreeVector momentumDirection;
45 G4ThreeVector deltaPosition;
46 G4int pmtNumber;
47 G4int detectorID;
49 // WavePID extensions for photon origin tracking
50 G4String photonOrigin;
51 G4int parentID;
52 std::string parentType;
53 G4String parentProcess;
54 G4double entryTime;
55};
56
61class OMSimSensitiveDetector : public G4VSensitiveDetector
62{
63public:
64 OMSimSensitiveDetector(G4String pName, DetectorType pDetectorType);
65 ~OMSimSensitiveDetector() override;
66
67 G4bool ProcessHits(G4Step* pStep, G4TouchableHistory* pTouchableHistory) override;
68 void setPMTResponse(OMSimPMTResponse* pResponse);
69
70private:
71 bool m_QEcut;
72 OMSimPMTResponse* m_PMTResponse;
73 DetectorType m_detectorType;
74
75 static thread_local G4OpBoundaryProcess* m_boundaryProcess;
76
77 G4bool checkVolumeAbsorption(G4Step* pStep);
78 G4bool checkBoundaryAbsorption(G4Step* pStep);
79 PhotonInfo getPhotonInfo(G4Step* pStep);
80 G4bool handlePMT(G4Step* pStep, G4TouchableHistory* pTouchableHistory);
81 G4bool handleGeneralPhotonDetector(G4Step* pStep, G4TouchableHistory* pTouchableHistory);
82 G4bool handleShellDetector(G4Step* pStep, G4TouchableHistory* pTouchableHistory);
83 bool isPhotonDetected(double p_efficiency);
84 void storePhotonHit(PhotonInfo& pInfo);
86 void killParticle(G4Track* pTrack);
87};
Simulation of PMT response.
Definition OMSimOpBoundaryProcess.hh:159
Class to simulate PMT response.
Definition OMSimPMTResponse.hh:20
Represents a sensitive detector.
Definition common/framework/include/OMSimSensitiveDetector.hh:53
G4bool handlePMT(G4Step *pStep, G4TouchableHistory *pTouchableHistory)
Handles hits for PMT detectors.
Definition common/framework/src/OMSimSensitiveDetector.cc:210
G4bool ProcessHits(G4Step *pStep, G4TouchableHistory *pTouchableHistory) override
Processes hits for optical photons in the detector.
Definition common/framework/src/OMSimSensitiveDetector.cc:90
void storePhotonHit(PhotonInfo &pInfo)
Stores photon hit information into the HitManager.
Definition common/framework/src/OMSimSensitiveDetector.cc:285
void setPMTResponse(OMSimPMTResponse *pResponse)
Sets the PMT response model.
Definition common/framework/src/OMSimSensitiveDetector.cc:74
PhotonInfo getPhotonInfo(G4Step *pStep)
Retrieves photon information from a given step.
Definition common/framework/src/OMSimSensitiveDetector.cc:133
G4bool handleGeneralPhotonDetector(G4Step *pStep, G4TouchableHistory *pTouchableHistory)
Handles hits for general photon detectors.
Definition common/framework/src/OMSimSensitiveDetector.cc:242
~OMSimSensitiveDetector()
Destructor for OMSimSensitiveDetector.
Definition common/framework/src/OMSimSensitiveDetector.cc:40
static thread_local G4OpBoundaryProcess * m_boundaryProcess
Definition common/framework/include/OMSimSensitiveDetector.hh:65
bool isPhotonDetected(double p_efficiency)
Monte carlo if the photon was detected based on the detection probability.
Definition common/framework/src/OMSimSensitiveDetector.cc:199
G4bool handleShellDetector(G4Step *pStep, G4TouchableHistory *pTouchableHistory)
Handles hits for shell photon detectors. This detector does not kill the particle.
Definition common/framework/src/OMSimSensitiveDetector.cc:256
void fetchBoundaryProcess()
Fetches the boundary process for detecting boundary absorptions.
Definition common/framework/src/OMSimSensitiveDetector.cc:52
G4bool checkVolumeAbsorption(G4Step *pStep)
Checks if the photon was absorbed in the volume.
Definition common/framework/src/OMSimSensitiveDetector.cc:165
void killParticle(G4Track *pTrack)
Stop the particle from propagating further. Necessary for 100% efficient detectors.
Definition common/framework/src/OMSimSensitiveDetector.cc:306
G4bool checkBoundaryAbsorption(G4Step *pStep)
Checks if the photon was detected at a boundary.
Definition common/framework/src/OMSimSensitiveDetector.cc:175
@ VolumePhotonDetector
Photon detector based on absorption in volume.
@ PMT
Photomultiplier tube detector.
@ BoundaryShellDetector
Shell detector that does not kill the particle.
@ BoundaryPhotonDetector
Photon detector based on absorption in boundary.
@ PerfectPMT
Photomultiplier tube detector.
Represents the output pulse for a detected photon.
Definition OMSimPMTResponse.hh:29
Contains information about a detected photon which will be appended in HitManager.
Definition common/framework/include/OMSimSensitiveDetector.hh:30
G4double globalTime
Global time of the photon hit.
Definition common/framework/include/OMSimSensitiveDetector.hh:32
OMSimPMTResponse::PMTPulse PMTResponse
PMT response to the photon hit.
Definition common/framework/include/OMSimSensitiveDetector.hh:43
G4ThreeVector deltaPosition
Change in position of the photon hit.
Definition common/framework/include/OMSimSensitiveDetector.hh:40
std::string parentType
Parent particle type (e.g., "mu-", "e-")
Definition simulations/wavepid/include/OMSimSensitiveDetector.hh:52
G4double kineticEnergy
Kinetic energy of the photon.
Definition common/framework/include/OMSimSensitiveDetector.hh:35
G4double wavelength
Wavelength of the photon.
Definition common/framework/include/OMSimSensitiveDetector.hh:36
G4int eventID
Event ID of the photon hit.
Definition common/framework/include/OMSimSensitiveDetector.hh:31
G4ThreeVector globalPosition
Global position of the photon hit.
Definition common/framework/include/OMSimSensitiveDetector.hh:37
G4String photonOrigin
Origin classification (e.g., "Cerenkov from Muon")
Definition simulations/wavepid/include/OMSimSensitiveDetector.hh:50
G4ThreeVector momentumDirection
Direction of the photon's momentum.
Definition common/framework/include/OMSimSensitiveDetector.hh:39
G4int pmtNumber
PMT number associated with the photon hit.
Definition common/framework/include/OMSimSensitiveDetector.hh:41
G4double trackLength
Length of the photon's track.
Definition common/framework/include/OMSimSensitiveDetector.hh:34
G4double localTime
Local time of the photon hit.
Definition common/framework/include/OMSimSensitiveDetector.hh:33
G4int parentID
Parent track ID.
Definition simulations/wavepid/include/OMSimSensitiveDetector.hh:51
G4int detectorID
ID of the detector registering the photon.
Definition common/framework/include/OMSimSensitiveDetector.hh:42
G4double entryTime
Time photon entered the DOM.
Definition simulations/wavepid/include/OMSimSensitiveDetector.hh:54
G4String parentProcess
Process that created parent particle.
Definition simulations/wavepid/include/OMSimSensitiveDetector.hh:53
G4ThreeVector localPosition
Local position of the photon hit.
Definition common/framework/include/OMSimSensitiveDetector.hh:38