Belle II Software  release-06-02-00
ValidationTreeStruct.cc
1 /**************************************************************************
2  * basf2 (Belle II Analysis Software Framework) *
3  * Author: The Belle II Collaboration *
4  * *
5  * See git log for contributors and copyright holders. *
6  * This file is licensed under LGPL-3.0, see LICENSE.md. *
7  **************************************************************************/
8 
9 #include <top/calibration/ValidationTreeStruct.h>
10 #include <framework/logging/Logger.h>
11 
12 namespace Belle2 {
17  namespace TOP {
18 
20  {
21  expNo = 0;
22  runNo = 0;
23  numTracks = 0;
24  commonT0 = 0;
25  commonT0Err = 0;
26  for (auto& x : moduleT0) x = 0;
27  for (auto& x : moduleT0Err) x = 0;
28  for (auto& x : numTBCalibrated) x = 0;
29  for (auto& x : numT0Calibrated) x = 0;
30  for (auto& x : numActive) x = 0;
31  for (auto& x : numActiveCalibrated) x = 0;
32  for (auto& x : thrEffi) x = 0;
33  for (auto& x : asicShifts) x = 0;
34  numMerged = 0;
35  }
36 
38  {
39  if (numMerged == 0) {
40  *this = other;
41  } else {
42  if (expNo != other.expNo or runNo != other.runNo) {
43  B2ERROR("TOP::ValidationTreeStruct: experiment and run numbers must be equal - objects not merged");
44  return;
45  }
46  numTracks += other.numTracks;
48  for (unsigned i = 0; i < c_numModules; i++) {
49  add(moduleT0[i], moduleT0Err[i], other.moduleT0[i], other.moduleT0Err[i]);
50  }
51  }
52  numMerged++;
53  }
54 
55  void ValidationTreeStruct::rescaleErrors(double scaleFactor)
56  {
57  commonT0Err *= scaleFactor;
58  for (auto& x : moduleT0Err) x *= scaleFactor;
59  }
60 
61  } // end namespace TOP
63 } // end namespace Belle2
64 
65 
Abstract base class for different kinds of events.
Calibration validation tree structure.
int numTBCalibrated[c_numModules]
number of timebase calibrated channels, index = slot - 1
void rescaleErrors(double scaleFactor)
Rescale errors.
int numMerged
number of merged entries
int numTracks
number of selected tracks
int numActive[c_numModules]
number of active channels, index = slot - 1
void merge(const ValidationTreeStruct &other)
Merge two structures.
float commonT0Err
common T0 uncertainty (not scaled)
float thrEffi[c_numModules]
threshold efficiency: average over active calibrated channels, index = slot - 1
float moduleT0[c_numModules]
module T0 residuals, index = slot - 1
int numActiveCalibrated[c_numModules]
number of active calibrated channels, index = slot - 1
void clear()
Clear the structure.
float moduleT0Err[c_numModules]
module T0 uncertainties (not scaled), index = slot - 1
void add(float &x, float &e, float x1, float e1)
Add (x1, e1) to (x, e) using weighting by errors (e.g.
float asicShifts[4]
carrier shifts of BS13d, index = carrier number
int numT0Calibrated[c_numModules]
number of channel T0 calibrated channels, index = slot - 1