LDMX Software
|
#include <ElectronicsMap.h>
Public Member Functions | |
ElectronicsMap (bool want_d2e=false) | |
void | clear () |
Remove all entries from the map. | |
void | addEntry (ElectronicsID eid, DetID did) |
Add an entry to the map. | |
bool | exists (ElectronicsID eid) const |
Tests if a given electronics id is in the map. | |
bool | exists (DetID did) const |
Tests if a given detector id is in the map This method is slow O(N) if the map is not configured for detector id to electronics id. | |
DetID | get (ElectronicsID eid) const |
Get the detector ID for this electronics ID. | |
ElectronicsID | get (DetID did) const |
Get the electronics ID for this detector ID This method is slow O(N) if the map is not configured for detector id to electronics id. | |
Private Attributes | |
std::vector< DetectorID::RawValue > | eid2did_ |
Linear-time map for electronics (packed index) to raw detector id. | |
bool | makeD2E_ |
Flag to determine if did2eid should be filled (resource optimization) | |
std::map< DetectorID::RawValue, ElectronicsID > | did2eid_ |
Log(N) map for raw detector id to electronics id. | |
A class for efficient mapping between electronics IDs (using packed index techniques) and detector IDs which are arbitrarily formatted.
in] ElectronicsID class of electronics ID
in] DetID class of detector IDs
Definition at line 28 of file ElectronicsMap.h.
|
inline |
Definition at line 30 of file ElectronicsMap.h.
|
inline |
Add an entry to the map.
Definition at line 44 of file ElectronicsMap.h.
References ldmx::ElectronicsMap< ElectronicsID, DetID >::did2eid_, ldmx::ElectronicsMap< ElectronicsID, DetID >::eid2did_, and ldmx::ElectronicsMap< ElectronicsID, DetID >::makeD2E_.
|
inline |
Remove all entries from the map.
Definition at line 36 of file ElectronicsMap.h.
References ldmx::ElectronicsMap< ElectronicsID, DetID >::did2eid_, and ldmx::ElectronicsMap< ElectronicsID, DetID >::eid2did_.
|
inline |
Tests if a given detector id is in the map This method is slow O(N) if the map is not configured for detector id to electronics id.
Definition at line 68 of file ElectronicsMap.h.
References ldmx::ElectronicsMap< ElectronicsID, DetID >::did2eid_, ldmx::ElectronicsMap< ElectronicsID, DetID >::eid2did_, and ldmx::ElectronicsMap< ElectronicsID, DetID >::makeD2E_.
|
inline |
Tests if a given electronics id is in the map.
Definition at line 59 of file ElectronicsMap.h.
References ldmx::ElectronicsMap< ElectronicsID, DetID >::eid2did_.
|
inline |
Get the electronics ID for this detector ID This method is slow O(N) if the map is not configured for detector id to electronics id.
Throws an exception on failure as there is no globally-defined invalid electronics
Definition at line 95 of file ElectronicsMap.h.
References ldmx::ElectronicsMap< ElectronicsID, DetID >::did2eid_, ldmx::ElectronicsMap< ElectronicsID, DetID >::eid2did_, and ldmx::ElectronicsMap< ElectronicsID, DetID >::makeD2E_.
|
inline |
Get the detector ID for this electronics ID.
Definition at line 82 of file ElectronicsMap.h.
References ldmx::ElectronicsMap< ElectronicsID, DetID >::eid2did_.
|
private |
Log(N) map for raw detector id to electronics id.
Definition at line 127 of file ElectronicsMap.h.
Referenced by ldmx::ElectronicsMap< ElectronicsID, DetID >::addEntry(), ldmx::ElectronicsMap< ElectronicsID, DetID >::clear(), ldmx::ElectronicsMap< ElectronicsID, DetID >::exists(), and ldmx::ElectronicsMap< ElectronicsID, DetID >::get().
|
private |
Linear-time map for electronics (packed index) to raw detector id.
Definition at line 118 of file ElectronicsMap.h.
Referenced by ldmx::ElectronicsMap< ElectronicsID, DetID >::addEntry(), ldmx::ElectronicsMap< ElectronicsID, DetID >::clear(), ldmx::ElectronicsMap< ElectronicsID, DetID >::exists(), ldmx::ElectronicsMap< ElectronicsID, DetID >::exists(), ldmx::ElectronicsMap< ElectronicsID, DetID >::get(), and ldmx::ElectronicsMap< ElectronicsID, DetID >::get().
|
private |
Flag to determine if did2eid should be filled (resource optimization)
Definition at line 122 of file ElectronicsMap.h.
Referenced by ldmx::ElectronicsMap< ElectronicsID, DetID >::addEntry(), ldmx::ElectronicsMap< ElectronicsID, DetID >::exists(), and ldmx::ElectronicsMap< ElectronicsID, DetID >::get().