Belle II Software development
CutsFromDBWireHitFilter.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 <tracking/trackFindingCDC/filters/wireHit/BaseWireHitFilter.h>
11#include <framework/database/DBObjPtr.h>
12#include <cdc/dbobjects/CDCWireHitRequirements.h>
13
14namespace Belle2 {
19 namespace TrackFindingCDC {
20 class CDCWireHit;
21
24
25 public:
26
29
31 virtual ~CutsFromDBWireHitFilter() = default;
32
34 void initialize() final;
35
37 void beginRun() final;
38
40 Weight operator()(const CDCWireHit& wireHit) final;
41
42 private:
43
47
50 template <typename T>
51 bool isInRange(const T& value, const std::pair<T, T>& range) const;
52
55 template <typename T>
56 bool isLessThanOrEqualTo(const T& value, const T& upper_value) const;
57
60
63 };
64 }
66}
Database object containing cut values to filter CDCWireHits.
Class for accessing objects in the database.
Definition: DBObjPtr.h:21
Class representing a hit wire in the central drift chamber.
Definition: CDCWireHit.h:55
Filter rejecting hits according to DB values.
std::unique_ptr< DBObjPtr< CDCWireHitRequirements > > m_CDCWireHitRequirementsFromDB
Cut values from the Data Base.
void initialize() final
Called at the beginning of the processing.
void beginRun() final
Called when a new run is started.
bool isInRange(const T &value, const std::pair< T, T > &range) const
Check if value >= range.first and value <= range.second If range.second == -1, then check only if val...
void checkIfDBObjPtrIsValid()
Check if m_CDCWireHitRequirementsFromDB is valid and set m_DBPtrIsValidForCurrentRun accordingly.
virtual ~CutsFromDBWireHitFilter()=default
Default destructor.
bool m_DBPtrIsValidForCurrentRun
Boolean asserting if DBObjPtr is valid for the current run.
bool isLessThanOrEqualTo(const T &value, const T &upper_value) const
Check if value <= upper_value If upper_value == -1, then return true.
Base class for filters on a generic object type.
Definition: Filter.dcl.h:31
Abstract base class for different kinds of events.
STL namespace.