Jpp
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
JPMTRunByRunSimulator.hh
Go to the documentation of this file.
1 #ifndef __JTRIGGER__JPMTRUNBYRUNSIMULATOR__
2 #define __JTRIGGER__JPTRUNBYRUNSIMULATOR__
3 
5 
8 #include "JDetector/JDetector.hh"
9 #include "JDAQ/JHighRateVeto.hh"
12 
13 
14 /**
15  * \author mdejong
16  */
17 
18 namespace JTRIGGER {}
19 namespace JPP { using namespace JTRIGGER; }
20 
21 namespace JTRIGGER {
22 
26 
27 
28  /**
29  * PMT simulation based on run-by-run information.
30  *
31  * This class overwrites the method JPMTDefaultSimulator::getPMTStatus.
32  * The actual PMT status is obtained from summary data.
33  */
36  {
37  public:
38  /**
39  * Constructor.
40  *
41  * \param router summary router
42  * \param parameters PMT parameters
43  * \param detector detector
44  */
47  const JDetector& detector) :
48  JPMTDefaultSimulator(parameters, detector),
49  summary_router(router)
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  {
66 
67  if (summary_router.hasSummaryFrame(id.getModuleID())) {
68 
69  const JDAQSummaryFrame& frame = summary_router.getSummaryFrame(id.getModuleID());
70 
71  const int pmt = id.getPMTAddress();
72 
73  return (getPMTStatus(status) &&
74  getDAQStatus(frame, status) &&
75  window.getUpperLimit() <= getMaximalTime(getRate(frame,pmt)));
76  }
77 
78  return false;
79  }
80 
81 
82  protected:
84  };
85 }
86 
87 #endif
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...
Detector data structure.
Definition: JDetector.hh:80
*fatal Wrong number of arguments esac JCookie sh typeset Z DETECTOR typeset Z SOURCE_RUN typeset Z TARGET_RUN set_variable PARAMETERS_FILE $WORKDIR parameters
Definition: diff-Tuna.sh:38
Auxiliary class for controlling PMT status.
Definition: JStatus.hh:40
virtual bool getPMTStatus(const JPMTIdentifier &id, const JTimeRange &window, const JStatus &status) const
Get PMT status.
Data structure for detector geometry and calibration.
JRange< double > JTimeRange
Type definition for time range.
esac $JPP_DIR examples JDetector JTransitTime o $OUTPUT_FILE n N $NPE T $TTS_NS d $DEBUG for HISTOGRAM in tts tt2 pmt
Definition: JTransitTime.sh:36
Detector file.
Definition: JHead.hh:130
double getRate(const JDAQSummaryFrame &frame, const int pmt, const double factor=1.0)
Get corrected rate of PMT.
Data storage class for rate measurements of all PMTs in one module.
Auxiliary class for map of PMT parameters.
const JDAQSummaryFrame & getSummaryFrame(const JDAQModuleIdentifier &module) const
Get summary frame.
double getMaximalTime(const double R_Hz)
Get maximal time for given rate.
PMT simulation based on run-by-run information.
bool getPMTStatus(const JStatus &status)
Test status of PMT.
bool hasSummaryFrame(const JDAQModuleIdentifier &module) const
Has summary frame.
bool getDAQStatus(const JDAQFrameStatus &frame, const JStatus &status)
Test status of DAQ.