Jpp 20.0.0-27-g39925593c-D
the software that should make you happy
Loading...
Searching...
No Matches
JPMTDefaultSimulatorInterface.hh
Go to the documentation of this file.
1#ifndef __JDETECTOR__JPMTDEFAULTSIMULATORINTERFACE__
2#define __JDETECTOR__JPMTDEFAULTSIMULATORINTERFACE__
3
5
8
9
10/**
11 * \author mdejong
12 */
13
14namespace JDETECTOR {}
15namespace JPP { using namespace JDETECTOR; }
16
17namespace JDETECTOR {
18
19 /**
20 * Default PMT simulation interface.
21 *
22 * This class implements the JPMTSimulator interface by transferring
23 * the PMT simulation to the PMT signal processor interface.
24 */
26 public JPMTSimulator
27 {
28 public:
29 /**
30 * Process hits.
31 *
32 * \param id PMT identifier
33 * \param calibration PMT calibration
34 * \param status PMT status
35 * \param input PMT signals
36 * \param output PMT hits
37 */
38 virtual void processHits(const JPMTIdentifier& id,
39 const JCalibration& calibration,
40 const JStatus& status,
41 const JPMTData<JPMTSignal>& input,
42 JPMTData<JPMTPulse>& output) const override
43 {
45
46 cpu(calibration, input, output);
47
48 // to correctly take into account dynamical nature of high-rate veto, apply PMT status to calibrated data
49
50 if (!output.empty()) {
51 if (!getPMTStatus(id, getTimeRange(output), status)) {
52 output.clear();
53 }
54 }
55 }
56
57
58 /**
59 * Get PMT status.
60 *
61 * \param id PMT identifier
62 * \param window time range
63 * \param status PMT status
64 * \return status
65 */
66 virtual bool getPMTStatus(const JPMTIdentifier& id, const JTimeRange& window, const JStatus& status) const
67 {
68 return !status.has(PMT_DISABLE);
69 }
70
71
72 /**
73 * Get PMT signal processor.
74 *
75 * \param pmt PMT identifier
76 * \return PMT signal processor
77 */
79 {
80 static const JPMTSignalProcessorInterface cpu;
81
82 return cpu;
83 }
84 };
85}
86
87#endif
Data structure for time calibration.
Template data structure for PMT I/O.
virtual void processHits(const JPMTIdentifier &id, const JCalibration &calibration, const JStatus &status, const JPMTData< JPMTSignal > &input, JPMTData< JPMTPulse > &output) const override
Process hits.
virtual bool getPMTStatus(const JPMTIdentifier &id, const JTimeRange &window, const JStatus &status) const
Get PMT status.
virtual const JPMTSignalProcessorInterface & getPMTSignalProcessor(const JPMTIdentifier &pmt) const
Get PMT signal processor.
Interface for PMT simulation.
file Auxiliary data structures and methods for detector calibration.
Definition JAnchor.hh:12
JTimeRange getTimeRange(const JTimeRange &timeRange, const JModule &module)
Get de-calibrated time range.
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
static const int PMT_DISABLE
ile KM3NeT Data Definitions v3.6.2 https://git.km3net.de/common/km3net-dataformat
Definition pmt_status.hh:13
Auxiliary class for handling status.
Definition JStatus.hh:31
bool has(const int bit) const
Test PMT status.
Definition JStatus.hh:198