Jpp - 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 
6 
7 
8 /**
9  * \author mdejong
10  */
11 
12 namespace JDETECTOR {}
13 namespace JPP { using namespace JDETECTOR; }
14 
15 namespace JDETECTOR {
16 
17  /**
18  * Default PMT simulation interface.
19  *
20  * This class implements the JPMTSimulator interface by transferring
21  * the PMT simulation to the PMT signal processor interface.
22  */
24  public JPMTSimulator
25  {
26  public:
27  /**
28  * Process hits.
29  *
30  * \param id PMT identifier
31  * \param calibration PMT calibration
32  * \param status PMT status
33  * \param input PMT signals
34  * \param output PMT hits
35  */
36  virtual void processHits(const JPMTIdentifier& id,
37  const JCalibration& calibration,
38  const JStatus& status,
39  const JPMTData<JPMTSignal>& input,
40  JPMTData<JPMTPulse>& output) const override
41  {
42  if (getPMTStatus(id, getTimeRange(input), status)) {
43 
45 
46  cpu(calibration, input, output);
47  }
48  }
49 
50 
51  /**
52  * Get PMT status.
53  *
54  * \param id PMT identifier
55  * \param window time range
56  * \param status PMT status
57  * \return status
58  */
59  virtual bool getPMTStatus(const JPMTIdentifier& id, const JTimeRange& window, const JStatus& status) const
60  {
61  return !status.has(PMT_DISABLE);
62  }
63 
64 
65  /**
66  * Get PMT signal processor.
67  *
68  * \param pmt PMT identifier
69  * \return PMT signal processor
70  */
72  {
73  static const JPMTSignalProcessorInterface cpu;
74 
75  return cpu;
76  }
77  };
78 }
79 
80 #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]).
Auxiliary class for controlling PMT status.
Definition: JStatus.hh:42
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.
virtual const JPMTSignalProcessorInterface & getPMTSignalProcessor(const JPMTIdentifier &pmt) const
Get PMT signal processor.
static const int PMT_DISABLE
KM3NeT Data Definitions v2.0.0-14-gbeccebb 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.
bool has(const int bit) const
Test PMT status.
Definition: JStatus.hh:113
Template data structure for PMT I/O.