Jpp  18.0.1-rc.2
the software that should make you happy
 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 
5 
6 #include "JPhysics/JK40Rates.hh"
10 
11 
12 /**
13  * \author mdejong
14  */
15 
16 namespace JTRIGGER {}
17 namespace JPP { using namespace JTRIGGER; }
18 
19 namespace JTRIGGER {
20 
22  using JPHYSICS::JK40Rates;
25 
26 
27  /**
28  * K40 simulation based on run-by-run information.
29  *
30  * This class overwrites the method JK40DefaultSimulator::getSinglesRate.
31  * The actual singles rate is obtained from summary data.
32  */
35  {
36  public:
37  /**
38  * Constructor.
39  *
40  * \param router summary router
41  * \param rates K40 rates [Hz]
42  */
44  const JK40Rates& rates) :
45  JK40DefaultSimulator(rates),
46  summary_router(router)
47  {}
48 
49 
50  /**
51  * Get singles rate as a function of PMT.
52  *
53  * \param pmt PMT identifier
54  * \return rate [Hz]
55  */
56  virtual double getSinglesRate(const JPMTIdentifier& pmt) const override
57  {
59 
61 
62  return getRate(frame, pmt.getPMTAddress());
63  }
64 
65  return 0.0;
66  }
67 
68 
69  protected:
71  };
72 }
73 
74 #endif
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.
K40 simulation based on run-by-run information.
JK40RunByRunSimulator(const JSummaryRouter &router, const JK40Rates &rates)
Constructor.
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.
int getPMTAddress() const
Get PMT address (= TDC).
const JDAQSummaryFrame & getSummaryFrame(const JDAQModuleIdentifier &module) const
Get summary frame.
virtual double getSinglesRate(const JPMTIdentifier &pmt) const override
Get singles rate as a function of PMT.
bool hasSummaryFrame(const JDAQModuleIdentifier &module) const
Has summary frame.
Auxiliary class for K40 rates.
Definition: JK40Rates.hh:41