Loading [MathJax]/jax/output/SVG/config.js
 |
ATLAS Offline Software
|
Go to the documentation of this file.
20 #include "GaudiKernel/MsgStream.h"
35 , m_supercell (supercell ? 1 : 0)
36 , m_tile_region_index(0)
38 , m_SECTION_INDEX(999)
64 return "Tile_Base_ID::to_string - unknown context";
69 return "Tile_Base_ID::to_string - can not expand ID";
71 return (std::string)(exp_id);
88 return "Tile_Base_ID::to_string - unknown context";
92 if (
get_id ( hash_id,
id, &context ) == 0 ) {
95 return "Tile_Base_ID::to_string - can not expand ID";
97 return (std::string)(exp_id);
100 return "Tile_Base_ID::to_string - can not get ID from hash_id";
121 IdentifierHash hash_id;
132 IdentifierHash hash_id;
262 && (
side(
id) == 0 );
408 IdentifierHash hash_id =
index;
428 std::string errorMessage =
"Tile_Base_ID::region_id() result is not OK: ID, range = "
482 std::string errorMessage =
"Tile_Base_ID::module_id() result is not OK: ID, range = "
538 std::string errorMessage =
"Tile_Base_ID::tower_id() result is not OK: ID, range = "
563 int module,
int tower)
const
607 std::string errorMessage =
"Tile_Base_ID::cell_id() result is not OK: ID, range = "
653 int pmt,
bool checks )
const
665 std::string errorMessage =
"Tile_Base_ID::pmt_id(cell_id,pmt) could not pack ID: "
679 std::string errorMessage =
"Tile_Base_ID::pmt_id(cell_id,pmt) result is not OK: ID = "
689 std::string errorMessage =
"Tile_Base_ID::pmt_id() result is not OK: ID, range = "
720 std::string errorMessage =
"Tile_Base_ID::pmt_id() result is not OK: ID, range = "
755 int pmt,
int adc,
bool checks )
const
768 std::string errorMessage =
"Tile_Base_ID::adc_id(cell_id,pmt,adc) could not pack ID: "
782 std::string errorMessage =
"Tile_Base_ID::adc_id(cell_id,pmt,adc) result is not OK: ID = "
792 std::string errorMessage =
"Tile_Base_ID::adc_id() result is not OK: ID, range = "
810 int adc,
bool checks )
const
822 std::string errorMessage =
"Tile_Base_ID::adc_id(pmt_id,adc) could not pack ID: "
836 std::string errorMessage =
"Tile_Base_ID::adc_id(pmt_id,adc) result is not OK: ID = "
846 std::string errorMessage =
"Tile_Base_ID::adc_id() result is not OK: ID, range = "
877 std::string errorMessage =
"Tile_Base_ID::adc_id() result is not OK: ID, range = "
923 if (!
dict()->pack32(
id,0,
id.
fields() - 1,compactId)) {
941 if (!
dict()->pack32(
id,0,
id.
fields() - 1,compactId)) {
960 if (!
dict()->pack32(
id,0,
id.
fields() - 1,compactId)) {
978 if (!
dict()->pack32(
id,0,
id.
fields() - 1,compactId)) {
996 if (!
dict()->pack32(
id,0,
id.
fields() - 1,compactId)) {
1014 if (!
dict()->pack32(
id,0,
id.
fields() - 1,compactId)) {
1022 if (hash_id <
channels().hash_max()) {
1025 std::string errorMessage =
"Tile_Base_ID::cell_id(hash_id) - hash_id out of range ";
1032 IdentifierHash ret = 0;
1036 std::string errorMessage =
"Tile_Base_ID::cell_hash(cell_id) - cell_id out of range ";
1096 log << MSG::ERROR <<
"get_id: adc hash_id is out of range " << hash_id
1105 log << MSG::ERROR <<
"get_id: pmt hash_id is out of range " << hash_id
1109 if (hash_id <
channels().hash_max()) {
1114 log << MSG::ERROR <<
"get_id: cell hash_id is out of range " << hash_id
1123 log << MSG::ERROR <<
"get_id: tower hash_id is out of range " << hash_id
1132 log << MSG::ERROR <<
"get_id: module hash_id is out of range " << hash_id
1136 if (hash_id <
regions().hash_max()) {
1141 log << MSG::ERROR <<
"get_id: region hash_id is out of range " << hash_id
1152 IdentifierHash& hash_id,
1210 if (atlasDict->
get_label_value(
"subdet",
"TileCalorimeter", tileField)) {
1211 log << MSG::ERROR <<
"Could not get value for label 'TileCalorimeter' of field 'subdet' in dictionary "
1219 tile_id.
add(tileField);
1231 int tilehwField = -1;
1232 if (
dict()->get_label_value(
"section",
"Online", tilehwField)) {
1233 log << MSG::ERROR <<
"Could not get value for label 'Online' of field 'section' in dictionary "
1239 reg_id.
add(tilehwField);
1249 int tiletbField = -1;
1250 if (
dict()->get_label_value(
"section",
"Testbeam", tiletbField)) {
1251 log << MSG::ERROR <<
"Could not get value for label 'Testbeam' of field 'section' in dictionary "
1257 reg_id.
add(tiletbField);
1284 std::string neighbourFile;
1286 neighbourFile =
"TileSuperCellNeighbour.txt";
1291 if (neighbourFile.empty())
throw std::runtime_error(
"TileID: Cannot find the Tile Neighbour file name");
1507 if (
range.match(expId)) {
1509 if (not eta_field.
empty()) {
1532 if (
range.match(expId)) {
1534 if (not eta_field.
empty()) {
1577 if (
range.match(expId)) {
1579 if (not phi_field.
empty()) {
1603 else if ( 0 ==
begin) {
1618 log << MSG::ERROR <<
"initLevelsFromDict - dictionary NOT initialized "
1636 log << MSG::ERROR <<
"initLevelsFromDict - cannot find " <<
group_name
1637 <<
" group' field " <<
endmsg;
1649 log << MSG::ERROR <<
"initLevelsFromDict - unable to find 'subdet' field "
1659 log << MSG::ERROR <<
"initLevelsFromDict - unable to find 'section' field "
1669 log << MSG::ERROR <<
"initLevelsFromDict - unable to find 'side' field "
1679 log << MSG::ERROR <<
"initLevelsFromDict - unable to find 'module' field "
1689 log << MSG::ERROR <<
"initLevelsFromDict - unable to find 'tower' field "
1699 log << MSG::ERROR <<
"initLevelsFromDict - unable to find 'sampling' field "
1709 log << MSG::ERROR <<
"initLevelsFromDict - unable to find 'pmt' field "
1719 log << MSG::ERROR <<
"initLevelsFromDict - unable to find 'adc' field "
1736 log <<
MSG::DEBUG <<
"initLevelsFromDict decode index and bit fields for each level: " <<
endmsg ;
1787 std::vector<IdentifierHash>& neighbourList)
const
1794 log << MSG::WARNING <<
"get_neighbours: neighbours not initialized !!! returning empty list" <<
endmsg;
1796 neighbourList.resize(0);
1800 neighbourList.clear();
1807 bool prevPhi = corners2DOnly || (option &
prevInPhi);
1808 bool nextPhi = corners2DOnly || (option &
nextInPhi);
1809 bool prevEta = corners2DOnly || (option &
prevInEta);
1810 bool nextEta = corners2DOnly || (option &
nextInEta);
1812 std::vector<IdentifierHash> inpList;
1816 inpList.push_back(id_orig);
1825 }
else if (corners2DOnly) {
1827 inpList = std::move(neighbourList);
1828 neighbourList.clear();
1832 inpList.insert (inpList.end(), neighbourList.begin(), neighbourList.end());
1837 inpItr = inpList.begin();
1838 inpLast = inpList.end();
1839 for ( ; inpItr != inpLast; ++inpItr) {
1840 IdentifierHash
id = (*inpItr);
1848 inpItr = inpList.begin();
1849 inpLast = inpList.end();
1850 for ( ; inpItr != inpLast; ++inpItr) {
1851 IdentifierHash
id = (*inpItr);
1863 if (!neighbourList.empty())
result = 0;
Identifier module_id(int section, int side, int module) const
JetConstituentVector::iterator iterator
IdDictFieldImplementation m_tower_impl
int eta_min(const Identifier &id) const
max values (-999 == failure)
bool is_tile_aux(const Identifier &id) const
int decode_section(int section) const
int next_eta(const IdentifierHash &id, std::vector< IdentifierHash > &neighbourList) const
id_range pmt_range() const
MultiRange build_multirange() const
Get MultiRange for full dictionary.
bool is_positive(const Identifier &id) const
MultiRange m_full_adc_range
size_type cell_hash_max(void) const
id_iterator tower_begin() const
iterator over set of tower Identifiers
int unpack(const Identifier &id, const ExpandedIdentifier &prefix, size_t index2, ExpandedIdentifier &unpackedId) const
Unpack the value_type id to an expanded Identifier, considering the provided prefix (result will incl...
std::vector< Identifier >::const_iterator id_iterator
Type for iterators over identifiers.
id_range reg_range() const
int next_samp(const IdentifierHash &id, std::vector< IdentifierHash > &neighbourList) const
id_iterator end() const
Return an end iterator over the group's Identifiers.
id_range range() const
Return an iterator range over the group's Identifiers.
IdDictFieldImplementation m_section_impl
std::string show_to_string(void) const
bool is_tile_gap(const Identifier &id) const
IdContext cell_context(void) const
id for cells
id_iterator cell_end() const
IdDictFieldImplementation m_system_impl
int pmt(const Identifier &id) const
const std::vector< Identifier > & region_ids() const
provide access to id vectors, accessed via hash
element_type get_minimum() const
Query the values.
id_range cell_range() const
int init(T &parent, const std::string &type, const MultiRange &full_range, Identifier(T::*idfunc)(const ExpandedIdentifier &) const, size_type end_index)
Initialize.
size_type end_index() const
int side(const Identifier &id) const
void add(element_type value)
Append a value into a new field.
id_iterator module_end() const
Identifier id(IdentifierHash hashId) const
Return the identifier for a given hash code (no checking).
int sample(const Identifier &id) const
int encode_section(int section) const
id_iterator begin() const
Return a begin iterator over the group's Identifiers.
size_type region_hash_max(void) const
hash tables max size
bool is_tile_extbarrel(const Identifier &id) const
int initLevelsFromDict(const std::string &group_name)
IMessageSvc * m_msgSvc
pointer to the message service
const std::vector< Identifier > & cell_ids() const
const std::string & find_metadata(const std::string &name) const
Access to meta data, name/value pairs.
element_type get_maximum() const
TileNeighbour m_neighbour
int tower(const Identifier &id) const
size_type module_hash_max(void) const
id_iterator cell_begin() const
iterator over set of cell Identifiers
int system(const Identifier &id) const
int get_hash(Identifier id, IdentifierHash &hash_id) const
Look up the hash code corresponding to an Identifier.
virtual int get_expanded_id(const Identifier &id, ExpandedIdentifier &exp_id, const IdContext *context) const
create expanded Identifier from Identifier (return == 0 for OK)
int prev_samp(const IdentifierHash &id, std::vector< IdentifierHash > &neighbourList) const
IdDictFieldImplementation m_module_impl
bool is_high_gain(const Identifier &id) const
ExpandedIdentifier tile_exp(void) const
IdDictField * find_field(const std::string &name) const
const HashGroup & regions() const
Return the HashGroup for regions.
int region(int section, int side) const
IdContext module_context(void) const
id for modules
int initialize_base_from_dictionary(const IdDictMgr &dict_mgr, const std::string &group_name)
initialization from the identifier dictionary
int prev_eta(const IdentifierHash &id, std::vector< IdentifierHash > &neighbourList) const
int prev_phi(const IdentifierHash &id, std::vector< IdentifierHash > &neighbourList) const
int get_field(const Identifier &id, size_type index) const
unpack one field from Identifier
bool m_do_neighbours
Flag for subclasses to know whether or not to perform neighbour initialization.
int initialize(const Tile_Base_ID *tileID, const std::string &filename="TileNeighbour.txt")
Tile_Base_ID(const std::string &name, bool supercell)
Constructor.
size_type m_SECTION_INDEX
CaloIDHelper::HashGroup m_pmts
Identifier tile_det(int section) const
build identifier for any Tilecal section
Identifier::size_type size_type
size_type m_tile_region_index
Identifier region_id(int index) const
build single region, module, tower, cell, pmt, adc identifiers
This class provides an interface to generate or decode an identifier for the upper levels of the dete...
size_type begin_index() const
virtual int get_id(const IdentifierHash &hash_id, Identifier &id, const IdContext *context=0) const
create compact id from hash id (return == 0 for OK)
IdDictGroup * find_group(const std::string &group_name) const
int adc(const Identifier &id) const
IdDictDictionary * find_dictionary(const std::string &name) const
Access dictionary by name.
Identifier tile_gap() const
build identifier for Tile Gap detector (ITC + gap/crack scintillators)
bool is_tile_gapscin(const Identifier &id) const
int module(const Identifier &id) const
Identifier tower_id(int section, int side, int module, int tower) const
void remove_range(const ExpandedIdentifier &id)
Remove a Range made from a single ExpandedIdentifier.
const std::vector< Identifier > & ids() const
Return a vector of all Identifiers for this group.
const IdDictDictionary * dict() const
Return the dictionary for this subdetector.
Base class to factor out code common among Calo ID helpers.
Identifier tile_system() const
build identifier for whole TileCal
id_range module_range() const
id_range adc_range() const
Identifier tile_extbarrel() const
build identifier for Tile Extended Barrel
std::vector< IdDictRegion * > m_regions
IdContext tower_context(void) const
id for towers
Exception class for Tile Identifiers.
bool is_tile(Identifier id) const
id_iterator tower_end() const
const std::vector< Identifier > & module_ids() const
int region_eta_max(const Identifier &id) const
id_iterator module_begin() const
iterator over set of module Identifiers
Factor out code common between TileID and Tile_SuperCell_ID.
bool m_quiet
If true, suppress DEBUG/INFO messages.
id_iterator reg_end() const
int initialize_base_from_dictionary(const IdDictMgr &dict_mgr, const std::string &dict_name)
Do basic initialization of the helper.
virtual int get_hash(const Identifier &id, IdentifierHash &hash_id, const IdContext *context=0) const
create hash id from compact id (return == 0 for OK)
id_iterator pmt_begin() const
iterator over set of pmt Identifiers
Identifier adc_id(const Identifier &cell_id, int pmt, int adc) const
int tile_field_value() const
int get_label_value(const std::string &field, const std::string &label, int &value) const
const ExpandedIdentifier & prefix_id() const
Accessors.
std::string strformat(const char *fmt,...)
return a std::string according to a format fmt and varargs
id_iterator adc_begin() const
iterator over set of adc Identifiers
id_iterator adc_end() const
MultiRange m_full_module_range
CaloIDHelper::HashGroup m_towers
IdDictFieldImplementation m_pmt_impl
int phi_max(const Identifier &id) const
A Range describes the possible ranges for the field values of an ExpandedIdentifier.
const std::vector< Identifier > & tower_ids() const
IdDictFieldImplementation m_adc_impl
Identifier tile_barrel() const
build identifier for Tile Barrel
def init(v_theApp, v_rootStream=None)
int get_neighbours(const IdentifierHash &id, const LArNeighbours::neighbourOption &option, std::vector< IdentifierHash > &neighbourList) const
access to hashes for neighbours return == 0 for neighbours found option = prevInPhi,...
size_type tower_hash_max(void) const
int region_eta_min(const Identifier &id) const
IdContext adc_context(void) const
id for ADCs
const HashGroup & channels() const
Return the HashGroup for channels (cells).
size_type pmt_hash_max(void) const
int prev_samp_wide(const IdentifierHash &id, std::vector< IdentifierHash > &neighbourList) const
IdDictFieldImplementation m_sample_impl
IdDictFieldImplementation m_side_impl
int match(const ExpandedIdentifier &id) const
Match an identifier.
MultiRange m_full_cell_range
bool reinitialize(const IdDictMgr &dict_mgr)
Test whether an idhelper should be reinitialized based on the change of tags.
CaloIDHelper::HashGroup m_adcs
CaloIDHelper::HashGroup m_modules
std::string to_string(const Identifier &id, int level=0) const
MultiRange m_full_pmt_range
int eta_max(const Identifier &id) const
const std::vector< Identifier > & adc_ids() const
Identifier pmt_id(const Identifier &any_id) const
id_iterator pmt_end() const
This is the individual specification for the range of one ExpandedIdentifier IdentifierField.
bool is_supercell(const Identifier &id) const
bool is_twosides(const Identifier &id) const
id_range tower_range() const
bool is_negative(const Identifier &id) const
IdContext pmt_context(void) const
id for PMTs
MultiRange m_full_tower_range
const std::vector< Identifier > & pmt_ids() const
boost::iterator_range< id_iterator > id_range
Type for range over identifiers.
IdContext region_context(void) const
access to IdContext's which define which levels of fields are contained in the id
size_type adc_hash_max(void) const
int next_phi(const IdentifierHash &id, std::vector< IdentifierHash > &neighbourList) const
IdentifierHash cell_hash(const Identifier &cell_id) const
fast conversion from ID to hash for cells
int next_samp_wide(const IdentifierHash &id, std::vector< IdentifierHash > &neighbourList) const
MultiRange m_full_region_range
int section(const Identifier &id) const
bool is_tile_barrel(const Identifier &id) const
Test of an Identifier to see if it belongs to a particular part of the calorimeter.
Identifier cell_id(const Identifier &any_id) const
virtual bool do_checks(void) const override
Checks are performed by default in debug compilation and NOT in optimized compilation.
bool is_low_gain(const Identifier &id) const
This class saves the "context" of an expanded identifier (ExpandedIdentifier) for compact or hash ver...
id_iterator reg_begin() const
iterator over set of region Identifiers
size_type hash_max() const
Return one more than the largest hash code.
Identifier channel_id(IdentifierHash hashId) const
Return the channel (cell) Identifier for a given hash code (no checking).