ATLAS Offline Software
MuonGeometryWriter.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2022 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 
18 namespace MuonGM {
19  class MuonDetectorManager;
20  class MuonStation;
21 }
22 
23 namespace 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
JiveXML::MuonGeometryWriter::processNSW
void processNSW(std::ofstream &out)
process the geometry of New Small Wheel
Definition: MuonGeometryWriter.cxx:391
MuonGM
Ensure that the Athena extensions are properly loaded.
Definition: GeoMuonHits.h:27
IGeometryWriter.h
JiveXML::MuonGeometryWriter::m_smallAngle
static const double m_smallAngle
Maximum deviation from the reference value before the station is considered different.
Definition: MuonGeometryWriter.h:173
JiveXML::MuonGeometryWriter::readBrepAsATrd
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...
Definition: MuonGeometryWriter.cxx:738
dumpTgcDigiDeadChambers.stationName
dictionary stationName
Definition: dumpTgcDigiDeadChambers.py:30
JiveXML::MuonGeometryWriter::getPhiIndex
int getPhiIndex(double phi, int maxPhi) const
Returns phi index of the sector.
Definition: MuonGeometryWriter.cxx:675
JiveXML::MuonGeometryWriter::MuonGeometryWriter
MuonGeometryWriter(const std::string &t, const std::string &n, const IInterface *p)
Constructor.
Definition: MuonGeometryWriter.h:37
JiveXML::MuonGeometryWriter::readNSWSTGCPars
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.
Definition: MuonGeometryWriter.cxx:717
python.AthDsoLogger.out
out
Definition: AthDsoLogger.py:71
JiveXML::MuonGeometryWriter::getPosition
HepGeom::Point3D< double > getPosition(const MuonGM::MuonStation *station, int maxPhi) const
Returns the global position of the station, rotated to sector 1.
Definition: MuonGeometryWriter.cxx:300
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
JiveXML::MuonGeometryWriter::getPositionNSW
HepGeom::Point3D< double > getPositionNSW(Amg::Vector3D pos, int maxPhi) const
Returns the global position of the NSW station, rotated to sector 1.
Definition: MuonGeometryWriter.cxx:681
GeoPrimitives.h
python.utils.AtlRunQueryDQUtils.p
p
Definition: AtlRunQueryDQUtils.py:210
beamspotman.n
n
Definition: beamspotman.py:731
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
Amg::Transform3D
Eigen::Affine3d Transform3D
Definition: GeoPrimitives.h:46
AthAlgTool.h
MuonGM::MuonStation
Definition: MuonStation.h:51
JiveXML::MuonGeometryWriter
Writes the GeoModel muon geometry to an XML file for use with Atlantis.
Definition: MuonGeometryWriter.h:28
JiveXML
This header is shared inbetween the C-style server thread and the C++ Athena ServerSvc.
Definition: BadLArRetriever.cxx:22
plotBeamSpotMon.b
b
Definition: plotBeamSpotMon.py:77
JiveXML::MuonGeometryWriter::writeGeometry
virtual StatusCode writeGeometry()
Writes the geometry of the ATLAS muon spectrometer to an XML file for use with Atlantis.
Definition: MuonGeometryWriter.cxx:30
Amg::Vector3D
Eigen::Matrix< double, 3, 1 > Vector3D
Definition: GeoPrimitives.h:47
JiveXML::MuonGeometryWriter::m_smallDistance
static const double m_smallDistance
Definition: MuonGeometryWriter.h:173
JiveXML::MuonGeometryWriter::writeFooter
void writeFooter(std::ofstream &out) const
Writes the footer of the XML file to a stream.
Definition: MuonGeometryWriter.cxx:355
python.LumiBlobConversion.pos
pos
Definition: LumiBlobConversion.py:18
eflowRec::phiIndex
unsigned int phiIndex(float phi, float binsize)
calculate phi index for a given phi
Definition: EtaPhiLUT.cxx:23
JiveXML::IGeometryWriter
Definition: IGeometryWriter.h:18
JiveXML::MuonGeometryWriter::equalLength
bool equalLength(double a, double b) const
Compares two coordinates or lenghts.
Definition: MuonGeometryWriter.cxx:754
JiveXML::MuonGeometryWriter::readNSWMMPars
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.
Definition: MuonGeometryWriter.cxx:692
a
TList * a
Definition: liststreamerinfos.cxx:10
MuonGM::MuonDetectorManager
The MuonDetectorManager stores the transient representation of the Muon Spectrometer geometry and pro...
Definition: MuonDetDescr/MuonReadoutGeometry/MuonReadoutGeometry/MuonDetectorManager.h:50
JiveXML::MuonGeometryWriter::getShift
double getShift(const HepGeom::Point3D< double > &pos, double dphi) const
Returns the shift of the station with respect to the center of the sector.
Definition: MuonGeometryWriter.cxx:336
JiveXML::MuonGeometryWriter::writeATrd
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.
Definition: MuonGeometryWriter.cxx:361
python.changerun.pv
pv
Definition: changerun.py:81
JiveXML::MuonGeometryWriter::m_muon_manager
const MuonGM::MuonDetectorManager * m_muon_manager
Pointer to the muon detector manager (GeoModel)
Definition: MuonGeometryWriter.h:170
JiveXML::MuonGeometryWriter::getAlpha
double getAlpha(const HepGeom::Transform3D &trans) const
Returns the forward tilt angle of a station (for CSCs).
Definition: MuonGeometryWriter.cxx:327
JiveXML::MuonGeometryWriter::writeHeader
void writeHeader(std::ofstream &out) const
Writes the header of the XML file to a stream.
Definition: MuonGeometryWriter.cxx:53
AthAlgTool
Definition: AthAlgTool.h:26
JiveXML::MuonGeometryWriter::equalAngle
bool equalAngle(double a, double b) const
Compares two angles.
Definition: MuonGeometryWriter.cxx:750
fitman.rho
rho
Definition: fitman.py:532
JiveXML::MuonGeometryWriter::getDeltaPhi
double getDeltaPhi(const HepGeom::Point3D< double > &pos, int maxPhi) const
Returns the rotation of the station with respect to the center of the sector.
Definition: MuonGeometryWriter.cxx:312
JiveXML::MuonGeometryWriter::writeStations
void writeStations(std::ofstream &out) const
Retrieves all stations from GeoModel and writes the corresponding XML elements to a stream.
Definition: MuonGeometryWriter.cxx:108