ATLAS Offline Software
TrigL2LayerNumberToolITk.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #ifndef TRIGONLINESPACEPOINTTOOL_TRIG_L2_LAYER_NUMBER_TOOL_ITK_H
6 #define TRIGONLINESPACEPOINTTOOL_TRIG_L2_LAYER_NUMBER_TOOL_ITK_H
7 
8 #include <vector>
9 #include <map>
10 #include <tuple>
11 
14 
15 class SCT_ID;
16 class PixelID;
17 
18 namespace InDetDD {
19  class PixelDetectorManager;
20  class SCT_DetectorManager;
21 }
22 
23 struct PhiEtaHashITk {
24 
25  struct compare {
26  public:
27  bool operator()(const struct PhiEtaHashITk& p1, const struct PhiEtaHashITk& p2) {
28  if(p1.m_phiIndex == p2.m_phiIndex) {
29  return p1.m_etaIndex < p2.m_etaIndex;
30  }
31  else {
32  return p1.m_phiIndex < p2.m_phiIndex;
33  }
34  }
35  };
36 
37 public:
38  PhiEtaHashITk(short phi, short eta, int hash) : m_phiIndex(phi), m_etaIndex(eta), m_hash(hash) {};
41  int m_hash;
42 };
43 
44 
46  public:
47 
48  // standard AlgTool methods
49  TrigL2LayerNumberToolITk(const std::string&,const std::string&,const IInterface*);
51 
52  // standard Athena methods
53  virtual StatusCode initialize() override;
54 
55  //concrete implementations
56 
57  virtual int maxSiliconLayerNum() const override {return m_MaxSiliconLayerNum;}
58  virtual int offsetEndcapPixels() const override {return m_OffsetEndcapPixels;}
59  virtual int offsetBarrelSCT() const override {return m_OffsetBarrelSCT;}
60  virtual int offsetEndcapSCT() const override {return m_OffsetEndcapSCT;}
61  virtual void report() const override;//prints out the above
62 
63  virtual int maxNumberOfUniqueLayers() const override {
64  return static_cast<int>(m_hashMap.size());
65  }
66 
67  virtual const std::vector<short>* pixelLayers() const override {
68  return &m_pixelLayers;
69  }
70 
71  virtual const std::vector<short>* sctLayers() const override {
72  return &m_sctLayers;
73  }
74 
75  virtual const std::vector<TrigInDetSiLayer>* layerGeometry() const override {
76  return &m_layerGeometry;
77  }
78 
79  protected:
80 
81  Gaudi::Property<bool> m_useNewScheme{this, "UseNewLayerScheme", false};
82 
83  //cached values
89 
90  const SCT_ID* m_sctId{nullptr};
91  const PixelID* m_pixelId{nullptr};
94 
95  void createModuleHashMap(std::map<std::tuple<int, int, short, short>,std::vector<PhiEtaHashITk> >&);
96 
97  std::map<std::tuple<int, int, short, short>,std::vector<PhiEtaHashITk> > m_hashMap;
98  std::vector<short> m_pixelLayers, m_sctLayers;//hashid addressable arrays of layer numbers
99  std::vector<TrigInDetSiLayer> m_layerGeometry;
100 };
101 #endif
TrigL2LayerNumberToolITk::offsetEndcapPixels
virtual int offsetEndcapPixels() const override
Definition: TrigL2LayerNumberToolITk.h:58
PhiEtaHashITk::compare::operator()
bool operator()(const struct PhiEtaHashITk &p1, const struct PhiEtaHashITk &p2)
Definition: TrigL2LayerNumberToolITk.h:27
PhiEtaHashITk::m_hash
int m_hash
Definition: TrigL2LayerNumberToolITk.h:41
InDetDD::SCT_DetectorManager
Definition: SCT_DetectorManager.h:49
python.PerfMonSerializer.p
def p
Definition: PerfMonSerializer.py:743
phi
Scalar phi() const
phi method
Definition: AmgMatrixBasePlugin.h:64
PhiEtaHashITk::m_etaIndex
short m_etaIndex
Definition: TrigL2LayerNumberToolITk.h:40
eta
Scalar eta() const
pseudorapidity method
Definition: AmgMatrixBasePlugin.h:79
TrigL2LayerNumberToolITk::m_sctId
const SCT_ID * m_sctId
Definition: TrigL2LayerNumberToolITk.h:90
TrigL2LayerNumberToolITk::sctLayers
virtual const std::vector< short > * sctLayers() const override
Definition: TrigL2LayerNumberToolITk.h:71
TrigL2LayerNumberToolITk::initialize
virtual StatusCode initialize() override
Definition: TrigL2LayerNumberToolITk.cxx:22
TrigL2LayerNumberToolITk
Definition: TrigL2LayerNumberToolITk.h:45
TrigL2LayerNumberToolITk::m_pixelLayers
std::vector< short > m_pixelLayers
Definition: TrigL2LayerNumberToolITk.h:98
TrigL2LayerNumberToolITk::maxSiliconLayerNum
virtual int maxSiliconLayerNum() const override
Definition: TrigL2LayerNumberToolITk.h:57
ITrigL2LayerNumberTool
Definition: ITrigL2LayerNumberTool.h:20
ITrigL2LayerNumberTool.h
TrigL2LayerNumberToolITk::m_OffsetBarrelSCT
int m_OffsetBarrelSCT
Definition: TrigL2LayerNumberToolITk.h:86
TrigL2LayerNumberToolITk::maxNumberOfUniqueLayers
virtual int maxNumberOfUniqueLayers() const override
Definition: TrigL2LayerNumberToolITk.h:63
PhiEtaHashITk::m_phiIndex
short m_phiIndex
Definition: TrigL2LayerNumberToolITk.h:39
TrigL2LayerNumberToolITk::report
virtual void report() const override
Definition: TrigL2LayerNumberToolITk.cxx:56
TrigL2LayerNumberToolITk::m_OffsetEndcapPixels
int m_OffsetEndcapPixels
Definition: TrigL2LayerNumberToolITk.h:85
TrigL2LayerNumberToolITk::m_OffsetEndcapSCT
int m_OffsetEndcapSCT
Definition: TrigL2LayerNumberToolITk.h:87
TrigL2LayerNumberToolITk::m_sctLayers
std::vector< short > m_sctLayers
Definition: TrigL2LayerNumberToolITk.h:98
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
TrigL2LayerNumberToolITk::m_layerGeometry
std::vector< TrigInDetSiLayer > m_layerGeometry
Definition: TrigL2LayerNumberToolITk.h:99
AthAlgTool.h
PhiEtaHashITk::compare
Definition: TrigL2LayerNumberToolITk.h:25
PhiEtaHashITk::PhiEtaHashITk
PhiEtaHashITk(short phi, short eta, int hash)
Definition: TrigL2LayerNumberToolITk.h:38
TrigL2LayerNumberToolITk::layerGeometry
virtual const std::vector< TrigInDetSiLayer > * layerGeometry() const override
Definition: TrigL2LayerNumberToolITk.h:75
InDetDD::PixelDetectorManager
Definition: PixelDetectorManager.h:47
PhiEtaHashITk::PhiEtaHashITk
PhiEtaHashITk(const PhiEtaHashITk &p)
Definition: TrigL2LayerNumberToolITk.h:39
TrigL2LayerNumberToolITk::offsetEndcapSCT
virtual int offsetEndcapSCT() const override
Definition: TrigL2LayerNumberToolITk.h:60
TrigL2LayerNumberToolITk::m_LastBarrelLayer
int m_LastBarrelLayer
Definition: TrigL2LayerNumberToolITk.h:88
TrigL2LayerNumberToolITk::m_pixelId
const PixelID * m_pixelId
Definition: TrigL2LayerNumberToolITk.h:91
TrigL2LayerNumberToolITk::m_useNewScheme
Gaudi::Property< bool > m_useNewScheme
Definition: TrigL2LayerNumberToolITk.h:81
TrigL2LayerNumberToolITk::offsetBarrelSCT
virtual int offsetBarrelSCT() const override
Definition: TrigL2LayerNumberToolITk.h:59
TrigL2LayerNumberToolITk::m_MaxSiliconLayerNum
int m_MaxSiliconLayerNum
Definition: TrigL2LayerNumberToolITk.h:84
CaloCondBlobAlgs_fillNoiseFromASCII.hash
dictionary hash
Definition: CaloCondBlobAlgs_fillNoiseFromASCII.py:109
SCT_ID
Definition: SCT_ID.h:68
TrigL2LayerNumberToolITk::m_sctManager
const InDetDD::SCT_DetectorManager * m_sctManager
Definition: TrigL2LayerNumberToolITk.h:93
InDetDD
Message Stream Member.
Definition: FakeTrackBuilder.h:8
TrigL2LayerNumberToolITk::~TrigL2LayerNumberToolITk
virtual ~TrigL2LayerNumberToolITk()
Definition: TrigL2LayerNumberToolITk.h:50
TrigL2LayerNumberToolITk::createModuleHashMap
void createModuleHashMap(std::map< std::tuple< int, int, short, short >, std::vector< PhiEtaHashITk > > &)
Definition: TrigL2LayerNumberToolITk.cxx:66
PhiEtaHashITk
Definition: TrigL2LayerNumberToolITk.h:23
AthAlgTool
Definition: AthAlgTool.h:26
PixelID
Definition: PixelID.h:67
TrigL2LayerNumberToolITk::TrigL2LayerNumberToolITk
TrigL2LayerNumberToolITk(const std::string &, const std::string &, const IInterface *)
Definition: TrigL2LayerNumberToolITk.cxx:14
TrigL2LayerNumberToolITk::m_pixelManager
const InDetDD::PixelDetectorManager * m_pixelManager
Definition: TrigL2LayerNumberToolITk.h:92
TrigL2LayerNumberToolITk::pixelLayers
virtual const std::vector< short > * pixelLayers() const override
Definition: TrigL2LayerNumberToolITk.h:67
TrigL2LayerNumberToolITk::m_hashMap
std::map< std::tuple< int, int, short, short >, std::vector< PhiEtaHashITk > > m_hashMap
Definition: TrigL2LayerNumberToolITk.h:97