14#include <G4ThreeVector.hh>
16#include <G4AutoLock.hh>
17#include <G4Threading.hh>
32 std::vector<G4double>
energy;
33 std::vector<G4int>
PMTnr;
38 std::vector<OMSimPMTResponse::PMTPulse>
PMTresponse;
83 G4double p_globalTime,
86 G4double p_trackLength,
89 G4ThreeVector pMomentumDirection,
90 G4ThreeVector pGlobalPos,
91 G4ThreeVector pLocalPos,
94 G4String pPhotonOrigin,
96 std::string pParentType,
97 G4String pParentProcess,
98 G4double p_wavelength,
102 std::vector<double>
countMergedHits(
int pModuleIndex = 0,
bool pDEweight =
false);
106 bool areThereHitsInModuleSingleThread(
int pModuleIndex = 0);
109 G4int getNextDetectorIndex() {
return ++m_currentIndex; }
110 G4int getNumberOfModules() {
return m_currentIndex + 1; }
112 void mergeThreadData();
118 G4int m_currentIndex;
119 static G4Mutex m_mutex;
122 struct ThreadLocalData {
123 std::map<G4int, HitStats> moduleHits;
125 G4ThreadLocal
static ThreadLocalData* m_threadData;
Simulation of PMT response.
ROOT-based output manager for WavePID photon hit data.
Manages detected photon information.
Definition common/framework/include/OMSimHitManager.hh:56
void reset()
Deletes hit information in memory for all modules.
Definition common/framework/src/OMSimHitManager.cc:188
std::vector< int > calculateMultiplicity(const G4double pTimeWindow, int pModuleNumber=0)
Calculates the multiplicity of hits within a specified time window for a given module.
Definition common/framework/src/OMSimHitManager.cc:274
static void init()
Initialize the global instance (called by OMSim::initialiseSimulation).
static void shutdown()
Shutdown and cleanup the global instance.
std::map< G4int, G4int > m_numberOfPMTs
Map of number of PMTs in the used optical modules.
Definition common/framework/include/OMSimHitManager.hh:97
static void setROOTOutputFile(const std::string &filename)
Set the ROOT output file (call after init, before simulation runs).
Definition simulations/wavepid/src/OMSimHitManager.cc:30
HitStats getSingleThreadHitsOfModule(int pModuleIndex=0)
Retrieves the HitStats structure for the specified module of single thread.
Definition common/framework/src/OMSimHitManager.cc:172
static OMSimHitManager & getInstance()
Get reference to the global instance.
void sortHitStatsByTime(HitStats &pHits)
Sorts the hit statistics by the hit time.
Definition common/framework/src/OMSimHitManager.cc:230
std::vector< double > countMergedHits(int pModuleIndex=0, bool pDEweight=false)
Counts hits for a specified module.
Definition common/framework/src/OMSimHitManager.cc:209
void appendHitInfo(G4int p_eventid, G4double pGlobalTime, G4double pLocalTime, G4double pTrackLength, G4double pEnergy, G4int pPMTHitNumber, G4ThreeVector pMomentumDirection, G4ThreeVector pGlobalPos, G4ThreeVector pLocalPos, G4double pDistance, OMSimPMTResponse::PMTPulse pResponse, G4int pModuleIndex=0)
Appends hit information for a detected photon to the corresponding module's hit data.
Definition common/framework/src/OMSimHitManager.cc:99
void setNumberOfPMTs(int pNumberOfPMTs, int pModuleIndex=0)
Stores the number of PMTs in a module for correct data handling.
Definition common/framework/src/OMSimHitManager.cc:148
std::map< G4int, HitStats > m_moduleHits
Map of a HitStats containing hit information for each simulated optical module.
Definition common/framework/include/OMSimHitManager.hh:94
HitStats getMergedHitsOfModule(int pModuleIndex=0)
Retrieves the HitStats structure for the specified module, should be called after data between thread...
Definition common/framework/src/OMSimHitManager.cc:159
Manages ROOT file output for photon hit data.
Definition ROOTHitManager.hh:50
A structure of vectors to store information about detected photons.
Definition common/framework/include/OMSimHitManager.hh:28
std::vector< G4double > flightTime
Photon flight time.
Definition common/framework/include/OMSimHitManager.hh:31
std::vector< G4double > pathLenght
Length of the photon's path before hitting.
Definition common/framework/include/OMSimHitManager.hh:32
std::vector< G4double > entryTime
Time photon entered DOM.
Definition simulations/wavepid/include/OMSimHitManager.hh:29
std::vector< G4double > generationDetectionDistance
Distance between generation and detection of photon.
Definition common/framework/include/OMSimHitManager.hh:38
std::vector< G4ThreeVector > direction
Momentum direction of the photon at the time of detection.
Definition common/framework/include/OMSimHitManager.hh:35
std::vector< G4double > energy
Energy of the detected photon.
Definition common/framework/include/OMSimHitManager.hh:33
std::vector< G4String > parentType
Parent particle type (e.g., "mu-", "e-")
Definition simulations/wavepid/include/OMSimHitManager.hh:41
std::vector< G4String > photonOrigin
Origin classification (e.g., "Cerenkov from Muon")
Definition simulations/wavepid/include/OMSimHitManager.hh:39
std::vector< G4int > parentID
Parent track ID.
Definition simulations/wavepid/include/OMSimHitManager.hh:40
std::vector< G4ThreeVector > globalPosition
Global position of the detected photon.
Definition common/framework/include/OMSimHitManager.hh:37
std::vector< G4String > parentProcess
Process that created parent.
Definition simulations/wavepid/include/OMSimHitManager.hh:42
std::vector< G4double > hitTime
Time of detection.
Definition common/framework/include/OMSimHitManager.hh:30
std::vector< G4int > PMTnr
ID of the PMT that detected the photon.
Definition common/framework/include/OMSimHitManager.hh:34
std::vector< G4long > eventId
ID of the event.
Definition common/framework/include/OMSimHitManager.hh:29
std::vector< OMSimPMTResponse::PMTPulse > PMTresponse
PMT's response to the detected photon, encapsulated as a PMTPulse.
Definition common/framework/include/OMSimHitManager.hh:39
std::vector< G4ThreeVector > localPosition
Local position of the detected photon within the PMT.
Definition common/framework/include/OMSimHitManager.hh:36
Represents the output pulse for a detected photon.
Definition OMSimPMTResponse.hh:29