ATLAS Offline Software
Loading...
Searching...
No Matches
GeoIDSvc.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 ISF_SERVICES_GEOIDSVC_H
6#define ISF_SERVICES_GEOIDSVC_H 1
7
8// framework includes
9#include "GaudiKernel/ServiceHandle.h"
11
12// STL includes
13#include <vector>
14#include <list>
15#include <set>
16
17// DetectorDescription
19
20// ISF includes
22
23// EnvelopeDefinitionService
24#include "SubDetectorEnvelopes/IEnvelopeDefSvc.h" //Required for RZPair definition.
25
26namespace ISF {
27
28 typedef std::pair<double, AtlasDetDescr::AtlasRegion> RadiusGeoIDPair;
29 typedef std::list<RZPair> RZPairList;
30
31 struct SortByRadius {
32 bool operator() (const RadiusGeoIDPair& lhs, const RadiusGeoIDPair& rhs) const
33 {return lhs.first<rhs.first;}
34 };
35 typedef std::set<RadiusGeoIDPair, SortByRadius> RadiusGeoIDPairSet;
36
43 class GeoIDSvc : public extends<AthService, ISF::IGeoIDSvc> {
44 public:
46 GeoIDSvc(const std::string& name,ISvcLocator* svc);
47
49 ~GeoIDSvc() = default;
50
51 // Athena algtool's Hooks
52 StatusCode initialize();
53
56
59
60
64
65 private:
66 std::unique_ptr<RZPairList> prepareRZPairs( AtlasDetDescr::AtlasRegion geoID);
67
69 bool checkSymmetric( RZPairList& positiveZ, RZPairList& negativeZ);
70
71 template <typename T> inline int sign(T val);
72
74 ServiceHandle<IEnvelopeDefSvc> m_envDefSvc{this, "EnvelopeDefSvc", "ISF_ISFEnvelopeDefSvc",
75 "The EnvelopeDefinitionService describing the AtlasRegion boundaries."};
76
78 DoubleProperty m_tolerance{this,"Tolerance", 1e-5,
79 "Estimated tolerance within which coordinates are considered being equal."};
80
82 double *m_zBins{};
83 int m_numZBins{0};
87 };
88
89 //
90 // inline functions
91 //
92
94 template <typename T> inline int ISF::GeoIDSvc::sign(T val) {
95 return (T(0) < val) - (val < T(0));
96 }
97
98} // ISF namespace
99
100#endif //> !ISF_SERVICES_GEOIDSVC_H
ServiceHandle< IEnvelopeDefSvc > m_envDefSvc
service providing the envelope dimensions for the different sub-detectors
Definition GeoIDSvc.h:74
double * m_zBins
Definition GeoIDSvc.h:82
AtlasDetDescr::AtlasRegion identifyGeoID(const Amg::Vector3D &pos) const
A static filter that returns the SimGeoID of the given position.
Definition GeoIDSvc.cxx:222
std::unique_ptr< RZPairList > prepareRZPairs(AtlasDetDescr::AtlasRegion geoID)
Definition GeoIDSvc.cxx:270
ISF::InsideType inside(const Amg::Vector3D &pos, AtlasDetDescr::AtlasRegion geoID) const
Checks if the given position (or ISFParticle) is inside a given SimGeoID.
Definition GeoIDSvc.cxx:189
int sign(T val)
a branchless signum function
Definition GeoIDSvc.h:94
GeoIDSvc(const std::string &name, ISvcLocator *svc)
Constructor with parameters.
Definition GeoIDSvc.cxx:19
~GeoIDSvc()=default
Destructor.
AtlasDetDescr::AtlasRegion identifyNextGeoID(const Amg::Vector3D &pos, const Amg::Vector3D &dir) const
Find the SimGeoID that the particle will enter with its next infinitesimal step along the given direc...
Definition GeoIDSvc.cxx:254
bool checkSymmetric(RZPairList &positiveZ, RZPairList &negativeZ)
Check if given RZPairLists are symmetric around z==0 plane.
Definition GeoIDSvc.cxx:391
RadiusGeoIDPair * m_radiusBins
m_radiusBins[m_numZBins][numCurRadiusBins]
Definition GeoIDSvc.h:85
StatusCode initialize()
Definition GeoIDSvc.cxx:25
DoubleProperty m_tolerance
(estimated) tolerance within which coordinates are considered equal
Definition GeoIDSvc.h:78
Eigen::Matrix< double, 3, 1 > Vector3D
AtlasRegion
A simple enum of ATLAS regions and sub-detectors.
Definition AtlasRegion.h:21
ISFParticleOrderedQueue.
std::set< RadiusGeoIDPair, SortByRadius > RadiusGeoIDPairSet
Definition GeoIDSvc.h:35
std::pair< double, AtlasDetDescr::AtlasRegion > RadiusGeoIDPair
Definition GeoIDSvc.h:28
InsideType
Definition IGeoIDSvc.h:22
std::list< RZPair > RZPairList
Definition GeoIDSvc.h:29
bool operator()(const RadiusGeoIDPair &lhs, const RadiusGeoIDPair &rhs) const
Definition GeoIDSvc.h:32