Jpp 19.3.0-rc.1
the software that should make you happy
Loading...
Searching...
No Matches
JPMTRunByRunSimulator.hh
Go to the documentation of this file.
1#ifndef __JTRIGGER__JPMTRUNBYRUNSIMULATOR__
2#define __JTRIGGER__JPMTRUNBYRUNSIMULATOR__
3
5
12
13
14/**
15 * \author mdejong
16 */
17
18namespace JTRIGGER {}
19namespace JPP { using namespace JTRIGGER; }
20
21namespace JTRIGGER {
22
27
28
29 /**
30 * PMT simulation based on run-by-run information.
31 *
32 * This class overwrites the method JPMTDefaultSimulator::getPMTStatus.
33 * The actual PMT status is obtained from summary data.
34 */
37 {
38 public:
39 /**
40 * Constructor.
41 *
42 * \param router summary router
43 * \param parameters PMT parameters
44 * \param detector detector
45 */
47 const JPMTParametersMap& parameters,
48 const JDetector& detector) :
49 JPMTDefaultSimulator(parameters, detector),
51 QE(parameters.getQE())
52 {}
53
54
55 /**
56 * Get PMT status.
57 *
58 * \param id PMT identifier
59 * \param window time range
60 * \param status PMT status
61 * \return status
62 */
63 virtual bool getPMTStatus(const JPMTIdentifier& id, const JTimeRange& window, const JStatus& status) const override
64 {
68
69 if (summary_router.hasSummaryFrame(id.getModuleID())) {
70
71 const JDAQSummaryFrame& frame = summary_router.getSummaryFrame(id.getModuleID());
72
73 const int pmt = id.getPMTAddress();
74
75 return (getPMTStatus(status) &&
76 getDAQStatus(frame, status) &&
77 window.getUpperLimit() <= getMaximalTime(getRate(frame,pmt) * QE));
78 }
79
80 return false;
81 }
82
83
84 protected:
86 const double QE;
87 };
88}
89
90#endif
Data structure for detector geometry and calibration.
Detector data structure.
Definition JDetector.hh:96
Auxiliary class for map of PMT parameters.
T getUpperLimit() const
Get upper limit.
Definition JRange.hh:213
PMT simulation based on run-by-run information.
virtual bool getPMTStatus(const JPMTIdentifier &id, const JTimeRange &window, const JStatus &status) const override
Get PMT status.
JPMTRunByRunSimulator(const JSummaryRouter &router, const JPMTParametersMap &parameters, const JDetector &detector)
Constructor.
Router for fast addressing of summary data in JDAQSummaryslice data structure as a function of the op...
bool hasSummaryFrame(const JDAQModuleIdentifier &module) const
Has summary frame.
const JDAQSummaryFrame & getSummaryFrame(const JDAQModuleIdentifier &module) const
Get summary frame.
Data storage class for rate measurements of all PMTs in one module.
double getQE(const double R, const double mu)
Get QE for given ratio of hit probabilities and expectation value of the number of photo-electrons.
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
Auxiliary classes and methods for triggering.
bool getDAQStatus(const JDAQFrameStatus &frame, const JStatus &status)
Test status of DAQ.
double getRate(const JDAQSummaryFrame &frame, const int pmt, const double factor=1.0)
Get corrected rate of PMT.
bool getPMTStatus(const JStatus &status)
Test status of PMT.
double getMaximalTime(const double R_Hz)
Get maximal time for given rate.
Detector file.
Definition JHead.hh:227
Auxiliary class for handling status.
Definition JStatus.hh:39