Enhanced hit manager with photon origin tracking and ROOT output.
Stores, manages, and provides access information related to detected photons across multiple optical modules. The manager uses a global instance pattern, ensuring a unified access point for photon hit data. Its lifecycle is managed by the OMSim class.
The hits are stored using 'OMSimHitManager::appendHitInfo'. The analysis manager of each study is in charge of writing the stored information into a file (see for example 'OMSimEffectiveAreaAnalyisis::writeScan' or 'OMSimDecaysAnalysis::writeHitInformation'). If the simulation will continue after the data is written, do not forget calling 'OMSimHitManager::reset'!.
|
| 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.
|
| |
|
void | reset () |
| | Deletes hit information in memory for all modules.
|
| |
| std::vector< double > | countMergedHits (int pModuleIndex=0, bool pDEweight=false) |
| | Counts hits for a specified module.
|
| |
| void | setNumberOfPMTs (int pNumberOfPMTs, int pModuleIndex=0) |
| | Stores the number of PMTs in a module for correct data handling.
|
| |
| HitStats | getMergedHitsOfModule (int pModuleIndex=0) |
| | Retrieves the HitStats structure for the specified module, should be called after data between threads was merged.
|
| |
| HitStats | getSingleThreadHitsOfModule (int pModuleIndex=0) |
| | Retrieves the HitStats structure for the specified module of single thread.
|
| |
|
bool | areThereHitsInModuleSingleThread (int pModuleIndex=0) |
| |
| void | sortHitStatsByTime (HitStats &pHits) |
| | Sorts the hit statistics by the hit time.
|
| |
| std::vector< int > | calculateMultiplicity (const G4double pTimeWindow, int pModuleNumber=0) |
| | Calculates the multiplicity of hits within a specified time window for a given module.
|
| |
|
G4int | getNextDetectorIndex () |
| |
|
G4int | getNumberOfModules () |
| |
|
void | mergeThreadData () |
| |
|
void | appendHitInfo (G4int p_eventid, G4double p_globalTime, G4double p_entryTime, G4double p_localTime, G4double p_trackLength, G4double p_energy, G4int pPMTHitNumber, G4ThreeVector pMomentumDirection, G4ThreeVector pGlobalPos, G4ThreeVector pLocalPos, G4double p_distance, OMSimPMTResponse::PMTPulse pResponse, G4String pPhotonOrigin, G4int pParentID, std::string pParentType, G4String pParentProcess, G4double p_wavelength, G4int pModuleIndex) |
| | Append hit information with photon origin data.
|
| |
|
void | reset () |
| |
|
std::vector< double > | countMergedHits (int pModuleIndex=0, bool pDEweight=false) |
| |
|
void | setNumberOfPMTs (int pNumberOfPMTs, int pModuleIndex=0) |
| |
|
HitStats | getMergedHitsOfModule (int pModuleIndex=0) |
| |
|
HitStats | getSingleThreadHitsOfModule (int pModuleIndex=0) |
| |
|
bool | areThereHitsInModuleSingleThread (int pModuleIndex=0) |
| |
|
void | sortHitStatsByTime (HitStats &pHits) |
| |
|
std::vector< int > | calculateMultiplicity (const G4double pTimeWindow, int pModuleNumber=0) |
| |
|
G4int | getNextDetectorIndex () |
| |
|
G4int | getNumberOfModules () |
| |
|
void | mergeThreadData () |
| |
| std::vector< int > OMSimHitManager::calculateMultiplicity |
( |
const G4double |
p_timeWindow, |
|
|
int |
p_moduleIndex = 0 |
|
) |
| |
This method determines the multiplicity of hits for the specified optical module within a given time window. Multiplicity is defined as the number of PMTs detecting a hit within the time window. The result is a vector where each element represents the number of occurrences of a specific multiplicity.
For instance, if the resulting vector is [5, 3, 2], it means:
- 5 occurrences of 1 PMT detecting a hit within the time window.
- 3 occurrences of 2 PMTs detecting hits within the same window.
- 2 occurrences of 3 PMTs detecting hits within the window.
- Parameters
-
| p_timeWindow | The time window within which to calculate the multiplicity (in seconds). |
| p_moduleIndex | The index of the module for which to calculate the multiplicity. Default is 0. |
- Returns
- A vector containing the multiplicity data.