5#ifndef INDETIDENTIFIER_SCT_ID_H
6#define INDETIDENTIFIER_SCT_ID_H
21#include "Identifier/Identifier.h"
246 std::array<IdentifierHash, 5>
250 std::array<IdentifierHash, 5>
354 std::array<size_t, NUM_INDICES>
m_indices{0,1,2,3,4,5,6,7,999};
647inline Identifier::diff_type
649 Identifier::diff_type tval =
static_cast<Identifier::diff_type
>(target.get_compact() >>
base_bit());
650 Identifier::diff_type bval =
static_cast<Identifier::diff_type
>(
base.get_compact() >>
base_bit());
657 Identifier::diff_type offset)
const {
658 Identifier::value_type bval =
base.get_compact() >>
base_bit();
723 unsigned short index = id;
724 if (
index < vectorOfHashes.size()) {
725 return vectorOfHashes[
index];
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
bool m_do_checks
Flag for subclasses to know whether or not to perform checks.
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.
int sct_field_value() const
AtlasDetectorID(const std::string &name, const std::string &group)
int indet_field_value() const
Provide efficient access to individual field values, for subclass idhelpers.
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 SCT subdetector.
std::array< IdentifierHash, 5 > neighbours_by_phi(const IdentifierHash &idh) const
Identifier::size_type size_type
int phi_module_max(const Identifier &id) const
virtual int initialize_from_dictionary(const IdDictMgr &dict_mgr) override final
Initialization from the identifier dictionary.
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.
IdentifierHash nextInSequence(const IdentifierHash &id, const hash_vec &vectorOfHashes) const
int getMaxField(const Identifier &id, const ExpandedIdIndices &fieldIndx) const
Identifier strip_id_offset(const Identifier &base, Identifier::diff_type offset) const
Create an identifier with a given base and channel offset.
int base_bit() const
Return the lowest bit position used in the channel id.
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)
std::array< size_t, NUM_INDICES > m_indices
virtual ~SCT_ID()=default
const std::array< std::function< IdentifierHash(const IdentifierHash &)>, 5 > & neighbour_calls_by_eta() const
return functions to give neighbours in order: opposite, eta minus, eta plus, phi minus,...
size_type wafer_hash_max() const
size_type m_strip_hash_max
size_type m_wafer_hash_max
const IdDictDictionary * m_dict
IdDictFieldImplementation m_eta_mod_impl
MultiRange::const_identifier_factory const_expanded_id_iterator
int layer_disk(const Identifier &id) const
int side(const Identifier &id) const
std::array< std::function< IdentifierHash(const IdentifierHash &)>, 5 > m_neighboursByEta
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)
const_id_iterator wafer_end() const
bool is_phi_module_max(const Identifier &id) const
IdContext strip_context() const
IdDictFieldImplementation m_row_impl
IdentifierHash wafer_hash(const Identifier &wafer_id) const
wafer hash from id - optimized
bool is_eta_module_max(const Identifier &id) const
For the barrel.
IdDictFieldImplementation m_side_impl
std::vector< Identifier >::const_iterator const_id_iterator
Identifier wafer_id(int barrel_ec, int layer_disk, int phi_module, int eta_module, int side) const
For a single side of module.
int strip_max(const Identifier &id) const
int row(const Identifier &id) const
std::array< IdentifierHash, 5 > neighbours_by_eta(const IdentifierHash &idh) const
int get_prev_in_eta(const IdentifierHash &id, IdentifierHash &prev) const
Previous wafer hash in eta (return == 0 for neighbor found)
int layer_disk_max(const Identifier &id) const
Max/Min values for each field (-999 == failure)
id_vec::const_iterator id_vec_it
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)
int get_prev_in_phi(const IdentifierHash &id, IdentifierHash &prev) const
Previous wafer hash in phi (return == 0 for neighbor found)
Identifier idForCheck(const Identifier &id) const
const_expanded_id_iterator strip_end() const
int phi_module(const Identifier &id) const
Identifier module_id(int barrel_ec, int layer_disk, int phi_module, int eta_module) const
For a single crystal.
int strip(const Identifier &id) const
int barrel_ec(const Identifier &id) const
Values of different levels (failure returns 0)
size_type m_sct_region_index
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)
void strip_id_checks(int barrel_ec, int layer_disk, int phi_module, int eta_module, int side, int strip) const
IdDictFieldImplementation m_bec_impl
std::vector< Identifier > id_vec
int eta_module_max(const Identifier &id) const
IdDictFieldImplementation m_phi_mod_impl
IdDictFieldImplementation m_indet_impl
int eta_module(const Identifier &id) const
hash_vec::const_iterator hash_vec_it
IdDictFieldImplementation m_strip_impl
MultiRange m_full_strip_range
size_type strip_hash_max() const
int get_next_in_phi(const IdentifierHash &id, IdentifierHash &next) const
Next wafer hash in phi (return == 0 for neighbor found)
AtlasDetectorID::HelperType helper() const override final
This is an SCT_ID helper.
IdContext wafer_context() const
int get_other_side(const IdentifierHash &id, IdentifierHash &other) const
Wafer hash on other side.
void wafer_id_checks(int barrel_ec, int layer_disk, int phi_module, int eta_module, int side) const
std::vector< IdentifierHash > hash_vec
hash_vec m_next_eta_wafer_vec
Identifier strip_id(int barrel_ec, int layer_disk, int phi_module, int eta_module, int side, int strip) const
For an individual strip.
const_expanded_id_iterator strip_begin() const
For strip ids, only expanded id iterators are available.
IdDictFieldImplementation m_sct_impl
bool is_eta_module_min(const Identifier &id) const
For the barrel.
const_id_iterator wafer_begin() const
Iterators over full set of ids. Wafer iterator is sorted.
bool is_barrel(const Identifier &id) const
Test for barrel - WARNING: id MUST be sct id, otherwise answer is not accurate. Use SiliconID for gen...
hash_vec m_prev_eta_wafer_vec
int eta_module_min(const Identifier &id) const
MultiRange m_full_wafer_range
hash_vec m_prev_phi_wafer_vec
IdDictFieldImplementation m_lay_disk_impl