Belle II Software development
eclCalDigit.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 <ecl/dataobjects/ECLCalDigit.h>
9
10#include <gtest/gtest.h>
11
12using namespace std;
13
14namespace Belle2 {
21 class ECLCalDigitTest : public ::testing::Test {
22 };
23
25 TEST_F(ECLCalDigitTest, Constructors)
26 {
27 ECLCalDigit myECLCalDigit;
28 EXPECT_EQ(myECLCalDigit.getCellId(), 0);
29 EXPECT_EQ(myECLCalDigit.getEnergy(), 0);
30 EXPECT_EQ(myECLCalDigit.getTime(), 0);
31 EXPECT_EQ(myECLCalDigit.getTimeResolution(), 0);
32 } // Testcases for Constructors
33
35 TEST_F(ECLCalDigitTest, SettersAndGetters)
36 {
37 const int cellId = 1;
38 const double energy = 2.1;
39 const double time = 2.2;
40 const double timeres = 2.3;
41
42 ECLCalDigit myECLCalDigit;
43 myECLCalDigit.setCellId(cellId);
44 myECLCalDigit.setEnergy(energy);
45 myECLCalDigit.setTime(time);
46 myECLCalDigit.setTimeResolution(timeres);
47
48 EXPECT_EQ(myECLCalDigit.getCellId(), cellId);
49 EXPECT_EQ(myECLCalDigit.getEnergy(), energy);
50 EXPECT_EQ(myECLCalDigit.getTime(), time);
51 EXPECT_EQ(myECLCalDigit.getTimeResolution(), timeres);
52 } // Testcases for Setters and Getters
53
55} // namespace
Set up a few arrays and objects in the datastore.
Definition: eclCalDigit.cc:21
Class to store calibrated ECLDigits: ECLCalDigits.
Definition: ECLCalDigit.h:23
int getCellId() const
Get Cell ID.
Definition: ECLCalDigit.h:118
void setTimeResolution(double TimeResolution)
Set Calibrated Time Resolution.
Definition: ECLCalDigit.h:101
void setEnergy(double Energy)
Set Calibrated Energy.
Definition: ECLCalDigit.h:64
void setCellId(int CellId)
Set Cell ID.
Definition: ECLCalDigit.h:60
double getEnergy() const
Get Calibrated Energy.
Definition: ECLCalDigit.h:123
void setTime(double Time)
Set Calibrated Time.
Definition: ECLCalDigit.h:97
double getTimeResolution() const
Get Calibrated Time Resolution.
Definition: ECLCalDigit.h:168
double getTime() const
Get Calibrated Time.
Definition: ECLCalDigit.h:163
Abstract base class for different kinds of events.
STL namespace.