Belle II Software  release-06-01-15
ValidationTreeStruct.h
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 #pragma once
10 #include <cmath>
11 
12 namespace Belle2 {
17  namespace TOP {
18 
23  enum {c_numModules = 16};
24  int expNo = 0;
25  int runNo = 0;
26  int numTracks = 0;
27  float commonT0 = 0;
28  float commonT0Err = 0;
29  float moduleT0[c_numModules] = {0};
30  float moduleT0Err[c_numModules] = {0};
31  int numTBCalibrated[c_numModules] = {0};
32  int numT0Calibrated[c_numModules] = {0};
33  int numActive[c_numModules] = {0};
34  int numActiveCalibrated[c_numModules] = {0};
35  float thrEffi[c_numModules] = {0};
36  float asicShifts[4] = {0};
37  int numMerged = 0;
42  void clear();
43 
47  void clearNumMerged() {numMerged = 0;}
48 
53  void merge(const ValidationTreeStruct& other);
54 
59  void rescaleErrors(double scaleFactor);
60 
68  void add(float& x, float& e, float x1, float e1);
69 
70  };
71 
72 
73  inline void ValidationTreeStruct::add(float& x, float& e, float x1, float e1)
74  {
75  if (e1 == 0) return;
76  if (e == 0) {
77  x = x1;
78  e = e1;
79  return;
80  }
81  e *= e;
82  e1 *= e1;
83  float s = 1 / e + 1 / e1;
84  x = (x / e + x1 / e1) / s;
85  e = sqrt(1 / s);
86  }
87 
88  } // TOP
90 } // Belle2
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 clearNumMerged()
Clear the number of merged entries.
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