Belle II Software light-2406-ragdoll
KFitVariables.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// Own header.
10#include <analysis/variables/KFitVariables.h>
11
12// include VariableManager
13#include <analysis/VariableManager/Manager.h>
14
15#include <analysis/dataobjects/Particle.h>
16
17#include <framework/logging/Logger.h>
18
19using namespace std;
20
21namespace Belle2 {
26 namespace Variable {
27
28// Chi2 and Prob -------------------------------------------
29
30 double FourCKFitChi2(const Particle* part)
31 {
32 if (part->hasExtraInfo("FourCFitChi2")) return part->getExtraInfo("FourCFitChi2");
33 else {
34 B2WARNING("The ExtraInfo 'FourCFitChi2' could not be found!");
35 return Const::doubleNaN;
36 }
37 }
38
39 double FourCKFitProb(const Particle* part)
40 {
41 if (part->hasExtraInfo("FourCFitProb")) return part->getExtraInfo("FourCFitProb");
42 else {
43 B2WARNING("The ExtraInfo 'FourCFitProb' could not be found!");
44 return Const::doubleNaN;
45 }
46 }
47
48 double Chi2TracksLBoost(const Particle* part)
49 {
50 if (part->hasExtraInfo("chiSquared_trackL")) return part->getExtraInfo("chiSquared_trackL");
51 else {
52 B2WARNING("The ExtraInfo 'chiSquared_trackL' could not be found!");
53 return Const::doubleNaN;
54 }
55 }
56
57 double KFitnTracks(const Particle* part)
58 {
59 if (part->hasExtraInfo("kFit_nTracks")) return part->getExtraInfo("kFit_nTracks");
60 else {
61 B2WARNING("The ExtraInfo 'kFit_nTracks' could not be found!");
62 return Const::doubleNaN;
63 }
64 }
65
66 VARIABLE_GROUP("KFit variables");
67 REGISTER_VARIABLE("FourCKFitChi2", FourCKFitChi2, "Chi2 of four momentum-constraint kinematical fit in KFit");
68 REGISTER_VARIABLE("FourCKFitProb", FourCKFitProb, "Prob of four momentum-constraint kinematical fit in KFit");
69
70 REGISTER_VARIABLE("TracksLBoostChi2", Chi2TracksLBoost,
71 "indicator of vertex KFit quality based on accumulated change of track positions");
72 REGISTER_VARIABLE("KFit_nTracks", KFitnTracks, "number of tracks used in the vertex KFit");
73 }
75}
static const double doubleNaN
quiet_NaN
Definition: Const.h:703
Abstract base class for different kinds of events.
Definition: ClusterUtils.h:24
STL namespace.