Belle II Software  release-08-01-10
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 
12 using namespace std;
13 
14 namespace 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:114
void setTimeResolution(double TimeResolution)
Set Calibrated Time Resolution.
Definition: ECLCalDigit.h:97
void setEnergy(double Energy)
Set Calibrated Energy.
Definition: ECLCalDigit.h:60
void setCellId(int CellId)
Set Cell ID.
Definition: ECLCalDigit.h:56
double getEnergy() const
Get Calibrated Energy.
Definition: ECLCalDigit.h:119
void setTime(double Time)
Set Calibrated Time.
Definition: ECLCalDigit.h:93
double getTimeResolution() const
Get Calibrated Time Resolution.
Definition: ECLCalDigit.h:164
double getTime() const
Get Calibrated Time.
Definition: ECLCalDigit.h:159
TEST_F(ECLCalDigitTest, SettersAndGetters)
Test Setters and Getter.
Definition: eclCalDigit.cc:35
Abstract base class for different kinds of events.