9#include <tracking/trackFindingVXD/filterMap/map/CompactSecIDs.h>
10#include "tracking/dataobjects/FullSecID.h"
12#include <gtest/gtest.h>
24 vector< double > uSup = { .25, .5, .75 };
25 vector< double > vSup = { .25, .5, .75, .8};
27 vector< vector< FullSecID > > sectors;
29 sectors.resize(uSup.size() + 1);
32 for (
unsigned int i = 0; i < uSup.size() + 1 ; i++) {
33 sectors[i].resize(vSup.size() + 1);
34 for (
unsigned int j = 0; j < vSup.size() + 1; j++) {
40 EXPECT_EQ(sectors.size()*sectors[0].size(),
41 compactSecIds.
addSectors(uSup, vSup, sectors)) ;
53 EXPECT_EQ(0, compactSecIds.
addSectors(uSup, vSup, sectors));
64 vector<int> layers = { 1, 2, 3, 4, 5, 6};
65 vector<int> ladders = { 8, 12, 7, 10, 12, 16};
66 vector<int> sensors = { 2, 2, 2, 3, 4, 5};
69 vector< double > uSup = { .25, .5, .75 };
70 vector< double > vSup = { .2, .4, .6, .8};
73 vector< vector< FullSecID > > sectors;
75 sectors.resize(uSup.size() + 1);
78 for (
auto layer : layers)
79 for (
int ladder = 1 ; ladder <= ladders[layer - 1] ; ladder++)
80 for (
int sensor = 1 ; sensor <= sensors[layer - 1] ; sensor++) {
82 for (
unsigned int i = 0; i < uSup.size() + 1; i++) {
83 sectors[i].resize(vSup.size() + 1);
84 for (
unsigned int j = 0; j < vSup.size() + 1 ; j++) {
86 sensor % 2 == 0 ?
false :
true, counter);
92 EXPECT_EQ(sectors.size()*sectors[0].size(), compactSecIds.
addSectors(uSup, vSup, sectors));
95 for (
auto layer : layers)
96 for (
int ladder = 1 ; ladder <= ladders[layer - 1] ; ladder++)
97 for (
int sensor = 1 ; sensor <= sensors[layer - 1] ; sensor++) {
99 for (
unsigned int i = 0; i < uSup.size() + 1 ; i++) {
100 sectors[i].resize(vSup.size() + 1);
101 for (
unsigned int j = 0; j < vSup.size() + 1; j++) {
103 sensor % 2 == 0 ?
false :
true, counter);
109 EXPECT_EQ(0, compactSecIds.
addSectors(uSup, vSup, sectors));
114 for (
auto layer : layers)
115 for (
int ladder = 1 ; ladder <= ladders[layer - 1] ; ladder++)
116 for (
int sensor = 1 ; sensor <= sensors[layer - 1] ; sensor++)
117 for (
unsigned int sector = 0 ; sector < (uSup.size() + 1) * (vSup.size() + 1) ; sector ++) {
119 sensor % 2 == 0 ?
false :
true
122 EXPECT_EQ(++ expected, compactSecIds.
getCompactID(aSector));
128 for (
double u = 0. ; u < 1.; u += .25) {
129 for (
double v = 0.; v < 1.; v += .2)
148 for (
double u = .25 ; u < 1.25; u += .25) {
149 for (
double v = 0.2; v < 1.2; v += .2) {
150 if (u < 0. or u > 1. or v < 0. or v >1.) {
This class provides a computer convenient numbering scheme for the sectors in the sector map and for ...
FullSecID getFullSecID(VxdID aSensorID, double normalizedU, double normalizedV) const
Returns a fullSecID for given sensor and pair of coordinates.
sectorID_t getCompactID(const FullSecID &fullID) const
Returns the compact id of the FullSecID It does not throw exceptions (at least it should not).
sectorID_t getCompactIDFastAndDangerous(const FullSecID &fullID) const
Fast (and potentially dangerous) equivalent of getCompactID.
int addSectors(const std::vector< double > &normalizedUsup, const std::vector< double > &normalizedVsup, const std::vector< std::vector< FullSecID > > &fullSecIDs)
This method defines all the sectors on a given sensor.
Class to identify a sector inside of the VXD.
Class to uniquely identify a any structure of the PXD and SVD.
Abstract base class for different kinds of events.