Belle II Software  release-05-01-25
sector.h
1 #include <framework/logging/Logger.h>
2 #include <gtest/gtest.h>
3 #include <tracking/dataobjects/FullSecID.h>
4 #include <tracking/trackFindingVXD/sectorMapTools/Sector.h>
5 
6 namespace Belle2 {
13  class SectorTest : public ::testing::Test {
14  protected:
15  };
16 
18  TEST_F(SectorTest, testConstructorSettersAndGetters)
19  {
20  VxdID vxdID = VxdID(34624); // this should be a sensor on layer 4
21  bool subLayerID = true;
22  unsigned short sectorID = 15;
23 
24 
25  B2INFO("creating FullSecIDs: ");
26  FullSecID aFullSecID = FullSecID(vxdID, subLayerID, sectorID);
27  unsigned int aFullSecInt = static_cast<unsigned int>(aFullSecID);
28 
29  FullSecID aFullSecID2 = FullSecID(vxdID, false, sectorID);
30  unsigned int aFullSecInt2 = static_cast<unsigned int>(aFullSecID2);
31 
32  FullSecID aFullSecID3 = FullSecID(vxdID, subLayerID, 7);
33  unsigned int aFullSecInt3 = static_cast<unsigned int>(aFullSecID3);
34 
35  FullSecID aFullSecID4;
36  unsigned int aFullSecInt4 = static_cast<unsigned int>(aFullSecID4);
37 
38 
39  // producing sectors which can be sorted by secID:
40  Sector aSector(aFullSecInt);
41  Sector aSector2(aFullSecInt2);
42  Sector aSector3(aFullSecInt3);
43  Sector aSector4(aFullSecInt4);
44 
45  EXPECT_EQ(aFullSecInt, aSector.getSecID());
46  EXPECT_EQ(aFullSecInt2, aSector2.getSecID());
47  EXPECT_EQ(aFullSecInt3, aSector3.getSecID());
48  EXPECT_EQ(aFullSecInt4, aSector4.getSecID());
49  EXPECT_EQ(0, aSector.getDistance());
50  EXPECT_EQ(0, aSector2.getDistance());
51  EXPECT_EQ(0, aSector3.getDistance());
52  EXPECT_EQ(0, aSector4.getDistance());
53 
54 
55  // producing sectors which can be sorted by secID:
56  Sector dSector(aFullSecInt, 3.5);
57  Sector dSector2(aFullSecInt2, 3.3, true);
58  Sector dSector3(aFullSecInt3, 3.4);
59  Sector dSector4(aFullSecInt4, 0, true);
60  }
62 }
Belle2::VxdID
Class to uniquely identify a any structure of the PXD and SVD.
Definition: VxdID.h:43
Belle2::Sector
Sector is a central part of storing information for VXD trackFinders.
Definition: Sector.h:53
Belle2::Sector::getSecID
unsigned getSecID() const
getter - getSecID returns the ID of the sector (for definition of secID, see m_sectorID).
Definition: Sector.h:148
Belle2::FullSecID
Class to identify a sector inside of the VXD.
Definition: FullSecID.h:43
Belle2
Abstract base class for different kinds of events.
Definition: MillepedeAlgorithm.h:19
Belle2::TEST_F
TEST_F(GlobalLabelTest, LargeNumberOfTimeDependentParameters)
Test large number of time-dep params for registration and retrieval.
Definition: globalLabel.cc:65
Belle2::Sector::getDistance
float getDistance() const
getter - get distance of sector to origin defined by sectorMap
Definition: Sector.h:144
Belle2::SectorTest
Set up a few arrays and objects in the datastore.
Definition: sector.h:13