ATLAS Offline Software
IGeoIDSvc.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_INTERFACES_IGEOIDSVC_H
6 #define ISF_INTERFACES_IGEOIDSVC_H 1
7 
8 // Gaudi
9 #include "GaudiKernel/IInterface.h"
10 
11 // Amg
13 
14 // DetectorDescription
16 
17 // ISF Simulation includes
18 #include "ISF_Event/ISFParticle.h"
19 
20 namespace ISF {
21 
22  enum InsideType {
23  fOutside = 0,
24  fSurface = 1,
25  fInside = 2,
26  // to be used to allocate arrays
27  fNumInsideTypes = 3
28  };
29 
41  class IGeoIDSvc : virtual public IInterface {
42  public:
43 
45  virtual ~IGeoIDSvc(){}
46 
49 
52  inline ISF::InsideType inside(const ISFParticle& sp, AtlasDetDescr::AtlasRegion geoID) const;
53  inline ISF::InsideType inside(double x, double y, double z, AtlasDetDescr::AtlasRegion geoID) const;
54 
59  inline AtlasDetDescr::AtlasRegion identifyGeoID(double x, double y, double z) const;
60 
65  inline AtlasDetDescr::AtlasRegion identifyNextGeoID(double x, double y, double z,
66  double dx, double dy, double dz) const;
67 
71  };
72 
73 
74  // inline methods (basically wrapper for ISFParticle/coord. -> HepGeom::Point3D<double>)
75  //
76  // inside() wrappers
78  return inside( sp.position(), geoID);
79  }
80  inline ISF::InsideType IGeoIDSvc::inside(double x, double y, double z, AtlasDetDescr::AtlasRegion geoID) const {
81  const Amg::Vector3D pos(x, y, z);
82  return inside( pos, geoID);
83  }
84 
85  // identifyGeoID() wrappers
87  return identifyGeoID( sp.position());
88  }
89  inline AtlasDetDescr::AtlasRegion IGeoIDSvc::identifyGeoID(double x, double y, double z) const {
90  const Amg::Vector3D pos(x, y, z);
91  return identifyGeoID( pos);
92  }
93 
94  // identifyNextGeoID() wrappers
96  return identifyNextGeoID( sp.position(), sp.momentum());
97  }
99  double dx, double dy, double dz) const {
100  const Amg::Vector3D pos(x, y, z);
101  const Amg::Vector3D dir(dx, dy, dz);
102  return identifyNextGeoID( pos, dir);
103  }
104 
105  // identifyAndRegNextGeoID() wrapper
107  AtlasDetDescr::AtlasRegion geoID = identifyNextGeoID( part.position(), part.momentum());
108  part.setNextGeoID(geoID);
109  return geoID;
110  }
111 
112 } // end of namespace
113 
114 #endif // ISF_INTERFACES_IGEOIDSVC_H
LArG4FSStartPointFilter.part
part
Definition: LArG4FSStartPointFilter.py:21
AtlasRegion.h
ISF::fNumInsideTypes
@ fNumInsideTypes
Definition: IGeoIDSvc.h:27
AtlasDetDescr::AtlasRegion
AtlasRegion
Definition: AtlasRegion.h:27
ISF::IGeoIDSvc::identifyAndRegNextGeoID
AtlasDetDescr::AtlasRegion identifyAndRegNextGeoID(ISFParticle &sp) const
Find the AtlasRegion that the particle will enter with its next infinitesimal step along the given di...
Definition: IGeoIDSvc.h:106
ISF::InsideType
InsideType
Definition: IGeoIDSvc.h:22
ISF::ISFParticle
Definition: ISFParticle.h:42
ISF::IGeoIDSvc::inside
virtual ISF::InsideType inside(const Amg::Vector3D &pos, AtlasDetDescr::AtlasRegion geoID) const =0
Checks if the given position (ISFParticle) is inside/outside/onsurface a given AtlasRegion.
ISF::fOutside
@ fOutside
Definition: IGeoIDSvc.h:23
ISF::IGeoIDSvc::DeclareInterfaceID
DeclareInterfaceID(IGeoIDSvc, 1, 0)
Creates the InterfaceID and interfaceID() method.
x
#define x
ISF::ISFParticle::position
const Amg::Vector3D & position() const
The current position of the ISFParticle.
ISF::fSurface
@ fSurface
Definition: IGeoIDSvc.h:24
GeoPrimitives.h
ISF::fInside
@ fInside
Definition: IGeoIDSvc.h:25
ISFParticle.h
z
#define z
ISF::IGeoIDSvc
Definition: IGeoIDSvc.h:41
beamspotman.dir
string dir
Definition: beamspotman.py:623
ISF::IGeoIDSvc::identifyNextGeoID
virtual AtlasDetDescr::AtlasRegion identifyNextGeoID(const Amg::Vector3D &pos, const Amg::Vector3D &dir) const =0
Find the AtlasRegion that the particle will enter with its next infinitesimal step along the given di...
ISF::ISFParticle::momentum
const Amg::Vector3D & momentum() const
The current momentum vector of the ISFParticle.
Amg::Vector3D
Eigen::Matrix< double, 3, 1 > Vector3D
Definition: GeoPrimitives.h:47
python.LumiBlobConversion.pos
pos
Definition: LumiBlobConversion.py:18
makeTRTBarrelCans.dy
tuple dy
Definition: makeTRTBarrelCans.py:21
y
#define y
ISF
ISFParticleOrderedQueue.
Definition: PrimaryParticleInformation.h:13
ISF::IGeoIDSvc::identifyGeoID
virtual AtlasDetDescr::AtlasRegion identifyGeoID(const Amg::Vector3D &pos) const =0
A static filter that returns the AtlasRegion of the given ISFParticle (position) -> returns ISF::fUnd...
makeTRTBarrelCans.dx
tuple dx
Definition: makeTRTBarrelCans.py:20
ISF::IGeoIDSvc::~IGeoIDSvc
virtual ~IGeoIDSvc()
Virtual destructor.
Definition: IGeoIDSvc.h:45