Skip to content

Commit

Permalink
Clean up unused variables
Browse files Browse the repository at this point in the history
  • Loading branch information
jmcarcell committed Nov 15, 2023
1 parent c88467c commit 4975d6a
Show file tree
Hide file tree
Showing 12 changed files with 31 additions and 29 deletions.
5 changes: 3 additions & 2 deletions detector/calorimeter/ECalBarrel_o2_v01_geo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,9 @@ 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;
// These are used later but clang complains
int totalRepeat [[maybe_unused]] = 0;
int totalSlices [[maybe_unused]] = 0;
double gap = xml_dim_t(x_det).gap();
int nsides = dim.numsides();

Expand Down
2 changes: 1 addition & 1 deletion detector/calorimeter/ECalEndcap_o1_v01_geo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ 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;
int l_set [[maybe_unused]] = 0;
for(xml_coll_t li(x_det,_U(layer)); li; ++li) {

xml_comp_t x_layer = li;
Expand Down
5 changes: 3 additions & 2 deletions detector/calorimeter/GenericCalBarrel_o1_v01_geo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,9 @@ 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;
// These are used later but clang complains
int totalRepeat [[maybe_unused]] = 0;
int totalSlices [[maybe_unused]] = 0;
double gap = xml_dim_t(x_det).gap();
int nsides = dim.numsides();

Expand Down
6 changes: 3 additions & 3 deletions detector/calorimeter/HCalBarrel_o1_v01_geo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -70,8 +70,8 @@ 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;
int totalRepeat [[maybe_unused]] = 0;
int totalSlices [[maybe_unused]] = 0;
double gap = xml_dim_t(x_det).gap();
int nsides = dim.numsides();

Expand Down
6 changes: 3 additions & 3 deletions detector/calorimeter/HCalThreePartsEndcap_o1_v01_geo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ void buildEC(dd4hep::Detector& aLcdd, dd4hep::SensitiveDetector& aSensDet, dd4he

layerVolume.setVisAttributes(aLcdd.invisible());
unsigned int idxSubMod = 0;
unsigned int idxActMod = 0;
unsigned int idxActMod [[maybe_unused]] = 0;

dd4hep::Position moduleOffset1 (0,0,sign * extBarrelOffset1);

Expand Down Expand Up @@ -290,7 +290,7 @@ void buildEC(dd4hep::Detector& aLcdd, dd4hep::SensitiveDetector& aSensDet, dd4he

layerVolume.setVisAttributes(aLcdd.invisible());
unsigned int idxSubMod = 0;
unsigned int idxActMod = 0;
unsigned int idxActMod [[maybe_unused]] = 0;

double tileZOffset = - 0.5* dzSequence;

Expand Down Expand Up @@ -361,7 +361,7 @@ void buildEC(dd4hep::Detector& aLcdd, dd4hep::SensitiveDetector& aSensDet, dd4he

layerVolume.setVisAttributes(aLcdd.invisible());
unsigned int idxSubMod = 0;
unsigned int idxActMod = 0;
unsigned int idxActMod [[maybe_unused]] = 0;

double tileZOffset = - 0.5* dzSequence;

Expand Down
2 changes: 1 addition & 1 deletion detector/calorimeter/HCalTileBarrel_o1_v01_geo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ 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;
unsigned int idxActMod [[maybe_unused]] = 0;


dd4hep::PlacedVolume placedLayerVolume = envelopeVolume.placeVolume(layerVolume);
Expand Down
2 changes: 1 addition & 1 deletion detector/calorimeter/SEcal05_ECRing.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions detector/calorimeter/SteppedMuonBarrel_o2_v02_geo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@ 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;
int totalRepeat [[maybe_unused]] = 0;
int totalSlices [[maybe_unused]] = 0;
double gap = xml_dim_t(x_det).gap();
int nsides = dim.numsides();

Expand Down
6 changes: 3 additions & 3 deletions detector/calorimeter/YokeBarrel_o1_v01_geo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -70,8 +70,8 @@ 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;
int totalRepeat [[maybe_unused]] = 0;
int totalSlices [[maybe_unused]] = 0;
double gap = xml_dim_t(x_det).gap();
int numSides = dim.numsides();
double detZ = dim.z();
Expand Down
3 changes: 1 addition & 2 deletions detector/calorimeter/YokeEndcap_o1_v01_geo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -114,7 +113,7 @@ 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.) ;
double th_i [[maybe_unused]] = 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");
Expand Down
13 changes: 7 additions & 6 deletions detector/tracker/VertexBarrel_detailed_o1_v01_geo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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) {

Expand All @@ -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 ...
Expand Down Expand Up @@ -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());
Expand Down Expand Up @@ -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, iPassive [[maybe_unused]] = 0;
for(int i=0; i<int(m.sensor_volumes.size()); i++){
x_pos = 0.0;
y_pos = m.sensor_xmin[i]+abs(m.sensor_xmax[i]-m.sensor_xmin[i])/2.;
Expand Down
6 changes: 3 additions & 3 deletions detector/tracker/VertexEndcap_detailed_o1_v01_geo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ using dd4hep::Assembly;
using dd4hep::BUILD_ENVELOPE;
using dd4hep::DetElement;
using dd4hep::Detector;
using dd4hep::ERROR;
using dd4hep::Material;
using dd4hep::PlacedVolume;
using dd4hep::Position;
Expand Down Expand Up @@ -171,7 +170,8 @@ static Ref_t create_detector(Detector& theDetector, xml_h e, SensitiveDetector s
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 with this default value below 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());
Expand Down Expand Up @@ -240,7 +240,7 @@ static Ref_t create_detector(Detector& theDetector, xml_h e, SensitiveDetector s
petalDE.setPlacement(pv);

int iStave = 0;
int nStaves = 0;
int nStaves [[maybe_unused]] = 0;
for(xml_coll_t ri(x_layer,_U(stave)); ri; ++ri)
nStaves+=1;

Expand Down

0 comments on commit 4975d6a

Please sign in to comment.