Skip to content

Commit

Permalink
Merge pull request #30777 from bsunanda/Phase2-hgx255A
Browse files Browse the repository at this point in the history
Phase2-hgx255A Remove magic number usage in 2 Algos
  • Loading branch information
cmsbuild committed Jul 21, 2020
2 parents b92d221 + 0147056 commit ac739f6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 10 deletions.
7 changes: 2 additions & 5 deletions Geometry/HGCalCommonData/plugins/DDHGCalModule.cc
Expand Up @@ -24,6 +24,7 @@
#include "FWCore/PluginManager/interface/PluginFactory.h"
#include "Geometry/HGCalCommonData/interface/HGCalGeomTools.h"
#include "Geometry/HGCalCommonData/interface/HGCalParameters.h"
#include "Geometry/HGCalCommonData/interface/HGCalTypes.h"

//#define EDM_ML_DEBUG
using namespace geant_units::operators;
Expand Down Expand Up @@ -282,11 +283,7 @@ void DDHGCalModule::positionSensitive(DDLogicalPart& glog, double rin, double ro
auto const& corner = HGCalGeomTools::waferCorner(xpos, ypos, dx, rr, rin, rout, true);
++ntot;
if (corner.first > 0) {
int copy = inr * 100 + inc;
if (nc < 0)
copy += 10000;
if (nr < 0)
copy += 100000;
int copy = HGCalTypes::packTypeUV(0, nc, nr);
if (inc > incm)
incm = inc;
if (inr > inrm)
Expand Down
7 changes: 2 additions & 5 deletions Geometry/HGCalCommonData/plugins/DDHGCalModuleAlgo.cc
Expand Up @@ -24,6 +24,7 @@
#include "FWCore/PluginManager/interface/PluginFactory.h"
#include "Geometry/HGCalCommonData/interface/HGCalGeomTools.h"
#include "Geometry/HGCalCommonData/interface/HGCalParameters.h"
#include "Geometry/HGCalCommonData/interface/HGCalTypes.h"

//#define EDM_ML_DEBUG
using namespace geant_units::operators;
Expand Down Expand Up @@ -286,11 +287,7 @@ void DDHGCalModuleAlgo::positionSensitive(DDLogicalPart& glog, double rin, doubl
double rpos = std::sqrt(xpos * xpos + ypos * ypos);
DDTranslation tran(xpos, ypos, 0.0);
DDRotation rotation;
int copy = inr * 100 + inc;
if (nc < 0)
copy += 10000;
if (nr < 0)
copy += 100000;
int copy = HGCalTypes::packTypeUV(0, nc, nr);
DDName name = (rpos < rMaxFine_) ? DDName(DDSplit(wafer_[0]).first, DDSplit(wafer_[0]).second)
: DDName(DDSplit(wafer_[1]).first, DDSplit(wafer_[1]).second);
cpv.position(name, glog.ddname(), copy, tran, rotation);
Expand Down

0 comments on commit ac739f6

Please sign in to comment.