ATLAS Offline Software
SiliconID.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3  */
4 
5 #ifndef INDETIDENTIFIER_XXX_SILICONID_H
6 #define INDETIDENTIFIER_XXX_SILICONID_H
7 
19 #include "Identifier/Identifier.h"
21 #include "Identifier/IdHelper.h"
23 #include "InDetIdentifier/SCT_ID.h"
24 #include "AthenaKernel/CLASS_DEF.h"
25 
26 
27 
42 {
43 public:
45 
48 
50 
51  SiliconID();
52  SiliconID(const PixelID* pixel_helper, const SCT_ID* sct_helper);
55 
57 
60 
63 
65  size_type wafer_hash_max() const;
66 
68  bool is_barrel(const Identifier& id) const;
69 
71  bool is_blayer(const Identifier& id) const;
73 
76 
79 
80 
82 
83  virtual int get_id(const IdentifierHash& hash_id,
85  Identifier& id,
86  const IdContext* context = 0) const override final;
87 
89  virtual int get_hash(const Identifier& id,
90  IdentifierHash& hash_id,
91  const IdContext* context = 0) const override final;
92 
94  virtual int initialize_from_dictionary(const IdDictMgr& dict_mgr) override final;
96 
99 private:
104 };
105 
106 
107 
108 //using the macros below we can assign an identifier (and a version)
109 //This is required and checked at compile time when you try to record/retrieve
110 CLASS_DEF(SiliconID, 129452393, 1)
111 
112 //----------------------------------------------------------------------------
113 inline Identifier
115  // Identifier from hash
117  // Pixel hash
119  } else if (wafer_hash < m_wafer_hash_max) {
120  // SCT hash
122  }
123  // return invalid Identifier
125  return(result);
126 }
127 
128 //----------------------------------------------------------------------------
129 inline IdentifierHash
131  // wafer hash from id
132  if (is_pixel(wafer_id)) {
133  // Pixel id
135  } else {
136  // SCT hash + pixel hash max
138  }
139 }
140 
141 //----------------------------------------------------------------------------
144  // Hash table maximum sizes
145  return(m_wafer_hash_max);
146 }
147 
148 //----------------------------------------------------------------------------
149 inline bool
151  if (is_pixel(id)) {
152  // Pixel id
153  return(m_pixel_helper->is_barrel(id));
154  } else {
155  // SCT
156  return(m_sct_helper->is_barrel(id));
157  }
158 }
159 
160 //----------------------------------------------------------------------------
162 inline bool
164  if (is_pixel(id)) {
165  // Pixel id
166  return(m_pixel_helper->is_blayer(id));
167  } else {
168  // SCT
169  return(false);
170  }
171 }
172 
173 //----------------------------------------------------------------------------
175 inline bool
177  // Identifier from hash
179  // Pixel hash
180  return(true);
181  }
182  // SCT hash
183  return(false);
184 }
185 
186 #endif // INDETIDENTIFIER_SILICONID_H
PixelID.h
This is an Identifier helper class for the Pixel subdetector. This class is a factory for creating co...
AtlasDetectorID::is_pixel
bool is_pixel(Identifier id) const
Definition: AtlasDetectorID.h:767
SiliconID::get_id
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: SiliconID.cxx:70
SCT_ID.h
This is an Identifier helper class for the SCT subdetector. This class is a factory for creating comp...
SiliconID::wafer_id
Identifier wafer_id(IdentifierHash wafer_hash) const
Identifier from hash.
Definition: SiliconID.h:114
get_generator_info.result
result
Definition: get_generator_info.py:21
SiliconID::wafer_hash_max
size_type wafer_hash_max() const
Hash table maximum sizes.
Definition: SiliconID.h:143
SiliconID::m_sct_helper
const SCT_ID * m_sct_helper
Definition: SiliconID.h:103
SiliconID::wafer_hash
IdentifierHash wafer_hash(Identifier wafer_id) const
wafer hash from id
Definition: SiliconID.h:130
SiliconID::test_wafer_hashes
int test_wafer_hashes() const
Tests of packing.
Definition: SiliconID.cxx:96
SiliconID::is_barrel
bool is_barrel(const Identifier &id) const
Test for barrel - generic, i.e. works for EITHER pixel or sct id.
Definition: SiliconID.h:150
IdHelper.h
const
bool const RAWDATA *ch2 const
Definition: LArRodBlockPhysicsV0.cxx:560
PixelID::is_blayer
bool is_blayer(const Identifier &id) const
Test for b-layer - WARNING: id MUST be pixel id, otherwise answer is not accurate....
Definition: PixelID.h:629
SiliconID::initialize_from_dictionary
virtual int initialize_from_dictionary(const IdDictMgr &dict_mgr) override final
Initialization from the identifier dictionary.
Definition: SiliconID.cxx:46
PixelID::wafer_id
Identifier wafer_id(int barrel_ec, int layer_disk, int phi_module, int eta_module) const
For a single crystal.
Definition: PixelID.h:360
SiliconID::m_wafer_hash_max
size_type m_wafer_hash_max
Definition: SiliconID.h:100
SiliconID::is_blayer
bool is_blayer(const Identifier &id) const
Test for pixle b-layer - generic, i.e. works for EITHER pixel or sct id.
Definition: SiliconID.h:163
AtlasDetectorID::size_type
Identifier::size_type size_type
Definition: AtlasDetectorID.h:391
SiliconID::SiliconID
SiliconID()
Definition: SiliconID.cxx:22
AtlasDetectorID.h
This class provides an interface to generate or decode an identifier for the upper levels of the dete...
IdDictMgr
Definition: IdDictMgr.h:14
PixelID::is_barrel
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...
Definition: PixelID.h:601
PixelID::wafer_hash
IdentifierHash wafer_hash(Identifier wafer_id) const
wafer hash from id
Definition: PixelID.h:383
SiliconID::is_hash_pixel
bool is_hash_pixel(IdentifierHash wafer_hash) const
Test whether hash is pixel or sct.
Definition: SiliconID.h:176
SiliconID::get_hash
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: SiliconID.cxx:81
SiliconID::size_type
Identifier::size_type size_type
Definition: SiliconID.h:46
SCT_ID::wafer_hash
IdentifierHash wafer_hash(const Identifier &wafer_id) const
wafer hash from id - optimized
Definition: SCT_ID.h:492
SiliconID::~SiliconID
~SiliconID()
columnar::final
CM final
Definition: ColumnAccessor.h:106
IdentifierHash.h
SiliconID
This is an Identifier helper class for both the Pixel and SCT subdetectors. This class defines identi...
Definition: SiliconID.h:42
SiliconID::m_pixel_wafer_hash_max
size_type m_pixel_wafer_hash_max
Definition: SiliconID.h:101
SCT_ID
Definition: SCT_ID.h:68
CLASS_DEF
#define CLASS_DEF(NAME, CID, VERSION)
associate a clid and a version to a type eg
Definition: Control/AthenaKernel/AthenaKernel/CLASS_DEF.h:67
private
#define private
Definition: xAODTruthCnvAlg.h:20
Identifier::size_type
unsigned long long size_type
Definition: DetectorDescription/Identifier/Identifier/Identifier.h:29
SCT_ID::wafer_id
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:464
IdentifierHash
This is a "hash" representation of an Identifier. This encodes a 32 bit index which can be used to lo...
Definition: IdentifierHash.h:25
PixelID
Definition: PixelID.h:67
IdContext
This class saves the "context" of an expanded identifier (ExpandedIdentifier) for compact or hash ver...
Definition: IdContext.h:26
CLASS_DEF.h
macros to associate a CLID to a type
AtlasDetectorID
This class provides an interface to generate or decode an identifier for the upper levels of the dete...
Definition: AtlasDetectorID.h:57
SiliconID::m_pixel_helper
const PixelID * m_pixel_helper
Definition: SiliconID.h:102
SCT_ID::is_barrel
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...
Definition: SCT_ID.h:721
Identifier
Definition: IdentifierFieldParser.cxx:14