Jpp 19.3.0-rc.3
the software that should make you happy
Loading...
Searching...
No Matches
JRECONSTRUCTION::JModuleL0 Struct Reference

Auxiliary class for handling module response. More...

#include <JModuleL0.hh>

Inheritance diagram for JRECONSTRUCTION::JModuleL0:
std::vector< JHitR0 >

Public Member Functions

 JModuleL0 ()
 Default constructor.
 
 JModuleL0 (const JModule &module, const JDAQSummaryFrame &frame, const std::vector< JHitR0 > &data)
 Constructor.
 
const JModuleoperator-> () const
 Smart pointer.
 
bool getStatus (const int pmt) const
 Get status of PMT.
 
double getProbability (const JRateL1_t &R_Hz, const JTimeRange &T_ns) const
 Get probability of response in optical module due to random background.
 

Public Attributes

JModule module
 
JDAQSummaryFrame frame
 

Detailed Description

Auxiliary class for handling module response.

Definition at line 43 of file JModuleL0.hh.

Constructor & Destructor Documentation

◆ JModuleL0() [1/2]

JRECONSTRUCTION::JModuleL0::JModuleL0 ( )
inline

Default constructor.

Definition at line 49 of file JModuleL0.hh.

50 {}

◆ JModuleL0() [2/2]

JRECONSTRUCTION::JModuleL0::JModuleL0 ( const JModule & module,
const JDAQSummaryFrame & frame,
const std::vector< JHitR0 > & data )
inline

Constructor.

Parameters
modulemodule
frameframe
datadata

Definition at line 60 of file JModuleL0.hh.

Member Function Documentation

◆ operator->()

const JModule * JRECONSTRUCTION::JModuleL0::operator-> ( ) const
inline

Smart pointer.

Returns
module

Definition at line 74 of file JModuleL0.hh.

75 {
76 return &module;
77 }

◆ getStatus()

bool JRECONSTRUCTION::JModuleL0::getStatus ( const int pmt) const
inline

Get status of PMT.

Parameters
pmtPMT
Returns
true is valid; else false

Definition at line 86 of file JModuleL0.hh.

87 {
88 using namespace JPP;
89
90 return (getDAQStatus(frame, module, pmt) &&
91 getPMTStatus(frame, module, pmt) &&
92 frame[pmt].is_valid() &&
94 }
const JPMT & getPMT(const int index) const
Get PMT.
Definition JModule.hh:172
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
bool is_valid(const json &js)
Check validity of JSon data.
bool getDAQStatus(const JDAQFrameStatus &frame, const JStatus &status)
Test status of DAQ.
bool getPMTStatus(const JStatus &status)
Test status of PMT.
static const int PMT_DISABLE
KM3NeT Data Definitions v3.6.0 https://git.km3net.de/common/km3net-dataformat.
Definition pmt_status.hh:12
bool has(const int bit) const
Test PMT status.
Definition JStatus.hh:120

◆ getProbability()

double JRECONSTRUCTION::JModuleL0::getProbability ( const JRateL1_t & R_Hz,
const JTimeRange & T_ns ) const
inline

Get probability of response in optical module due to random background.

Parameters
R_Hzmultiples rates [Hz]
T_nstime window [ns]
Returns
probability

Definition at line 104 of file JModuleL0.hh.

106 {
107 using namespace std;
108 using namespace JPP;
109
111
112 for (const_iterator hit = this->begin(); hit != this->end(); ++hit) {
113 if (T_ns(hit->getT())) {
114 top.insert(hit->getPMT());
115 }
116 }
117
118 size_t N = 0; // number of active PMTs
119 size_t M = 0; // multiplicity
120 double R = 0.0; // total rate
121
122 for (size_t i = 0; i != module.size(); ++i) {
123 if (getStatus(i)) {
124 N += 1;
125 M += top.count(i);
126 R += frame.getRate(i);
127 }
128 }
129
130 if (N != 0)
131 return JFIT::getProbability(N, M, JK40Rates(R/N, R_Hz), (T_ns.getUpperLimit() - T_ns.getLowerLimit()));
132 else
133 return (M == 0 ? 1.0 : 0.0);
134 }
T getLowerLimit() const
Get lower limit.
Definition JRange.hh:202
T getUpperLimit() const
Get upper limit.
Definition JRange.hh:213
double getRate(const int tdc, const double factor=1.0) const
Get count rate.
double getProbability(const size_t N, const size_t M, const JK40Rates &R_Hz, const double T_ns)
Get probability due to random background.
Auxiliary class for K40 rates.
Definition JK40Rates.hh:41
bool getStatus(const int pmt) const
Get status of PMT.
Definition JModuleL0.hh:86

Member Data Documentation

◆ module

JModule JRECONSTRUCTION::JModuleL0::module

Definition at line 136 of file JModuleL0.hh.

◆ frame

JDAQSummaryFrame JRECONSTRUCTION::JModuleL0::frame

Definition at line 137 of file JModuleL0.hh.


The documentation for this struct was generated from the following file: