 |
Belle II Software
release-05-01-25
|
13 #include <background/modules/BeamBkgHitRateMonitor/HitRateBase.h>
14 #include <framework/datastore/StoreArray.h>
15 #include <cdc/dataobjects/CDCHit.h>
25 namespace Background {
30 class CDCHitRateCounter:
public HitRateBase {
69 for (
int iL = 0 ; iL <
f_nLayer ; ++iL) {
89 const int timeWindowUpperEdge_smallCell,
90 const int timeWindowLowerEdge_normalCell,
91 const int timeWindowUpperEdge_normalCell,
92 const bool enableBadWireTreatment,
93 const bool enableBackgroundHitFilter,
94 const bool enableMarkBackgroundHit):
105 B2FATAL(
"invalid seting of CDC time window");
112 virtual void initialize(TTree* tree)
override;
117 virtual void clear()
override;
123 virtual void accumulate(
unsigned timeStamp)
override;
129 virtual void normalize(
unsigned timeStamp)
override;
139 std::map<unsigned, TreeStruct>
m_buffer;
const int m_timeWindowUpperEdge_smallCell
upper edge of the time window for small cells [tdc count = ns]
StoreArray< CDCHit > m_digits
collection of digits
int numEvents
number of events accumulated
virtual void accumulate(unsigned timeStamp) override
Accumulate hits.
static const int f_nSuperLayer
the number of super layers
virtual void clear() override
Clear time-stamp buffer to prepare for 'accumulate'.
int m_nActiveWireInLayer[f_nLayer]
the number of wires used in this hit-rate calculation in each layer
int timeWindowForSmallCell
time window for the small cells in ns
const bool m_enableBadWireTreatment
flag to enable the bad wire treatment.
int nActiveWireInTotal
number of wires used in this analysis in the whole CDC
const int m_timeWindowUpperEdge_normalCell
upper edge of the time window for normal cells [tdc count = ns]
const int m_timeWindowLowerEdge_normalCell
lower edge of the time window for normal cells [tdc count = ns]
std::map< unsigned, TreeStruct > m_buffer
average rates in time stamps
virtual void initialize(TTree *tree) override
Class initializer: set branch addresses and other staf.
const bool m_enableMarkBackgroundHit
flag to enable to mark background flag on CDCHit (set 0x100 bit for CDCHit::m_status).
int timeWindowForNormalCell
time window for the normal cells in ns
Abstract base class for different kinds of events.
void normalize()
normalize accumulated hits to hit rate in kHz
float superLayerHitRate[f_nSuperLayer]
SuperLayer average hit rate in kHz.
bool valid
status: true = rates valid
float averageRate
total detector average hit rate in KHz
int nActiveWireInSuperLayer[f_nSuperLayer]
number of wires used in this analysis in each super layer
void countActiveWires_countAll()
set m_nActiveWireInTotal, m_nActiveWireInLayer[] and m_nActiveWireInSuperLayer[].
TreeStruct m_rates
tree variables
bool isInTimeWindow(const int SL, const short tdc)
return true if the hit is in the given time window
CDCHitRateCounter(const int timeWindowLowerEdge_smallCell, const int timeWindowUpperEdge_smallCell, const int timeWindowLowerEdge_normalCell, const int timeWindowUpperEdge_normalCell, const bool enableBadWireTreatment, const bool enableBackgroundHitFilter, const bool enableMarkBackgroundHit)
Constructor.
const bool m_enableBackgroundHitFilter
flag to enable the CDC background hit (crosstakl, noise) filter.
void countActiveWires()
set m_nActiveWireInTotal, m_nActiveWireInLayer[] and m_nActiveWireInSuperLayer[].
int m_nActiveWireInTotal
the number of wires used in this hit-rate calculation in the whole CDC
const int m_timeWindowLowerEdge_smallCell
lower edge of the time window for small cells [tdc count = ns]
Accessor to arrays stored in the data store.
float layerHitRate[f_nLayer]
Layer average hit rate in kHz.
int nActiveWireInLayer[f_nLayer]
number of wires used in this analysis in each layer
virtual void normalize(unsigned timeStamp) override
Normalize accumulated hits (e.g.
int m_nActiveWireInSuperLayer[f_nSuperLayer]
the number of wires used in this hit-rate calculation in each suler layer
static const int f_nLayer
the number of layers