ATLAS Offline Software
Loading...
Searching...
No Matches
TrigInDetRoadPredictorTool.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 TRIGINDETTRACKFITTER_TRIGINDETROADPREDICTORTOOL_H
6#define TRIGINDETTRACKFITTER_TRIGINDETROADPREDICTORTOOL_H
7
9#include "GaudiKernel/ToolHandle.h"
10#include "GaudiKernel/ServiceHandle.h"
11
14
15// MagField cache
17
18
19#include <vector>
20#include <map>
21#include <algorithm> //std::accumulate etc
22
23namespace InDetDD {
26}
27
28namespace Trk {
29 class SpacePoint;
30}
31
32class PixelID;
33class SCT_ID;
34
36{
37 public:
38 TrigInDetRoadPredictorTool( const std::string&, const std::string&, const IInterface* );
39
40 virtual StatusCode initialize() override;
41
42 virtual int getRoad(const std::vector<const Trk::SpacePoint*>&, std::vector<const InDetDD::SiDetectorElement*>&,
43 const EventContext&) const override;
44
45private:
46
48 DetectorElementDescription(unsigned int h) : m_hash(h) {};
49 unsigned int m_hash{};
50 short m_index{};
51 float m_ref{};//z or Phi
52 float m_c[4][3]={};
54 };
55
57 DetectorElementsCollection(short idx, float min, float max) : m_index(idx), m_minCoord(min), m_maxCoord(max) {};
58 short m_index{};
59 float m_minCoord{}, m_maxCoord{}; //phi or R
60 std::vector<DetectorElementDescription> m_vDE;
61 };
62
64 LayerDescription(unsigned int id, int nSL, unsigned int mType) : m_id(id), m_nSubLayers(nSL), m_mappingType(mType) {};
65 unsigned int m_id{};
67 unsigned int m_mappingType{};
68 std::map<short, DetectorElementsCollection> m_colls[2];
69 };
70
71
73 SearchInterval(float z, float r) : m_r(0.0), m_z(0.0), m_phi(0.0) {
74 m_vZx.push_back(z);
75 m_vRx.push_back(r);
76 }
77
78 void addPoint(float z, float r) {
79 m_vZx.push_back(z);
80 m_vRx.push_back(r);
81 }
82
84 return std::accumulate(m_vRx.begin(), m_vRx.end(), 0)/m_vRx.size();
85 }
86
87 float getAverageZ() {
88 return std::accumulate(m_vZx.begin(), m_vZx.end(), 0)/m_vZx.size();
89 }
90
91 float getMinZ() const {
92 return *std::min_element( m_vZx.begin(), m_vZx.end());
93 }
94
95 float getMaxZ() const {
96 return *std::max_element( m_vZx.begin(), m_vZx.end());
97 }
98
99 float getMinR() const {
100 return *std::min_element( m_vRx.begin(), m_vRx.end());
101 }
102
103 float getMaxR() const {
104 return *std::max_element( m_vRx.begin(), m_vRx.end());
105 }
106
107 std::vector<float> m_vZx;
108 std::vector<float> m_vRx;
109 float m_r{};
110 float m_z{};
111 float m_phi{};
112 };
113
115 int m_index{};
116 float m_zr[4]={};
117 int m_vol_id{};
118 std::vector<int> m_layers;
119 };
120
123 std::vector<float> m_z;
124 std::vector<float> m_r;
125 };
126
128 void createHitBoxes();
129
130 void addNewElement(unsigned int, short, short, const InDetDD::SiDetectorElement*);
131 void findDetectorElements(unsigned int, const SearchInterval&, std::vector<unsigned int>&, bool) const;
132
133 ToolHandle<ITrigL2LayerNumberTool> m_layerNumberTool {this, "LayerNumberTool", "TrigL2LayerNumberToolITk"};
134
135 Gaudi::Property<float> m_min_rz_rw {this, "MinRzRoadWidth", 3.0, "Minimum rz road width"};
136 Gaudi::Property<float> m_max_rz_rw {this, "MaxRzRoadWidth", 15.0, "Maximum rz road width"};
137 Gaudi::Property<float> m_min_rphi_rw {this, "MinRPhiRoadWidth", 3.0, "Minimum rphi road width"};
138 Gaudi::Property<float> m_max_rphi_rw {this, "MaxRPhiRoadWidth", 15.0, "Maximum rphi road width"};
139 Gaudi::Property<float> m_min_phi_rw {this, "MinPhiRoadWidth", 0.05, "Minimum phi road width"};
140 Gaudi::Property<float> m_max_phi_rw {this, "MaxPhiRoadWidth", 0.1, "Maximum phi road width"};
141
143 this, "AtlasFieldCacheCondObj", "fieldCondObj",
144 "Name of the Magnetic Field conditions object key"};
145
146 std::vector<VolumeBoundary> m_vBoundaries;
147 std::vector<LayerBoundary> m_lBoundaries;
148 std::map<unsigned int, LayerDescription> m_layerMap;
149
152 const PixelID* m_pixelId{nullptr};
153 const SCT_ID* m_stripId{nullptr};
154};
155
156#endif
#define z
#define min(a, b)
Definition cfImp.cxx:40
#define max(a, b)
Definition cfImp.cxx:41
AthAlgTool(const std::string &type, const std::string &name, const IInterface *parent)
Constructor with parameters:
Header file for AthHistogramAlgorithm.
Dedicated detector manager extending the functionality of the SiDetectorManager with dedicated pixel ...
Dedicated detector manager extending the functionality of the SiDetectorManager with dedicated SCT in...
Class to hold geometrical description of a silicon detector element.
This is an Identifier helper class for the Pixel subdetector.
Definition PixelID.h:67
This is an Identifier helper class for the SCT subdetector.
Definition SCT_ID.h:68
void addNewElement(unsigned int, short, short, const InDetDD::SiDetectorElement *)
std::vector< VolumeBoundary > m_vBoundaries
std::vector< LayerBoundary > m_lBoundaries
std::map< unsigned int, LayerDescription > m_layerMap
Gaudi::Property< float > m_max_rphi_rw
void findDetectorElements(unsigned int, const SearchInterval &, std::vector< unsigned int > &, bool) const
virtual StatusCode initialize() override
Gaudi::Property< float > m_min_phi_rw
const InDetDD::SCT_DetectorManager * m_stripManager
Gaudi::Property< float > m_max_phi_rw
TrigInDetRoadPredictorTool(const std::string &, const std::string &, const IInterface *)
SG::ReadCondHandleKey< AtlasFieldCacheCondObj > m_fieldCondObjInputKey
Gaudi::Property< float > m_min_rphi_rw
const InDetDD::PixelDetectorManager * m_pixelManager
ToolHandle< ITrigL2LayerNumberTool > m_layerNumberTool
virtual int getRoad(const std::vector< const Trk::SpacePoint * > &, std::vector< const InDetDD::SiDetectorElement * > &, const EventContext &) const override
int r
Definition globals.cxx:22
Message Stream Member.
Ensure that the ATLAS eigen extensions are properly loaded.
std::map< short, DetectorElementsCollection > m_colls[2]
LayerDescription(unsigned int id, int nSL, unsigned int mType)