Belle II Software development
DirectedNodeNetworkTest Class Reference

Test class demonstrating the behavior of TCNetworkContainer. More...

Inheritance diagram for DirectedNodeNetworkTest:

Protected Member Functions

virtual void SetUp ()
 SetUp environment - prepare related storearrays of SpacePoints and PXDClusters.
 
virtual void TearDown ()
 TearDown environment - clear datastore.
 

Protected Attributes

StoreArray< SpacePointm_spacePointData
 some spacePoints for testing.
 
StoreArray< PXDClusterm_pxdClusterData
 some pxd clusters for testing.
 
StoreArray< SpacePointTrackCandm_spacePointTrackCandData
 some spacePointTrackCands for testing.
 
StoreArray< DirectedNodeNetworkContainerm_networkContainerInDataStore
 testing to store a dummy class containing DirectedNodeNetwork as member .
 

Detailed Description

Test class demonstrating the behavior of TCNetworkContainer.

used for preparing mockup.

Definition at line 66 of file directedNodeNetwork.cc.

Member Function Documentation

◆ SetUp()

virtual void SetUp ( )
inlineprotectedvirtual

SetUp environment - prepare related storearrays of SpacePoints and PXDClusters.

prepare pxdClusters and spacePoints related to them

prepare some SpacePointTrackCands partially overlapping:

Definition at line 70 of file directedNodeNetwork.cc.

71 {
73
74 m_spacePointData.registerInDataStore();
75 m_pxdClusterData.registerInDataStore();
76 m_spacePointTrackCandData.registerInDataStore();
77
78 m_spacePointData.registerRelationTo(m_pxdClusterData);
79
80 m_networkContainerInDataStore.registerInDataStore();
81
83
84 unsigned int nHits = 5;
85
87 for (unsigned int i = 1; i <= nHits; ++i) { //
88
89 VxdID aVxdID = VxdID(i, i, i);
90
91 VXD::SensorInfoBase aSensorInfo = provideSensorInfo(aVxdID, (unsigned short)i, (unsigned short)i + 1., (unsigned short)i + 2.);
92
93 const PXDCluster* pxdCluster = m_pxdClusterData.appendNew(providePXDCluster(float(i) / float(nHits), float(i) / float(nHits),
94 aVxdID));
95
96 SpacePoint* newSP = m_spacePointData.appendNew(pxdCluster, &aSensorInfo);
97 B2DEBUG(10, " setup: new spacePoint got arrayIndex: " << newSP->getArrayIndex() << " and VxdID " << newSP->getVxdID());
98 newSP->addRelationTo(pxdCluster);
99 }
100
101 B2DEBUG(10, "DirectedNodeNetworkTest:SetUP: created " << m_pxdClusterData.getEntries() << "/" << m_spacePointData.getEntries() <<
102 " pxdClusters/SpacePoints");
103
105 vector<SpacePoint*> allSpacePoints;
106 for (SpacePoint& aSP : m_spacePointData) {
107 allSpacePoints.push_back(&aSP);
108 }
109
110 vector<const SpacePoint*> sps4TC1 = { allSpacePoints.at(0), allSpacePoints.at(1)};
111 SpacePointTrackCand* aSPTC1 = m_spacePointTrackCandData.appendNew((sps4TC1)); // shares hits with no one
112 aSPTC1->setQualityIndicator(0.92);
113
114 vector<const SpacePoint*> sps4TC2 = { allSpacePoints.at(2), allSpacePoints.at(3)};
115 SpacePointTrackCand* aSPTC2 = m_spacePointTrackCandData.appendNew((sps4TC2)); // shares a hit with tc3, tc4, tc5
116 aSPTC2->setQualityIndicator(0.9);
117
118 vector<const SpacePoint*> sps4TC3 = { allSpacePoints.at(3), allSpacePoints.at(4)};
119 SpacePointTrackCand* aSPTC3 = m_spacePointTrackCandData.appendNew((sps4TC3)); // shares a hit with tc2, tc5
120 aSPTC3->setQualityIndicator(0.8);
121
122 vector<const SpacePoint*> sps4TC4 = { allSpacePoints.at(4)};
123 SpacePointTrackCand* aSPTC4 = m_spacePointTrackCandData.appendNew((sps4TC4)); // shares a hit with tc3 too, but not with tc2
124 aSPTC4->setQualityIndicator(0.7);
125
126 vector<const SpacePoint*> sps4TC5 = { allSpacePoints.at(2), allSpacePoints.at(4)};
127 SpacePointTrackCand* aSPTC5 = m_spacePointTrackCandData.appendNew((sps4TC5)); // shares a hit with tc2 and tc3
128 aSPTC5->setQualityIndicator(0.65);
129 }
static DataStore & Instance()
Instance of singleton Store.
Definition DataStore.cc:53
void setInitializeActive(bool active)
Setter for m_initializeActive.
Definition DataStore.cc:93
void addRelationTo(const RelationsInterface< BASE > *object, float weight=1.0, const std::string &namedRelation="") const
Add a relation from this object to another object (with caching).
int getArrayIndex() const
Returns this object's array index (in StoreArray), or -1 if not found.
void setQualityIndicator(const double newIndicator)
sets the new status of the estimated quality of this track candidate.
VxdID getVxdID() const
Return the VxdID of the sensor on which the the cluster of the SpacePoint lives.
Definition SpacePoint.h:148
PXDCluster providePXDCluster(double u, double v, VxdID aVxdID, double uError=0.1, double vError=0.1)
returns a pxdCluster with given sensorID and local coordinates
Definition observers.cc:69
VXD::SensorInfoBase provideSensorInfo(VxdID aVxdID, double globalX=0., double globalY=0., double globalZ=-0.)
this is a small helper function to create a sensorInfo to be used
Definition observers.cc:49

◆ TearDown()

virtual void TearDown ( )
inlineprotectedvirtual

TearDown environment - clear datastore.

Definition at line 132 of file directedNodeNetwork.cc.

void reset(EDurability durability)
Frees memory occupied by data store items and removes all objects from the map.
Definition DataStore.cc:85

Member Data Documentation

◆ m_networkContainerInDataStore

StoreArray<DirectedNodeNetworkContainer> m_networkContainerInDataStore
protected

testing to store a dummy class containing DirectedNodeNetwork as member .

Definition at line 138 of file directedNodeNetwork.cc.

◆ m_pxdClusterData

StoreArray<PXDCluster> m_pxdClusterData
protected

some pxd clusters for testing.

Definition at line 135 of file directedNodeNetwork.cc.

◆ m_spacePointData

StoreArray<SpacePoint> m_spacePointData
protected

some spacePoints for testing.

Definition at line 134 of file directedNodeNetwork.cc.

◆ m_spacePointTrackCandData

StoreArray<SpacePointTrackCand> m_spacePointTrackCandData
protected

some spacePointTrackCands for testing.

Definition at line 136 of file directedNodeNetwork.cc.


The documentation for this class was generated from the following file: