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 
5 
9 
10 
11 /**
12  * \author mdejong
13  */
14 
15 namespace JTRIGGER {}
16 namespace JPP { using namespace JTRIGGER; }
17 
18 namespace JTRIGGER {
19 
24 
25 
26  /**
27  * K40 simulation based on run-by-run information.
28  *
29  * This class overwrites the method JK40DefaultSimulator::getSinglesRate.
30  * The actual singles rate is obtained from summary data.
31  */
34  {
35  public:
36  /**
37  * Constructor.
38  *
39  * \param router summary router
40  * \param rates K40 rates [Hz]
41  */
43  const JK40Rates& rates) :
44  JK40DefaultSimulator(rates),
45  summary_router(router)
46  {}
47 
48 
49  /**
50  * Get singles rate as a function of PMT.
51  *
52  * \param pmt PMT identifier
53  * \return rate [Hz]
54  */
55  virtual double getSinglesRate(const JPMTIdentifier& pmt) const
56  {
58 
60 
61  return getRate(frame, pmt.getPMTAddress());
62  }
63 
64  return 0.0;
65  }
66 
67 
68  protected:
70  };
71 }
72 
73 #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.
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
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 identifier (= TDC).
const JDAQSummaryFrame & getSummaryFrame(const JDAQModuleIdentifier &module) const
Get summary frame.
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