Belle II Software  release-05-01-25
ARICHHitRateCounter Class Reference

Class for monitoring beam background hit rates of ARICH. More...

#include <ARICHHitRateCounter.h>

Inheritance diagram for ARICHHitRateCounter:
Collaboration diagram for ARICHHitRateCounter:

Classes

struct  TreeStruct
 tree structure More...
 

Public Member Functions

 ARICHHitRateCounter ()
 Constructor.
 
virtual void initialize (TTree *tree) override
 Class initializer: set branch addresses and other staf. More...
 
virtual void clear () override
 Clear time-stamp buffer to prepare for 'accumulate'.
 
virtual void accumulate (unsigned timeStamp) override
 Accumulate hits. More...
 
virtual void normalize (unsigned timeStamp) override
 Normalize accumulated hits (e.g. More...
 

Private Member Functions

void setActiveHapds ()
 Sets number of active hapds in each segment.
 

Private Attributes

TreeStruct m_rates
 tree variables
 
std::map< unsigned, TreeStructm_buffer
 average rates in time stamps
 
StoreArray< ARICHHitm_hits
 collection of digits
 
DBObjPtr< ARICHChannelMaskm_channelMask
 channel mask
 
DBObjPtr< ARICHModulesInfom_modulesInfo
 HAPD modules info.
 
double m_activeHapds [18] = {0}
 number of active HAPDS in each segment
 
double m_activeTotal = 0
 total number of active HAPDS
 
int m_segmentMap [420] = {0}
 mapping from module ID to segments
 

Detailed Description

Class for monitoring beam background hit rates of ARICH.

Definition at line 41 of file ARICHHitRateCounter.h.

Member Function Documentation

◆ accumulate()

void accumulate ( unsigned  timeStamp)
overridevirtual

Accumulate hits.

Parameters
timeStamptime stamp

Implements HitRateBase.

Definition at line 55 of file ARICHHitRateCounter.cc.

56  {
57  // check if data are available
58  if (not m_hits.isValid()) return;
59 
60  // get buffer element
61  auto& rates = m_buffer[timeStamp];
62 
63  // increment event counter
64  rates.numEvents++;
65 
66  // count and weight hits accoring to channel efficiecny
67  for (const auto& hit : m_hits) {
68  if (hit.getModule() < 1 || hit.getModule() > 420) continue;
69  auto effi = m_modulesInfo->getChannelQE(hit.getModule(), hit.getChannel());
70  float wt = std::min(1.0 / effi, 100.);
71  rates.segmentRates[m_segmentMap[hit.getModule() - 1]] += wt;
72  rates.averageRate += wt;
73  }
74 
75  // set flag to true to indicate the rates are valid
76  rates.valid = true;
77 
78  }

◆ initialize()

void initialize ( TTree *  tree)
overridevirtual

Class initializer: set branch addresses and other staf.

Parameters
treea valid TTree pointer

Implements HitRateBase.

Definition at line 26 of file ARICHHitRateCounter.cc.

◆ normalize()

void normalize ( unsigned  timeStamp)
overridevirtual

Normalize accumulated hits (e.g.

transform to rates)

Parameters
timeStamptime stamp

Implements HitRateBase.

Definition at line 80 of file ARICHHitRateCounter.cc.


The documentation for this class was generated from the following files:
Belle2::Background::ARICHHitRateCounter::m_modulesInfo
DBObjPtr< ARICHModulesInfo > m_modulesInfo
HAPD modules info.
Definition: ARICHHitRateCounter.h:114
Belle2::Background::ARICHHitRateCounter::m_hits
StoreArray< ARICHHit > m_hits
collection of digits
Definition: ARICHHitRateCounter.h:110
Belle2::Background::ARICHHitRateCounter::m_buffer
std::map< unsigned, TreeStruct > m_buffer
average rates in time stamps
Definition: ARICHHitRateCounter.h:107
Belle2::Background::ARICHHitRateCounter::m_segmentMap
int m_segmentMap[420]
mapping from module ID to segments
Definition: ARICHHitRateCounter.h:119