Belle II Software development
CDClayerTimeCut.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 "tracking/trackFindingCDC/topology/ISuperLayer.h"
12#include <boost/property_tree/ptree.hpp>
13#include <boost/property_tree/json_parser.hpp>
14
15namespace Belle2 {
24 class CDClayerTimeCut: public TObject {
25 public:
26
30 CDClayerTimeCut() = default;
31
35 explicit CDClayerTimeCut(boost::property_tree::ptree tree)
36 {
37 try {
38 int iLayer = 0;
39 for (auto& value : tree.get_child("LayerTimeCut")) {
40
41 m_maxDriftTimes[iLayer] = value.second.get_value<float>();
42 iLayer += 1;
44 B2FATAL("Cannot parse CDClayerTimeCut: too many layers");
45 }
46 }
47 } catch (boost::property_tree::ptree_error& e) {
48 // Any problem when parsing the tree?
49 B2FATAL("Cannot parse CDClayerTimeCut requirement information: " << e.what());
50 }
51
52
53 }
54
58 float getLayerTimeCut(int layer) const
59 {
60 return m_maxDriftTimes[layer];
61 }
62
66 void dump() const
67 {
68 std::cout << "Content of CDClayerTimeCut" << std::endl;
69 for (int iLayer = 0; iLayer < TrackFindingCDC::ISuperLayerUtil::c_N; iLayer++) {
70 std::cout << " Layer :" << iLayer << " Cut:" << getLayerTimeCut(iLayer) << std::endl;
71 }
72 }
73
74 private:
76 std::array<float, TrackFindingCDC::ISuperLayerUtil::c_N> m_maxDriftTimes = { -1, -1, -1, -1, -1, -1, -1, -1, -1};
78 };
79
81} // end namespace Belle2
82
Database object for timing offset (t0).
CDClayerTimeCut(boost::property_tree::ptree tree)
Constructor using a boost::property_tree.
ClassDef(CDClayerTimeCut, 1)
ClassDef.
std::array< float, TrackFindingCDC::ISuperLayerUtil::c_N > m_maxDriftTimes
Cut for approximate drift time (super-layer dependent)
CDClayerTimeCut()=default
Default constructor.
void dump() const
Dump information.
float getLayerTimeCut(int layer) const
Return cut value for a given layer.
Abstract base class for different kinds of events.
static const ISuperLayer c_N
Constant representing the total number of cdc superlayers.
Definition: ISuperLayer.h:56