ATLAS Offline Software
SiliconID.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3  */
4 
5 #ifndef INDETIDENTIFIER_XXX_SILICONID_H
6 #define INDETIDENTIFIER_XXX_SILICONID_H
7 
18 //<<<<<< INCLUDES >>>>>>
19 
21 #include "Identifier/Identifier.h"
23 #include "Identifier/IdHelper.h"
25 #include "InDetIdentifier/SCT_ID.h"
26 #include "AthenaKernel/CLASS_DEF.h"
27 
28 
29 
43 class SiliconID final: public AtlasDetectorID
44 {
45 public:
47 
50 
52 
53  SiliconID(void);
54  SiliconID(const PixelID* pixel_helper, const SCT_ID* sct_helper);
55  ~SiliconID(void);
57 
59 
62 
65 
67  size_type wafer_hash_max(void) const;
68 
70  bool is_barrel(const Identifier& id) const;
71 
73  bool is_blayer(const Identifier& id) const;
75 
78 
81 
82 
84 
85  virtual int get_id(const IdentifierHash& hash_id,
87  Identifier& id,
88  const IdContext* context = 0) const override final;
89 
91  virtual int get_hash(const Identifier& id,
92  IdentifierHash& hash_id,
93  const IdContext* context = 0) const override final;
94 
96  virtual int initialize_from_dictionary(const IdDictMgr& dict_mgr) override final;
98 
100  int test_wafer_hashes(void) const;
101 private:
106 };
107 
108 
109 
111 //<<<<<< INLINE MEMBER FUNCTIONS >>>>>>
113 
114 //using the macros below we can assign an identifier (and a version)
115 //This is required and checked at compile time when you try to record/retrieve
116 CLASS_DEF(SiliconID, 129452393, 1)
117 
118 //----------------------------------------------------------------------------
119 inline Identifier
121  // Identifier from hash
123  // Pixel hash
125  } else if (wafer_hash < m_wafer_hash_max) {
126  // SCT hash
128  }
129  // return invalid Identifier
131  return(result);
132 }
133 
134 //----------------------------------------------------------------------------
135 inline IdentifierHash
137  // wafer hash from id
138  if (is_pixel(wafer_id)) {
139  // Pixel id
141  } else {
142  // SCT hash + pixel hash max
144  }
145 }
146 
147 //----------------------------------------------------------------------------
150  // Hash table maximum sizes
151  return(m_wafer_hash_max);
152 }
153 
154 //----------------------------------------------------------------------------
155 inline bool
157  if (is_pixel(id)) {
158  // Pixel id
159  return(m_pixel_helper->is_barrel(id));
160  } else {
161  // SCT
162  return(m_sct_helper->is_barrel(id));
163  }
164 }
165 
166 //----------------------------------------------------------------------------
168 inline bool
170  if (is_pixel(id)) {
171  // Pixel id
172  return(m_pixel_helper->is_blayer(id));
173  } else {
174  // SCT
175  return(false);
176  }
177 }
178 
179 //----------------------------------------------------------------------------
181 inline bool
183  // Identifier from hash
185  // Pixel hash
186  return(true);
187  }
188  // SCT hash
189  return(false);
190 }
191 
192 #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:760
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:74
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:120
get_generator_info.result
result
Definition: get_generator_info.py:21
SiliconID::wafer_hash_max
size_type wafer_hash_max(void) const
Hash table maximum sizes.
Definition: SiliconID.h:149
SiliconID::m_sct_helper
const SCT_ID * m_sct_helper
Definition: SiliconID.h:105
SiliconID::test_wafer_hashes
int test_wafer_hashes(void) const
Tests of packing.
Definition: SiliconID.cxx:100
SiliconID::wafer_hash
IdentifierHash wafer_hash(Identifier wafer_id) const
wafer hash from id
Definition: SiliconID.h:136
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:156
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:633
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:364
SiliconID::m_wafer_hash_max
size_type m_wafer_hash_max
Definition: SiliconID.h:102
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:169
AtlasDetectorID::size_type
Identifier::size_type size_type
Definition: AtlasDetectorID.h:384
AtlasDetectorID.h
This class provides an interface to generate or decode an identifier for the upper levels of the dete...
IdDictMgr
Definition: IdDictDefs.h:32
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:605
PixelID::wafer_hash
IdentifierHash wafer_hash(Identifier wafer_id) const
wafer hash from id
Definition: PixelID.h:387
SiliconID::~SiliconID
~SiliconID(void)
SiliconID::is_hash_pixel
bool is_hash_pixel(IdentifierHash wafer_hash) const
Test whether hash is pixel or sct.
Definition: SiliconID.h:182
SiliconID::SiliconID
SiliconID(void)
Definition: SiliconID.cxx:24
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:85
SiliconID::size_type
Identifier::size_type size_type
Definition: SiliconID.h:48
SCT_ID::wafer_hash
IdentifierHash wafer_hash(const Identifier &wafer_id) const
wafer hash from id - optimized
Definition: SCT_ID.h:492
private
#define private
Definition: DetDescrConditionsDict_dict_fixes.cxx:13
IdentifierHash.h
SiliconID
This is an Identifier helper class for both the Pixel and SCT subdetectors. This class defines identi...
Definition: SiliconID.h:44
SiliconID::m_pixel_wafer_hash_max
size_type m_pixel_wafer_hash_max
Definition: SiliconID.h:103
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:64
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:104
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