5#ifndef INDETIDENTIFIER_PIXELID_H
6#define INDETIDENTIFIER_PIXELID_H
20#include "Identifier/Identifier.h"
492 if ((val << 32) && !(val >> 32)) {
500 }
else if (!(val << 32) && (val >> 32)) {
513 return (val >> 31) && (val & 0xff);
525 Identifier::value_type val =
id.get_compact();
528 if ((val << 32) && !(val >> 32)) {
531 }
else if (!(val << 32) && (val >> 32)) {
546 int bec = bec_val[(val >> 29) & 0x03];
551 ((val >> 27) & 0x03),
552 ((val >> 21) & 0x3f),
554 ((val >> 8) & 0x1ff),
559inline Identifier::diff_type
561 Identifier::diff_type tval =
static_cast<Identifier::diff_type
>(target.get_compact() >>
base_bit());
562 Identifier::diff_type bval =
static_cast<Identifier::diff_type
>(
base.get_compact() >>
base_bit());
569 Identifier::diff_type offset)
const {
570 Identifier::value_type bval =
base.get_compact() >>
base_bit();
This class provides an interface to generate or decode an identifier for the upper levels of the dete...
macros to associate a CLID to a type
#define CLASS_DEF(NAME, CID, VERSION)
associate a clid and a version to a type eg
HelperType
enum class for eventual final derived types of this class
virtual bool do_checks(void) const override
Checks are performed by default in debug compilation and NOT in optimized compilation.
AtlasDetectorID(const std::string &name, const std::string &group)
This class saves the "context" of an expanded identifier (ExpandedIdentifier) for compact or hash ver...
IdDictFieldImplementation is used to capture the specification of a single field of an Identifier.
This is a "hash" representation of an Identifier.
A MultiRange combines several Ranges.
This is an Identifier helper class for the Pixel subdetector.
bool is_phi_module_max(const Identifier &id) const
To check for when phi wrap around may be needed.
bool is_dbm(const Identifier &id) const
Test for dbm - WARNING: id MUST be pixel id, otherwise answer is not accurate. Use SiliconID for gene...
const_id_iterator wafer_begin() const
Iterators over full set of ids. Wafer iterator is sorted.
int eta_index(const Identifier &id) const
int layer_disk(const Identifier &id) const
IdDictFieldImplementation m_bec_eta_mod_impl
virtual int initialize_from_dictionary(const IdDictMgr &dict_mgr) override
Initialization from the identifier dictionary.
int eta_module_max(const Identifier &id) const
size_type m_ETA_MODULE_INDEX
IdDictFieldImplementation m_lay_disk_shift_impl
IdDictFieldImplementation m_eta_mod_impl
MultiRange m_full_wafer_range
Identifier wafer_id(int barrel_ec, int layer_disk, int phi_module, int eta_module) const
For a single crystal.
int barrel_ec(const Identifier &id) const
Values of different levels (failure returns 0)
size_type m_LAYER_DISK_INDEX
std::vector< Identifier > id_vec
IdDictFieldImplementation m_lay_disk_impl
const_expanded_id_iterator pixel_end() const
const IdDictDictionary * m_dict
bool is_shortened_pixel_id(Identifier32::value_type val) const
Test if this is a valid shortened pixel channel id.
bool is_eta_module_max(const Identifier &id) const
For the barrel.
void pixel_id_checks(int barrel_ec, int layer_disk, int phi_module, int eta_module, int phi_index, int eta_index) const
Identifier pixel_id(int barrel_ec, int layer_disk, int phi_module, int eta_module, int phi_index, int eta_index) const
For an individual pixel.
hash_vec m_prev_phi_wafer_vec
int base_bit() const
Return the lowest bit position used in the channel id.
size_type m_pixel_region_index
IdDictFieldImplementation m_phi_mod_shift_impl
IdentifierHash wafer_hash(Identifier wafer_id) const
wafer hash from id
size_type wafer_hash_max() const
int eta_module(const Identifier &id) const
size_type m_BARREL_EC_INDEX
int phi_index(const Identifier &id) const
hash_vec::const_iterator hash_vec_it
IdDictFieldImplementation m_phi_mod_impl
const_id_iterator wafer_end() const
IdDictFieldImplementation m_phi_index_impl
ExpandedIdentifier m_baseExpandedIdentifier
hash_vec m_next_phi_wafer_vec
Identifier::diff_type calc_offset(const Identifier &base, const Identifier &target) const
Calculate a channel offset between the two identifiers.
int eta_index_max(const Identifier &id) const
Identifier::size_type size_type
std::vector< unsigned short > hash_vec
Identifier pixel_id_offset(const Identifier &base, Identifier::diff_type offset) const
Create an identifier with a given base and channel offset.
int layer_disk_max(const Identifier &id) const
Max/Min values for each field (error returns -999)
void get_expanded_id(const Identifier &id, ExpandedIdentifier &exp_id, const IdContext *context=0) const
Create expanded id from compact id (return == 0 for OK)
size_type m_pixel_hash_max
Range::field m_barrel_field
int get_next_in_eta(const IdentifierHash &id, IdentifierHash &next) const
Next wafer hash in eta (return == 0 for neighbor found)
size_type m_PHI_INDEX_INDEX
MultiRange::const_identifier_factory const_expanded_id_iterator
bool is_blayer(const Identifier &id) const
Test for b-layer - WARNING: id MUST be pixel id, otherwise answer is not accurate....
virtual int get_hash(const Identifier &id, IdentifierHash &hash_id, const IdContext *context=0) const override final
Create hash id from compact id (return == 0 for OK)
IdContext pixel_context() const
int phi_index_max(const Identifier &id) const
Identifier pixel_id_from_shortened(Identifier32::value_type val) const
Create a compact pixel id from a (fixed format) legacy pixel channel id.
const_expanded_id_iterator pixel_begin() const
For pixel ids, only expanded id iterators are available.
size_type m_PHI_MODULE_INDEX
IdDictFieldImplementation m_eta_mod_shift_impl
int get_prev_in_eta(const IdentifierHash &id, IdentifierHash &prev) const
Previous wafer hash in eta (return == 0 for neighbor found)
id_vec::const_iterator id_vec_it
void wafer_id_checks(int barrel_ec, int layer_disk, int phi_module, int eta_module) const
size_type m_wafer_hash_max
int get_prev_in_phi(const IdentifierHash &id, IdentifierHash &prev) const
Previous wafer hash in phi (return == 0 for neighbor found)
Identifier m_baseIdentifier
IdContext wafer_context() const
std::vector< Identifier >::const_iterator const_id_iterator
int get_next_in_phi(const IdentifierHash &id, IdentifierHash &next) const
Next wafer hash in phi (return == 0 for neighbor found)
IdDictFieldImplementation m_bec_impl
hash_vec m_prev_eta_wafer_vec
void test_wafer_packing() const
Tests of packing.
size_type m_ETA_INDEX_INDEX
IdDictFieldImplementation m_pixel_impl
int eta_module_min(const Identifier &id) const
IdDictFieldImplementation m_indet_impl
virtual int get_id(const IdentifierHash &hash_id, Identifier &id, const IdContext *context=0) const override final
Create compact id from hash id (return == 0 for OK)
IdDictFieldImplementation m_eta_index_impl
IdDictFieldImplementation m_bec_shift_impl
hash_vec m_next_eta_wafer_vec
int phi_module(const Identifier &id) const
bool is_barrel(const Identifier &id) const
Test for barrel - WARNING: id MUST be pixel id, otherwise answer is not accurate. Use SiliconID for g...
bool is_eta_module_min(const Identifier &id) const
For the barrel.
MultiRange m_full_pixel_range
virtual AtlasDetectorID::HelperType helper() const override
THis is a PixelID helper.
size_type pixel_hash_max() const
int phi_module_max(const Identifier &id) const