ATLAS Offline Software
TrigL2LayerNumberTool.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_H
6 #define TRIGONLINESPACEPOINTTOOL_TRIG_L2_LAYER_NUMBER_TOOL_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 PhiEtaHash {
24 
25  struct compare {
26  public:
27  bool operator()(const struct PhiEtaHash& p1, const struct PhiEtaHash& 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  PhiEtaHash(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  TrigL2LayerNumberTool(const std::string&,const std::string&,const IInterface*);
51 
52  // standard Athena methods
55 
56  //concrete implementations
57 
58  virtual int maxSiliconLayerNum() const {return m_MaxSiliconLayerNum;}
59  virtual int offsetEndcapPixels() const {return m_OffsetEndcapPixels;}
60  virtual int offsetBarrelSCT() const {return m_OffsetBarrelSCT;}
61  virtual int offsetEndcapSCT() const {return m_OffsetEndcapSCT;}
62  virtual void report() const;//prints out the above
63 
64  virtual int maxNumberOfUniqueLayers() const {
65  return (int) m_hashMap.size();
66  }
67 
68  virtual const std::vector<short>* pixelLayers() const {
69  return &m_pixelLayers;
70  }
71 
72  virtual const std::vector<short>* sctLayers() const {
73  return &m_sctLayers;
74  }
75 
76  virtual const std::vector<TrigInDetSiLayer>* layerGeometry() const {
77  return &m_layerGeometry;
78  }
79 
80  protected:
81 
83 
84  //cached values
90 
91  const SCT_ID* m_sctId = nullptr;
92  const PixelID* m_pixelId = nullptr;
95 
96  void createModuleHashMap(std::map<std::tuple<short,short,short>,std::vector<PhiEtaHash> >&);
97 
98  std::map<std::tuple<short,short,short>,std::vector<PhiEtaHash> > m_hashMap;
99  std::vector<short> m_pixelLayers, m_sctLayers;//hashid addressable arrays of layer numbers
100  std::vector<TrigInDetSiLayer> m_layerGeometry;
101 };
102 #endif
TrigL2LayerNumberTool::finalize
StatusCode finalize()
Definition: TrigL2LayerNumberTool.cxx:87
TrigL2LayerNumberTool::m_layerGeometry
std::vector< TrigInDetSiLayer > m_layerGeometry
Definition: TrigL2LayerNumberTool.h:100
TrigL2LayerNumberTool::offsetEndcapPixels
virtual int offsetEndcapPixels() const
Definition: TrigL2LayerNumberTool.h:59
InDetDD::SCT_DetectorManager
Definition: SCT_DetectorManager.h:49
python.PerfMonSerializer.p
def p
Definition: PerfMonSerializer.py:743
PhiEtaHash::compare::operator()
bool operator()(const struct PhiEtaHash &p1, const struct PhiEtaHash &p2)
Definition: TrigL2LayerNumberTool.h:27
phi
Scalar phi() const
phi method
Definition: AmgMatrixBasePlugin.h:64
TrigL2LayerNumberTool::offsetEndcapSCT
virtual int offsetEndcapSCT() const
Definition: TrigL2LayerNumberTool.h:61
TrigL2LayerNumberTool
Definition: TrigL2LayerNumberTool.h:45
TrigL2LayerNumberTool::TrigL2LayerNumberTool
TrigL2LayerNumberTool(const std::string &, const std::string &, const IInterface *)
Definition: TrigL2LayerNumberTool.cxx:14
eta
Scalar eta() const
pseudorapidity method
Definition: AmgMatrixBasePlugin.h:79
PhiEtaHash
Definition: TrigL2LayerNumberTool.h:23
TrigL2LayerNumberTool::m_hashMap
std::map< std::tuple< short, short, short >, std::vector< PhiEtaHash > > m_hashMap
Definition: TrigL2LayerNumberTool.h:98
TrigL2LayerNumberTool::maxNumberOfUniqueLayers
virtual int maxNumberOfUniqueLayers() const
Definition: TrigL2LayerNumberTool.h:64
ITrigL2LayerNumberTool
Definition: ITrigL2LayerNumberTool.h:20
ITrigL2LayerNumberTool.h
TrigL2LayerNumberTool::m_sctId
const SCT_ID * m_sctId
Definition: TrigL2LayerNumberTool.h:91
TrigL2LayerNumberTool::m_LastBarrelLayer
int m_LastBarrelLayer
Definition: TrigL2LayerNumberTool.h:89
TrigL2LayerNumberTool::pixelLayers
virtual const std::vector< short > * pixelLayers() const
Definition: TrigL2LayerNumberTool.h:68
TrigL2LayerNumberTool::offsetBarrelSCT
virtual int offsetBarrelSCT() const
Definition: TrigL2LayerNumberTool.h:60
TrigL2LayerNumberTool::maxSiliconLayerNum
virtual int maxSiliconLayerNum() const
Definition: TrigL2LayerNumberTool.h:58
TrigL2LayerNumberTool::m_sctManager
const InDetDD::SCT_DetectorManager * m_sctManager
Definition: TrigL2LayerNumberTool.h:94
TrigL2LayerNumberTool::report
virtual void report() const
Definition: TrigL2LayerNumberTool.cxx:93
PhiEtaHash::m_hash
int m_hash
Definition: TrigL2LayerNumberTool.h:41
TrigL2LayerNumberTool::layerGeometry
virtual const std::vector< TrigInDetSiLayer > * layerGeometry() const
Definition: TrigL2LayerNumberTool.h:76
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
TrigL2LayerNumberTool::m_sctLayers
std::vector< short > m_sctLayers
Definition: TrigL2LayerNumberTool.h:99
TrigL2LayerNumberTool::m_OffsetEndcapSCT
int m_OffsetEndcapSCT
Definition: TrigL2LayerNumberTool.h:88
AthAlgTool.h
TrigL2LayerNumberTool::m_OffsetEndcapPixels
int m_OffsetEndcapPixels
Definition: TrigL2LayerNumberTool.h:86
TrigL2LayerNumberTool::m_pixelManager
const InDetDD::PixelDetectorManager * m_pixelManager
Definition: TrigL2LayerNumberTool.h:93
TrigL2LayerNumberTool::m_useNewScheme
bool m_useNewScheme
Definition: TrigL2LayerNumberTool.h:82
TrigL2LayerNumberTool::m_MaxSiliconLayerNum
int m_MaxSiliconLayerNum
Definition: TrigL2LayerNumberTool.h:85
TrigL2LayerNumberTool::~TrigL2LayerNumberTool
virtual ~TrigL2LayerNumberTool()
Definition: TrigL2LayerNumberTool.h:50
PhiEtaHash::PhiEtaHash
PhiEtaHash(short phi, short eta, int hash)
Definition: TrigL2LayerNumberTool.h:38
PhiEtaHash::PhiEtaHash
PhiEtaHash(const PhiEtaHash &p)
Definition: TrigL2LayerNumberTool.h:39
InDetDD::PixelDetectorManager
Definition: PixelDetectorManager.h:47
TrigL2LayerNumberTool::m_pixelLayers
std::vector< short > m_pixelLayers
Definition: TrigL2LayerNumberTool.h:99
PhiEtaHash::compare
Definition: TrigL2LayerNumberTool.h:25
PhiEtaHash::m_etaIndex
short m_etaIndex
Definition: TrigL2LayerNumberTool.h:40
PhiEtaHash::m_phiIndex
short m_phiIndex
Definition: TrigL2LayerNumberTool.h:39
CaloCondBlobAlgs_fillNoiseFromASCII.hash
dictionary hash
Definition: CaloCondBlobAlgs_fillNoiseFromASCII.py:109
SCT_ID
Definition: SCT_ID.h:68
InDetDD
Message Stream Member.
Definition: FakeTrackBuilder.h:8
TrigL2LayerNumberTool::createModuleHashMap
void createModuleHashMap(std::map< std::tuple< short, short, short >, std::vector< PhiEtaHash > > &)
Definition: TrigL2LayerNumberTool.cxx:102
AthAlgTool
Definition: AthAlgTool.h:26
TrigL2LayerNumberTool::m_pixelId
const PixelID * m_pixelId
Definition: TrigL2LayerNumberTool.h:92
PixelID
Definition: PixelID.h:67
TrigL2LayerNumberTool::m_OffsetBarrelSCT
int m_OffsetBarrelSCT
Definition: TrigL2LayerNumberTool.h:87
TrigL2LayerNumberTool::sctLayers
virtual const std::vector< short > * sctLayers() const
Definition: TrigL2LayerNumberTool.h:72
TrigL2LayerNumberTool::initialize
StatusCode initialize()
Definition: TrigL2LayerNumberTool.cxx:27