8#include <framework/gearbox/Const.h>
9#include <framework/logging/Logger.h>
10#include <tracking/trackFindingVXD/displayInterfaceTF/CollectorTFInfo.h>
11#include <gtest/gtest.h>
95 uint sector_map_size = 40;
98 std::map<std::pair<unsigned int, unsigned int>, std::vector<int>> sectors_display_all_pass;
99 std::vector<int> sectors_display_friends;
103 sectors_display_friends.clear();
104 sectors_display_all_pass.insert(std::make_pair(std::make_pair(
pass_sector_id_single, 0), sectors_display_friends));
106 sectors_display_friends.clear();
107 sectors_display_friends.push_back(0);
108 sectors_display_all_pass.insert(std::make_pair(std::make_pair(
pass_sector_id_single, 1), sectors_display_friends));
110 sectors_display_friends.clear();
111 sectors_display_friends.push_back(1);
112 sectors_display_all_pass.insert(std::make_pair(std::make_pair(
pass_sector_id_single, 2), sectors_display_friends));
115 sectors_display_friends.clear();
116 for (uint u = 3; u < sector_map_size; u++) {
117 sectors_display_all_pass.insert(std::make_pair(std::make_pair(
pass_sector_id_single, u), sectors_display_friends));
133 uint anz_clusters_svd = 15;
134 uint anz_clusters_pxd = 15;
137 for (uint i = 0; i < anz_clusters_svd; i++) {
145 for (uint i = 0; i < anz_clusters_pxd; i++) {
157 std::map<unsigned int, std::vector<int>> sector_map;
158 uint size_of_sectors = 10;
160 for (uint i = 0; i < size_of_sectors; i++) {
161 sector_map.insert(std::make_pair(i, std::vector<int>()));
166 std::map<std::pair<unsigned int, unsigned int>, std::vector<int>> sectors_display_all_pass;
167 std::vector<int> sectors_display_friends;
171 B2DEBUG(1,
"PassNr. " << i <<
"Size of Sector Map: " << sector_map.size());
173 for (
auto& akt_sector : sector_map) {
174 sectors_display_friends.clear();
177 for (
auto& akt_friend : akt_sector.second) {
178 sectors_display_friends.push_back(akt_friend);
180 sectors_display_all_pass.insert(std::make_pair(std::make_pair(i, akt_sector.first), sectors_display_friends));
191 uint anz_clusters_svd = 10;
192 uint anz_clusters_pxd = 10;
195 for (uint i = 0; i < anz_clusters_svd; i++) {
198 m_collector.importCluster(index,
"", -1, std::vector<int>(), std::vector<int>(), Const::SVD, i);
200 for (uint i = 0; i < anz_clusters_pxd; i++) {
203 m_collector.importCluster(index,
"", -1, std::vector<int>(), std::vector<int>(), Const::PXD, i);
279 for (uint i = 0; i < anz_hits; i++) {
284 m_collector.importHit(index,
"", -1, std::vector<int>(), std::vector<int>(), std::vector<int>(), 1,
B2Vector3D(),
316 std::vector<int> hits = {1, 2, 3};
319 for (uint i = 0; i < anz_cell; i++) {
322 m_collector.importCell(index,
"", -1, std::vector<int>(), std::vector<int>(), hits);
329 std::vector<std::pair<int, unsigned int>> cells0 = {std::make_pair(0, 0)};
330 std::vector<std::pair<int, unsigned int>> cells1 = {std::make_pair(1, 1)};
331 std::vector<std::pair<int, unsigned int>> cells23 = {std::make_pair(2, 2), std::make_pair(3, 3)};
332 std::vector<std::pair<int, unsigned int>> cells79 = {std::make_pair(7, 7), std::make_pair(9, 9)};
333 std::vector<std::pair<int, unsigned int>> cells8 = {std::make_pair(8, 8)};
345 std::vector<std::pair<int, unsigned int>>({}));
347 std::vector<std::pair<int, unsigned int>>({}));
349 std::vector<std::pair<int, unsigned int>>({}));
351 std::vector<std::pair<int, unsigned int>>({}));
353 std::vector<std::pair<int, unsigned int>>({}));
360 std::vector<std::pair<int, unsigned int>> cells = {std::make_pair(1, 1), std::make_pair(2, 2), std::make_pair(3, 3)};
363 for (uint i = 0; i < anz_tfc; i++) {
367 m_collector.importTC(index,
"", -1, std::vector<int>(), std::vector<int>(), cells);
376 for (uint i = 0; i <
m_collector.m_cellTF.size(); i++) {
377 B2INFO(
"* Cell ID: " << i <<
"; active: " <<
m_collector.m_cellTF[i].getActive() <<
", died_at: " <<
378 m_collector.m_cellTF[i].getDiedAt() <<
"; m_assigned_hits_ids - size: " <<
m_collector.m_cellTF[i].getAssignedHits().size() <<
379 "; Neighbours - size: " <<
m_collector.m_cellTF[i].getNeighbours().size() <<
"; State: " <<
m_collector.m_cellTF[i].getState() <<
380 "; use counter: " <<
m_collector.m_cellTF[i].getUseCounter());
388 for (uint i = 0; i <
m_collector.m_hitTF.size(); i++) {
389 B2INFO(
"* Hit ID: " << i <<
"; active: " <<
m_collector.m_hitTF[i].getActive() <<
", died_at: " <<
390 m_collector.m_hitTF[i].getDiedAt() <<
"; m_assigned_cluster - size: " <<
m_collector.m_hitTF[i].getAssignedCluster().size() <<
391 "; UseTC IDs - size: " <<
m_collector.m_hitTF[i].getUseCounterTCIDs().size() <<
392 "; use counter: " <<
m_collector.m_hitTF[i].getUseCounter() <<
"; SectorID: " <<
m_collector.m_hitTF[i].getSectorID());
399 for (uint i = 0; i <
m_collector.m_clustersTF.size(); i++) {
400 B2INFO(
"* Cluster ID: " << i <<
"; active: " <<
m_collector.m_clustersTF[i].getActive() <<
", died_at: " <<
401 m_collector.m_clustersTF[i].getDiedAt() <<
"; Real Cluster ID: " <<
402 m_collector.m_clustersTF[i].getRealClusterID() <<
"; Detector Type: "
403 <<
m_collector.m_clustersTF[i].getDetectorType() <<
"; use counter: " <<
m_collector.m_clustersTF[i].getUseCounter());
411 for (uint i = 0; i <
m_collector.m_tfCandTF.size(); i++) {
412 B2INFO(
"* TC ID: " << i <<
"; active: " <<
m_collector.m_tfCandTF[i].getActive() <<
", died_at: " <<
413 m_collector.m_tfCandTF[i].getDiedAt() <<
"; Own ID: " <<
414 m_collector.m_tfCandTF[i].getOwnID() <<
"; AssignedCells - size: " <<
415 m_collector.m_tfCandTF[i].getAssignedCell().size());
424 B2INFO(
"* Sector ID: " << akt_sector.second.getSectorID() <<
"; active: " << akt_sector.second.getActive() <<
", died_at: " <<
425 akt_sector.second.getDiedAt() <<
"; is only friend: " <<
426 akt_sector.second.getIsOnlyFriend() <<
"; Friends - size: "
427 << akt_sector.second.getFriends().size() <<
"; use counter: " << akt_sector.second.getUseCounter());
581 bool false_item =
false;
582 bool true_item =
true;
584 import_sectors_loop();
586 import_clusters_loop();
588 m_collector.updateSectors(4, 1,
"geloescht", 0, std::vector<int>(), std::vector<int>(), 0);
590 m_collector.updateClusters(3,
"geloescht", 0, std::vector<int>(), std::vector<int>(), 0);
592 ASSERT_EQ(
"geloescht", m_collector.m_clustersTF[3].getDiedAt());
593 ASSERT_EQ(false_item, m_collector.m_clustersTF[3].getActive());
597 m_collector.updateHit(1,
"geloescht", 0, std::vector<int>(), std::vector<int>(), -1, -1, std::vector<int>());
599 ASSERT_EQ(
"geloescht", m_collector.m_hitTF[1].getDiedAt());
600 ASSERT_EQ(false_item, m_collector.m_hitTF[1].getActive());
601 ASSERT_EQ(true_item, m_collector.m_hitTF[2].getActive());
604 m_collector.updateCell(3,
"geloescht", 2, std::vector<int>(), std::vector<int>(), -1, -1, 0, std::vector<int>());
606 ASSERT_EQ(
"geloescht", m_collector.m_cellTF[3].getDiedAt());
607 ASSERT_EQ(false_item, m_collector.m_cellTF[3].getActive());
608 ASSERT_EQ(true_item, m_collector.m_cellTF[1].getActive());
612 m_collector.updateTC(2,
"geloescht", 4, std::vector<int>(), std::vector<int>());
614 ASSERT_EQ(
"geloescht", m_collector.m_tfCandTF[2].getDiedAt());
615 ASSERT_EQ(false_item, m_collector.m_tfCandTF[2].getActive());
616 ASSERT_EQ(true_item, m_collector.m_tfCandTF[1].getActive());
Set up a few arrays and objects in the datastore.
std::vector< int > pass_sector_ids
fixed vector of pass indices (values are never used)
CollectorTFInfo m_collector
cached ref to CollectorTFInfo()
int pass_sector_id_single
fixed index for beginning pass
B2Vector3< double > B2Vector3D
typedef for common usage with double
void import_hit_standard()
dummy comment: import_hit_standard
void import_clusters_standard()
dummy comment: import_clusters_standard
void import_clusters_loop()
dummy comment: import_clusters_loop
void getAllSectors()
Output of all interesting Information of Sectors.
void import_tfc_standard()
dummy comment: import_tfc_standard
void import_sectors_standard()
dummy comment: import_sectors_standard
void import_cell_loop()
dummy comment: import_cell_loop
void getAllTC()
Output of all interesting Information of TC.
void import_hit_loop()
dummy comment: import_hit_loop
void import_tfc_loop()
dummy comment: import_tfc_loop
void import_cell_standard()
dummy comment: import_cell_standard
void import_sectors_loop()
Documentation Comment Jakob Lettenbichler: this was written by a student and will be removed after fi...
void getAllClusters()
Output of all interesting Information of Clusters.
void getAllHits()
Output of all interesting Information of Hits.
void getAllCells()
Output of all interesting Information of Cells.
Abstract base class for different kinds of events.