49 if (range.match(expId)) {
51 if (not eta_field.
empty()) {
57 if (etamin < result) result = etamin;
75 if (range.match(expId)) {
77 if (not eta_field.
empty()) {
79 if (result < etamax) result = etamax;
96 if (range.match(expId)) {
98 if (not phi_field.
empty()) {
100 if (-999 == result) {
104 if (phimin < result) result = phimin;
122 if (range.match(expId)) {
124 if (not phi_field.
empty()) {
126 if (result < phimax) result = phimax;
139 neighbourList.clear();
142 ATH_MSG_WARNING(
"neighbours not initialized !!! returning empty list");
147 ATH_MSG_WARNING(
"neighbours requested for non-existing channel -- id/max " <<
id <<
"/"
156 neighbourList.insert(neighbourList.end(),
164 neighbourList.insert(neighbourList.end(),
172 neighbourList.insert(neighbourList.end(),
197 ATH_MSG_DEBUG(
"Request to reinitialize not satisfied - tags have not changed");
205 if(CaloIDHelper::initialize_base_from_dictionary(dict_mgr,
213 if (!dict()->find_group(
"lar_mini_fcal")) {
214 ATH_MSG_INFO(
"initialize_from_dict - LArCalorimeter dictionary does NOT contain miniFCAL description. Unable to initialize LArMiniFCAL_ID.");
221 ATH_MSG_WARNING(
"initialize_from_dict - cannot initialize MiniFCAL part of LArCalorimeter dictionary");
229 if (atlasDict->
get_label_value(
"subdet",
"LArCalorimeter", larField)) {
230 ATH_MSG_ERROR(
"Could not get value for label 'LArCalorimeter' of field 'subdet' in dictionary " << atlasDict->
name());
236 int larFcalField = -1;
237 if (dict()->get_label_value(
"part",
"LArFCAL", larFcalField)) {
238 ATH_MSG_ERROR(
"Could not get value for label 'LArMiniFCAL' of field 'part' in dictionary " << atlasDict->
name());
250 std::string
str =
"lar_mini_fcal";
297 std::string errorMessage =
"LArMiniFCAL_ID::module_id() result is not OK: ID, range = "
313 std::string errorMessage =
"LArMiniFCAL_ID::channel_id() result is not OK: ID, range = "
328 std::string errorMessage =
"LArMiniFCAL_ID::channel_id(modId) result is not OK: ID = "
336 std::string errorMessage =
"LArMiniFCAL_ID::channel_id(modId) result is not OK: ID, range = "
365 ATH_MSG_ERROR(
"initLevelsFromDict - dictionary NOT initialized");
380 const IdDictField* field = dict()->find_field(
"subdet") ;
385 ATH_MSG_ERROR(
"initLevelsFromDict - unable to find 'subdet' field");
389 field = dict()->find_field(
"part") ;
394 ATH_MSG_ERROR(
"initLevelsFromDict - unable to find 'part' field");
398 field = dict()->find_field(
"barrel-endcap") ;
403 ATH_MSG_ERROR(
"initLevelsFromDict - unable to find 'barrel-endcap' field");
407 field = dict()->find_field(
"module") ;
412 ATH_MSG_ERROR(
"initLevelsFromDict - unable to find 'module' field");
417 field = dict()->find_field(
"depth-mfcal") ;
427 field = dict()->find_field(
"eta-mfcal") ;
432 ATH_MSG_ERROR(
"initLevelsFromDict - unable to find 'eta' field");
436 field = dict()->find_field(
"phi-mfcal") ;
441 ATH_MSG_ERROR(
"initLevelsFromDict - unable to find 'phi' field");
459 const IdDictRegion& region = *dict()->find_region (
"",
"lar_mini_fcal");
469 ATH_MSG_DEBUG(
"decode index and bit fields for each level: ");
483 if (
channels().init (*
this,
"channels",
488 if (
regions().init (*
this,
"regions",
507 fin.open(
file.c_str());
526 bool isComment =
true;
528 int isamp,idepth, iphi,ieta;
533 fin.getline(aLine,
sizeof(aLine)-1);
534 sLine = std::string(aLine);
535 }
while (sLine.empty() && !fin.eof());
536 isComment = ( sLine.find(
'#') != std::string::npos );
539 while ( sLine.empty() && !fin.eof()) {
540 fin.getline(aLine,
sizeof(aLine)-1);
541 sLine = std::string(aLine);
543 std::istringstream es( sLine.c_str() );
545 if ( es >> AorC >> isamp >>
dot >> idepth >>
dot >> iphi >>
dot >> ieta ) {
548 while ( es >> AorC >> isamp >>
dot >> idepth >>
dot >> iphi >>
dot >> ieta ) {
549 if (!ic.is_valid())
continue;
552 vec[ic].insert(
vec[ic].end(),inext);
556 }
while (!fin.eof()) ;
567 std::string f2d,f3dnext,f3dprev;
572 if (f2d.empty() || f3dnext.empty() || f3dprev.empty()) {
573 ATH_MSG_ERROR(
"init_neighbours: cannot find neighbours files: "
574 <<
" f2d: " << f2d <<
" f3dnext: " << f3dnext <<
" f3dprev: " << f3dprev);
575 throw std::runtime_error(
"LArMiniFCAL_ID::init_neighbours: Cannot find the FCAL Neighbour file names");
Scalar eta() const
pseudorapidity method
Scalar phi() const
phi method
#define ATH_MSG_DEBUG(x,...)
#define ATH_MSG_ERROR(x,...)
#define ATH_MSG_WARNING(x,...)
#define ATH_MSG_INFO(x,...)
This class provides an interface to generate or decode an identifier for the upper levels of the dete...
std::vector< size_t > vec
static const Attributes_t empty
virtual std::string dictionaryVersion(void) const override
bool m_do_neighbours
Flag for subclasses to know whether or not to perform neighbour initialization.
bool reinitialize(const IdDictMgr &dict_mgr)
Test whether an idhelper should be reinitialized based on the change of tags.
int lar_fcal_field_value() const
virtual void setDictVersion(const IdDictMgr &dict_mgr, const std::string &name) override
ExpandedIdentifier lar_fcal_exp(void) const
int lar_field_value() const
std::string show_to_string(Identifier id, const IdContext *context=0, char sep='.') const
or provide the printout in string form
size_type hash_max() const
Return one more than the largest hash code.
const HashGroup & regions() const
Return the HashGroup for regions.
IdContext region_context() const
Return the context for regions.
size_type channel_hash_max() const
One more than the largest channel (cell) hash code.
CaloIDHelper(const std::string &name, const std::string &group)
Constructor.
Identifier region_id(IdentifierHash hashId) const
Return the region Identifier for a given hash code (no checking).
int fill_vec_of_dict_regions(const std::string &group_name="")
Do basic initialization of the helper.
const HashGroup & channels() const
Return the HashGroup for channels (cells).
void clear()
Erase all fields.
This class saves the "context" of an expanded identifier (ExpandedIdentifier) for compact or hash ver...
int get_label_value(const std::string &field, const std::string &label, int &value) const
const std::string & name() const
Dictionary name.
const IdDictDictionary * find_dictionary(const std::string &name) const
Access dictionary by name.
const std::string & find_metadata(const std::string &name) const
Access to meta data, name/value pairs.
const IdDictFieldImplementation & implementation(size_t i) const
element_type get_minimum() const
Query the values.
bool empty() const
If true, this field does not have any constraints, and may hold any value representable by element_ty...
element_type get_maximum() const
This is a "hash" representation of an Identifier.
Exception class for LAr Identifiers.
virtual int initialize_from_dictionary(const IdDictMgr &dict_mgr)
initialization from the identifier dictionary
IdDictFieldImplementation m_depth_impl
void module_id_checks(int pos_neg, int module) const
int eta_max(const Identifier regId) const
max value of eta index (-999 == failure)
int init_neighbors_from_file(const std::string &filename, std::vector< std::set< IdentifierHash > > &vec)
IdDictFieldImplementation m_phi_impl
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 = all2D,...
int phi_max(const Identifier regId) const
max value of phi index (-999 == failure)
IdDictFieldImplementation m_module_impl
MultiRange m_full_depth_range
int depth(const Identifier id) const
depth [0,3]
MultiRange m_full_module_range
IdDictFieldImplementation m_pn_impl
int pos_neg(const Identifier id) const
pos_neg : +/- 2 (A/C side)
int eta_min(const Identifier regId) const
min value of eta index (-999 == failure)
IdentifierHash channel_hash(Identifier channelId) const
Convert a connected channel (cell) Identifier to a hash code.
IdDictFieldImplementation m_lar_impl
std::vector< short int > m_vecOfPhiMin
int init_neighbors_3d_next(const std::string &filename)
MultiRange m_full_channel_range
size_type m_MiniFCAL_INDEX
int eta(const Identifier id) const
eta [0,63] module 1 ; [0,31] module 2 ; [0,15] module 3
IdContext module_context() const
context for modules – method kept for backward compatibility.
virtual int get_expanded_id(const Identifier &id, ExpandedIdentifier &exp_id, const IdContext *context) const
create expanded Identifier from Identifier (return == 0 for OK)
size_type m_fcal_region_index
IdDictFieldImplementation m_fcal_impl
IdDictFieldImplementation m_eta_impl
int phi_min_init(const Identifier regId) const
void channel_id_checks(int pos_neg, int module, int depth, int eta, int phi) const
std::vector< std::set< IdentifierHash > > m_neighbors_2d_vec
Identifier channel_id(const ExpandedIdentifier &exp_id) const
cell identifier for a channel from ExpandedIdentifier
int phi(const Identifier id) const
phi [0,15]
int init_neighbors(const IdDictMgr &dict_mgr)
Identifier module_id(const ExpandedIdentifier &exp_id) const
module identifier for a channel from ExpandedIdentifier
int init_neighbors_3d_prev(const std::string &filename)
int init_neighbors_2d(const std::string &filename)
std::vector< std::set< IdentifierHash > > m_neighbors_3d_next_vec
std::vector< std::set< IdentifierHash > > m_neighbors_3d_prev_vec
static std::string find_file(const std::string &logical_file_name, const std::string &search_path)
A Range describes the possible ranges for the field values of an ExpandedIdentifier.
std::string depth
tag string for intendation