Belle II Software development
binnedEventT0.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#include <framework/dataobjects/BinnedEventT0.h>
9#include <gtest/gtest.h>
10
11using namespace Belle2;
12
13namespace {
14
16 TEST(BinnedEventT0, Basic)
17 {
19
20 ASSERT_FALSE(t0.hasBinnedEventT0(Const::SVD));
21 ASSERT_EQ(t0.getBinnedEventT0(Const::SVD), 0);
22
23 t0.addBinnedEventT0(-10, Const::SVD);
24 ASSERT_TRUE(t0.hasBinnedEventT0(Const::SVD));
25 ASSERT_FALSE(t0.hasBinnedEventT0(Const::CDC));
26 ASSERT_EQ(t0.getBinnedEventT0(Const::SVD), -10);
27 ASSERT_EQ(t0.getBinnedEventT0(Const::CDC), 0);
28
29 t0.clear();
30 ASSERT_FALSE(t0.hasBinnedEventT0(Const::SVD));
31 ASSERT_EQ(t0.getBinnedEventT0(Const::SVD), 0);
32 }
33}
Database object for storing a binned EventT0 coming from the trigger.
Definition: BinnedEventT0.h:33
bool hasBinnedEventT0(const Const::EDetector detector) const
Check if one of the detectors in the given set has a binned t0 estimation.
int getBinnedEventT0(const Const::EDetector detector) const
Return the stored binned event t0 for the given detector or 0 if nothing stored.
void addBinnedEventT0(int eventT0, Const::EDetector detector)
Store a binned event t0 for the given detector replacing any other hypothesis for this detector.
void clear()
Clear the list of extracted event T0 estimations.
Abstract base class for different kinds of events.