Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clean up unused variables #302

Merged
merged 7 commits into from
Feb 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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.;

Expand All @@ -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){
Expand Down
10 changes: 0 additions & 10 deletions detector/calorimeter/ECalBarrel_o2_v01_geo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand Down Expand Up @@ -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) ;
Expand Down
2 changes: 0 additions & 2 deletions detector/calorimeter/ECalEndcap_o1_v01_geo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down
10 changes: 0 additions & 10 deletions detector/calorimeter/GenericCalBarrel_o1_v01_geo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand Down Expand Up @@ -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 ) ;
Expand Down
12 changes: 1 addition & 11 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,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();

Expand Down Expand Up @@ -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 ) ;
Expand Down
7 changes: 0 additions & 7 deletions detector/calorimeter/HCalThreePartsEndcap_o1_v01_geo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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: ";
}
Expand Down Expand Up @@ -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);

Expand Down Expand Up @@ -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();
}
Expand Down Expand Up @@ -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;

Expand All @@ -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();
}
Expand Down Expand Up @@ -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;

Expand All @@ -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();
}
Expand Down
3 changes: 0 additions & 3 deletions detector/calorimeter/HCalTileBarrel_o1_v01_geo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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: ";
}
Expand Down Expand Up @@ -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);
Expand All @@ -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();
}
Expand Down
2 changes: 0 additions & 2 deletions detector/calorimeter/SECalEndcap_o1_v01_geo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
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
9 changes: 0 additions & 9 deletions detector/calorimeter/SteppedMuonBarrel_o2_v02_geo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand Down Expand Up @@ -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 ---------------------

Expand Down
12 changes: 1 addition & 11 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,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();
Expand All @@ -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 ) ;
Expand Down
12 changes: 1 addition & 11 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,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");
Expand All @@ -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;
Expand Down
14 changes: 7 additions & 7 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;
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 All @@ -368,7 +369,6 @@ static Ref_t create_element(Detector& theDetector, xml_h e, SensitiveDetector se
// Place passive sensor parts
else{
stave_assembly.placeVolume(m.sensor_volumes[i], Transform3D(rot, pos)*Translation3D(pos2));
iPassive++;
}
}
}
Expand Down
7 changes: 2 additions & 5 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,9 +240,6 @@ static Ref_t create_detector(Detector& theDetector, xml_h e, SensitiveDetector s
petalDE.setPlacement(pv);

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

for(xml_coll_t ri(x_layer,_U(stave)); ri; ++ri) {
xml_comp_t x_stave = ri;
Expand Down
Loading