Belle II Software  release-05-02-19
utilityFunctions.cc
1 #include <ecl/dataobjects/ECLShower.h>
2 #include <ecl/utility/utilityFunctions.h>
3 #include <mdst/dataobjects/ECLCluster.h>
4 #include "TRandom.h"
5 #include "TMath.h"
6 #include <gtest/gtest.h>
7 
8 using namespace std;
9 
10 namespace Belle2 {
15  using namespace ECL;
16 
18  TEST(TestgetDetectorRegion, TestgetDetectorRegion)
19  {
20  ECLShower myECLShower;
21  ECLCluster myECLCluster;
22  for (int i = 0; i < 1e4; ++i) {
23  const double theta = gRandom->Uniform(0, TMath::Pi());
24 
25  //Check shower
26  myECLShower.setTheta(theta);
27  EXPECT_EQ(myECLShower.getDetectorRegion(), static_cast<int>(getDetectorRegion(theta)));
28 
29  //Check ECLCluster
30  myECLCluster.setTheta(theta);
31  EXPECT_EQ(myECLCluster.getDetectorRegion(), static_cast<int>(getDetectorRegion(theta)));
32  }
33 
34  } // Testcases for Something
35 
36 
38 } // namespace
Belle2::ECLShower::setTheta
void setTheta(double Theta)
Set Theta (rad)
Definition: ECLShower.h:150
Belle2::ECLCluster
ECL cluster data.
Definition: ECLCluster.h:39
Belle2::ECLShower::getDetectorRegion
int getDetectorRegion() const
Return detector region: 0: below acceptance, 1: FWD, 2: BRL, 3: BWD, 11: FWDGAP, 13: BWDGAP.
Definition: ECLShower.h:464
Belle2
Abstract base class for different kinds of events.
Definition: MillepedeAlgorithm.h:19
Belle2::TEST
TEST(TestgetDetectorRegion, TestgetDetectorRegion)
Test Constructors.
Definition: utilityFunctions.cc:18
Belle2::ECLCluster::getDetectorRegion
int getDetectorRegion() const
Return detector region: 0: below acceptance, 1: FWD, 2: BRL, 3: BWD, 11: FWDGAP, 13: BWDGAP.
Definition: ECLCluster.cc:68
Belle2::ECLCluster::setTheta
void setTheta(double theta)
Set Theta of Shower (radian).
Definition: ECLCluster.h:229
Belle2::ECLShower
Class to store ECL Showers.
Definition: ECLShower.h:42