ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Simulation
ISF
ISF_Core
ISF_Services
src
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"
10
#include "
AthenaBaseComps/AthService.h
"
11
12
// STL includes
13
#include <vector>
14
#include <list>
15
#include <set>
16
17
// DetectorDescription
18
#include "
AtlasDetDescr/AtlasRegion.h
"
19
20
// ISF includes
21
#include "
ISF_Interfaces/IGeoIDSvc.h
"
22
23
// EnvelopeDefinitionService
24
#include "
SubDetectorEnvelopes/IEnvelopeDefSvc.h
"
//Required for RZPair definition.
25
26
namespace
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
55
AtlasDetDescr::AtlasRegion
identifyGeoID
(
const
Amg::Vector3D
&pos)
const
;
56
58
ISF::InsideType
inside
(
const
Amg::Vector3D
&pos,
AtlasDetDescr::AtlasRegion
geoID)
const
;
59
60
63
AtlasDetDescr::AtlasRegion
identifyNextGeoID
(
const
Amg::Vector3D
&pos,
const
Amg::Vector3D
&dir)
const
;
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};
85
RadiusGeoIDPair
*
m_radiusBins
{};
86
int
m_maxRBins
{
AtlasDetDescr::fNumAtlasRegions
+1};
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
AthService.h
AtlasRegion.h
IEnvelopeDefSvc.h
IGeoIDSvc.h
ISF::GeoIDSvc::m_numZBins
int m_numZBins
Definition
GeoIDSvc.h:83
ISF::GeoIDSvc::m_envDefSvc
ServiceHandle< IEnvelopeDefSvc > m_envDefSvc
service providing the envelope dimensions for the different sub-detectors
Definition
GeoIDSvc.h:74
ISF::GeoIDSvc::m_zBins
double * m_zBins
Definition
GeoIDSvc.h:82
ISF::GeoIDSvc::identifyGeoID
AtlasDetDescr::AtlasRegion identifyGeoID(const Amg::Vector3D &pos) const
A static filter that returns the SimGeoID of the given position.
Definition
GeoIDSvc.cxx:222
ISF::GeoIDSvc::prepareRZPairs
std::unique_ptr< RZPairList > prepareRZPairs(AtlasDetDescr::AtlasRegion geoID)
Definition
GeoIDSvc.cxx:270
ISF::GeoIDSvc::inside
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
ISF::GeoIDSvc::sign
int sign(T val)
a branchless signum function
Definition
GeoIDSvc.h:94
ISF::GeoIDSvc::GeoIDSvc
GeoIDSvc(const std::string &name, ISvcLocator *svc)
Constructor with parameters.
Definition
GeoIDSvc.cxx:19
ISF::GeoIDSvc::~GeoIDSvc
~GeoIDSvc()=default
Destructor.
ISF::GeoIDSvc::identifyNextGeoID
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
ISF::GeoIDSvc::checkSymmetric
bool checkSymmetric(RZPairList &positiveZ, RZPairList &negativeZ)
Check if given RZPairLists are symmetric around z==0 plane.
Definition
GeoIDSvc.cxx:391
ISF::GeoIDSvc::m_radiusBins
RadiusGeoIDPair * m_radiusBins
m_radiusBins[m_numZBins][numCurRadiusBins]
Definition
GeoIDSvc.h:85
ISF::GeoIDSvc::m_maxRBins
int m_maxRBins
Definition
GeoIDSvc.h:86
ISF::GeoIDSvc::initialize
StatusCode initialize()
Definition
GeoIDSvc.cxx:25
ISF::GeoIDSvc::m_tolerance
DoubleProperty m_tolerance
(estimated) tolerance within which coordinates are considered equal
Definition
GeoIDSvc.h:78
ServiceHandle
Definition
ClusterMakerTool.h:36
Amg::Vector3D
Eigen::Matrix< double, 3, 1 > Vector3D
Definition
GeoPrimitives.h:47
AtlasDetDescr::AtlasRegion
AtlasRegion
A simple enum of ATLAS regions and sub-detectors.
Definition
AtlasRegion.h:21
AtlasDetDescr::fNumAtlasRegions
@ fNumAtlasRegions
Definition
AtlasRegion.h:33
ISF
ISFParticleOrderedQueue.
Definition
PrimaryParticleInformation.h:13
ISF::RadiusGeoIDPairSet
std::set< RadiusGeoIDPair, SortByRadius > RadiusGeoIDPairSet
Definition
GeoIDSvc.h:35
ISF::RadiusGeoIDPair
std::pair< double, AtlasDetDescr::AtlasRegion > RadiusGeoIDPair
Definition
GeoIDSvc.h:28
ISF::InsideType
InsideType
Definition
IGeoIDSvc.h:22
ISF::RZPairList
std::list< RZPair > RZPairList
Definition
GeoIDSvc.h:29
ISF::SortByRadius
Definition
GeoIDSvc.h:31
ISF::SortByRadius::operator()
bool operator()(const RadiusGeoIDPair &lhs, const RadiusGeoIDPair &rhs) const
Definition
GeoIDSvc.h:32
Generated on
for ATLAS Offline Software by
1.17.0