Manages detected photon information.
More...
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 () |
|
|
std::map< G4int, HitStats > | m_moduleHits |
| Map of a HitStats containing hit information for each simulated optical module.
|
|
|
std::map< G4int, G4int > | m_numberOfPMTs |
| Map of number of PMTs in the used optical modules.
|
|
G4int | m_currentIndex |
|
◆ appendHitInfo()
void OMSimHitManager::appendHitInfo |
( |
G4int |
p_eventid, |
|
|
G4double |
p_globalTime, |
|
|
G4double |
p_localTime, |
|
|
G4double |
p_trackLength, |
|
|
G4double |
p_energy, |
|
|
G4int |
p_PMTHitNumber, |
|
|
G4ThreeVector |
p_momentumDirection, |
|
|
G4ThreeVector |
p_globalPos, |
|
|
G4ThreeVector |
p_localPos, |
|
|
G4double |
p_distance, |
|
|
OMSimPMTResponse::PMTPulse |
p_response, |
|
|
G4int |
p_moduleNumber = 0 |
|
) |
| |
This method appends hit information to the corresponding module's HitStats
structure in the manager. If the specified module number is not yet in the manager, a new HitStats
structure is created for it.
- Parameters
-
p_globalTime | Time of detection. |
p_localTime | Photon flight time. |
p_trackLength | Length of the photon's path before hitting. |
p_energy | Energy of the detected photon. |
p_PMTHitNumber | ID of the PMT that detected the photon. |
p_momentumDirection | Momentum direction of the photon at the time of detection. |
p_globalPos | Global position of the detected photon. |
p_localPos | Local position of the detected photon within the PMT. |
p_distance | Distance between generation and detection of photon. |
p_response | PMT's p_response to the detected photon, encapsulated as a PMTPulse . |
p_moduleNumber | ID of the module in which the photon was detected. |
◆ calculateMultiplicity()
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.
◆ countMergedHits()
std::vector< double > OMSimHitManager::countMergedHits |
( |
int |
p_moduleIndex = 0 , |
|
|
bool |
p_getWeightedDE = false |
|
) |
| |
- Parameters
-
p_moduleIndex | Index of the module for which to count hits. Default is 0. |
p_getWeightedDE | If true, the counts are weighted with detection probability |
- Returns
- A vector containing the hit count for each PMT in the specified module.
◆ getInstance()
◆ getMergedHitsOfModule()
HitStats OMSimHitManager::getMergedHitsOfModule |
( |
int |
p_moduleIndex = 0 | ) |
|
- See also
- mergeThreadData
- Parameters
-
p_moduleIndex | Index of the module for which to retrieve hit statistics. Default is 0. |
- Returns
- A HitStats structure containing hit information of specified module.
◆ getSingleThreadHitsOfModule()
HitStats OMSimHitManager::getSingleThreadHitsOfModule |
( |
int |
p_moduleIndex = 0 | ) |
|
- Parameters
-
p_moduleIndex | Index of the module for which to retrieve hit statistics. Default is 0. |
- Returns
- A HitStats structure containing hit information of specified module.
◆ init()
void OMSimHitManager::init |
( |
| ) |
|
|
static |
◆ setNumberOfPMTs()
void OMSimHitManager::setNumberOfPMTs |
( |
int |
p_numberOfPMTs, |
|
|
int |
p_moduleIndex = 0 |
|
) |
| |
- Parameters
-
p_numberOfPMTs | Nr of PMTs in OM |
p_moduleIndex | Module index for which we are getting the information (default 0) |
◆ shutdown()
void OMSimHitManager::shutdown |
( |
| ) |
|
|
static |
This method is normally called in the destructor ~OMSim.
◆ sortHitStatsByTime()
void OMSimHitManager::sortHitStatsByTime |
( |
HitStats & |
p_hits | ) |
|
- Parameters
-
p_hits | The hit statistics to be sorted. |
The documentation for this class was generated from the following files: