Belle II Software prerelease-10-00-00a
DAFConfiguration.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#pragma once
9
10#include <TObject.h>
11#include <map>
12
13#include <tracking/dbobjects/DAFParameters.h>
14#include <framework/logging/Logger.h>
15
16namespace Belle2 {
21
25 class DAFConfiguration: public TObject {
26
27 public:
28
33 enum ETrackFitType : short {
37 };
38
43
47 {
48 std::map<DAFConfiguration::ETrackFitType, DAFParameters>::const_iterator it = m_DAFParameters.find(trackFitType);
49 if (it != m_DAFParameters.end()) {
50 return &it->second;
51 } else {
52 B2FATAL("Track Fit option " << trackFitType << " not found");
53 }
54 }
55
59 {
60 if (DAFParam == nullptr) {
61 B2FATAL("Cannot set DAFParameters since the parameter is nullptr");
62 }
63
64 std::map<DAFConfiguration::ETrackFitType, DAFParameters>::const_iterator it = m_DAFParameters.find(trackFitType);
65
66 if (it != m_DAFParameters.end()) {
67 // if it does already exist
68 B2INFO("DAFParameters for track Fit option " << trackFitType << " already exists. Overwriting.");
69 }
70
71 // Setting the corresponding DAFParameter
72 m_DAFParameters[trackFitType] = *DAFParam;
73 }
74
75 private:
77 std::map<DAFConfiguration::ETrackFitType, DAFParameters> m_DAFParameters;
78
80 };
81
82}
ETrackFitType
Enum for identifying the type of track fit algorythm ( or cosmic)
@ c_CDConly
configuration for the CDC-only track fitting
@ c_Cosmics
configuration for cosmics data reconstruction
@ c_Default
default configuration
ClassDef(DAFConfiguration, 1)
ClassDef, necessary for ROOT.
const DAFParameters * getDAFParameters(DAFConfiguration::ETrackFitType trackFitType) const
Get the DAFParameters for the specific track fit type.
void setDAFParameters(DAFConfiguration::ETrackFitType trackFitType, const DAFParameters *DAFParam)
Set the DAFParameters for the specific track fit type.
std::map< DAFConfiguration::ETrackFitType, DAFParameters > m_DAFParameters
The minimum allowed pValue for the convergence criterion.
DAFConfiguration()
Default constructor.
The payload containing the DAF parameters.
Abstract base class for different kinds of events.