diff --git a/detector/calorimeter/ECalBarrel_NobleLiquid_InclinedTrapezoids_o1_v01_geo.cpp b/detector/calorimeter/ECalBarrel_NobleLiquid_InclinedTrapezoids_o1_v01_geo.cpp index d0abe7645..2f3777384 100644 --- a/detector/calorimeter/ECalBarrel_NobleLiquid_InclinedTrapezoids_o1_v01_geo.cpp +++ b/detector/calorimeter/ECalBarrel_NobleLiquid_InclinedTrapezoids_o1_v01_geo.cpp @@ -574,15 +574,13 @@ static dd4hep::detail::Ref_t createECalBarrelInclined(dd4hep::Detector& aLcdd, dd4hep::xml::setDetectorTypeFlag(xmlDetElem, caloDetElem); dd4hep::rec::MaterialManager matMgr(envelopeVol); dd4hep::rec::LayeredCalorimeterData::Layer caloLayer; - double nRadiationLengths = 0.; - double nInteractionLengths = 0.; double rad_first = Rmin; double rad_last = 0; double scale_fact = dR / (-Rmin * cos(angle) + sqrt(pow(Rmax, 2) - pow(Rmin * sin(angle), 2))); // since the layer height is given along the electrode and not along the radius it needs to be scaled to get the values of layer height radially std::cout << "Scaling factor " << scale_fact << std::endl; - for (auto il = 0; il < layerHeight.size(); il++) { + for (size_t il = 0; il < layerHeight.size(); il++) { double thickness_sen = 0.; double absorberThickness = 0.; @@ -600,7 +598,7 @@ static dd4hep::detail::Ref_t createECalBarrelInclined(dd4hep::Detector& aLcdd, const double value_of_lambda = layerHeight[il] / nInteractionLengths; std::string str1("LAr"); - for (auto imat = 0; imat < materials.size(); imat++) { + for (size_t imat = 0; imat < materials.size(); imat++) { std::string str2(materials.at(imat).first.name()); if (str1.compare(str2) == 0){ diff --git a/detector/calorimeter/ECalBarrel_o2_v01_geo.cpp b/detector/calorimeter/ECalBarrel_o2_v01_geo.cpp index 2cce0befa..c05626be8 100644 --- a/detector/calorimeter/ECalBarrel_o2_v01_geo.cpp +++ b/detector/calorimeter/ECalBarrel_o2_v01_geo.cpp @@ -71,8 +71,6 @@ static Ref_t create_detector(Detector& theDetector, xml_h e, SensitiveDetector s string det_type = x_det.typeStr(); Material air = theDetector.air(); double totalThickness = layering.totalThickness(); - int totalRepeat = 0; - int totalSlices = 0; double gap = xml_dim_t(x_det).gap(); int nsides = dim.numsides(); @@ -107,14 +105,6 @@ static Ref_t create_detector(Detector& theDetector, xml_h e, SensitiveDetector s caloData->gap1 = 0.; //FIXME caloData->gap2 = 0.; //FIXME - - for (xml_coll_t c(x_det, _U(layer)); c; ++c) { - xml_comp_t x_layer = c; - int repeat = x_layer.repeat(); - totalRepeat += repeat; - totalSlices += x_layer.numChildren(_U(slice)); - } - // --- create an envelope volume and position it into the world --------------------- Volume envelopeVol = dd4hep::xml::createPlacedEnvelope(theDetector, e , sdet) ; diff --git a/detector/calorimeter/ECalEndcap_o1_v01_geo.cpp b/detector/calorimeter/ECalEndcap_o1_v01_geo.cpp index d78650fd6..f27941378 100644 --- a/detector/calorimeter/ECalEndcap_o1_v01_geo.cpp +++ b/detector/calorimeter/ECalEndcap_o1_v01_geo.cpp @@ -184,7 +184,6 @@ static Ref_t create_detector(Detector& theDetector, xml_h e, SensitiveDetector s // Loop over the sets of layer elements in the detector double check_thick = 0.0; int l_num = 1; - int l_set = 0; for(xml_coll_t li(x_det,_U(layer)); li; ++li) { xml_comp_t x_layer = li; @@ -281,7 +280,6 @@ static Ref_t create_detector(Detector& theDetector, xml_h e, SensitiveDetector s // Increment layer number ++l_num; } - l_set++; } std::cout << "Total slice thickness check " << check_thick << " cm" << std::endl; diff --git a/detector/calorimeter/GenericCalBarrel_o1_v01_geo.cpp b/detector/calorimeter/GenericCalBarrel_o1_v01_geo.cpp index 3b199f76c..77a718c61 100644 --- a/detector/calorimeter/GenericCalBarrel_o1_v01_geo.cpp +++ b/detector/calorimeter/GenericCalBarrel_o1_v01_geo.cpp @@ -74,8 +74,6 @@ static Ref_t create_detector(Detector& theDetector, xml_h e, SensitiveDetector s string det_type = x_det.typeStr(); Material air = theDetector.air(); double totalThickness = layering.totalThickness(); - int totalRepeat = 0; - int totalSlices = 0; double gap = xml_dim_t(x_det).gap(); int nsides = dim.numsides(); @@ -110,14 +108,6 @@ static Ref_t create_detector(Detector& theDetector, xml_h e, SensitiveDetector s caloData->gap1 = 0.; //FIXME caloData->gap2 = 0.; //FIXME - - for (xml_coll_t c(x_det, _U(layer)); c; ++c) { - xml_comp_t x_layer = c; - int repeat = x_layer.repeat(); - totalRepeat += repeat; - totalSlices += x_layer.numChildren(_U(slice)); - } - // --- create an envelope volume and position it into the world --------------------- Volume envelopeVol = dd4hep::xml::createPlacedEnvelope( theDetector, e , sdet ) ; diff --git a/detector/calorimeter/HCalBarrel_o1_v01_geo.cpp b/detector/calorimeter/HCalBarrel_o1_v01_geo.cpp index dbee8243b..060606e5b 100644 --- a/detector/calorimeter/HCalBarrel_o1_v01_geo.cpp +++ b/detector/calorimeter/HCalBarrel_o1_v01_geo.cpp @@ -22,7 +22,7 @@ using dd4hep::Layer; using dd4hep::Layering; using dd4hep::Material; using dd4hep::PlacedVolume; -using dd4hep::PolyhedraRegular; +// using dd4hep::PolyhedraRegular; using dd4hep::Position; using dd4hep::Readout; using dd4hep::Ref_t; @@ -70,8 +70,6 @@ static Ref_t create_detector(Detector& theDetector, xml_h e, SensitiveDetector s string det_type = x_det.typeStr(); Material air = theDetector.air(); double totalThickness = layering.totalThickness(); - int totalRepeat = 0; - int totalSlices = 0; double gap = xml_dim_t(x_det).gap(); int nsides = dim.numsides(); @@ -106,14 +104,6 @@ static Ref_t create_detector(Detector& theDetector, xml_h e, SensitiveDetector s caloData->gap1 = 0.; //FIXME caloData->gap2 = 0.; //FIXME - - for (xml_coll_t c(x_det, _U(layer)); c; ++c) { - xml_comp_t x_layer = c; - int repeat = x_layer.repeat(); - totalRepeat += repeat; - totalSlices += x_layer.numChildren(_U(slice)); - } - // --- create an envelope volume and position it into the world --------------------- Volume envelopeVol = dd4hep::xml::createPlacedEnvelope( theDetector, e , sdet ) ; diff --git a/detector/calorimeter/HCalThreePartsEndcap_o1_v01_geo.cpp b/detector/calorimeter/HCalThreePartsEndcap_o1_v01_geo.cpp index e02d4bfea..34544c2e2 100644 --- a/detector/calorimeter/HCalThreePartsEndcap_o1_v01_geo.cpp +++ b/detector/calorimeter/HCalThreePartsEndcap_o1_v01_geo.cpp @@ -5,7 +5,6 @@ #define endmsg std::endl #define lLog std::cout namespace MSG { -const std::string ERROR = " Error: "; const std::string DEBUG = " Debug: "; const std::string INFO = " Info: "; } @@ -216,7 +215,6 @@ void buildEC(dd4hep::Detector& aLcdd, dd4hep::SensitiveDetector& aSensDet, dd4he layerVolume.setVisAttributes(aLcdd.invisible()); unsigned int idxSubMod = 0; - unsigned int idxActMod = 0; dd4hep::Position moduleOffset1 (0,0,sign * extBarrelOffset1); @@ -248,7 +246,6 @@ void buildEC(dd4hep::Detector& aLcdd, dd4hep::SensitiveDetector& aSensDet, dd4he if (xComp.isSensitive()) { tileVol.setSensitiveDetector(sensDet); tilesPerLayer.push_back(placedTileVol); - idxActMod++; } tileZOffset += xComp.thickness(); } @@ -290,7 +287,6 @@ void buildEC(dd4hep::Detector& aLcdd, dd4hep::SensitiveDetector& aSensDet, dd4he layerVolume.setVisAttributes(aLcdd.invisible()); unsigned int idxSubMod = 0; - unsigned int idxActMod = 0; double tileZOffset = - 0.5* dzSequence; @@ -311,7 +307,6 @@ void buildEC(dd4hep::Detector& aLcdd, dd4hep::SensitiveDetector& aSensDet, dd4he if (xComp.isSensitive()) { tileVol.setSensitiveDetector(sensDet); tilesPerLayer.push_back(placedTileVol); - idxActMod++; } tileZOffset += xComp.thickness(); } @@ -361,7 +356,6 @@ void buildEC(dd4hep::Detector& aLcdd, dd4hep::SensitiveDetector& aSensDet, dd4he layerVolume.setVisAttributes(aLcdd.invisible()); unsigned int idxSubMod = 0; - unsigned int idxActMod = 0; double tileZOffset = - 0.5* dzSequence; @@ -382,7 +376,6 @@ void buildEC(dd4hep::Detector& aLcdd, dd4hep::SensitiveDetector& aSensDet, dd4he if (xComp.isSensitive()) { tileVol.setSensitiveDetector(sensDet); tilesPerLayer.push_back(placedTileVol); - idxActMod++; } tileZOffset += xComp.thickness(); } diff --git a/detector/calorimeter/HCalTileBarrel_o1_v01_geo.cpp b/detector/calorimeter/HCalTileBarrel_o1_v01_geo.cpp index e6d67caa8..89be7154d 100644 --- a/detector/calorimeter/HCalTileBarrel_o1_v01_geo.cpp +++ b/detector/calorimeter/HCalTileBarrel_o1_v01_geo.cpp @@ -12,7 +12,6 @@ using dd4hep::PlacedVolume; #define endmsg std::endl #define lLog std::cout namespace MSG { -const std::string ERROR = " Error: "; const std::string DEBUG = " Debug: "; const std::string INFO = " Info: "; } @@ -168,7 +167,6 @@ static dd4hep::Ref_t createHCal(dd4hep::Detector& lcdd, xml_det_t xmlDet, dd4hep layerVolume.setVisAttributes(lcdd.invisible()); unsigned int idxSubMod = 0; - unsigned int idxActMod = 0; dd4hep::PlacedVolume placedLayerVolume = envelopeVolume.placeVolume(layerVolume); @@ -192,7 +190,6 @@ static dd4hep::Ref_t createHCal(dd4hep::Detector& lcdd, xml_det_t xmlDet, dd4hep if (xComp.isSensitive()) { tileVol.setSensitiveDetector(sensDet); tilesPerLayer.push_back(placedTileVol); - idxActMod++; } tileZOffset += xComp.thickness(); } diff --git a/detector/calorimeter/SECalEndcap_o1_v01_geo.cpp b/detector/calorimeter/SECalEndcap_o1_v01_geo.cpp index 338282826..bf16d0348 100644 --- a/detector/calorimeter/SECalEndcap_o1_v01_geo.cpp +++ b/detector/calorimeter/SECalEndcap_o1_v01_geo.cpp @@ -193,7 +193,6 @@ static Ref_t create_detector(Detector& theDetector, xml_h e, SensitiveDetector s // Loop over the sets of layer elements in the detector double check_thick = 0.0; int l_num = 1; - int l_set = 0; for(xml_coll_t li(x_det,_U(layer)); li; ++li) { xml_comp_t x_layer = li; @@ -289,7 +288,6 @@ static Ref_t create_detector(Detector& theDetector, xml_h e, SensitiveDetector s // Increment layer number ++l_num; } - l_set++; } std::cout << "Total slice thickness check " << check_thick << " cm" << std::endl; diff --git a/detector/calorimeter/SEcal05_ECRing.cpp b/detector/calorimeter/SEcal05_ECRing.cpp index aee2e0b16..186ad7605 100644 --- a/detector/calorimeter/SEcal05_ECRing.cpp +++ b/detector/calorimeter/SEcal05_ECRing.cpp @@ -210,7 +210,7 @@ static Ref_t create_detector(Detector& theDetector, xml_h element, SensitiveDete // //==================================================================== - int Number_of_Si_Layers_in_Barrel = 0; + int Number_of_Si_Layers_in_Barrel [[maybe_unused]] = 0; #ifdef VERBOSE std::cout << " Ecal total number of Silicon layers = " << Number_of_Si_Layers_in_Barrel << std::endl; diff --git a/detector/calorimeter/SteppedMuonBarrel_o2_v02_geo.cpp b/detector/calorimeter/SteppedMuonBarrel_o2_v02_geo.cpp index 11df5cee7..0d8e42da6 100644 --- a/detector/calorimeter/SteppedMuonBarrel_o2_v02_geo.cpp +++ b/detector/calorimeter/SteppedMuonBarrel_o2_v02_geo.cpp @@ -52,8 +52,6 @@ static Ref_t create_detector(Detector& theDetector, xml_h e, SensitiveDetector s string det_type = x_det.typeStr(); Material air = theDetector.air(); double totalThickness = layering.totalThickness(); - int totalRepeat = 0; - int totalSlices = 0; double gap = xml_dim_t(x_det).gap(); int nsides = dim.numsides(); @@ -93,13 +91,6 @@ static Ref_t create_detector(Detector& theDetector, xml_h e, SensitiveDetector s caloData->gap1 = 0.; //FIXME caloData->gap2 = 0.; //FIXME - for (xml_coll_t c(x_det, _U(layer)); c; ++c) { - xml_comp_t x_layer = c; - int repeat = x_layer.repeat(); - totalRepeat += repeat; - totalSlices += x_layer.numChildren(_U(slice)); - } - // CHECK THIS! // --- create an envelope volume and position it into the world --------------------- diff --git a/detector/calorimeter/YokeBarrel_o1_v01_geo.cpp b/detector/calorimeter/YokeBarrel_o1_v01_geo.cpp index 673a5dd63..5be170b91 100644 --- a/detector/calorimeter/YokeBarrel_o1_v01_geo.cpp +++ b/detector/calorimeter/YokeBarrel_o1_v01_geo.cpp @@ -22,7 +22,7 @@ using dd4hep::Layer; using dd4hep::Layering; using dd4hep::Material; using dd4hep::PlacedVolume; -using dd4hep::PolyhedraRegular; +// using dd4hep::PolyhedraRegular; using dd4hep::Position; using dd4hep::Readout; using dd4hep::Ref_t; @@ -70,8 +70,6 @@ static Ref_t create_detector(Detector& theDetector, xml_h e, SensitiveDetector s string det_type = x_det.typeStr(); Material air = theDetector.air(); double totalThickness = layering.totalThickness(); - int totalRepeat = 0; - int totalSlices = 0; double gap = xml_dim_t(x_det).gap(); int numSides = dim.numsides(); double detZ = dim.z(); @@ -98,14 +96,6 @@ static Ref_t create_detector(Detector& theDetector, xml_h e, SensitiveDetector s caloData->gap1 = 0.; //FIXME caloData->gap2 = 0.; //FIXME - - for (xml_coll_t c(x_det, _U(layer)); c; ++c) { - xml_comp_t x_layer = c; - int repeat = x_layer.repeat(); - totalRepeat += repeat; - totalSlices += x_layer.numChildren(_U(slice)); - } - // --- create an envelope volume and position it into the world --------------------- Volume envelopeVol = dd4hep::xml::createPlacedEnvelope( theDetector, e , sdet ) ; diff --git a/detector/calorimeter/YokeEndcap_o1_v01_geo.cpp b/detector/calorimeter/YokeEndcap_o1_v01_geo.cpp index 169ee3082..2f957424c 100644 --- a/detector/calorimeter/YokeEndcap_o1_v01_geo.cpp +++ b/detector/calorimeter/YokeEndcap_o1_v01_geo.cpp @@ -20,7 +20,6 @@ using dd4hep::RotationZYX; using dd4hep::Segmentation; using dd4hep::SensitiveDetector; using dd4hep::Transform3D; -using dd4hep::Tube; using dd4hep::Volume; using dd4hep::_toString; @@ -114,7 +113,6 @@ static Ref_t create_detector(Detector& theDetector, xml_h e, SensitiveDetector s double sliceZ = -l_thick/2; double totalAbsorberThickness=0.; - double th_i(0.), th_o(-1.) ; for(xml_coll_t s(x_layer,_U(slice)); s; ++s) { xml_comp_t x_slice = s; string s_name = _toString(s_num,"slice%d"); @@ -132,15 +130,7 @@ static Ref_t create_detector(Detector& theDetector, xml_h e, SensitiveDetector s s_phv.addPhysVolID("submodule",sensor_num); sensor_num++; - th_i += s_thick / 2. ; - th_o = s_thick / 2. ; - } else { - if( th_o < 0. ){ - th_i += s_thick; - } else { - th_o += s_thick; - } - } + } if( x_slice.isRadiator() ==true) totalAbsorberThickness+= s_thick; diff --git a/detector/tracker/VertexBarrel_detailed_o1_v01_geo.cpp b/detector/tracker/VertexBarrel_detailed_o1_v01_geo.cpp index 9ade326c0..cc9704eb5 100644 --- a/detector/tracker/VertexBarrel_detailed_o1_v01_geo.cpp +++ b/detector/tracker/VertexBarrel_detailed_o1_v01_geo.cpp @@ -43,10 +43,10 @@ using dd4hep::Translation3D; using dd4hep::Trapezoid; using dd4hep::Volume; using dd4hep::_toString; -using dd4hep::rec::Vector3D; -using dd4hep::rec::SurfaceType; +// using dd4hep::rec::Vector3D; +// using dd4hep::rec::SurfaceType; using dd4hep::rec::VolPlane; -using dd4hep::rec::volSurfaceList; +// using dd4hep::rec::volSurfaceList; static Ref_t create_element(Detector& theDetector, xml_h e, SensitiveDetector sens) { @@ -55,7 +55,7 @@ static Ref_t create_element(Detector& theDetector, xml_h e, SensitiveDetector se std::string det_name = x_det.nameStr(); DetElement sdet( det_name, x_det.id() ) ; - PlacedVolume pv; + // PlacedVolume pv; // put the whole detector into an assembly // - should be replaced by an envelope volume ... @@ -182,7 +182,8 @@ static Ref_t create_element(Detector& theDetector, xml_h e, SensitiveDetector se m.sensor_thickness = xml_comp_t(c_sensor).thickness(); xml_coll_t c_component = xml_coll_t(c_sensor,_U(component)); - int iSensitive, iPassive = 0; + // Is iSensitive being used later with this default value in a call to _toString? + int iSensitive = 0, iPassive = 0; for(c_component.reset(); c_component; ++c_component){ xml_comp_t component = c_component; m.sensor_sensitives.push_back(component.isSensitive()); @@ -341,7 +342,7 @@ static Ref_t create_element(Detector& theDetector, xml_h e, SensitiveDetector se // passivesDE.setPlacement(pv); // Place all sensor parts - int iSensitive = 0, iPassive = 0; + int iSensitive = 0; for(int i=0; i