Belle II Software  release-08-01-10
utilityFunctions.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/ECLShower.h>
9 #include <ecl/utility/utilityFunctions.h>
10 #include <mdst/dataobjects/ECLCluster.h>
11 #include "TRandom.h"
12 #include "TMath.h"
13 #include <gtest/gtest.h>
14 
15 using namespace std;
16 
17 namespace Belle2 {
22  using namespace ECL;
23 
25  TEST(TestgetDetectorRegion, TestgetDetectorRegion)
26  {
27  ECLShower myECLShower;
28  ECLCluster myECLCluster;
29  for (int i = 0; i < 1e4; ++i) {
30  const double theta = gRandom->Uniform(0, TMath::Pi());
31 
32  //Check shower
33  myECLShower.setTheta(theta);
34  EXPECT_EQ(myECLShower.getDetectorRegion(), static_cast<int>(getDetectorRegion(theta)));
35 
36  //Check ECLCluster
37  myECLCluster.setTheta(theta);
38  EXPECT_EQ(myECLCluster.getDetectorRegion(), static_cast<int>(getDetectorRegion(theta)));
39  }
40 
41  } // Testcases for Something
42 
43 
45 } // namespace
ECL cluster data.
Definition: ECLCluster.h:27
void setTheta(double theta)
Set Theta of Shower (radian).
Definition: ECLCluster.h:217
int getDetectorRegion() const
Return detector region: 0: below acceptance, 1: FWD, 2: BRL, 3: BWD, 11: FWDGAP, 13: BWDGAP.
Definition: ECLCluster.cc:70
Class to store ECL Showers.
Definition: ECLShower.h:30
void setTheta(double Theta)
Set Theta (rad)
Definition: ECLShower.h:139
int getDetectorRegion() const
Return detector region: 0: below acceptance, 1: FWD, 2: BRL, 3: BWD, 11: FWDGAP, 13: BWDGAP.
Definition: ECLShower.h:480
TEST(TestgetDetectorRegion, TestgetDetectorRegion)
Test Constructors.
Abstract base class for different kinds of events.