ATLAS Offline Software
Loading...
Searching...
No Matches
SCT_ID.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3 */
4
5/***************************************************************************
6 Inner Detector identifier package
7 -------------------------------------------
8***************************************************************************/
9
10
13#include "IdDict/IdDictField.h"
14#include "IdDict/IdDictMgr.h"
15#include "IdDict/IdDictRegion.h"
19#include <set>
20#include <algorithm>
21#include <iostream>
22
23
24namespace{
26 const std::array<IdentifierHash, 5> invalidHashes{invalidHash, invalidHash, invalidHash,
28 const std::function< IdentifierHash(const IdentifierHash &)>
29 invalidHashFunc = ([](const IdentifierHash &){return IdentifierHash{};});
30}
31
32
33
35 :
36 AtlasDetectorID("SCT_ID", "sct"),
37 m_neighboursByEta{invalidHashFunc, invalidHashFunc, invalidHashFunc , invalidHashFunc, invalidHashFunc},
38 m_dict(nullptr),
42 m_hasRows(false) {
43
44}
45
46void
48 int layer_disk,
49 int phi_module,
50 int eta_module,
51 int side) const {
52 // Check that id is within allowed range
53
54 // Fill expanded id
56
59
60 if (!m_full_wafer_range.match(id)) { // module range check is sufficient
61 ATH_MSG_ERROR(" result is NOT ok. ID, range " + std::string(id)+std::string(m_full_wafer_range));
62 }
63}
64
65void
67 int layer_disk,
68 int phi_module,
69 int eta_module,
70 int side,
71 int strip) const {
72 // Check that id is within allowed range
73
74 // Fill expanded id
76
79
80 if (!m_full_strip_range.match(id)) {
81 ATH_MSG_ERROR(" result is NOT ok. ID, range " + std::string(id)+std::string(m_full_strip_range));
82 }
83}
84
85void
87 if (not m_hasRows){
89 expId[m_indices[LAYER_DISK]],
90 expId[m_indices[PHI]],
91 expId[m_indices[ETA]],
92 expId[m_indices[SIDE]],
93 expId[m_indices[STRIP]]);
94 } else {
96 expId[m_indices[LAYER_DISK]],
97 expId[m_indices[PHI]],
98 expId[m_indices[ETA]],
99 expId[m_indices[SIDE]],
100 expId[m_indices[ROW]],
101 expId[m_indices[STRIP]]);
102 }
103}
104
105void
107 int layer_disk,
108 int phi_module,
109 int eta_module,
110 int side,
111 int row,
112 int strip) const {
113 // Check that id is within allowed range
114
115 // Fill expanded id
117
120
121
122 if (!m_full_strip_range.match(id)) {
123 ATH_MSG_ERROR(" result is NOT ok. ID, range " + std::string(id)+std::string(m_full_strip_range));
124 }
125}
126
127int
128SCT_ID::getMaxField(const Identifier & id, const ExpandedIdIndices &fieldIndx) const{
129 // get max from dictionary
130 ExpandedIdentifier expId;
131 int result(-999);
132 const IdContext context = (fieldIndx == LAYER_DISK) ? wafer_context():IdContext(expId, 0, m_indices[LAYER_DISK]) ;
133 get_expanded_id(id, expId, &context);
134 const auto & useRange = (fieldIndx == STRIP)? m_full_strip_range : m_full_wafer_range;
135 for (unsigned int i = 0; i != useRange.size(); ++i) {
136 const Range& range = useRange[i];
137 if (range.match(expId)) {
138 const Range::field& thisField = range[m_indices[fieldIndx]];
139 if (not thisField.empty()) {
140 auto thisMax= thisField.get_maximum();
141 if (fieldIndx == ETA or fieldIndx == STRIP){
142 result = std::max(result, thisMax);
143 } else {
144 return thisMax;
145 }
146 }
147 }
148 }
149 return result; // default
150}
151
152int
154 return getMaxField(id, LAYER_DISK);
155}
156
157int
159 // get min from dictionary - note that eta modules skip 0 for
160 // sct, so we must search for absolute min
161 ExpandedIdentifier expId;
162 IdContext layer_context(expId, 0, m_indices[LAYER_DISK]);
163 get_expanded_id(id, expId, &layer_context);
164 int result = -999;
165 for (unsigned int i = 0; i < m_full_wafer_range.size(); ++i) {
166 const Range& range = m_full_wafer_range[i];
167 if (range.match(expId)) {
168 const Range::field& eta_field = range[m_indices[ETA]];
169 if (not eta_field.empty()) {
170 int etamin = eta_field.get_minimum();
171 if (-999 == result) {
172 result = etamin;
173 } else {
174 if (etamin < result) result = etamin;
175 }
176 }
177 }
178 }
179 return(result);
180}
181
182int
184 return getMaxField(id, ETA);
185}
186
187int
189 return getMaxField(id, STRIP);
190}
191
192bool
194 // get min from dictionary
195 return(eta_module(id) == eta_module_min(id));
196}
197
198bool
200 // get max from dictionary
201 return(eta_module(id) == eta_module_max(id));
202}
203
204int
206 return getMaxField(id, PHI);
207}
208
209bool
211 // get max from dictionary
212 return(phi_module(id) == phi_module_max(id));
213}
214
215int
217 ATH_MSG_INFO("initialize_from_dictionary");
218
219 // Check whether this helper should be reinitialized
220 if (!reinitialize(dict_mgr)) {
221 ATH_MSG_INFO("Request to reinitialize not satisfied - tags have not changed");
222 return(0);
223 } else {
224 ATH_MSG_DEBUG("(Re)initialize");
225 }
226
227 // init base object
228 if (AtlasDetectorID::initialize_from_dictionary(dict_mgr)) return(2);
229
230 // Register version of InnerDetector dictionary
231 if (register_dict_tag(dict_mgr, "InnerDetector")) return(1);
232
233 m_dict = dict_mgr.find_dictionary("InnerDetector");
234 if (!m_dict) {
235 ATH_MSG_ERROR(" - cannot access InnerDetector dictionary ");
236 return 1;
237 }
238
239 // Initialize the field indices
240 if (initLevelsFromDict()) return(1);
241
242 //
243 // Set barrel field for testing is_barrel
244 //
245 int barrel_value;
246 if (m_dict->get_label_value("barrel_endcap", "barrel", barrel_value)) {
247 ATH_MSG_ERROR("Could not get value for label 'barrel' of field 'barrel_endcap' in dictionary " + m_dict->name());
248 return(1);
249 }
250 m_barrel_field.clear();
251 m_barrel_field.add_value(barrel_value);
252 ATH_MSG_DEBUG("Set barrel field values: " << std::string(m_barrel_field));
253
254
255 //
256 // Build multirange for the valid set of identifiers
257 //
258
259
260 // Find value for the field InnerDetector
261 const IdDictDictionary* atlasDict = dict_mgr.find_dictionary("ATLAS");
262 int inDetField = -1;
263 if (atlasDict->get_label_value("subdet", "InnerDetector", inDetField)) {
264 ATH_MSG_ERROR("Could not get value for label 'InnerDetector' of field 'subdet' in dictionary " + atlasDict->name());
265 return(1);
266 }
267
268 // Find value for the field SCT
269 int sctField = -1;
270 if (m_dict->get_label_value("part", "SCT", sctField)) {
271 ATH_MSG_ERROR("Could not get value for label 'SCT' of field 'part' in dictionary " + m_dict->name());
272 return(1);
273 }
274 ATH_MSG_DEBUG("Found field values: SCT " << std::to_string(sctField));
275
276 // Set up id for region and range prefix
277 ExpandedIdentifier region_id;
278 region_id.add(inDetField);
279 region_id.add(sctField);
280 Range prefix;
281 m_full_wafer_range = m_dict->build_multirange(region_id, prefix, "side");
282 m_full_strip_range = m_dict->build_multirange(region_id, prefix);
283
284 // Setup the hash tables
285 if (init_hashes()) return(1);
286
287 // Setup hash tables for finding neighbors
288 if (init_neighbors()) return(1);
289 ATH_MSG_DEBUG("Wafer range -> " << std::string( m_full_wafer_range) <<
290 "\nStrip range -> " << std::string(m_full_strip_range));
291
294 [this](const IdentifierHash & id){return this->get_other_side(id);},
295 [this](const IdentifierHash & id){return this->get_prev_in_eta(id);},
296 [this](const IdentifierHash & id){return this->get_next_in_eta(id);},
297 [this](const IdentifierHash & id){return this->get_prev_in_phi(id);},
298 [this](const IdentifierHash & id){return this->get_next_in_phi(id);}
299 };
300 return 0;
301}
302
303int
305 //
306 // create a vector(s) to retrieve the hashes for compact ids. For
307 // the moment, we implement a hash for wafers but NOT for strips
308 // (too many)
309 //
310
311 // wafer hash
312 m_wafer_hash_max = m_full_wafer_range.cardinality();
314 unsigned int nids = 0;
315 std::set<Identifier> ids;
316 for (unsigned int i = 0; i < m_full_wafer_range.size(); ++i) {
317 const Range& range = m_full_wafer_range[i];
318 ConstRangeIterator rit(range);
319 for (const auto & exp_id : rit) {
320 Identifier id = wafer_id(exp_id);
321 if (!(ids.insert(id)).second) {
322 ATH_MSG_ERROR("duplicated id for wafer id. nid " + std::to_string(nids) + " compact id " + id.getString() + " id " + std::string(exp_id));
323 return(1);
324 }
325 nids++;
326 }
327 }
328 if (ids.size() != m_wafer_hash_max) {
329 ATH_MSG_ERROR("set size NOT EQUAL to hash max. size " + std::to_string(ids.size()) + " hash max " +std::to_string( m_wafer_hash_max));
330 return(1);
331 }
332
333 nids = 0;
334 std::set<Identifier>::const_iterator first = ids.begin();
335 std::set<Identifier>::const_iterator last = ids.end();
336 for (; first != last && nids < m_wafer_vec.size(); ++first) {
337 m_wafer_vec[nids] = (*first);
338 nids++;
339 }
340
341 // strip hash - we do not keep a vec for the strips - too large
342 m_strip_hash_max = m_full_strip_range.cardinality();
343
344 return(0);
345}
346
351
356
361
366
369 if (m_dict) {
370 // get max from dictionary
371 Identifier id;
372 const IdContext & wafer_context1 = wafer_context();
373 if (!get_id(hashId, id, &wafer_context1)) {
374 return( side(id) ? hashId - 1 : hashId + 1);
375 }
376 }
377 return IdentifierHash{};
378}
379//
380const std::array<std::function< IdentifierHash(const IdentifierHash &)>, 5 >&
384
385
386int
389 if (result.is_valid()) {
390 prev = result;
391 return 0;
392 }
393 return 1;
394}
395
396int
399 if (result.is_valid()) {
400 next = result;
401 return 0;
402 }
403 return 1;
404}
405
406int
409 if (result.is_valid()) {
410 prev = result;
411 return 0;
412 }
413 return 1;
414}
415
416int
419 if (result.is_valid()) {
420 next = result;
421 return 0;
422 }
423 return 1;
424}
425
426int
428 if (m_dict) {
429 // get max from dictionary
430 Identifier id;
431 IdContext wafer_context1 = wafer_context();
432 if (!get_id(hashId, id, &wafer_context1)) {
433 other = side(id) ? hashId - 1 : hashId + 1;
434 return(0);
435 }
436 }
437 return(1);
438}
439
442 return wafer_id(expId[m_indices[BARREL_EC]],
443 expId[m_indices[LAYER_DISK]],
444 expId[m_indices[PHI]],
445 expId[m_indices[ETA]],
446 expId[m_indices[SIDE]]);
447 }
448
449int
451 //
452 // create a vector(s) to retrieve the hashes for compact ids for
453 // wafer neighbors.
454 //
455
456 ATH_MSG_DEBUG("init_neighbors");
462
463 for (unsigned int i = 0; i < m_full_wafer_range.size(); ++i) {
464 const Range& range = m_full_wafer_range[i];
465 const Range::field& phi_field = range[m_indices[PHI]];
466 const Range::field& eta_field = range[m_indices[ETA]];
467 ConstRangeIterator rit(range);
468 for (const auto & exp_id : rit) {
473 bool pphi = phi_field.get_previous(exp_id[m_indices[PHI]], previous_phi);
474 bool nphi = phi_field.get_next(exp_id[m_indices[PHI]], next_phi);
475 bool peta = eta_field.get_previous(exp_id[m_indices[ETA]], previous_eta);
476 bool neta = eta_field.get_next(exp_id[m_indices[ETA]], next_eta);
477
478 IdContext wcontext = wafer_context();
479
480 // First get primary hash id
481 IdentifierHash hash_id;
482 Identifier id = wafer_id(exp_id);
483 if (get_hash(id, hash_id, &wcontext)) {
484 ATH_MSG_ERROR("- unable to get hash, exp/compact " + show_to_string(id, &wcontext) + std::string(m_full_wafer_range));
485 return(1);
486 }
487
488 // index for the subsequent arrays
489 unsigned short index = hash_id;
490 assert(hash_id < m_prev_phi_wafer_vec.size());
491 assert(hash_id < m_next_phi_wafer_vec.size());
492 assert(hash_id < m_prev_eta_wafer_vec.size());
493 assert(hash_id < m_next_eta_wafer_vec.size());
494
495 if (pphi) {
496 // Get previous phi hash id
497 ExpandedIdentifier expId = exp_id;
498 expId[m_indices[PHI]] = previous_phi;
499 Identifier id = wafer_id(expId);
500 if (get_hash(id, hash_id, &wcontext)) {
501 ATH_MSG_ERROR("- unable to get previous phi hash, exp/compact " + id.getString());
502 return(1);
503 }
504 m_prev_phi_wafer_vec[index] = hash_id;
505 }
506
507 if (nphi) {
508 // Get next phi hash id
509 ExpandedIdentifier expId = exp_id;
510 expId[m_indices[PHI]] = next_phi;
511 Identifier id = wafer_id(expId);
512 if (get_hash(id, hash_id, &wcontext)) {
513 ATH_MSG_ERROR("- unable to get next phi hash, exp/compact " + id.getString());
514 return(1);
515 }
516 m_next_phi_wafer_vec[index] = hash_id;
517 }
518
519 if (peta) {
520 // Get previous eta hash id
521 ExpandedIdentifier expId = exp_id;
522 expId[m_indices[ETA]] = previous_eta;
523 Identifier id = wafer_id(expId);
524 if (get_hash(id, hash_id, &wcontext)) {
525 ATH_MSG_ERROR("- unable to get previous eta hash, exp/compact " + id.getString());
526 return(1);
527 }
528 m_prev_eta_wafer_vec[index] = hash_id;
529 }
530
531 if (neta) {
532 // Get next eta hash id
533 ExpandedIdentifier expId = exp_id;
534 expId[m_indices[ETA]] = next_eta;
535 Identifier id = wafer_id(expId);
536 if (get_hash(id, hash_id, &wcontext)) {
537 ATH_MSG_ERROR("- unable to get next eta hash, exp/compact " + id.getString());
538 return(1);
539 }
540 m_next_eta_wafer_vec[index] = hash_id;
541 }
542 }
543 }
544 return(0);
545}
546
547int
549 if (!m_dict) {
550 ATH_MSG_ERROR("- dictionary NOT initialized");
551 return(1);
552 }
553 // Find out which identifier field corresponds to each level. Use
554 // names to find each field/leve.
555 m_indices.fill(999);
556 m_hasRows = false;
557 // Save index to a SCT region for unpacking
560
561
562 if (m_dict->find_region(id, m_sct_region_index)) {
563 ATH_MSG_ERROR("- unable to find sct region index: id, reg " + std::string(id) + " " + std::to_string(m_sct_region_index));
564 return(1);
565 }
566
567 auto findField = [this](const std::string &name, const size_t indx){
568 const IdDictField* pField = m_dict->find_field(name);
569 if (pField) {
570 m_indices[indx] = pField->index();
571 return true;
572 }
573 const auto lvl = (indx == ROW) ? MSG::DEBUG : MSG::ERROR;
574 msg() << lvl << "- unable to find '" << name << "' field " << endmsg;
575 return false;
576 };
577
578 // Find an SCT region
579 if (not findField("subdet", INDET)) return 1;
580 if (not findField("part", SCT)) return 1;
581 if (not findField("barrel_endcap", BARREL_EC)) return 1;
582 if (not findField("layer", LAYER_DISK)) return 1;
583 if (not findField("phi_module", PHI)) return 1;
584 if (not findField("eta_module", ETA)) return 1;
585 if (not findField("side", SIDE)) return 1;
586 m_hasRows = (findField("row", ROW));
587 if (not findField("strip", STRIP)) return 1;
588
589 // Set the field implementations: for bec, lay/disk, eta/phi mod
590
591 const IdDictRegion& region = m_dict->region(m_sct_region_index);
592
600 if (m_hasRows) {
602 }
604 ATH_MSG_DEBUG("decode index and bit fields for each level: ");
605 ATH_MSG_DEBUG("indet " + m_indet_impl.show_to_string());
606 ATH_MSG_DEBUG("sct " + m_sct_impl.show_to_string());
607 ATH_MSG_DEBUG("bec " + m_bec_impl.show_to_string());
608 ATH_MSG_DEBUG("lay_disk " + m_lay_disk_impl.show_to_string());
609 ATH_MSG_DEBUG("phi_mod " + m_phi_mod_impl.show_to_string());
610 ATH_MSG_DEBUG("eta_mod " + m_eta_mod_impl.show_to_string());
611 ATH_MSG_DEBUG("side " + m_side_impl.show_to_string());
612 if (m_hasRows) {
613 ATH_MSG_DEBUG("row " + m_row_impl.show_to_string());
614 }
615 ATH_MSG_DEBUG("strip " + m_strip_impl.show_to_string());
616
617 return(0);
618}
619
622 return m_wafer_hash_max;
623}
624
627 return m_strip_hash_max;
628}
629
633
637
641
645
646// From hash get Identifier
647int
649 Identifier& id,
650 const IdContext* context) const {
651 int result = 1;
652 id.clear();
653 size_t begin = (context) ? context->begin_index() : 0;
654 // cannot get hash if end is 0:
655 size_t end = (context) ? context->end_index() : 0;
656 if (0 == begin) {
657 // No hashes yet for ids with prefixes
658 if (m_indices[SIDE] == end) {
659 if (hash_id < m_wafer_vec.size()) {
660 id = m_wafer_vec[hash_id];
661 result = 0;
662 }
663 } else if (m_indices[STRIP] == end) {
664 // Do not know how to calculate strip id from hash yet!!
665 ATH_MSG_ERROR( "Do not know how to calculate strip id from hash yet!!");
666 }
667 }
668 return(result);
669}
670
671void
673 ExpandedIdentifier& exp_id,
674 const IdContext* context) const {
675 exp_id.clear();
676 exp_id << indet_field_value()
677 << sct_field_value()
678 << barrel_ec(id)
679 << layer_disk(id)
680 << phi_module(id)
681 << eta_module(id)
682 << side(id);
683 if (!context || context->end_index() == m_indices[STRIP]) {
684 if (m_hasRows) {
685 exp_id << row(id) << strip(id);
686 } else {
687 exp_id << strip(id);
688 }
689 }
690}
691
692int
694 IdentifierHash& hash_id,
695 const IdContext* context) const {
696 // Get the hash code from either a vec (for wafers) or calculate
697 // it (strips). For the former, we convert to compact and call
698 // get_hash again. For the latter, we calculate the hash from the
699 // Identifier.
700
701 int result = 1;
702
703 hash_id = 0;
704 size_t begin = (context) ? context->begin_index() : 0;
705 size_t end = (context) ? context->end_index() : 0;
706 if (0 == begin) {
707 // No hashes yet for ids with prefixes
708 if (m_indices[SIDE] == end) {
709 hash_id = wafer_hash(id);
710 if (hash_id.is_valid()) result = 0;
711 } else if (context && context->end_index() == m_indices[STRIP]) {
712 // Must calculate for strip hash
713 ExpandedIdentifier new_id;
714 get_expanded_id(id, new_id);
715 hash_id = m_full_strip_range.cardinalityUpTo(new_id);
716 result = 0;
717 }
718 }
719 return(result);
720}
721
722//all neighbours: opposite and then eta direction first
723std::array<IdentifierHash, 5>
732
733//all neighbours: opposite and then phi direction first
734std::array<IdentifierHash, 5>
743
744
747 // Build identifier
748 Identifier result((Identifier::value_type) 0);
749
750 // Pack fields independently
757 m_side_impl.pack(id[m_indices[SIDE]], result);
758 if (m_hasRows) {
759 m_row_impl.pack(id[m_indices[ROW]], result);
760 }
762
763 // Do checks
764 if (m_do_checks) {
765 strip_id_checks(id);
766 }
767 return result;
768}
769
770
774
775 return(IdContext(id, 0, m_indices[SIDE]));
776}
777
778
782
783 return(IdContext(id, 0, m_indices[STRIP]));
784}
#define endmsg
#define ATH_MSG_ERROR(x)
#define ATH_MSG_INFO(x)
#define ATH_MSG_DEBUG(x)
static const IdentifierHash invalidHash
This is an Identifier helper class for the SCT subdetector.
MsgStream & msg() const
The standard message stream.
bool m_do_checks
Flag for subclasses to know whether or not to perform checks.
virtual int initialize_from_dictionary(const IdDictMgr &dict_mgr) override
Initialization from the identifier dictionary.
bool reinitialize(const IdDictMgr &dict_mgr)
Test whether an idhelper should be reinitialized based on the change of tags.
int register_dict_tag(const IdDictMgr &dict_mgr, const std::string &dict_name)
Register the file and tag names for a particular IdDict dictionary.
int sct_field_value() const
std::string show_to_string(Identifier id, const IdContext *context=0, char sep='.') const
or provide the printout in string form
AtlasDetectorID(const std::string &name, const std::string &group)
int indet_field_value() const
Provide efficient access to individual field values, for subclass idhelpers.
void clear()
Erase all fields.
This class saves the "context" of an expanded identifier (ExpandedIdentifier) for compact or hash ver...
Definition IdContext.h:26
size_type begin_index() const
Definition IdContext.h:45
size_type end_index() const
Definition IdContext.h:46
int get_label_value(const std::string &field, const std::string &label, int &value) const
const std::string & name() const
Dictionary name.
size_t index() const
Definition IdDictField.h:74
const IdDictDictionary * find_dictionary(const std::string &name) const
Access dictionary by name.
const IdDictFieldImplementation & implementation(size_t i) const
bool get_previous(element_type current, element_type &previous) const
Returns false if previous/next is at end of range, or not possible.
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...
bool get_next(element_type current, element_type &next) const
element_type get_maximum() const
This is a "hash" representation of an Identifier.
bool is_valid() const
Check if id is in a valid state.
A Range describes the possible ranges for the field values of an ExpandedIdentifier.
std::array< IdentifierHash, 5 > neighbours_by_phi(const IdentifierHash &idh) const
Definition SCT_ID.cxx:735
Identifier::size_type size_type
Definition SCT_ID.h:72
int phi_module_max(const Identifier &id) const
Definition SCT_ID.cxx:205
virtual int initialize_from_dictionary(const IdDictMgr &dict_mgr) override final
Initialization from the identifier dictionary.
Definition SCT_ID.cxx:216
hash_vec m_next_phi_wafer_vec
Definition SCT_ID.h:363
IdentifierHash nextInSequence(const IdentifierHash &id, const hash_vec &vectorOfHashes) const
Definition SCT_ID.h:722
int getMaxField(const Identifier &id, const ExpandedIdIndices &fieldIndx) const
Definition SCT_ID.cxx:128
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)
Definition SCT_ID.cxx:693
std::array< size_t, NUM_INDICES > m_indices
Definition SCT_ID.h:354
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,...
Definition SCT_ID.cxx:381
size_type wafer_hash_max() const
Definition SCT_ID.cxx:621
size_type m_strip_hash_max
Definition SCT_ID.h:359
size_type m_wafer_hash_max
Definition SCT_ID.h:358
const IdDictDictionary * m_dict
Definition SCT_ID.h:355
IdDictFieldImplementation m_eta_mod_impl
Definition SCT_ID.h:373
MultiRange::const_identifier_factory const_expanded_id_iterator
Definition SCT_ID.h:74
int layer_disk(const Identifier &id) const
Definition SCT_ID.h:687
int side(const Identifier &id) const
Definition SCT_ID.h:705
std::array< std::function< IdentifierHash(const IdentifierHash &)>, 5 > m_neighboursByEta
Definition SCT_ID.h:311
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)
Definition SCT_ID.cxx:672
const_id_iterator wafer_end() const
Definition SCT_ID.cxx:634
int initLevelsFromDict()
Definition SCT_ID.cxx:548
bool is_phi_module_max(const Identifier &id) const
Definition SCT_ID.cxx:210
IdContext strip_context() const
Definition SCT_ID.cxx:780
IdDictFieldImplementation m_row_impl
Definition SCT_ID.h:375
IdentifierHash wafer_hash(const Identifier &wafer_id) const
wafer hash from id - optimized
Definition SCT_ID.h:487
bool is_eta_module_max(const Identifier &id) const
For the barrel.
Definition SCT_ID.cxx:199
id_vec m_wafer_vec
Definition SCT_ID.h:361
IdDictFieldImplementation m_side_impl
Definition SCT_ID.h:374
bool m_hasRows
Definition SCT_ID.h:366
std::vector< Identifier >::const_iterator const_id_iterator
Definition SCT_ID.h:73
Identifier wafer_id(int barrel_ec, int layer_disk, int phi_module, int eta_module, int side) const
For a single side of module.
Definition SCT_ID.h:459
int strip_max(const Identifier &id) const
Definition SCT_ID.cxx:188
int row(const Identifier &id) const
Definition SCT_ID.h:711
std::array< IdentifierHash, 5 > neighbours_by_eta(const IdentifierHash &idh) const
Definition SCT_ID.cxx:724
int get_prev_in_eta(const IdentifierHash &id, IdentifierHash &prev) const
Previous wafer hash in eta (return == 0 for neighbor found)
Definition SCT_ID.cxx:407
int layer_disk_max(const Identifier &id) const
Max/Min values for each field (-999 == failure)
Definition SCT_ID.cxx:153
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)
Definition SCT_ID.cxx:648
int get_prev_in_phi(const IdentifierHash &id, IdentifierHash &prev) const
Previous wafer hash in phi (return == 0 for neighbor found)
Definition SCT_ID.cxx:387
const_expanded_id_iterator strip_end() const
Definition SCT_ID.cxx:642
int phi_module(const Identifier &id) const
Definition SCT_ID.h:693
int strip(const Identifier &id) const
Definition SCT_ID.h:717
int barrel_ec(const Identifier &id) const
Values of different levels (failure returns 0)
Definition SCT_ID.h:681
size_type m_sct_region_index
Definition SCT_ID.h:352
Range::field m_barrel_field
Definition SCT_ID.h:360
int get_next_in_eta(const IdentifierHash &id, IdentifierHash &next) const
Next wafer hash in eta (return == 0 for neighbor found)
Definition SCT_ID.cxx:417
void strip_id_checks(int barrel_ec, int layer_disk, int phi_module, int eta_module, int side, int strip) const
Definition SCT_ID.cxx:66
IdDictFieldImplementation m_bec_impl
Definition SCT_ID.h:370
int eta_module_max(const Identifier &id) const
Definition SCT_ID.cxx:183
IdDictFieldImplementation m_phi_mod_impl
Definition SCT_ID.h:372
IdDictFieldImplementation m_indet_impl
Definition SCT_ID.h:368
int eta_module(const Identifier &id) const
Definition SCT_ID.h:699
IdDictFieldImplementation m_strip_impl
Definition SCT_ID.h:376
MultiRange m_full_strip_range
Definition SCT_ID.h:357
size_type strip_hash_max() const
Definition SCT_ID.cxx:626
int init_hashes()
Definition SCT_ID.cxx:304
int get_next_in_phi(const IdentifierHash &id, IdentifierHash &next) const
Next wafer hash in phi (return == 0 for neighbor found)
Definition SCT_ID.cxx:397
int init_neighbors()
Definition SCT_ID.cxx:450
IdContext wafer_context() const
Definition SCT_ID.cxx:772
int get_other_side(const IdentifierHash &id, IdentifierHash &other) const
Wafer hash on other side.
Definition SCT_ID.cxx:427
SCT_ID()
Definition SCT_ID.cxx:34
void wafer_id_checks(int barrel_ec, int layer_disk, int phi_module, int eta_module, int side) const
Definition SCT_ID.cxx:47
hash_vec m_next_eta_wafer_vec
Definition SCT_ID.h:365
Identifier strip_id(int barrel_ec, int layer_disk, int phi_module, int eta_module, int side, int strip) const
For an individual strip.
Definition SCT_ID.h:530
const_expanded_id_iterator strip_begin() const
For strip ids, only expanded id iterators are available.
Definition SCT_ID.cxx:638
IdDictFieldImplementation m_sct_impl
Definition SCT_ID.h:369
bool is_eta_module_min(const Identifier &id) const
For the barrel.
Definition SCT_ID.cxx:193
ExpandedIdIndices
Definition SCT_ID.h:310
@ INDET
Definition SCT_ID.h:310
@ STRIP
Definition SCT_ID.h:310
@ SIDE
Definition SCT_ID.h:310
@ BARREL_EC
Definition SCT_ID.h:310
@ ROW
Definition SCT_ID.h:310
@ PHI
Definition SCT_ID.h:310
@ LAYER_DISK
Definition SCT_ID.h:310
@ ETA
Definition SCT_ID.h:310
const_id_iterator wafer_begin() const
Iterators over full set of ids. Wafer iterator is sorted.
Definition SCT_ID.cxx:630
hash_vec m_prev_eta_wafer_vec
Definition SCT_ID.h:364
int eta_module_min(const Identifier &id) const
Definition SCT_ID.cxx:158
MultiRange m_full_wafer_range
Definition SCT_ID.h:356
hash_vec m_prev_phi_wafer_vec
Definition SCT_ID.h:362
IdDictFieldImplementation m_lay_disk_impl
Definition SCT_ID.h:371
Definition index.py:1