From 63f9376396aaf7829e9953fe2de7db8694a6bb6c Mon Sep 17 00:00:00 2001 From: Markus Frank <Markus.Frank@cern.ch> Date: Mon, 19 Jun 2017 20:01:30 +0200 Subject: [PATCH] Fix shadow compilation warnings --- DDCore/src/plugins/LCDDConverter.cpp | 12 ++++++------ DDDetectors/src/PolyhedraBarrelCalorimeter2_geo.cpp | 8 ++++---- DDDetectors/src/PolyhedraEndcapCalorimeter2_geo.cpp | 8 ++++---- DDDetectors/src/Solenoid_o1_v01_gep.cpp | 10 +++++----- DDG4/src/Geant4Converter.cpp | 10 +++++----- 5 files changed, 24 insertions(+), 24 deletions(-) diff --git a/DDCore/src/plugins/LCDDConverter.cpp b/DDCore/src/plugins/LCDDConverter.cpp index dfbb8d3c8..a7d8da0e5 100644 --- a/DDCore/src/plugins/LCDDConverter.cpp +++ b/DDCore/src/plugins/LCDDConverter.cpp @@ -789,9 +789,9 @@ xml_h LCDDConverter::handlePlacement(const string& name,PlacedVolume node) const GeometryInfo& geo = data(); xml_h place = geo.xmlPlacements[node]; if (!place) { - TGeoMatrix* m = node->GetMatrix(); - TGeoVolume* v = node->GetVolume(); - xml_ref_t vol = xml_h(geo.xmlVolumes[v]); + TGeoMatrix* matrix = node->GetMatrix(); + TGeoVolume* volume = node->GetVolume(); + xml_ref_t vol = xml_h(geo.xmlVolumes[volume]); xml_h mot = geo.xmlVolumes[node->GetMotherVolume()]; place = xml_elt_t(geo.doc, _U(physvol)); @@ -800,10 +800,10 @@ xml_h LCDDConverter::handlePlacement(const string& name,PlacedVolume node) const } place.setRef(_U(volumeref), vol.name()); if (m) { - xml_ref_t pos = handlePosition(name+"_pos", m); + xml_ref_t pos = handlePosition(name+"_pos", matrix); place.setRef(_U(positionref), pos.name()); - if ( m->IsRotation() ) { - xml_ref_t rot = handleRotation(name+"_rot", m); + if ( matrix->IsRotation() ) { + xml_ref_t rot = handleRotation(name+"_rot", matrix); place.setRef(_U(rotationref), rot.name()); } } diff --git a/DDDetectors/src/PolyhedraBarrelCalorimeter2_geo.cpp b/DDDetectors/src/PolyhedraBarrelCalorimeter2_geo.cpp index c9f044282..029d9bab3 100644 --- a/DDDetectors/src/PolyhedraBarrelCalorimeter2_geo.cpp +++ b/DDDetectors/src/PolyhedraBarrelCalorimeter2_geo.cpp @@ -97,8 +97,8 @@ static Ref_t create_detector(Detector& description, xml_h e, SensitiveDetector s //#### LayeringExtensionImpl* layeringExtension = new LayeringExtensionImpl(); //#### Position layerNormal(0,0,1); - for (xml_coll_t c(x_det, _U(layer)); c; ++c) { - xml_comp_t x_layer = c; + for (xml_coll_t xc(x_det, _U(layer)); xc; ++xc) { + xml_comp_t x_layer = xc; int repeat = x_layer.repeat(); // Get number of times to repeat this layer. const Layer* lay = layering.layer(layer_num - 1); // Get the layer from the layering engine. // Loop over repeats for this layer. @@ -116,8 +116,8 @@ static Ref_t create_detector(Detector& description, xml_h e, SensitiveDetector s // Create the slices (sublayers) within the layer. double slice_pos_z = -(layer_thickness / 2); int slice_number = 1; - for (xml_coll_t k(x_layer, _U(slice)); k; ++k) { - xml_comp_t x_slice = k; + for (xml_coll_t xk(x_layer, _U(slice)); xk; ++xk) { + xml_comp_t x_slice = xk; string slice_name = _toString(slice_number, "slice%d"); double slice_thickness = x_slice.thickness(); Material slice_material = description.material(x_slice.materialStr()); diff --git a/DDDetectors/src/PolyhedraEndcapCalorimeter2_geo.cpp b/DDDetectors/src/PolyhedraEndcapCalorimeter2_geo.cpp index 8d92071d0..f9782d494 100644 --- a/DDDetectors/src/PolyhedraEndcapCalorimeter2_geo.cpp +++ b/DDDetectors/src/PolyhedraEndcapCalorimeter2_geo.cpp @@ -43,8 +43,8 @@ static Ref_t create_detector(Detector& description, xml_h e, SensitiveDetector s endcapVol.setAttributes(description,x_det.regionStr(),x_det.limitsStr(),x_det.visStr()); - for(xml_coll_t c(x_det,_U(layer)); c; ++c) { - xml_comp_t x_layer = c; + for(xml_coll_t xc(x_det,_U(layer)); xc; ++xc) { + xml_comp_t x_layer = xc; double l_thick = layering.layer(l_num-1)->thickness(); string l_name = _toString(layerType,"layer%d"); int l_repeat = x_layer.repeat(); @@ -53,8 +53,8 @@ static Ref_t create_detector(Detector& description, xml_h e, SensitiveDetector s int s_num = 1; double sliceZ = -l_thick/2; - for(xml_coll_t s(x_layer,_U(slice)); s; ++s) { - xml_comp_t x_slice = s; + for(xml_coll_t xs(x_layer,_U(slice)); xs; ++xs) { + xml_comp_t x_slice = xs; string s_name = _toString(s_num,"slice%d"); double s_thick = x_slice.thickness(); Material s_mat = description.material(x_slice.materialStr()); diff --git a/DDDetectors/src/Solenoid_o1_v01_gep.cpp b/DDDetectors/src/Solenoid_o1_v01_gep.cpp index 00f17a2cd..242dd178c 100644 --- a/DDDetectors/src/Solenoid_o1_v01_gep.cpp +++ b/DDDetectors/src/Solenoid_o1_v01_gep.cpp @@ -64,10 +64,10 @@ static Ref_t create_detector(Detector& description, xml_h e, SensitiveDetector s DetElement layer(sdet,_toString(n,"layer%d"),x_layer.id()); Tube l_tub (rmin,2*rmin,z); Volume l_vol(l_name,l_tub,air); - int m = 0; + int im = 0; - for(xml_coll_t j(x_layer,_U(slice)); j; ++j, ++m) { + for(xml_coll_t j(x_layer,_U(slice)); j; ++j, ++im) { xml_comp_t x_slice = j; Material mat = description.material(x_slice.materialStr()); string s_name= l_name+_toString(m,"_slice%d"); @@ -90,14 +90,14 @@ static Ref_t create_detector(Detector& description, xml_h e, SensitiveDetector s r += thickness; if ( x_slice.isSensitive() ) { - sens.setType("tracker"); - s_vol.setSensitiveDetector(sens); + sens.setType("tracker"); + s_vol.setSensitiveDetector(sens); } // Set Attributes s_vol.setAttributes(description,x_slice.regionStr(),x_slice.limitsStr(),x_slice.visStr()); pv = l_vol.placeVolume(s_vol); // Slices have no extra id. Take the ID of the layer! - pv.addPhysVolID("slice",m); + pv.addPhysVolID("slice",im); } l_tub.setDimensions(rmin,r,z); diff --git a/DDG4/src/Geant4Converter.cpp b/DDG4/src/Geant4Converter.cpp index aa62584ec..4e2b83137 100644 --- a/DDG4/src/Geant4Converter.cpp +++ b/DDG4/src/Geant4Converter.cpp @@ -514,8 +514,8 @@ void* Geant4Converter::handleSolid(const string& name, const TGeoShape* shape) c const TGeoCompositeShape* sh = (const TGeoCompositeShape*) shape; const TGeoBoolNode* boolean = sh->GetBoolNode(); TGeoBoolNode::EGeoBoolType oper = boolean->GetBooleanOperator(); - TGeoMatrix* m = boolean->GetRightMatrix(); - G4VSolid* left = (G4VSolid*) handleSolid(name + "_left", boolean->GetLeftShape()); + TGeoMatrix* matrix = boolean->GetRightMatrix(); + G4VSolid* left = (G4VSolid*) handleSolid(name + "_left", boolean->GetLeftShape()); G4VSolid* right = (G4VSolid*) handleSolid(name + "_right", boolean->GetRightShape()); if (!left) { @@ -556,8 +556,8 @@ void* Geant4Converter::handleSolid(const string& name, const TGeoShape* shape) c } } - if (m->IsRotation()) { - MyTransform3D transform(m->GetTranslation(),m->GetRotationMatrix()); + if (matrix->IsRotation()) { + MyTransform3D transform(matrix->GetTranslation(),matrix->GetRotationMatrix()); if (oper == TGeoBoolNode::kGeoSubtraction) solid = new G4SubtractionSolid(name, left, right, transform); else if (oper == TGeoBoolNode::kGeoUnion) @@ -566,7 +566,7 @@ void* Geant4Converter::handleSolid(const string& name, const TGeoShape* shape) c solid = new G4IntersectionSolid(name, left, right, transform); } else { - const Double_t *t = m->GetTranslation(); + const Double_t *t = matrix->GetTranslation(); G4ThreeVector transform(t[0] * CM_2_MM, t[1] * CM_2_MM, t[2] * CM_2_MM); if (oper == TGeoBoolNode::kGeoSubtraction) solid = new G4SubtractionSolid(name, left, right, 0, transform); -- GitLab