Belle II Software  release-08-02-06
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 31 of file ARICHHitRateCounter.h.

Member Function Documentation

◆ accumulate()

void accumulate ( unsigned  timeStamp)
overridevirtual

Accumulate hits.

Parameters
timeStamptime stamp

Implements HitRateBase.

Definition at line 53 of file ARICHHitRateCounter.cc.

54  {
55  // check if data are available
56  if (not m_hits.isValid()) return;
57 
58  // get buffer element
59  auto& rates = m_buffer[timeStamp];
60 
61  // increment event counter
62  rates.numEvents++;
63 
64  // count and weight hits accoring to channel efficiecny
65  for (const auto& hit : m_hits) {
66  if (hit.getModule() < 1 || hit.getModule() > 420) continue;
67  auto effi = m_modulesInfo->getChannelQE(hit.getModule(), hit.getChannel());
68  float wt = std::min(1.0 / effi, 100.);
69  rates.segmentRates[m_segmentMap[hit.getModule() - 1]] += wt;
70  rates.averageRate += wt;
71  }
72 
73  // set flag to true to indicate the rates are valid
74  rates.valid = true;
75 
76  }
std::map< unsigned, TreeStruct > m_buffer
average rates in time stamps
int m_segmentMap[420]
mapping from module ID to segments
StoreArray< ARICHHit > m_hits
collection of digits
DBObjPtr< ARICHModulesInfo > m_modulesInfo
HAPD modules info.

◆ initialize()

void initialize ( TTree *  tree)
overridevirtual

Class initializer: set branch addresses and other staf.

Parameters
treea valid TTree pointer

Implements HitRateBase.

Definition at line 24 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 78 of file ARICHHitRateCounter.cc.


The documentation for this class was generated from the following files: