Skip to content
Snippets Groups Projects
Commit 6207769b authored by Shaun Roe's avatar Shaun Roe Committed by Graeme Stewart
Browse files

forbid various copy/assignments to placate coverity (SCT_SLHC_GeoModel-00-00-25)

parent 5fdcb5c7
No related branches found
No related tags found
No related merge requests found
Showing
with 103 additions and 46 deletions
......@@ -16,9 +16,10 @@ class SCT_BarrelModuleParametersOld : public SCT_BarrelModuleParameters{
public:
// Constructor
/// default constructor
SCT_BarrelModuleParametersOld(const SCT_DataBase * sctdb, const SCT_GeoModelAthenaComps * athenaComps);
~SCT_BarrelModuleParametersOld();
// Sensors
double sensorThickness(int moduleType) const;
double sensorWidth(int moduleType) const;
......@@ -51,6 +52,11 @@ public:
private:
//disallow copy and assignment
/// assignment
SCT_BarrelModuleParametersOld & operator=(const SCT_BarrelModuleParametersOld & );
/// copy constructor
SCT_BarrelModuleParametersOld(const SCT_BarrelModuleParametersOld & );
std::map<std::string, float>* m_SCT_Modules;
std::map<std::string, std::string>* m_SCT_Modules_Strng;
};
......
......@@ -20,7 +20,10 @@ public:
// Constructor
SCT_BarrelParametersOld(const SCT_DataBase * sctdb, const SCT_GeoModelAthenaComps * athenaComps);
~SCT_BarrelParametersOld();
//disable copy
SCT_BarrelParametersOld(const SCT_BarrelParametersOld & ) = delete;
//disable assign
SCT_BarrelParametersOld & operator=(const SCT_BarrelParametersOld & ) = delete;
int layoutType() const;
bool doEndCaps() const;
// Ski
......
......@@ -49,35 +49,28 @@ private:
};
class SCT_SharedComponentFactory : public SCT_ComponentFactory
{
public:
SCT_SharedComponentFactory(const std::string & name) :
SCT_ComponentFactory(name) {};
GeoVPhysVol * getVolume() const {return m_physVolume;}
class SCT_SharedComponentFactory : public SCT_ComponentFactory{
protected:
GeoVPhysVol * m_physVolume;
virtual GeoVPhysVol * build() = 0;
};
class SCT_UniqueComponentFactory : public SCT_ComponentFactory
{
public:
SCT_SharedComponentFactory(const std::string & name) :
SCT_ComponentFactory(name), m_physVolume(0){/**nop **/};
GeoVPhysVol * getVolume() const {return m_physVolume;}
};
SCT_UniqueComponentFactory(const std::string & name) :
SCT_ComponentFactory(name)
{};
virtual GeoVPhysVol * build(SCT_Identifier id) const = 0;
class SCT_UniqueComponentFactory : public SCT_ComponentFactory{
protected:
const GeoLogVol * m_logVolume;
virtual const GeoLogVol * preBuild() = 0;
public:
SCT_UniqueComponentFactory(const std::string & name) :
SCT_ComponentFactory(name), m_logVolume(0){
//nop
};
virtual GeoVPhysVol * build(SCT_Identifier id) const = 0;
};
}
......
......@@ -18,7 +18,11 @@ public:
// Constructor
SCT_ForwardModuleParametersOld(const SCT_DataBase * sctdb, const SCT_GeoModelAthenaComps * athenaComps);
~SCT_ForwardModuleParametersOld();
//disable assignment
SCT_ForwardModuleParametersOld & operator=(const SCT_ForwardModuleParametersOld &) = delete;
//disable copy
SCT_ForwardModuleParametersOld(const SCT_ForwardModuleParametersOld &) = delete;
// Sensor
int fwdSensorNumWafers(int iModuleType) const;
double fwdSensorThickness(int iModuleType) const;
......
......@@ -22,6 +22,10 @@ public:
// Constructor
SCT_ForwardParametersOld(const SCT_DataBase * sctdb, const SCT_GeoModelAthenaComps * athenaComps);
~SCT_ForwardParametersOld();
//disable assign and copy
SCT_ForwardParametersOld & operator=(const SCT_ForwardParametersOld &) = delete;
SCT_ForwardParametersOld(const SCT_ForwardParametersOld &) = delete;
//////////////////////////////////////////////////////////////////////////////
// Forward SCT
//////////////////////////////////////////////////////////////////////////////
......
......@@ -26,13 +26,13 @@ class SCT_FwdModule : public SCT_UniqueComponentFactory{
SCT_FwdModule(const std::string & name, int ring, int doubleSided);
~SCT_FwdModule();
SCT_FwdModule & operator=(const SCT_FwdModule &) = delete;
SCT_FwdModule(const SCT_FwdModule &) = delete;
//GeoVPhysVol* build(SCT_Identifier id, GeoTransform * position, GeoPhysVol * world) ;
virtual GeoVPhysVol* build(SCT_Identifier id) const;
double stereoAngle() const {return m_stereoAngle;}
double moduleShift() const {return m_moduleShift;}
double moduleShift() const {return m_moduleShift;}
double thickness() const {return m_thickness;}
double length() const {return m_length;}
double innerRadius() const {return m_innerRadius;}
......
......@@ -26,6 +26,9 @@ class SCT_FwdRing : public SCT_UniqueComponentFactory{
SCT_FwdRing(const std::string & name, int iWheel, int iRing, double offset);
~SCT_FwdRing();
//disable copy and assign
SCT_FwdRing & operator=(const SCT_FwdRing &) = delete;
SCT_FwdRing(const SCT_FwdRing &) = delete;
int numModules() const {return m_numModules;}
double moduleStagger() const {return m_moduleStagger;}
......
......@@ -20,6 +20,8 @@ class SCT_FwdWheel : public SCT_UniqueComponentFactory{
SCT_FwdWheel(const std::string & name, int iWheel);
~SCT_FwdWheel();
SCT_FwdWheel & operator=(const SCT_FwdWheel &) = delete;
SCT_FwdWheel(const SCT_FwdWheel &) = delete;
int wheelNum() const {return m_iWheel;}
// Retrieve basic parameters
......
......@@ -25,6 +25,9 @@ public:
SCT_GeneralParameters(const SCT_DataBase * sctdb, const SCT_GeoModelAthenaComps * athenaComps);
~SCT_GeneralParameters();
//disable copy, assign
SCT_GeneralParameters & operator=(const SCT_GeneralParameters &) = delete;
SCT_GeneralParameters(const SCT_GeneralParameters &) = delete;
// General
double safety() const;
......
......@@ -24,7 +24,11 @@ class SCT_InnerSide: public SCT_UniqueComponentFactory{
public:
SCT_InnerSide(const std::string & name, int moduleType, bool staveLayout);
~SCT_InnerSide();
~SCT_InnerSide();
//disable copy, assign
SCT_InnerSide & operator=(const SCT_InnerSide &) = delete;
SCT_InnerSide(const SCT_InnerSide &) = delete;
virtual GeoVPhysVol * build(SCT_Identifier id) const;
public:
......
......@@ -30,6 +30,10 @@ public:
SCT_Layer(const std::string & name,
int iLayer,
double cylLength);
//disable copy, assign
SCT_Layer & operator=(const SCT_Layer &) = delete;
SCT_Layer(const SCT_Layer &) = delete;
~SCT_Layer();
......
......@@ -28,7 +28,11 @@ public:
SCT_Module(const std::string & name, bool doubleSided, bool staveLayout, int moduleType);
~SCT_Module();
~SCT_Module();
//disable copy, assign
SCT_Module & operator=(const SCT_Module &) = delete;
SCT_Module(const SCT_Module &) = delete;
virtual GeoVPhysVol * build(SCT_Identifier id) const;
public:
......
......@@ -25,6 +25,10 @@ public:
SCT_OuterSide(const std::string & name, int moduleType);
~SCT_OuterSide();
//disable copy, assign
SCT_OuterSide & operator=(const SCT_OuterSide &) = delete;
SCT_OuterSide(const SCT_OuterSide &) = delete;
virtual GeoVPhysVol * build(SCT_Identifier id) const;
public:
......
......@@ -19,7 +19,11 @@ class SCT_ServiceBuilder {
public:
SCT_ServiceBuilder(InDetDD::Zone * topZone, const SCT_GeometryManager *);
InDetDD::VolumeBuilder * getServMatBuilder() const {return m_servMatBuilder;}
//disable copy, assign
SCT_ServiceBuilder & operator=(const SCT_ServiceBuilder&) = delete;
SCT_ServiceBuilder( const SCT_ServiceBuilder &) = delete;
~SCT_ServiceBuilder();
private:
InDetDD::VolumeBuilder * m_servMatBuilder;
};
......
......@@ -36,6 +36,10 @@ class SCT_Ski: public SCT_UniqueComponentFactory{
const SCT_Module* module);
~SCT_Ski();
//disable copy, assign
SCT_Ski & operator=(const SCT_Ski &) = delete;
SCT_Ski(const SCT_Ski &) = delete;
virtual GeoVPhysVol * build(SCT_Identifier id) const;
public:
......
......@@ -99,7 +99,7 @@ SCT_BarrelModuleParametersOld::SCT_BarrelModuleParametersOld(const SCT_DataBase
continue;
}else if(!strcmp(name, "SCT_BRL_MODULES_PARAMETERS_END")) break;
else{
//put string paramters in a different container
//put string parameters in a different container
if(strstr(name, "_STRNG") != NULL){
//re-read the second parameter as a string
sscanf(line, "%s %s", name, value_strng);
......@@ -110,7 +110,6 @@ SCT_BarrelModuleParametersOld::SCT_BarrelModuleParametersOld(const SCT_DataBase
}
}
}
//print the values for test
std::map<std::string, float>::iterator map_itr;
std::cout<<"-----------------Begin of SCT Barrel Modules parameters----------------"<<std::endl;
......@@ -122,6 +121,7 @@ SCT_BarrelModuleParametersOld::SCT_BarrelModuleParametersOld(const SCT_DataBase
std::cout<<"--------------- --End of SCT Barrel Modules parameters------- ---------" <<std::endl;
}
//
// Barrel Sensors
//
......@@ -305,4 +305,8 @@ SCT_BarrelModuleParametersOld::barrelDeadEdge(int moduleType) const
return deadEdge;
}
SCT_BarrelModuleParametersOld::~SCT_BarrelModuleParametersOld(){
delete m_SCT_Modules; m_SCT_Modules=0;
delete m_SCT_Modules_Strng; m_SCT_Modules_Strng=0;
}
}
......@@ -287,4 +287,11 @@ SCT_ForwardModuleParametersOld::fwdSpineMaterial(int iModuleType) const
//---return m_rdb->fwdSpine(iModuleType)->getString("MATERIAL");
}
SCT_ForwardModuleParametersOld::~SCT_ForwardModuleParametersOld(){
delete m_SCT_Fwd_Modules; m_SCT_Fwd_Modules=0;
delete m_SCT_Fwd_Modules_Strng; m_SCT_Fwd_Modules_Strng=0;
}
}
......@@ -38,13 +38,19 @@ inline double sqr(double x) {return x*x;}
SCT_FwdModule::SCT_FwdModule(const std::string & name, int ring, int doubleSided)
: SCT_UniqueComponentFactory(name), m_ring(ring), m_doubleSided(doubleSided){
: SCT_UniqueComponentFactory(name), m_ring(ring), m_doubleSided(doubleSided),
m_stereoAngle(0),
m_length(0),m_innerRadius(0),
m_middleRadius(0),m_outerRadius(0),
m_innerWidth(0), m_outerWidth(0),
m_deltaPhi(0),m_thickness(0),
m_moduleShift(0),m_interSidesGap(0),
m_sensor(0), m_spine(0){
getParameters();
m_logVolume = preBuild();
}
SCT_FwdModule::~SCT_FwdModule()
{
SCT_FwdModule::~SCT_FwdModule(){
delete m_spine;
delete m_sensor;
}
......@@ -61,8 +67,6 @@ SCT_FwdModule::getParameters()
const GeoLogVol * SCT_FwdModule::preBuild(){
//int iring = m_ring%4;//the sensors are defined in Simulation/G4Atlas/G4AtlasApps/python/atlas_idet.py
//m_spine = new SCT_FwdSpine("SCT_FwdSpine"+intToString(iring), m_ring);
//m_sensor = new SCT_FwdSensor("ECSensor"+intToString(iring), m_ring);
m_spine = new SCT_FwdSpine("SCT_FwdSpine0", m_ring);
m_sensor = new SCT_FwdSensor("ECSensor0", m_ring);
......@@ -75,11 +79,11 @@ const GeoLogVol * SCT_FwdModule::preBuild(){
if(m_doubleSided){
double interSidesGap = std::max(m_spine->thickness(), m_interSidesGap);
m_thickness = 2*m_sensor->thickness() + interSidesGap + 0.01*CLHEP::mm;//0.01mm safety necessary
//the term 10*CLHEP::degree*3.14/180, is for accomodate the stereo rotation
m_deltaPhi = m_deltaPhi + 10*CLHEP::degree*3.14/180;
//add 1cm, to accomodate for stereo rotation (to be delt correctly with later)
m_innerRadius = m_innerRadius;// - 0.5*CLHEP::cm;
m_outerRadius = m_outerRadius;// + 0.5*CLHEP::cm;
//the term 10*CLHEP::degree*3.14/180, is to accommodate the stereo rotation
m_deltaPhi = m_deltaPhi + 10*CLHEP::degree*3.14/180.;
//add 1cm, to accomodate for stereo rotation (to be dealt correctly with later)
//m_innerRadius = m_innerRadius - 0.5*CLHEP::cm;
//m_outerRadius = m_outerRadius + 0.5*CLHEP::cm;
m_innerWidth = std::max(m_sensor->innerWidth(), m_spine->innerWidth()) + 2*CLHEP::cm;
m_outerWidth = std::max(m_sensor->outerWidth(), m_spine->outerWidth()) + 2*CLHEP::cm;
}else{
......@@ -93,7 +97,6 @@ const GeoLogVol * SCT_FwdModule::preBuild(){
0.5*m_length);
SCT_MaterialManager * materials = geometryManager()->materialManager();
GeoLogVol* moduleLog = new GeoLogVol(getName(), moduleEnvelope, materials->gasMaterial());
return moduleLog;
}
......
......@@ -37,16 +37,16 @@ SCT_FwdRing::SCT_FwdRing(const std::string & name,
int iRing, double offset)
: SCT_UniqueComponentFactory(name),
m_iWheel(iWheel),
m_iRing(iRing){
m_iRing(iRing),
m_numModules(0), m_doubleSided(0), m_moduleStagger(0),m_stereoSign(0), m_refStartAngle(0),
m_refFirstStagger(0), m_innerRadius(0), m_middleRadius(0),m_length(0),m_thickness(0), m_firstStagger(0){
m_ringSide = (offset>0) ? 1 : -1;
getParameters();
m_logVolume = preBuild();
}
void SCT_FwdRing::getParameters(){
const SCT_ForwardParameters* parameters = geometryManager()->forwardParameters();
m_innerRadius = parameters->fwdRingInnerRadius(m_iRing);
m_middleRadius = parameters->fwdRingMiddleRadius(m_iRing);
m_outerRadius = parameters->fwdRingOuterRadius(m_iRing);
......@@ -110,7 +110,7 @@ GeoVPhysVol* SCT_FwdRing::build(SCT_Identifier id) const{
// _ |
// _ - |
// | |
// -|------- |-------->Z axis (Y is down the screen and X comming out the screen)
// -|------- |-------->Z axis (Y is down the screen and X coming out the screen)
// |_ |
// - _ |
// -
......
......@@ -20,6 +20,7 @@ namespace InDetDDSLHC {
SCT_GeometryManager::SCT_GeometryManager(const SCT_GeoModelAthenaComps *athenaComps)
: SCT_ParametersBase(athenaComps),
m_commonItems(0),
m_barrelParameters(0),
m_barrelModuleParameters(0),
m_forwardParameters(0),
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment