Jpp  16.0.1
the software that should make you happy
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
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 
14 namespace JDETECTOR {}
15 namespace JPP { using namespace JDETECTOR; }
16 
17 namespace 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 (getPMTStatus(id, getTimeRange(input), status)) {
45 
47 
48  cpu(calibration, input, output);
49  }
50  }
51 
52 
53  /**
54  * Get PMT status.
55  *
56  * \param id PMT identifier
57  * \param window time range
58  * \param status PMT status
59  * \return status
60  */
61  virtual bool getPMTStatus(const JPMTIdentifier& id, const JTimeRange& window, const JStatus& status) const
62  {
63  return !status.has(PMT_DISABLE);
64  }
65 
66 
67  /**
68  * Get PMT signal processor.
69  *
70  * \param pmt PMT identifier
71  * \return PMT signal processor
72  */
74  {
75  static const JPMTSignalProcessorInterface cpu;
76 
77  return cpu;
78  }
79  };
80 }
81 
82 #endif
Interface for PMT simulation.
virtual void processHits(const JPMTIdentifier &id, const JCalibration &calibration, const JStatus &status, const JPMTData< JPMTSignal > &input, JPMTData< JPMTPulse > &output) const override
Process hits.
JTOOLS::JRange< double > JTimeRange
Type definition for time range (unit [ns]).
Data structure for time calibration.
JTimeRange getTimeRange(const Evt &event)
Get time range (i.e. time between earliest and latest hit) of Monte Carlo event.
bool has(const int bit) const
Test PMT status.
Definition: JStatus.hh:108
virtual const JPMTSignalProcessorInterface & getPMTSignalProcessor(const JPMTIdentifier &pmt) const
Get PMT signal processor.
Auxiliary class for handling status.
Definition: JStatus.hh:37
static const int PMT_DISABLE
KM3NeT Data Definitions v2.1.0-12-g9520e6e https://git.km3net.de/common/km3net-dataformat.
Definition: pmt_status.hh:12
virtual bool getPMTStatus(const JPMTIdentifier &id, const JTimeRange &window, const JStatus &status) const
Get PMT status.
Template data structure for PMT I/O.