Belle II Software development
MLRange.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
11#include <TTree.h>
12#include <array>
13
14namespace Belle2 {
28 template<typename ClassifierType, size_t Ndims = 9, typename CutType = double>
29 class MLRange {
31 ClassifierType* m_classifier;
33 CutType m_cut;
34
35 public:
40 MLRange(ClassifierType* classifier, CutType cut) : m_classifier(classifier), m_cut(cut) { ; }
41
48 inline bool contains(std::array<double, Ndims> hits) const { return !(m_classifier->analyze(hits) < m_cut); }
49
55 void persist(TTree* /*t*/, const std::string& /*branchname*/, const std::string& /*variablename*/)
56 {
57 // TODO
58 }
59 };
61}
Range used for the Machine Learning assisted TrackFinding approach.
Definition: MLRange.h:29
CutType m_cut
Cut value.
Definition: MLRange.h:33
bool contains(std::array< double, Ndims > hits) const
method used to decide if a hit combination passes the Machine Learning filter
Definition: MLRange.h:48
ClassifierType * m_classifier
Pointer to classifier to be used.
Definition: MLRange.h:31
void persist(TTree *, const std::string &, const std::string &)
For Storing this range.
Definition: MLRange.h:55
MLRange(ClassifierType *classifier, CutType cut)
Constructor.
Definition: MLRange.h:40
Abstract base class for different kinds of events.