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

Run3-hcx264 Try internal computation in double for DDHcalAngular for dd4hep #31319

Merged
merged 1 commit into from
Sep 3, 2020
Merged
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
18 changes: 9 additions & 9 deletions Geometry/HcalAlgo/plugins/dd4hep/DDHCalAngular.cc
Original file line number Diff line number Diff line change
Expand Up @@ -16,18 +16,18 @@ static long algorithm(dd4hep::Detector& /* description */,
int n = args.value<int>("n");
int startCopyNo = args.value<int>("startCopyNo");
int incrCopyNo = args.value<int>("incrCopyNo");
float rangeAngle = args.value<float>("rangeAngle"); //Angular range
float startAngle = args.value<float>("startAngle"); //Start anle
float shiftX = args.value<float>("shiftX"); //x Shift
float shiftY = args.value<float>("shiftY"); //y Shift
float zoffset = args.value<float>("zoffset"); //z offset
double rangeAngle = args.value<double>("rangeAngle"); //Angular range
double startAngle = args.value<double>("startAngle"); //Start anle
double shiftX = args.value<double>("shiftX"); //x Shift
double shiftY = args.value<double>("shiftY"); //y Shift
double zoffset = args.value<double>("zoffset"); //z offset
dd4hep::Volume mother = ns.volume(args.parentName());
std::string childName = args.value<std::string>("ChildName");
childName = ns.prepend(childName);
dd4hep::Volume child = ns.volume(childName);

// Increment
float dphi = rangeAngle / n;
double dphi = rangeAngle / n;
#ifdef EDM_ML_DEBUG
edm::LogVerbatim("HCalGeom") << "DDHCalAngular: Parameters for positioning::"
<< " n " << n << " Start, Range, Delta " << convertRadToDeg(startAngle) << " "
Expand All @@ -36,7 +36,7 @@ static long algorithm(dd4hep::Detector& /* description */,
<< "\tChild " << child.name() << " NameSpace " << ns.name();
#endif
int copy = startCopyNo;
float phix = startAngle;
double phix = startAngle;
for (int ii = 0; ii < n; ++ii) {
if (phix >= 2._pi)
phix -= 2._pi;
Expand All @@ -52,8 +52,8 @@ static long algorithm(dd4hep::Detector& /* description */,
rotation = dd4hep::RotationZ(phix);
}

float xpos = shiftX * cos(phix) - shiftY * sin(phix);
float ypos = shiftX * sin(phix) + shiftY * cos(phix);
double xpos = shiftX * cos(phix) - shiftY * sin(phix);
double ypos = shiftX * sin(phix) + shiftY * cos(phix);
dd4hep::Position tran(xpos, ypos, zoffset);
mother.placeVolume(child, copy, dd4hep::Transform3D(rotation, tran));
#ifdef EDM_ML_DEBUG
Expand Down