ATLAS Offline Software
SiliconID.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2020 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/Range.h"
24 #include "Identifier/IdHelper.h"
26 #include "InDetIdentifier/SCT_ID.h"
27 //#include "IdDict/IdDictFieldImplementation.h"
28 #include "AthenaKernel/CLASS_DEF.h"
29 
30 
31 
45 class SiliconID final: public AtlasDetectorID
46 {
47 public:
49 
52 
54 
55  SiliconID(void);
56  SiliconID(const PixelID* pixel_helper, const SCT_ID* sct_helper);
57  ~SiliconID(void);
59 
61 
64 
67 
69  size_type wafer_hash_max(void) const;
70 
72  bool is_barrel(const Identifier& id) const;
73 
75  bool is_blayer(const Identifier& id) const;
77 
80 
83 
84 
86 
87  virtual int get_id(const IdentifierHash& hash_id,
89  Identifier& id,
90  const IdContext* context = 0) const override final;
91 
93  virtual int get_hash(const Identifier& id,
94  IdentifierHash& hash_id,
95  const IdContext* context = 0) const override final;
96 
98  virtual int initialize_from_dictionary(const IdDictMgr& dict_mgr) override final;
100 
102  int test_wafer_hashes(void) const;
103 private:
108 };
109 
110 
111 
113 //<<<<<< INLINE MEMBER FUNCTIONS >>>>>>
115 
116 //using the macros below we can assign an identifier (and a version)
117 //This is required and checked at compile time when you try to record/retrieve
118 CLASS_DEF(SiliconID, 129452393, 1)
119 
120 //----------------------------------------------------------------------------
121 inline Identifier
123  // Identifier from hash
125  // Pixel hash
127  } else if (wafer_hash < m_wafer_hash_max) {
128  // SCT hash
130  }
131  // return invalid Identifier
133  return(result);
134 }
135 
136 //----------------------------------------------------------------------------
137 inline IdentifierHash
139  // wafer hash from id
140  if (is_pixel(wafer_id)) {
141  // Pixel id
143  } else {
144  // SCT hash + pixel hash max
146  }
147 }
148 
149 //----------------------------------------------------------------------------
152  // Hash table maximum sizes
153  return(m_wafer_hash_max);
154 }
155 
156 //----------------------------------------------------------------------------
157 inline bool
159  if (is_pixel(id)) {
160  // Pixel id
161  return(m_pixel_helper->is_barrel(id));
162  } else {
163  // SCT
164  return(m_sct_helper->is_barrel(id));
165  }
166 }
167 
168 //----------------------------------------------------------------------------
170 inline bool
172  if (is_pixel(id)) {
173  // Pixel id
174  return(m_pixel_helper->is_blayer(id));
175  } else {
176  // SCT
177  return(false);
178  }
179 }
180 
181 //----------------------------------------------------------------------------
183 inline bool
185  // Identifier from hash
187  // Pixel hash
188  return(true);
189  }
190  // SCT hash
191  return(false);
192 }
193 
194 #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:122
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:151
SiliconID::m_sct_helper
const SCT_ID * m_sct_helper
Definition: SiliconID.h:107
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:138
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:158
IdHelper.h
const
bool const RAWDATA *ch2 const
Definition: LArRodBlockPhysicsV0.cxx:562
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:104
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:171
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)
Identifier
Definition: DetectorDescription/Identifier/Identifier/Identifier.h:32
SiliconID::is_hash_pixel
bool is_hash_pixel(IdentifierHash wafer_hash) const
Test whether hash is pixel or sct.
Definition: SiliconID.h:184
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:50
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:46
SiliconID::m_pixel_wafer_hash_max
size_type m_pixel_wafer_hash_max
Definition: SiliconID.h:105
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
IDENTIFIER_TYPE size_type
Definition: DetectorDescription/Identifier/Identifier/Identifier.h:41
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
Definition: IdentifierHash.h:38
PixelID
Definition: PixelID.h:67
IdContext
class IdContext
Definition: IdContext.h:34
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:106
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