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)
80 if (normalizedU < 0. or normalizedU > 1.)
82 if (normalizedV < 0. or normalizedV > 1.)
94 auto uIndex = uKeyVal->second;
95 auto vIndex = vKeyVal->second;
107 void get(std::vector< double >* normalizedUsup,
108 std::vector< double >* normalizedVsup,
109 std::vector< std::vector< unsigned int > >* secID)
const
113 if (uIndexPair.first != FLT_MAX)
114 normalizedUsup->push_back(uIndexPair.first);
118 if (vIndexPair.first != FLT_MAX)
119 normalizedVsup->push_back(vIndexPair.first);
123 std::vector< unsigned int > tmp_col;
125 tmp_col.push_back(
id);
126 secID->push_back(tmp_col);
134 if ((normalizedU < 0.) or (normalizedU > 1.))
return false;
135 if ((normalizedV < 0.) or (normalizedV > 1.))
return false;
169 if (sector.equalIgnoreSubLayerID(thisSecID)) {
170 thisSecID =
FullSecID(thisSecID.getVxdID(), (
bool)sublayer, thisSecID.getSecID());
Class to identify a sector inside of the VXD.
This class associates to an ordered pairs of normalized local coordinates a compact sector id.
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.