Commit d0f728fc authored by Walter Lampl's avatar Walter Lampl
Browse files

Merge branch 'threadMGM.MuonGeoModel-20211015' into 'master'

MuonGeoModel+MuonAGDDBase: Enable thread-safety checking for MuonGeoModel.

See merge request atlas/athena!47251
parents a451d751 63143f7d
......@@ -11,6 +11,7 @@
#include "GeoModelKernel/GeoPhysVol.h"
#include "GeoModelKernel/GeoFullPhysVol.h"
#include "GeoModelKernel/GeoMaterial.h"
#include "AGDDKernel/AGDDBuilder.h"
#include "StoreGate/StoreGateSvc.h"
#include "GaudiKernel/ISvcLocator.h"
......@@ -19,6 +20,7 @@
#include "MuonGeoModel/MMSpacerComponent.h"
#include "MuonGeoModel/MMSpacer.h"
#include "MuonGeoModel/MYSQL.h"
void AGDDMMSpacer::CreateSolid (const AGDDBuilder& /*builder*/)
{
......@@ -34,9 +36,10 @@ void AGDDMMSpacer::CreateVolume (const AGDDBuilder& builder)
mm_comp->dx1=m_small_x;
mm_comp->dx2=m_large_x;
mm_comp->dy=m_y;
MuonGM::MMSpacer cham(mm_comp);
GeoPhysVol *vvv=cham.build(1);
MuonGM::MYSQL::LockedMYSQL mysql = MuonGM::MYSQL::GetPointer();
MuonGM::MMSpacer cham(*mysql, mm_comp);
GeoPhysVol *vvv=cham.build(builder.GetMaterialManager(), *mysql, 1);
CreateSolid (builder);
......
......@@ -6,6 +6,7 @@
#include "AGDDModel/AGDDParameterStore.h"
#include "AGDDKernel/AGDDDetectorStore.h"
#include "AGDDKernel/AGDDVolume.h"
#include "AGDDKernel/AGDDBuilder.h"
#include "GeoModelKernel/GeoTrd.h"
#include "GeoModelKernel/GeoShape.h"
......@@ -61,7 +62,7 @@ void AGDDMicromegas::CreateVolume (const AGDDBuilder& builder)
mm_comp->subType=subType();
MuonGM::Micromegas *cham=new MuonGM::Micromegas(mm_comp);
GeoPhysVol *vvv=(GeoPhysVol*)cham->build(1);
GeoPhysVol *vvv=(GeoPhysVol*)cham->build(builder.GetMaterialManager(), 1);
CreateSolid (builder);
......
......@@ -8,6 +8,7 @@
#include "AGDDModel/AGDDParameterStore.h"
#include "AGDDKernel/AGDDDetectorStore.h"
#include "AGDDKernel/AGDDVolume.h"
#include "AGDDKernel/AGDDBuilder.h"
#include "GeoModelKernel/GeoTrd.h"
#include "GeoModelKernel/GeoShape.h"
......@@ -57,7 +58,7 @@ void AGDDsTGC::CreateVolume (const AGDDBuilder& builder)
stgc_comp->yCutoutCathode=yCutoutCathode();
MuonGM::sTGC *cham=new MuonGM::sTGC(stgc_comp);
GeoPhysVol *vvv=(GeoPhysVol*)cham->build(1);
GeoPhysVol *vvv=(GeoPhysVol*)cham->build(builder.GetMaterialManager(), 1);
CreateSolid (builder);
......
......@@ -4,6 +4,7 @@
#include "MuonAGDDBase/mmSpacer_TechHandler.h"
#include "MuonGeoModel/MMSpacer_Technology.h"
#include "MuonGeoModel/MYSQL.h"
#include <iostream>
......@@ -22,7 +23,7 @@ void mmSpacer_TechHandler::ElementHandle(AGDDController& c,
bool ret=true;
std::string name=getAttributeAsString(c, t, "type",ret);
MuonGM::MMSpacer_Technology *tech=new MuonGM::MMSpacer_Technology(name);
MuonGM::MMSpacer_Technology *tech=new MuonGM::MMSpacer_Technology(*MuonGM::MYSQL::GetPointer(), name);
tech->thickness=getAttributeAsDouble(c, t, "Tck",ret);
......
......@@ -14,7 +14,7 @@ find_package( GeoModel COMPONENTS GeoModelKernel )
atlas_add_library( MuonGeoModelLib
src/*.cxx
PUBLIC_HEADERS MuonGeoModel
LINK_LIBRARIES ${GEOMODEL_LIBRARIES} AthenaKernel GeoModelUtilities GaudiKernel MuonCondInterface MuonReadoutGeometry MuonGMdbObjects StoreGateLib MuonIdHelpersLib MuonAGDDDescription AGDDKernel AmdcDbLib
LINK_LIBRARIES ${GEOMODEL_LIBRARIES} AthenaKernel GeoModelUtilities GaudiKernel MuonCondInterface MuonReadoutGeometry MuonGMdbObjects StoreGateLib MuonIdHelpersLib MuonAGDDDescription AGDDControl AGDDKernel AmdcDbLib CxxUtils
PRIVATE_LINK_LIBRARIES AthenaPoolUtilities IdDictDetDescr MuonDetDescrUtils )
atlas_add_component( MuonGeoModel
......
/*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
*/
#ifndef CHV_H
......@@ -8,16 +8,17 @@
#include "MuonGeoModel/Technology.h"
namespace MuonGM {
class MYSQL;
class CHV : public Technology {
public:
inline CHV(std::string s);
inline CHV(MYSQL& mysql, const std::string& s);
double largeness;
double height;
double excent;
};
CHV::CHV(std::string s) : Technology(s), largeness(0.), height(0.), excent(0.) {}
CHV::CHV(MYSQL& mysql, const std::string& s) : Technology(mysql, s), largeness(0.), height(0.), excent(0.) {}
} // namespace MuonGM
#endif
/*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
*/
#ifndef CMI_H
......@@ -8,16 +8,17 @@
#include "MuonGeoModel/Technology.h"
namespace MuonGM {
class MYSQL;
class CMI : public Technology {
public:
inline CMI(std::string s);
inline CMI(MYSQL& mysql, const std::string& s);
double largeness;
double height;
double excent;
};
CMI::CMI(std::string s) : Technology(s), largeness(0.), height(0.), excent(0.) {}
CMI::CMI(MYSQL& mysql, const std::string& s) : Technology(mysql, s), largeness(0.), height(0.), excent(0.) {}
} // namespace MuonGM
#endif
/*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
*/
#ifndef CRO_H
......@@ -8,16 +8,17 @@
#include "MuonGeoModel/Technology.h"
namespace MuonGM {
class MYSQL;
class CRO : public Technology {
public:
inline CRO(std::string s);
inline CRO(MYSQL& mysql, const std::string& s);
double largeness;
double height;
double excent;
};
CRO::CRO(std::string s) : Technology(s), largeness(0.), height(0.), excent(0.) {}
CRO::CRO(MYSQL& mysql, const std::string& s) : Technology(mysql, s), largeness(0.), height(0.), excent(0.) {}
} // namespace MuonGM
#endif
/*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
*/
#ifndef CSC_H
......@@ -8,10 +8,11 @@
#include "MuonGeoModel/Technology.h"
namespace MuonGM {
class MYSQL;
class CSC : public Technology {
public:
inline CSC(std::string s);
inline CSC(MYSQL& sql, const std::string& s);
int numOfLayers;
double innerRadius;
double totalThickness;
......@@ -27,8 +28,8 @@ namespace MuonGM {
int nEtastrips, nPhistrips;
};
CSC::CSC(std::string s)
: Technology(s), numOfLayers(0), innerRadius(0.), totalThickness(0.), nonsisa(0.), honeycombthick(0.), g10thick(0.), wirespacing(0.), anocathodist(0.),
CSC::CSC(MYSQL& mysql, const std::string& s)
: Technology(mysql, s), numOfLayers(0), innerRadius(0.), totalThickness(0.), nonsisa(0.), honeycombthick(0.), g10thick(0.), wirespacing(0.), anocathodist(0.),
gapbetwcathstrips(0.), readoutstripswidth(0.), phistripwidth(0.), floatingstripswidth(0.), rectwasherthick(0.), roxacellwith(0.), roxwirebargap(0.),
fullgasgapwirewidth(0.), fullwirefixbarwidth(0.), wirebarposx(0.), wirebarposy(0.), wirebarposz(0.), cathreadoutpitch(0.), phireadoutpitch(0.), nEtastrips(0),
nPhistrips(0) {}
......
......@@ -17,6 +17,7 @@ namespace MuonGM {
class CscComponent;
class CscMultiLayer;
class Cutout;
class MYSQL;
class Csc : public DetectorElement {
......@@ -32,12 +33,17 @@ namespace MuonGM {
int index;
Csc(Component *s);
Csc(const MYSQL& mysql, Component *s);
~Csc();
CscMultiLayer *layer;
GeoFullPhysVol *build(int minimalgeo);
GeoFullPhysVol *build(int minimalgeo, int cutoutson, std::vector<Cutout *>);
void print();
GeoFullPhysVol *build(const StoredMaterialManager& matManager,
const MYSQL& mysql,
int minimalgeo);
GeoFullPhysVol *build(const StoredMaterialManager& matManager,
const MYSQL& mysql,
int minimalgeo, int cutoutson,
const std::vector<Cutout *>&);
virtual void print() override;
private:
CscComponent *m_component;
......
/*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
*/
#ifndef CscMultiLayer_H
......@@ -12,6 +12,7 @@
namespace MuonGM {
class Cutout;
class MYSQL;
class CscMultiLayer : public DetectorElement {
......@@ -32,10 +33,14 @@ namespace MuonGM {
double dim[8];
public: // methods
CscMultiLayer(std::string n);
GeoVPhysVol *build();
GeoVPhysVol *build(int cutoutson, const std::vector<Cutout *>& vcutdef);
void print();
CscMultiLayer(const MYSQL& mysql, std::string n);
GeoVPhysVol *build(const StoredMaterialManager& matManager,
const MYSQL& mysql);
GeoVPhysVol *build(const StoredMaterialManager& matManager,
const MYSQL& mysql,
int cutoutson,
const std::vector<Cutout *>& vcutdef);
virtual void print() override;
};
} // namespace MuonGM
......
/*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
*/
#ifndef DED_H
......@@ -11,12 +11,14 @@
namespace MuonGM {
class MYSQL;
class DED : public Technology {
public:
double AlThickness;
double HoneyCombThickness;
DED(std::string s);
DED(MYSQL& mysql, std::string s);
bool hasAlHoneyComb() { return false; };
bool hasPaperHoneyComb() { return true; };
......
/*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
*/
#ifndef Ded_H
......@@ -13,6 +13,7 @@ class GeoVPhysVol;
namespace MuonGM {
class Cutout;
class MYSQL;
class Ded : public DetectorElement {
......@@ -22,10 +23,14 @@ namespace MuonGM {
double thickness;
double longWidth; // for trapezoidal layers
Ded(Component *s);
GeoVPhysVol *build();
GeoVPhysVol *build(int cutoutson, std::vector<Cutout *>);
void print();
Ded(const MYSQL& mysql, Component *s);
GeoVPhysVol *build(const StoredMaterialManager& matManager,
const MYSQL& mysql);
GeoVPhysVol *build(const StoredMaterialManager& matManager,
const MYSQL& mysql,
int cutoutson,
const std::vector<Cutout *>&);
virtual void print() override;
private:
DedComponent *m_component;
......
......@@ -6,7 +6,6 @@
#define DetectorElement_H
#include "AthenaKernel/getMessageSvc.h"
#include "CxxUtils/checker_macros.h"
#include "GaudiKernel/MsgStream.h"
#include "GeoModelInterfaces/StoredMaterialManager.h"
......@@ -31,23 +30,6 @@ namespace MuonGM {
virtual ~DetectorElement() = default;
// Static
//!
//! Set Material Manager for all childs of this class
//! MUST BE CALLED BEFORE ANY THREADS TRY TO CALL @ref getMaterialManager
//!
static void setMaterialManager(const StoredMaterialManager &matMan) { s_matManager = &matMan; }
const StoredMaterialManager *getMaterialManager() const { return s_matManager; }
private:
//!
//! Actually, it haves thread-safe access only when @ref getMaterialManager
//! is called before any @ref getMaterialManager.
//!
static const StoredMaterialManager *s_matManager ATLAS_THREAD_SAFE;
}; // class DetectorElement
} // namespace MuonGM
......
......@@ -12,6 +12,7 @@
class GeoVPhysVol;
namespace MuonGM {
class MYSQL;
class DriftTube : public DetectorElement {
public:
......@@ -24,9 +25,9 @@ namespace MuonGM {
double gasRadius;
double plugLength;
GeoVPhysVol *build();
void print();
DriftTube(std::string s);
GeoVPhysVol *build(const StoredMaterialManager& matManager);
virtual void print() override;
DriftTube(const MYSQL& mysql, std::string s);
};
} // namespace MuonGM
......
/*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
*/
#ifndef LBI_H
......@@ -8,16 +8,17 @@
#include "MuonGeoModel/Technology.h"
namespace MuonGM {
class MYSQL;
class LBI : public Technology {
public:
inline LBI(std::string s);
inline LBI(MYSQL& mysql, const std::string& s);
double height;
float lowerThickness;
float yShift;
};
LBI::LBI(std::string s) : Technology(s), height(0.), lowerThickness(0.), yShift(0.) {}
LBI::LBI(MYSQL& mysql, const std::string& s) : Technology(mysql, s), height(0.), lowerThickness(0.), yShift(0.) {}
} // namespace MuonGM
#endif
/*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
*/
#ifndef MDT_H
......@@ -10,6 +10,7 @@
#include <string>
namespace MuonGM {
class MYSQL;
class MDT : public Technology {
public:
......@@ -24,7 +25,7 @@ namespace MuonGM {
double y[4];
double x[4];
MDT(std::string s) : Technology(s), numOfLayers(0), pitch(0.), innerRadius(0.), totalThickness(0.), tubeDeadLength(0.), tubeEndPlugLength(0.), tubeWallThickness(0.) {}
MDT(MYSQL& mysql, const std::string& s) : Technology(mysql, s), numOfLayers(0), pitch(0.), innerRadius(0.), totalThickness(0.), tubeDeadLength(0.), tubeEndPlugLength(0.), tubeWallThickness(0.) {}
};
} // namespace MuonGM
......
......@@ -16,6 +16,7 @@ namespace MuonGM {
class Cutout;
class Component;
class MMSpacerComponent;
class MYSQL;
class MMSpacer : public DetectorElement {
......@@ -26,10 +27,15 @@ namespace MuonGM {
double longWidth; // for trapezoidal layers
int index;
MMSpacer(Component *s);
GeoPhysVol *build(int minimalgeo);
GeoPhysVol *build(int minimalgeo, int cutoutson, const std::vector<Cutout *>&);
void print();
MMSpacer(const MYSQL& mysql, Component *s);
GeoPhysVol *build(const StoredMaterialManager& matManager,
const MYSQL& mysql,
int minimalgeo);
GeoPhysVol *build(const StoredMaterialManager& matManager,
const MYSQL& mysql,
int minimalgeo, int cutoutson,
const std::vector<Cutout *>&);
virtual void print() override;
private:
MMSpacerComponent *m_component;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment