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

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

#include <SVDHitRateCounter.h>

Inheritance diagram for SVDHitRateCounter:
Collaboration diagram for SVDHitRateCounter:

Classes

struct  TreeStruct
 tree structure More...
 

Public Member Functions

 SVDHitRateCounter (const std::string &svdShaperDigitsName, double thrCharge)
 Constructor. More...
 
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...
 
virtual void normalize_rates (TreeStruct &rates)
 Normalize TreeStruct. More...
 
int nStripsOnLayerSide (int layer, bool isU)
 Return number of strips on a sensor. More...
 

Private Attributes

int m_nLayers = 4
 number of layers
 
int m_nLadders [4] = {7, 10, 12, 16}
 number of ladders on each layer
 
int m_nSensors [4] = {2, 3, 4, 5}
 number of sensors on a ladder on each layer
 
TreeStruct m_rates
 tree variables for fired strips
 
TreeStruct m_rates_highE
 tree variables for high-energy clusters
 
TreeStruct m_rates_lowE
 tree variables for low-energy clusters
 
std::map< unsigned, TreeStructm_buffer
 average strip occupancies in time stamps
 
std::map< unsigned, TreeStructm_buffer_highE
 average cluster occupancies (high energy) in time stamps
 
std::map< unsigned, TreeStructm_buffer_lowE
 average cluster occupancies (low energy) in time stamps
 
StoreArray< SVDShaperDigitm_digits
 collection of digits
 
StoreArray< SVDClusterm_clusters
 collection of clusters
 
StoreObjPtr< SoftwareTriggerResultm_resultStoreObjectPointer
 trigger decision
 
SVDHotStripsCalibrations m_HotStripsCalib
 payload for hot strips
 
SVDFADCMaskedStrips m_FADCMaskedStrips
 payload for strips masked on FADC level
 
std::string m_svdShaperDigitsName
 name of the input SVDShaperDigits collection
 
int m_activeStrips = 0
 number of active strips
 
int m_layerActiveStrips [4] = {0}
 number of active strips in each layer
 
int m_layerLadderActiveStrips [4][16] = {0}
 number of active strips in each layer, ladder
 
int m_layerSensorActiveStrips [4][5] = {0}
 number of active strips in each layer, sensor position
 
int m_l3LadderSensorActiveStrips [7][2] = {0}
 number of active strips in each sensor in Layer 3
 
double m_thrCharge = 0
 cut on cluster energy in electrons
 

Detailed Description

Class for monitoring beam background hit rates of SVD.

Definition at line 43 of file SVDHitRateCounter.h.

Constructor & Destructor Documentation

◆ SVDHitRateCounter()

SVDHitRateCounter ( const std::string &  svdShaperDigitsName,
double  thrCharge 
)
inlineexplicit

Constructor.

Parameters
svdShaperDigitsNamename of the input SVDShaperDigits collection
thrChargecut on cluster energy in electrons

Definition at line 90 of file SVDHitRateCounter.h.

