k4SimGeant4
Loading...
Searching...
No Matches
MagFieldScanner.h
Go to the documentation of this file.
1#ifndef MAGFIELDSCANNER_H
2#define MAGFIELDSCANNER_H
3
4// Gaudi
5#include "GaudiKernel/Service.h"
6
7// k4FWCore
8#include "k4Interface/IGeoSvc.h"
9#include "k4Interface/ISimG4Svc.h"
10#include "k4Interface/ISimG4MagneticFieldTool.h"
11
12
27class MagFieldScanner : public Service {
28public:
29 explicit MagFieldScanner(const std::string& name, ISvcLocator* svcLoc);
30
31 virtual StatusCode initialize();
32 virtual StatusCode finalize();
33 virtual ~MagFieldScanner(){};
34
35private:
37 ServiceHandle<IGeoSvc> m_geoSvc;
38
40 ServiceHandle<ISimG4Svc> m_simG4Svc;
41
43 Gaudi::Property<std::string> m_outFilePath{this,
44 "outFilePath",
45 "magFieldProbes.root",
46 "Output file path"};
47
49 Gaudi::Property<std::vector<std::vector<double>>> m_xyPlaneProbes{
50 this,
51 "xyPlaneProbes",
52 {},
53 "xy-plane probe definitions"};
54
55 Gaudi::Property<std::vector<std::vector<double>>> m_zPlaneProbes{
56 this,
57 "zPlaneProbes",
58 {},
59 "z-plane probe definitions"};
60
61 Gaudi::Property<std::vector<std::vector<double>>> m_tubeProbes{
62 this,
63 "tubeProbes",
64 {},
65 "Tube probe definitions"};
66
67
68 struct XYPlaneProbe {
69 const double xMax;
70 const double yMax;
71 const double z;
72 };
73
74 struct ZPlaneProbe {
75 const double zMin;
76 const double zMax;
77 const double rMax;
78 const double phi;
79 };
80
81 struct TubeProbe {
82 const double zMin;
83 const double zMax;
84 const double r;
85 };
86
87 friend std::ostream& operator<<(std::ostream& outStream,
88 const XYPlaneProbe& probe);
89 friend std::ostream& operator<<(std::ostream& outStream,
90 const ZPlaneProbe& probe);
91 friend std::ostream& operator<<(std::ostream& outStream,
92 const TubeProbe& probe);
93};
94
95#endif /* MAGFIELDSCANNER_H */
Service probes the Geant4 magnetic field on initialize.
Definition MagFieldScanner.h:27
Gaudi::Property< std::string > m_outFilePath
Path to the output file.
Definition MagFieldScanner.h:43
virtual StatusCode initialize()
Definition MagFieldScanner.cpp:20
virtual ~MagFieldScanner()
Definition MagFieldScanner.h:33
MagFieldScanner(const std::string &name, ISvcLocator *svcLoc)
Definition MagFieldScanner.cpp:14
Gaudi::Property< std::vector< std::vector< double > > > m_tubeProbes
Definition MagFieldScanner.h:61
ServiceHandle< ISimG4Svc > m_simG4Svc
Handle to the Geant4 service.
Definition MagFieldScanner.h:40
friend std::ostream & operator<<(std::ostream &outStream, const XYPlaneProbe &probe)
Definition MagFieldScanner.cpp:337
virtual StatusCode finalize()
Definition MagFieldScanner.cpp:334
ServiceHandle< IGeoSvc > m_geoSvc
Handle to the geometry service.
Definition MagFieldScanner.h:37
Gaudi::Property< std::vector< std::vector< double > > > m_zPlaneProbes
Definition MagFieldScanner.h:55
Gaudi::Property< std::vector< std::vector< double > > > m_xyPlaneProbes
Probes.
Definition MagFieldScanner.h:49
Definition MagFieldScanner.h:81
const double zMax
Definition MagFieldScanner.h:83
const double r
Definition MagFieldScanner.h:84
const double zMin
Definition MagFieldScanner.h:82
Definition MagFieldScanner.h:68
const double yMax
Definition MagFieldScanner.h:70
const double z
Definition MagFieldScanner.h:71
const double xMax
Definition MagFieldScanner.h:69
Definition MagFieldScanner.h:74
const double zMax
Definition MagFieldScanner.h:76
const double rMax
Definition MagFieldScanner.h:77
const double phi
Definition MagFieldScanner.h:78
const double zMin
Definition MagFieldScanner.h:75