11#include <background/modules/BeamBkgHitRateMonitor/HitRateBase.h>
12#include <framework/datastore/StoreArray.h>
13#include <cdc/dataobjects/CDCHit.h>
23 namespace Background {
61 for (
int i = 0 ; i <
f_nLayer ; ++i) {
84 for (
int iL = 0 ; iL <
f_nLayer ; ++iL) {
109 const int timeWindowUpperEdge_smallCell,
110 const int timeWindowLowerEdge_normalCell,
111 const int timeWindowUpperEdge_normalCell,
112 const bool enableBadWireTreatment,
113 const bool enableBackgroundHitFilter,
114 const bool enableMarkBackgroundHit):
125 B2FATAL(
"invalid seting of CDC time window");
132 virtual void initialize(TTree* tree)
override;
137 virtual void clear()
override;
143 virtual void accumulate(
unsigned timeStamp)
override;
149 virtual void normalize(
unsigned timeStamp)
override;
216 unsigned short getIPhiBin(
unsigned short iSL,
unsigned short iWireInLayer);
Class for monitoring beam background hit rates of CDC.
static const int f_nLayer
the number of layers
std::map< unsigned, TreeStruct > m_buffer
average rates in time stamps
int m_nActiveWireInLayer[f_nLayer]
the number of wires used in this hit-rate calculation in each layer
TreeStruct m_rates
tree variables
void countActiveWires_countAll()
set m_nActiveWireInTotal, m_nActiveWireInLayer[] and m_nActiveWireInSuperLayer[].
const bool m_enableBackgroundHitFilter
flag to enable the CDC background hit (crosstakl, noise) filter.
bool isInTimeWindow(const int SL, const short tdc)
return true if the hit is in the given time window
virtual void initialize(TTree *tree) override
Class initializer: set branch addresses and other staf.
const int m_timeWindowLowerEdge_normalCell
lower edge of the time window for normal cells [tdc count = 0.982536 ns]
int m_nActiveWireInTotal
the number of wires used in this hit-rate calculation in the whole CDC
StoreArray< CDCHit > m_digits
collection of digits
virtual void accumulate(unsigned timeStamp) override
Accumulate hits.
unsigned short getIPhiBin(unsigned short iSL, unsigned short iWireInLayer)
get the bin ID of the division.
int m_nActiveWireInLayerPhi[f_nLayer][f_nPhiDivision]
the number of wires used in this hit-rate calculation in each phi bin in each layer
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 int m_timeWindowUpperEdge_smallCell
upper edge of the time window for small cells [tdc count = 0.982536 ns]
const bool m_enableBadWireTreatment
flag to enable the bad wire treatment.
const int m_timeWindowUpperEdge_normalCell
upper edge of the time window for normal cells [tdc count = 0.982536 ns]
static const int f_nSuperLayer
the number of super layers
const bool m_enableMarkBackgroundHit
flag to enable to mark background flag on CDCHit (set 0x100 bit for CDCHit::m_status).
static const int f_nPhiDivision
the number of division in phi
void countActiveWires()
set m_nActiveWireInTotal, m_nActiveWireInLayer[] and m_nActiveWireInSuperLayer[].
const int m_timeWindowLowerEdge_smallCell
lower edge of the time window for small cells [tdc count = 0.982536 ns]
int m_nActiveWireInSuperLayer[f_nSuperLayer]
the number of wires used in this hit-rate calculation in each suler layer
virtual void normalize(unsigned timeStamp) override
Normalize accumulated hits (e.g.
virtual void clear() override
Clear time-stamp buffer to prepare for 'accumulate'.
Abstract base class for monitoring beam background hit rates All the monitoring classes must inherit ...
Accessor to arrays stored in the data store.
Abstract base class for different kinds of events.
float superLayerHitRate[f_nSuperLayer]
SuperLayer average hit rate in kHz.
bool valid
status: true = rates valid
float layerPhiHitRate[f_nLayer][f_nPhiDivision]
Layer (in the phi bin) average hit rate in kHz.
int nActiveWireInLayerPhi[f_nLayer][f_nPhiDivision]
number of wires used in this analysis in each phi bin in each layer
int numEvents
number of events accumulated
float layerHitRate[f_nLayer]
Layer average hit rate in kHz.
int nActiveWireInTotal
number of wires used in this analysis in the whole CDC
int nActiveWireInSuperLayer[f_nSuperLayer]
number of wires used in this analysis in each super layer
int nActiveWireInLayer[f_nLayer]
number of wires used in this analysis in each layer
float averageRate
total detector average hit rate in KHz
void normalize()
normalize accumulated hits to hit rate in kHz
int timeWindowForSmallCell
time window for the small cells in 2*508.887 MHz clock ( 1 clock = 0.982536 ns)
int timeWindowForNormalCell
time window for the normal cells in 2*508.887 MHz clock ( 1 clock = 0.982536 ns)