Jpp test-rotations-old
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 {
44 if (hasPMTSignalProcessor(id)) {
45
47
48 cpu(calibration, input, output);
49
50 // to correctly take into account dynamical nature of high-rate veto, apply PMT status to calibrated data
51
52 if (!getPMTStatus(id, getTimeRange(output), status)) {
53 output.clear();
54 }
55 }
56 }
57
58
59 /**
60 * Get PMT status.
61 *
62 * \param id PMT identifier
63 * \param window time range
64 * \param status PMT status
65 * \return status
66 */
67 virtual bool getPMTStatus(const JPMTIdentifier& id, const JTimeRange& window, const JStatus& status) const
68 {
69 return !status.has(PMT_DISABLE);
70 }
71
72
73 /**
74 * Has PMT signal processor.
75 *
76 * \param pmt PMT identifier
77 * \return true if this has PMT signal processor; else false
78 */
79 virtual const bool hasPMTSignalProcessor(const JPMTIdentifier& pmt) const
80 {
81 return true;
82 }
83
84
85 /**
86 * Get PMT signal processor.
87 *
88 * \param pmt PMT identifier
89 * \return PMT signal processor
90 */
92 {
93 static const JPMTSignalProcessorInterface cpu;
94
95 return cpu;
96 }
97 };
98}
99
100#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 const bool hasPMTSignalProcessor(const JPMTIdentifier &pmt) const
Has PMT signal processor.
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
KM3NeT Data Definitions v3.6.0 https://git.km3net.de/common/km3net-dataformat.
Definition pmt_status.hh:12
Auxiliary class for handling status.
Definition JStatus.hh:39
bool has(const int bit) const
Test PMT status.
Definition JStatus.hh:120