Belle II Software  release-05-01-25
SectorsOnSensor< sectorID > Class Template Reference

This class associates to an ordered pairs of normalized local coordinates a compact sector id. More...

#include <SectorsOnSensor.h>

Collaboration diagram for SectorsOnSensor< sectorID >:

Public Member Functions

 SectorsOnSensor ()
 Default constructor needed for the vector traits.
 
 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.
 
FullSecID operator() (double normalizedU, double normalizedV) const
 Returns the Full Sector ID of the sector on this sensor that contains the point at normalized coordinates U, V.
 
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. More...
 
bool areCoordinatesValid (double normalizedU, double normalizedV) const
 check if using operator() would be safe (true if it is safe):
 
sectorID & operator[] (int index)
 minimal vector semantics to access the compactSecIDs vector using the sector More...
 
const sectorID & operator[] (int index) const
 minimal vector semantics to access the compactSecIDs vector
 
size_t size () const
 minimal vector semantics to get the size of the compactSecIDs vector
 
void resize (size_t n)
 minimal vector semantics to resize the compactSecIDs vector
 
bool updateSubLayerID (FullSecID sector, int sublayer)
 update the sublayer id for the sector with the given FullSecID, the sublayer id is ignored when searching for the sector More...
 
const std::vector< sectorID > & getCompactSecIDs () const
 JKL: for testing - get all compactSecIDs:
 

Private Types

typedef unsigned char index_t
 Typedef for the internal numbering of rows and columns of the sectors.
 

Private Attributes

std::map< double, index_tm_normalizedUsup
 Upper limits of the sectors in normalized U coordinates.
 
std::map< double, index_tm_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. More...
 
std::vector< sectorID > m_compactSecIDs
 The 1D array of the compact ID is stored in this member. More...
 

Detailed Description

template<class sectorID>
class Belle2::SectorsOnSensor< sectorID >

This class associates to an ordered pairs of normalized local coordinates a compact sector id.

Definition at line 36 of file SectorsOnSensor.h.

Member Function Documentation

◆ get()

void get ( std::vector< double > *  normalizedUsup,
std::vector< double > *  normalizedVsup,
std::vector< std::vector< unsigned int > > *  secID 
) const
inline

copy the vector members on the vector pointed from the arguments.

Parameters
normalizedUsup
normalizedVsup
secID

Definition at line 117 of file SectorsOnSensor.h.

120  if (vIndexPair.first != FLT_MAX)
121  normalizedVsup->push_back(vIndexPair.first);
122 
123  // and finally we copy the array of full sec ids
124  for (auto col : m_fullSecIDs) {
125  std::vector< unsigned int > tmp_col;
126  for (auto id : col)
127  tmp_col.push_back(id);
128  secID->push_back(tmp_col);
129  }
130  }
131 
133  bool areCoordinatesValid(double normalizedU, double normalizedV) const
134  {
135  // check u and v
136  if ((normalizedU < 0.) or (normalizedU > 1.)) return false;
137  if ((normalizedV < 0.) or (normalizedV > 1.)) return false;
138  // check internal map for problems:

◆ operator[]()

sectorID& operator[] ( int  index)
inline

minimal vector semantics to access the compactSecIDs vector using the sector

Parameters
indexfrom the fullSecId

Definition at line 159 of file SectorsOnSensor.h.

◆ updateSubLayerID()

bool updateSubLayerID ( FullSecID  sector,
int  sublayer 
)
inline

update the sublayer id for the sector with the given FullSecID, the sublayer id is ignored when searching for the sector

Parameters
sectorFullSecID of the sector to be updated
sublayer: the new value for the sublayer ID, the new SubLayerID will be 0 if sublayer==0, and will be 1 else

WARNING: the comparison will ignore the sublayer id

Definition at line 174 of file SectorsOnSensor.h.

Member Data Documentation

◆ m_compactSecIDs

std::vector< sectorID > m_compactSecIDs
private

The 1D array of the compact ID is stored in this member.

It is indexed by the sector component on the FullSecID

Definition at line 53 of file SectorsOnSensor.h.

◆ m_fullSecIDs

std::vector< std::vector < FullSecID > > m_fullSecIDs
private

The 2D array of the full sec ID is stored in this member.

It is indexed by discretized normalized U V pairs

Definition at line 49 of file SectorsOnSensor.h.


The documentation for this class was generated from the following file:
Belle2::SectorsOnSensor::m_fullSecIDs
std::vector< std::vector< FullSecID > > m_fullSecIDs
The 2D array of the full sec ID is stored in this member.
Definition: SectorsOnSensor.h:49
Belle2::SectorsOnSensor::areCoordinatesValid
bool areCoordinatesValid(double normalizedU, double normalizedV) const
check if using operator() would be safe (true if it is safe):
Definition: SectorsOnSensor.h:141
Belle2::SectorsOnSensor::m_normalizedVsup
std::map< double, index_t > m_normalizedVsup
Upper limits of the sectors in normalized V coordinates.
Definition: SectorsOnSensor.h:45