11#include "tracking/dataobjects/FullSecID.h"
25 template<
class sectorID >
52 const std::vector< double >& normalizedUsup,
53 const std::vector< double >& normalizedVsup,
54 const std::vector< std::vector< FullSecID > >& fullSecIDs)
58 for (
auto Vsup : normalizedVsup)
63 for (
auto Usup : normalizedUsup)
79 if (normalizedU < 0. or normalizedU > 1.)
81 if (normalizedV < 0. or normalizedV > 1.)
93 auto uIndex = uKeyVal->second;
94 auto vIndex = vKeyVal->second;
106 void get(std::vector< double >* normalizedUsup,
107 std::vector< double >* normalizedVsup,
108 std::vector< std::vector< unsigned int > >* secID)
const
112 if (uIndexPair.first != FLT_MAX)
113 normalizedUsup->push_back(uIndexPair.first);
117 if (vIndexPair.first != FLT_MAX)
118 normalizedVsup->push_back(vIndexPair.first);
122 std::vector< unsigned int > tmp_col;
124 tmp_col.push_back(
id);
125 secID->push_back(tmp_col);
133 if ((normalizedU < 0.) or (normalizedU > 1.))
return false;
134 if ((normalizedV < 0.) or (normalizedV > 1.))
return false;
168 if (sector.equalIgnoreSubLayerID(thisSecID)) {
169 thisSecID =
FullSecID(thisSecID.getVxdID(), (
bool)sublayer, thisSecID.getSecID());
Class to identify a sector inside of the VXD.
std::map< double, index_t > m_normalizedVsup
Upper limits of the sectors in normalized V coordinates.
std::vector< std::vector< FullSecID > > m_fullSecIDs
The 2D array of the full sec ID is stored in this member.
size_t size() const
minimal vector semantics to get the size of the compactSecIDs vector
sectorID & operator[](int index)
minimal vector semantics to access the compactSecIDs vector using the sector
bool areCoordinatesValid(double normalizedU, double normalizedV) const
check if using operator() would be safe (true if it is safe):
SectorsOnSensor()
Default constructor needed for the vector traits.
unsigned char index_t
Typedef for the internal numbering of rows and columns of the sectors.
void resize(size_t n)
minimal vector semantics to resize the compactSecIDs vector
FullSecID operator()(double normalizedU, double normalizedV) const
Returns the Full Sector ID of the sector on this sensor that contains the point at normalized coordin...
std::map< double, index_t > m_normalizedUsup
Upper limits of the sectors in normalized U coordinates.
SectorsOnSensor(const std::vector< double > &normalizedUsup, const std::vector< double > &normalizedVsup, const std::vector< std::vector< FullSecID > > &fullSecIDs)
Useful constructor.
~SectorsOnSensor()
Destructor of the object.
const std::vector< sectorID > & getCompactSecIDs() const
JKL: for testing - get all compactSecIDs:
std::vector< sectorID > m_compactSecIDs
The 1D array of the compact ID is stored in this member.
bool updateSubLayerID(FullSecID sector, int sublayer)
update the sublayer id for the sector with the given FullSecID, the sublayer id is ignored when searc...
const sectorID & operator[](int index) const
minimal vector semantics to access the compactSecIDs vector
void get(std::vector< double > *normalizedUsup, std::vector< double > *normalizedVsup, std::vector< std::vector< unsigned int > > *secID) const
copy the vector members on the vector pointed from the arguments.
Abstract base class for different kinds of events.