Belle II Software development
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
12namespace 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 svdOffset = 0;
35 svdSigma = 0;
36 cdcOffset = 0;
37 cdcSigma = 0;
39 numMerged = 0;
40 }
41
43 {
44 if (numMerged == 0) {
45 *this = other;
46 } else {
47 if (expNo != other.expNo or runNo != other.runNo) {
48 B2ERROR("TOP::ValidationTreeStruct: experiment and run numbers must be equal - objects not merged");
49 return;
50 }
51 numTracks += other.numTracks;
53 for (unsigned i = 0; i < c_numModules; i++) {
54 add(moduleT0[i], moduleT0Err[i], other.moduleT0[i], other.moduleT0Err[i]);
55 }
56 }
57 numMerged++;
58 }
59
60 void ValidationTreeStruct::rescaleErrors(double scaleFactor)
61 {
62 commonT0Err *= scaleFactor;
63 for (auto& x : moduleT0Err) x *= scaleFactor;
64 }
65
66 } // end namespace TOP
68} // end namespace Belle2
69
70
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
float svdOffset
SVD event T0 offset.
float svdSigma
SVD event T0 resolution.
void merge(const ValidationTreeStruct &other)
Merge two structures.
float fillPatternOffset
fill pattern offset
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
float cdcSigma
CDC event T0 resolution.
void clear()
Clear the structure.
float cdcOffset
CDC event T0 offset.
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