Belle II Software development
|
This class provides a computer convenient numbering scheme for the sectors in the sector map and for the N sectors combinations. More...
#include <CompactSecIDs.h>
Public Types | |
typedef uint16_t | sectorID_t |
Typedef of the compact Id for a single sector. | |
typedef uint32_t | secPairID_t |
Typedef of the compact Id for a 2 sectors combination. | |
typedef uint64_t | secTripletID_t |
Typedef of the compact Id for a 3 sectors combination. | |
typedef uint64_t | secQuadrupletID_t |
Typedef of the compact Id for a 4 sectors combination. | |
typedef std::vector< SectorsOnSensor< sectorID_t > > | SensorsOnLadder_t |
Typedef for vector of IDs of sectors on a sensors. | |
typedef std::vector< SensorsOnLadder_t > | LaddersOnLayer_t |
Typedef for vector of vector of IDs of sectors on a Ladder. | |
typedef std::vector< LaddersOnLayer_t > | LayersLookUpTable_t |
Typedef for vector of vector of vector of IDs of sectors on a layer. | |
Public Member Functions | |
CompactSecIDs () | |
The constructor have just to set the internal counter to 0. | |
~CompactSecIDs () | |
The destructor is quite trivial: nothing special to delete. | |
int | getSize () const |
Returns the number of sectors defined so far. | |
unsigned int | getAvailableSlots () const |
Returns the available number of sector that can be defined now. | |
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. | |
sectorID_t | getCompactID (const FullSecID &fullID) const |
Returns the compact id of the FullSecID It does not throw exceptions (at least it should not). | |
SectorsOnSensor< sectorID_t > | getSectorsOnSensor (unsigned layer, unsigned ladder, unsigned sensor) const |
Getter for IDs of all sectors on a sensor. | |
BELLE2_DEFINE_EXCEPTION (unboundedNormalizedU, "On layer:%1% ladder:%2% sensor:%3% abnormal U=%4$") | |
Exception for normalized coordinate U out of bound [0,1]. | |
BELLE2_DEFINE_EXCEPTION (unboundedNormalizedV, "On layer:%1% ladder:%2% sensor:%3% abnormal V=%4$") | |
Exception for normalized coordinate V out of bound [0,1]. | |
FullSecID | getFullSecID (VxdID aSensorID, double normalizedU, double normalizedV) const |
Returns a fullSecID for given sensor and pair of coordinates. | |
sectorID_t | operator[] (const FullSecID &fullID) const |
Returns the compact id of the FullSecID fullID. | |
secPairID_t | getCompactID (const FullSecID &id1, const FullSecID &id2) const |
Returns the compact id of the pair of FullSecID id1 id2. | |
secTripletID_t | getCompactID (const FullSecID &id1, const FullSecID &id2, const FullSecID &id3) const |
Returns the compact id of the triplet of FullSecID id1 id2 id3. | |
secQuadrupletID_t | getCompactID (const FullSecID &id1, const FullSecID &id2, const FullSecID &id3, const FullSecID &id4) const |
Returns the compact id of the quadruplet of FullSecID id1 id2 id3 id4 If any of the id1, id2, id3 or id4 is undefined 0 is returned. | |
sectorID_t | getCompactIDFastAndDangerous (const FullSecID &fullID) const |
Fast (and potentially dangerous) equivalent of getCompactID. | |
bool | areCoordinatesValid (VxdID aSensorID, double normalizedU, double normalizedV) const |
JKL: returns true if operator() will not throw an exception. | |
const LayersLookUpTable_t & | getCompactSectorsIDMap () const |
Get access to the whole map. | |
int | nOfLayers (void) const |
get the number of layers in this CompactSecIDs | |
int | nOfLadders (int layer) const |
get the number of ladders on | |
int | nOfSensors (int layer, int ladder) const |
get the number of sensors on | |
bool | setSubLayerID (FullSecID §or, int sublayer) |
set the SublayerID of the sector | |
Static Public Member Functions | |
static void | extractCompactID (secPairID_t pair_id, sectorID_t &id1, sectorID_t &id2) |
Uses the values coded by the Sector Pair ID pair_id and sets the two compact Sector ids id1 and id2. | |
static void | extractCompactID (secTripletID_t triplet_id, sectorID_t &id1, sectorID_t &id2, sectorID_t &id3) |
Uses the values coded by the Sector Pair ID to set the three compact sector ids. | |
Private Member Functions | |
template<class TContainer , class ... Indexes> | |
int | privateAddSectors (TContainer &container, const std::vector< double > &normalizedUsup, const std::vector< double > &normalizedVsup, const std::vector< std::vector< FullSecID > > &fullSecIDs, short unsigned int index, Indexes ... indexes) |
The hidden private method that recursively manage the size of everything. | |
int | privateAddSectors (SectorsOnSensor< sectorID_t > §ors, const std::vector< double > &normalizedUsup, const std::vector< double > &normalizedVsup, const std::vector< std::vector< FullSecID > > &fullSecIDs) |
The hidden private method that end the recursion. | |
template<class TContainer , class ... Indexes> | |
sectorID_t | privateGetCompactID (const TContainer &container, short unsigned int index, Indexes ... indexes) const |
The hidden private method that recursively descend the layer, ladder, sensor stack and returns the compactID of a given fullSecID. | |
template<class TContainer > | |
sectorID_t | privateGetCompactID (const TContainer &container, short unsigned int index) const |
The hidden private method that close the recursion. | |
Private Attributes | |
sectorID_t | m_sectorCounter |
Counter for sectors. | |
LayersLookUpTable_t | m_compactSectorsIDMap |
Lookup table containing all sectorIDs. | |
This class provides a computer convenient numbering scheme for the sectors in the sector map and for the N sectors combinations.
Sectors are labeled with consecutives numbers starting from 1. Methods are provided to convert the fullSecIds (human readable) to compactSecIDs (computer convenient) back and forth.
Definition at line 28 of file CompactSecIDs.h.
typedef std::vector<SensorsOnLadder_t> LaddersOnLayer_t |
Typedef for vector of vector of IDs of sectors on a Ladder.
Definition at line 315 of file CompactSecIDs.h.
typedef std::vector<LaddersOnLayer_t> LayersLookUpTable_t |
Typedef for vector of vector of vector of IDs of sectors on a layer.
Definition at line 317 of file CompactSecIDs.h.
typedef uint32_t secPairID_t |
Typedef of the compact Id for a 2 sectors combination.
Definition at line 38 of file CompactSecIDs.h.
typedef uint64_t secQuadrupletID_t |
Typedef of the compact Id for a 4 sectors combination.
Definition at line 44 of file CompactSecIDs.h.
typedef uint16_t sectorID_t |
Typedef of the compact Id for a single sector.
Definition at line 35 of file CompactSecIDs.h.
typedef uint64_t secTripletID_t |
Typedef of the compact Id for a 3 sectors combination.
Definition at line 41 of file CompactSecIDs.h.
typedef std::vector<SectorsOnSensor<sectorID_t> > SensorsOnLadder_t |
Typedef for vector of IDs of sectors on a sensors.
Definition at line 313 of file CompactSecIDs.h.
|
inline |
The constructor have just to set the internal counter to 0.
Definition at line 47 of file CompactSecIDs.h.
|
inline |
The destructor is quite trivial: nothing special to delete.
Definition at line 50 of file CompactSecIDs.h.
|
inline |
This method defines all the sectors on a given sensor.
The two vectors normalizedUsup and normalizedVsup define the sector boundaries in normalized coordinates. (e.g.: if normalizesUsup = { a, 1} two sectors boundary are defined [0,a) and [a,1). ) The returned value is the number of fullSecIDs actually added to this CompacSecIDs.
Definition at line 69 of file CompactSecIDs.h.
|
inline |
JKL: returns true if operator() will not throw an exception.
Definition at line 297 of file CompactSecIDs.h.
|
inlinestatic |
Uses the values coded by the Sector Pair ID pair_id and sets the two compact Sector ids id1 and id2.
pair_id | input sector pair id |
id1 | reference to first sector id to be set |
id2 | reference second sector id to be set |
Definition at line 208 of file CompactSecIDs.h.
|
inlinestatic |
Uses the values coded by the Sector Pair ID to set the three compact sector ids.
triplet_id | input compact id of the triplet |
id1 | reference to compact id of first sector to be set |
id2 | reference to compact id of second sector to be set |
id3 | reference to compact id of third sector to be set |
Definition at line 246 of file CompactSecIDs.h.
|
inline |
Returns the available number of sector that can be defined now.
Definition at line 56 of file CompactSecIDs.h.
|
inline |
Returns the compact id of the FullSecID It does not throw exceptions (at least it should not).
fullID | the FullSecID |
Definition at line 116 of file CompactSecIDs.h.
|
inline |
Returns the compact id of the pair of FullSecID id1 id2.
Definition at line 188 of file CompactSecIDs.h.
|
inline |
Returns the compact id of the triplet of FullSecID id1 id2 id3.
id1 | first id |
id2 | second id |
id3 | third id |
Definition at line 221 of file CompactSecIDs.h.
|
inline |
Returns the compact id of the quadruplet of FullSecID id1 id2 id3 id4 If any of the id1, id2, id3 or id4 is undefined 0 is returned.
Definition at line 255 of file CompactSecIDs.h.
|
inline |
Fast (and potentially dangerous) equivalent of getCompactID.
It will not check for out of boundaries fullID / ill defined
fullID |
Definition at line 282 of file CompactSecIDs.h.
|
inline |
Returns a fullSecID for given sensor and pair of coordinates.
An exception is thrown in case of errors (index/coordinate out of range).
Definition at line 153 of file CompactSecIDs.h.
|
inline |
Getter for IDs of all sectors on a sensor.
layer | : layer number of the sensor |
ladder | : ladder number of the sensor |
sensor | : sensor number |
Definition at line 133 of file CompactSecIDs.h.
|
inline |
|
inline |
get the number of ladders on
layer | the layer |
Definition at line 331 of file CompactSecIDs.h.
|
inline |
|
inline |
get the number of sensors on
layer | the layer |
ladder | the ladder |
Definition at line 343 of file CompactSecIDs.h.
|
inline |
Returns the compact id of the FullSecID fullID.
It will not throw exceptions.
fullID | the FullSecID |
Definition at line 179 of file CompactSecIDs.h.
|
inlineprivate |
The hidden private method that end the recursion.
It returns the number of added sectors. In particular it return 0 if sectors are already defined on the sensor.
Definition at line 398 of file CompactSecIDs.h.
|
inlineprivate |
The hidden private method that recursively manage the size of everything.
It returns the number of added sectors. It returns 0 in case of errors (memory exhausted, or sector redefinition.)
Definition at line 379 of file CompactSecIDs.h.
|
inlineprivate |
The hidden private method that close the recursion.
Sanity checks are performed on the last index. 0 is returned in case of errors (i.e. indexes out of bound).
Definition at line 446 of file CompactSecIDs.h.
|
inlineprivate |
The hidden private method that recursively descend the layer, ladder, sensor stack and returns the compactID of a given fullSecID.
Sanity checks are performed at each step. 0 is returned in case of errors (i.e. indexes out of bound).
Definition at line 432 of file CompactSecIDs.h.
|
inline |
set the SublayerID of the sector
sector | the FullSectorID of the sector, the sublayer id will be ignored during searching for the sector |
sublayer | the new sublayer id |
Definition at line 355 of file CompactSecIDs.h.
|
private |
Lookup table containing all sectorIDs.
Definition at line 372 of file CompactSecIDs.h.
|
private |
Counter for sectors.
Definition at line 369 of file CompactSecIDs.h.