Jpp
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
JK40RunByRunSimulator.hh
Go to the documentation of this file.
1 #ifndef __JDETECTOR__JK40RUNBYRUNSIMULATOR__
2 #define __JDETECTOR__JK40RUNBYRUNSIMULATOR__
3 
8 
9 
10 /**
11  * \author mdejong
12  */
13 
14 namespace JDETECTOR {}
15 namespace JPP { using namespace JDETECTOR; }
16 
17 namespace JDETECTOR {
18 
21 
22 
23  /**
24  * K40 simulation based on run-by-run information.
25  *
26  * This class overwrites the method JK40DefaultSimulator::getSinglesRate.
27  * The singles rate is determined from summary data.
28  */
31  {
32  public:
33  /**
34  * Constructor.
35  *
36  * \param router summary router
37  * \param rates K40 rates [Hz]
38  */
40  const JK40Rates& rates) :
41  JK40DefaultSimulator(rates),
42  summary_router(router)
43  {}
44 
45 
46  /**
47  * Get singles rate as a function of PMT.
48  *
49  * \param pmt PMT identifier
50  * \return rate [Hz]
51  */
52  virtual double getSinglesRate(const JPMTIdentifier& pmt) const
53  {
55 
57 
58  return frame.getRate(pmt.getPMTAddress());
59  }
60 
61  return 0.0;
62  }
63 
64 
65  protected:
67  };
68 }
69 
70 #endif
K40 simulation based on run-by-run information.
double getRate(const int tdc, const double factor=1.0) const
Get count rate.
Default implementation of the simulation of K40 background.
Router for fast addressing of summary data in JDAQSummaryslice data structure as a function of the op...
int getModuleID() const
Get module identifier.
Data storage class for rate measurements of all PMTs in one module.
int getPMTAddress() const
Get PMT identifier (= TDC).
const JDAQSummaryFrame & getSummaryFrame(const JDAQModuleIdentifier &module) const
Get summary frame.
JK40RunByRunSimulator(const JSummaryRouter &router, const JK40Rates &rates)
Constructor.
bool hasSummaryFrame(const JDAQModuleIdentifier &module) const
Has summary frame.
virtual double getSinglesRate(const JPMTIdentifier &pmt) const
Get singles rate as a function of PMT.
Auxiliary class for K40 rates.
Definition: JK40Rates.hh:41