121  {

Member Function Documentation

◆ accumulate()

void accumulate ( unsigned  timeStamp)
overridevirtual

Accumulate hits.

Parameters
timeStamptime stamp

Implements HitRateBase.

Definition at line 84 of file SVDHitRateCounter.cc.

85  {
86  B2DEBUG(10, "SVDHitRateCounter: accumulate()");
87 
88  // check if the event has passed HLT filter
89  if (m_resultStoreObjectPointer.isValid()) {
91  if (!eventAccepted) return;
92  }
93 
94  // check if data are available
95  if (m_digits.isValid()) {
96 
97  // get buffer element
98  auto& rates = m_buffer[timeStamp];
99 
100  // increment event counter
101  rates.numEvents++;
102 
103  // accumulate hits
104  for (const auto& digit : m_digits) {
105  // select digits to count (usualy only good ones)
106  VxdID sensorID = digit.getSensorID();
107  int layer = sensorID.getLayerNumber() - 3;
108  int ladder = sensorID.getLadderNumber() - 1;
109  int sensor = sensorID.getSensorNumber() - 1;
110  rates.layerAverageRates[layer] ++;
111  rates.layerLadderAverageRates[layer][ladder] ++;
112  rates.layerSensorAverageRates[layer][sensor] ++;
113  rates.averageRate ++;
114  if (layer == 0)
115  rates.l3LadderSensorAverageRates[ladder][sensor] ++;
116  }
117 
118  // set flag to true to indicate the rates are valid
119  rates.valid = true;
120  }
121 
122  // check if data are available
123  if (m_clusters.isValid()) {
124 
125  // get buffer element
126  auto& rates_highE = m_buffer_highE[timeStamp];
127  auto& rates_lowE = m_buffer_lowE[timeStamp];
128 
129  // increment event counter
130  rates_highE.numEvents++;
131  rates_lowE.numEvents++;
132 
133  // accumulate clusters
134  for (const auto& cluster : m_clusters) {
135  VxdID sensorID = cluster.getSensorID();
136  int layer = sensorID.getLayerNumber() - 3;
137  int ladder = sensorID.getLadderNumber() - 1;
138  int sensor = sensorID.getSensorNumber() - 1;
139  if (cluster.getCharge() > m_thrCharge) {
140  rates_highE.layerAverageRates[layer] ++;
141  rates_highE.layerLadderAverageRates[layer][ladder] ++;
142  rates_highE.layerSensorAverageRates[layer][sensor] ++;
143  rates_highE.averageRate ++;
144  if (layer == 0)
145  rates_highE.l3LadderSensorAverageRates[ladder][sensor] ++;
146  } else {
147  rates_lowE.layerAverageRates[layer] ++;
148  rates_lowE.layerLadderAverageRates[layer][ladder] ++;
149  rates_lowE.layerSensorAverageRates[layer][sensor] ++;
150  rates_lowE.averageRate ++;
151  if (layer == 0)
152  rates_lowE.l3LadderSensorAverageRates[ladder][sensor] ++;
153  }
154  }
155 
156  // set flag to true to indicate the rates are valid
157  rates_highE.valid = true;
158  rates_lowE.valid = true;
159  }
160 
161  }

◆ initialize()

void initialize ( TTree *  tree)
overridevirtual

Class initializer: set branch addresses and other staf.

Parameters
treea valid TTree pointer

Implements HitRateBase.

Definition at line 27 of file SVDHitRateCounter.cc.

◆ normalize()

void normalize ( unsigned  timeStamp)
overridevirtual

Normalize accumulated hits (e.g.

transform to rates)

Parameters
timeStamptime stamp

Implements HitRateBase.

Definition at line 163 of file SVDHitRateCounter.cc.

◆ normalize_rates()

void normalize_rates ( TreeStruct rates)
virtual

Normalize TreeStruct.

Parameters
ratesTreeStruct to be normalized

Definition at line 176 of file SVDHitRateCounter.cc.

◆ nStripsOnLayerSide()

int nStripsOnLayerSide ( int  layer,
bool  isU 
)
inline

Return number of strips on a sensor.

Parameters
layerlayer number of the sensor (starting from 0)
isUtrue if the sensor is U side, false if V.

Definition at line 128 of file SVDHitRateCounter.h.


The documentation for this class was generated from the following files:
Belle2::Background::SVDHitRateCounter::m_resultStoreObjectPointer
StoreObjPtr< SoftwareTriggerResult > m_resultStoreObjectPointer
trigger decision
Definition: SVDHitRateCounter.h:156
Belle2::Background::SVDHitRateCounter::m_thrCharge
double m_thrCharge
cut on cluster energy in electrons
Definition: SVDHitRateCounter.h:169
Belle2::Background::SVDHitRateCounter::m_clusters
StoreArray< SVDCluster > m_clusters
collection of clusters
Definition: SVDHitRateCounter.h:153
Belle2::Background::SVDHitRateCounter::m_digits
StoreArray< SVDShaperDigit > m_digits
collection of digits
Definition: SVDHitRateCounter.h:152
Belle2::SoftwareTrigger::FinalTriggerDecisionCalculator::getFinalTriggerDecision
static bool getFinalTriggerDecision(const SoftwareTriggerResult &result, bool forgetTotalResult=false)
Calculate the final cut decision using all "total_results" of all sub triggers in the software trigge...
Definition: FinalTriggerDecisionCalculator.cc:17
Belle2::Background::SVDHitRateCounter::m_buffer_highE
std::map< unsigned, TreeStruct > m_buffer_highE
average cluster occupancies (high energy) in time stamps
Definition: SVDHitRateCounter.h:148
Belle2::Background::SVDHitRateCounter::m_buffer
std::map< unsigned, TreeStruct > m_buffer
average strip occupancies in time stamps
Definition: SVDHitRateCounter.h:147
Belle2::StoreArray::isValid
bool isValid() const
Check wether the array was registered.
Definition: StoreArray.h:298
Belle2::Background::SVDHitRateCounter::m_buffer_lowE
std::map< unsigned, TreeStruct > m_buffer_lowE
average cluster occupancies (low energy) in time stamps
Definition: SVDHitRateCounter.h:149