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
77
79
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:54
void setInitializeActive(bool active)
Setter for m_initializeActive.
Definition: DataStore.cc:94
The PXD Cluster class This class stores all information about reconstructed PXD clusters The position...
Definition: PXDCluster.h:30
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.
Storage for (VXD) SpacePoint-based track candidates.
void setQualityIndicator(const double newIndicator)
sets the new status of the estimated quality of this track candidate.
SpacePoint typically is build from 1 PXDCluster or 1-2 SVDClusters.
Definition: SpacePoint.h:42
VxdID getVxdID() const
Return the VxdID of the sensor on which the the cluster of the SpacePoint lives.
Definition: SpacePoint.h:148
bool registerInDataStore(DataStore::EStoreFlags storeFlags=DataStore::c_WriteOut)
Register the object/array in the DataStore.
T * appendNew()
Construct a new T object at the end of the array.
Definition: StoreArray.h:246
int getEntries() const
Get the number of objects in the array.
Definition: StoreArray.h:216
bool registerRelationTo(const StoreArray< TO > &toArray, DataStore::EDurability durability=DataStore::c_Event, DataStore::EStoreFlags storeFlags=DataStore::c_WriteOut, const std::string &namedRelation="") const
Register a relation to the given StoreArray.
Definition: StoreArray.h:140
Base class to provide Sensor Information for PXD and SVD.
Class to uniquely identify a any structure of the PXD and SVD.
Definition: VxdID.h:33
StoreArray< DirectedNodeNetworkContainer > m_networkContainerInDataStore
testing to store a dummy class containing DirectedNodeNetwork as member .
StoreArray< PXDCluster > m_pxdClusterData
some pxd clusters for testing.
StoreArray< SpacePoint > m_spacePointData
some spacePoints for testing.
StoreArray< SpacePointTrackCand > m_spacePointTrackCandData
some spacePointTrackCands for testing.
PXDCluster providePXDCluster(double u, double v, VxdID aVxdID, double uError=0.1, double vError=0.1)
helper function: returns a pxdCluster with given sensorID and local coordinates
VXD::SensorInfoBase provideSensorInfo(VxdID aVxdID, double globalX=0., double globalY=0., double globalZ=-0.)
helper function: create a sensorInfo to be used

◆ 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:86

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: