ATLAS Offline Software
Loading...
Searching...
No Matches
MuonGeometryWriter.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 JIVEXML_MUONGEOMETRYWRITER
6#define JIVEXML_MUONGEOMETRYWRITER
7
10#include "CLHEP/Geometry/Point3D.h"
12#include "GeoModelKernel/GeoVolumeCursor.h"
13#include "GeoModelKernel/GeoSimplePolygonBrep.h"
14
15#include <string>
16#include <fstream>
17
18namespace MuonGM {
20 class MuonStation;
21}
22
23namespace JiveXML
24{
28 class MuonGeometryWriter : virtual public IGeometryWriter, public AthAlgTool {
29
30 public:
31
37 MuonGeometryWriter(const std::string& t,const std::string& n,const IInterface* p):
38 AthAlgTool(t,n,p){declareInterface<IGeometryWriter>(this);};
39
43 virtual StatusCode writeGeometry();
44
45 private:
46
51 void writeHeader(std::ofstream &out) const ;
52
57 void writeStations(std::ofstream &out) const ;
58
60 void processNSW(std::ofstream &out);
61
66 void writeFooter(std::ofstream &out) const ;
67
72 void writeATrd(std::ofstream &out,
73 const std::string& stationTech,
74 const std::string& stationName,
75 double zi, double zo,
76 double ri, double ro,
77 double wi, double wo, int eta,
78 const std::string& phiString,
79 double dphi, double shift, double alpha) const ;
80
81
88 HepGeom::Point3D<double> getPosition(const MuonGM::MuonStation *station, int maxPhi) const ;
89
96 double getDeltaPhi(const HepGeom::Point3D<double> &pos, int maxPhi) const ;
97
104 double getShift(const HepGeom::Point3D<double> &pos, double dphi) const ;
105
111 double getAlpha(const HepGeom::Transform3D &trans) const ;
112
119 HepGeom::Point3D<double> getPositionNSW(Amg::Vector3D pos, int maxPhi) const ;
120
127 int getPhiIndex(double phi, int maxPhi) const ;
128
135 void readNSWMMPars(const GeoVolumeCursor *pv, int maxPhi, std::string& chamberName, HepGeom::Point3D<double>& pos_rot,
136 double& zi, double& zo, double& ri, double& ro, double& wi, double& wo, double& dphi, double& shift, int& phiIndex) const ;
137
144 void readNSWSTGCPars(const GeoVolumeCursor *pv, int maxPhi,
145 std::string& chamberName, HepGeom::Point3D<double>& pos_rot, const GeoSimplePolygonBrep*& theBrep,
146 int& nvtx, double& dz, double& dphi, double& shift, int& phiIndex) const ;
147
155 void readBrepAsATrd(const GeoSimplePolygonBrep* theBrep, double rho, const int* vtx, double& ri, double& ro, double& wi, double& wo) const ;
156
161 bool equalAngle(double a, double b) const ;
162
167 bool equalLength(double a, double b) const ;
168
171
173 static const double m_smallAngle, m_smallDistance ;
174 };
175}
176#endif
Scalar eta() const
pseudorapidity method
Scalar phi() const
phi method
static Double_t a
AthAlgTool(const std::string &type, const std::string &name, const IInterface *parent)
Constructor with parameters:
void readNSWMMPars(const GeoVolumeCursor *pv, int maxPhi, std::string &chamberName, HepGeom::Point3D< double > &pos_rot, double &zi, double &zo, double &ri, double &ro, double &wi, double &wo, double &dphi, double &shift, int &phiIndex) const
Reads the geometry parameters of a NSW Micromegas chamber.
void writeStations(std::ofstream &out) const
Retrieves all stations from GeoModel and writes the corresponding XML elements to a stream.
HepGeom::Point3D< double > getPositionNSW(Amg::Vector3D pos, int maxPhi) const
Returns the global position of the NSW station, rotated to sector 1.
static const double m_smallAngle
Maximum deviation from the reference value before the station is considered different.
bool equalLength(double a, double b) const
Compares two coordinates or lenghts.
MuonGeometryWriter(const std::string &t, const std::string &n, const IInterface *p)
Constructor.
void processNSW(std::ofstream &out)
process the geometry of New Small Wheel
void writeFooter(std::ofstream &out) const
Writes the footer of the XML file to a stream.
void writeHeader(std::ofstream &out) const
Writes the header of the XML file to a stream.
HepGeom::Point3D< double > getPosition(const MuonGM::MuonStation *station, int maxPhi) const
Returns the global position of the station, rotated to sector 1.
double getDeltaPhi(const HepGeom::Point3D< double > &pos, int maxPhi) const
Returns the rotation of the station with respect to the center of the sector.
double getShift(const HepGeom::Point3D< double > &pos, double dphi) const
Returns the shift of the station with respect to the center of the sector.
void readBrepAsATrd(const GeoSimplePolygonBrep *theBrep, double rho, const int *vtx, double &ri, double &ro, double &wi, double &wo) const
Takes four vetecies of a GeoSimplePolygonBrep to form a trapezoid shape and reads the parameters of t...
void readNSWSTGCPars(const GeoVolumeCursor *pv, int maxPhi, std::string &chamberName, HepGeom::Point3D< double > &pos_rot, const GeoSimplePolygonBrep *&theBrep, int &nvtx, double &dz, double &dphi, double &shift, int &phiIndex) const
Reads the geometry parameters of a NSW sTGC chamber.
int getPhiIndex(double phi, int maxPhi) const
Returns phi index of the sector.
static const double m_smallDistance
void writeATrd(std::ofstream &out, const std::string &stationTech, const std::string &stationName, double zi, double zo, double ri, double ro, double wi, double wo, int eta, const std::string &phiString, double dphi, double shift, double alpha) const
Writes a trapezoid station in XML to a stream.
bool equalAngle(double a, double b) const
Compares two angles.
const MuonGM::MuonDetectorManager * m_muon_manager
Pointer to the muon detector manager (GeoModel)
virtual StatusCode writeGeometry()
Writes the geometry of the ATLAS muon spectrometer to an XML file for use with Atlantis.
double getAlpha(const HepGeom::Transform3D &trans) const
Returns the forward tilt angle of a station (for CSCs).
The MuonDetectorManager stores the transient representation of the Muon Spectrometer geometry and pro...
Eigen::Matrix< double, 3, 1 > Vector3D
This header is shared inbetween the C-style server thread and the C++ Athena ServerSvc.
Ensure that the Athena extensions are properly loaded.
Definition GeoMuonHits.h:27