Skip to content

Commit

Permalink
Code check
Browse files Browse the repository at this point in the history
  • Loading branch information
Sunanda committed Jan 31, 2023
1 parent c0d9472 commit 2d2112b
Show file tree
Hide file tree
Showing 6 changed files with 45 additions and 28 deletions.
9 changes: 6 additions & 3 deletions Geometry/HGCalCommonData/plugins/DDHGCalWaferFullRotated.cc
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,9 @@ void DDHGCalWaferFullRotated::initialize(const DDNumericArguments& nArgs,
#ifdef EDM_ML_DEBUG
edm::LogVerbatim("HGCalGeom") << "DDHGCalWaferFullRotated: " << layerNames_.size() << " types of volumes";
for (unsigned int i = 0; i < layerNames_.size(); ++i)
edm::LogVerbatim("HGCalGeom") << "Volume [" << i << "] " << layerNames_[i] << " of thickness " << layerThick_[i] << " size offset " << layerSizeOff_[i] << " filled with " << materials_[i] << " type " << layerType_[i];
edm::LogVerbatim("HGCalGeom") << "Volume [" << i << "] " << layerNames_[i] << " of thickness " << layerThick_[i]
<< " size offset " << layerSizeOff_[i] << " filled with " << materials_[i] << " type "
<< layerType_[i];
#endif
layers_ = dbl_to_int(vArgs["Layers"]);
#ifdef EDM_ML_DEBUG
Expand Down Expand Up @@ -177,9 +179,10 @@ void DDHGCalWaferFullRotated::execute(DDCompactView& cpv) {
zw[0] = -0.5 * layerThick_[i];
zw[1] = 0.5 * layerThick_[i];
}
std::string layerName = layerNames_[i] + tag_[k] + waferTag_;
std::string layerName = layerNames_[i] + tag_[k] + waferTag_;
#ifdef EDM_ML_DEBUG
edm::LogVerbatim("HGCalGeom") << "DDHGCalWaferFullRotated: Layer " << l << ": " << i << ": " << layerName << " " << layerSizeOff_[i] << " r " << r2 << ":" << R2;
edm::LogVerbatim("HGCalGeom") << "DDHGCalWaferFullRotated: Layer " << l << ": " << i << ": " << layerName << " "
<< layerSizeOff_[i] << " r " << r2 << ":" << R2;
#endif
solid = DDSolidFactory::extrudedpolygon(layerName, xL, yL, zw, zx, zy, scale);
DDName matN(DDSplit(materials_[i]).first, DDSplit(materials_[i]).second);
Expand Down
26 changes: 15 additions & 11 deletions Geometry/HGCalCommonData/plugins/DDHGCalWaferPartialRotated.cc
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
#include <vector>
#include <sstream>

//#define EDM_ML_DEBUG
#define EDM_ML_DEBUG

class DDHGCalWaferPartialRotated : public DDAlgorithm {
public:
Expand Down Expand Up @@ -92,7 +92,9 @@ void DDHGCalWaferPartialRotated::initialize(const DDNumericArguments& nArgs,
#ifdef EDM_ML_DEBUG
edm::LogVerbatim("HGCalGeom") << "DDHGCalWaferPartialRotated: " << layerNames_.size() << " types of volumes";
for (unsigned int i = 0; i < layerNames_.size(); ++i)
edm::LogVerbatim("HGCalGeom") << "Volume [" << i << "] " << layerNames_[i] << " of thickness " << layerThick_[i] << " size offset " << layerSizeOff_[i] << " filled with " << materials_[i] << " type " << layerType_[i];
edm::LogVerbatim("HGCalGeom") << "Volume [" << i << "] " << layerNames_[i] << " of thickness " << layerThick_[i]
<< " size offset " << layerSizeOff_[i] << " filled with " << materials_[i] << " type "
<< layerType_[i];
#endif
layers_ = dbl_to_int(vArgs["Layers"]);
#ifdef EDM_ML_DEBUG
Expand Down Expand Up @@ -156,16 +158,18 @@ void DDHGCalWaferPartialRotated::execute(DDCompactView& cpv) {
double zi(-0.5 * thick_), thickTot(0.0);
for (unsigned int l = 0; l < layers_.size(); l++) {
unsigned int i = layers_[l];
double r2 = 0.5 * (waferSize_ - layerSizeOff_[i]);
double R2 = r2 / sqrt3;
wxy = HGCalWaferMask::waferXY(partialTypes_[k], placementIndex_[m], r2, R2, 0.0, 0.0);
std::vector<double> xL, yL;
for (unsigned int i0 = 0; i0 < (wxy.size() - 1); ++i0) {
xL.emplace_back(wxy[i0].first);
yL.emplace_back(wxy[i0].second);
}
double r2 = 0.5 * (waferSize_ - layerSizeOff_[i]);
double R2 = r2 / sqrt3;
wxy = HGCalWaferMask::waferXY(partialTypes_[k], placementIndex_[m], r2, R2, 0.0, 0.0);
std::vector<double> xL, yL;
for (unsigned int i0 = 0; i0 < (wxy.size() - 1); ++i0) {
xL.emplace_back(wxy[i0].first);
yL.emplace_back(wxy[i0].second);
}
#ifdef EDM_ML_DEBUG
edm::LogVerbatim("HGCalGeom") << "DDHGCalWaferPartialRotated:Layer " << l << ":" << i << " T " << layerThick_[i] << " Size offset " << layerSizeOff_[i] << " Copy " << copyNumber[i] << " Partial type " << partialTypes_[k] << " r " << r2 << ":" << r;
edm::LogVerbatim("HGCalGeom") << "DDHGCalWaferPartialRotated:Layer " << l << ":" << i << " T " << layerThick_[i]
<< " Size offset " << layerSizeOff_[i] << " Copy " << copyNumber[i]
<< " Partial type " << partialTypes_[k] << " r " << r2 << ":" << r;
#endif
DDRotation rot;
if (copyNumber[i] == 1) {
Expand Down
3 changes: 2 additions & 1 deletion Geometry/HGCalCommonData/plugins/dd4hep/DDHGCalCell.cc
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,8 @@ static long algorithm(dd4hep::Detector& /* description */, cms::DDParsingContext
edm::LogVerbatim("HGCalGeom") << "DDHGCalCell: Wafer r " << cms::convert2mm(waferSize) << " T "
<< cms::convert2mm(waferT) << " Cell T " << cms::convert2mm(cellT) << " Cells/Wafer "
<< nCells << " Material " << material << "Sensitive Position " << posSens
<< " NameSpace " << ns.name() << " Full Cell: " << fullCN << ":" << fullSensN << " Separation " << waferSeparation << ":" << addWaferSeparation;
<< " NameSpace " << ns.name() << " Full Cell: " << fullCN << ":" << fullSensN
<< " Separation " << waferSeparation << ":" << addWaferSeparation;
for (unsigned int k = 0; k < truncCN.size(); ++k)
edm::LogVerbatim("HGCalGeom") << "DDHGCalCell: Truncated Cell[" << k << "] " << truncCN[k] << ":" << truncSensN[k];
for (unsigned int k = 0; k < extenCN.size(); ++k)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,9 @@ static long algorithm(dd4hep::Detector& /* description */, cms::DDParsingContext
#ifdef EDM_ML_DEBUG
edm::LogVerbatim("HGCalGeom") << "DDHGCalWaferFullRotated: " << layerNames.size() << " types of volumes";
for (unsigned int i = 0; i < layerNames.size(); ++i)
edm::LogVerbatim("HGCalGeom") << "Volume [" << i << "] " << layerNames[i] << " of thickness " << layerThick[i] << " size offset " << layerSizeOff[i] << " filled with " << materials[i] << " type " << layerType[i];
edm::LogVerbatim("HGCalGeom") << "Volume [" << i << "] " << layerNames[i] << " of thickness " << layerThick[i]
<< " size offset " << layerSizeOff[i] << " filled with " << materials[i] << " type "
<< layerType[i];
#endif
const auto& layers = args.value<std::vector<int> >("Layers");
#ifdef EDM_ML_DEBUG
Expand Down Expand Up @@ -128,7 +130,8 @@ static long algorithm(dd4hep::Detector& /* description */, cms::DDParsingContext
}
std::string layerName = layerNames[i] + tag[k] + waferTag;
#ifdef EDM_ML_DEBUG
edm::LogVerbatim("HGCalGeom") << "DDHGCalWaferFullRotated: Layer " << l << ": " << i << ":" << layerName << " " << layerSizeOff[i] << " r " << r2 << ":" << R2;
edm::LogVerbatim("HGCalGeom") << "DDHGCalWaferFullRotated: Layer " << l << ": " << i << ":" << layerName << " "
<< layerSizeOff[i] << " r " << r2 << ":" << R2;
#endif
solid = dd4hep::ExtrudedPolygon(xL, yL, zw, zx, zy, scale);
ns.addSolidNS(ns.prepend(layerName), solid);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,10 @@ static long algorithm(dd4hep::Detector& /* description */, cms::DDParsingContext
#ifdef EDM_ML_DEBUG
edm::LogVerbatim("HGCalGeom") << "DDHGCalWaferPartialRotated: " << layerNames.size() << " types of volumes";
for (unsigned int i = 0; i < layerNames.size(); ++i)
edm::LogVerbatim("HGCalGeom") << "Volume [" << i << "] " << layerNames[i] << " of thickness " << cms::convert2mm(layerThick[i]) << " size offset " << cms::convert2mm(layerSizeOff[i]) << " filled with " << materials[i] << " type " << layerType[i];
edm::LogVerbatim("HGCalGeom") << "Volume [" << i << "] " << layerNames[i] << " of thickness "
<< cms::convert2mm(layerThick[i]) << " size offset "
<< cms::convert2mm(layerSizeOff[i]) << " filled with " << materials[i] << " type "
<< layerType[i];
#endif
const auto& layers = args.value<std::vector<int>>("Layers");
#ifdef EDM_ML_DEBUG
Expand Down Expand Up @@ -119,16 +122,18 @@ static long algorithm(dd4hep::Detector& /* description */, cms::DDParsingContext
double zi(-0.5 * thick), thickTot(0.0);
for (unsigned int l = 0; l < layers.size(); l++) {
unsigned int i = layers[l];
double r2 = 0.5 * (waferSize - layerSizeOff[i]);
double R2 = r2 / sqrt3;
wxy = HGCalWaferMask::waferXY(partialTypes[k], placementIndex[m], r2, R2, 0.0, 0.0);
std::vector<double> xL, yL;
for (unsigned int i0 = 0; i0 < (wxy.size() - 1); ++i0) {
xL.emplace_back(wxy[i0].first);
yL.emplace_back(wxy[i0].second);
}
double r2 = 0.5 * (waferSize - layerSizeOff[i]);
double R2 = r2 / sqrt3;
wxy = HGCalWaferMask::waferXY(partialTypes[k], placementIndex[m], r2, R2, 0.0, 0.0);
std::vector<double> xL, yL;
for (unsigned int i0 = 0; i0 < (wxy.size() - 1); ++i0) {
xL.emplace_back(wxy[i0].first);
yL.emplace_back(wxy[i0].second);
}
#ifdef EDM_ML_DEBUG
edm::LogVerbatim("HGCalGeom") << "DDHGCalWaferPartialRotated:Layer " << l << ":" << i << " T " << layerThick[i] << " Size offset " << layerSizeOff[i] << " Copy " << copyNumber[i] << " Partial type " << partialTypes_[k] << " r " << r2 << ":" << r;
edm::LogVerbatim("HGCalGeom") << "DDHGCalWaferPartialRotated:Layer " << l << ":" << i << " T " << layerThick[i]
<< " Size offset " << layerSizeOff[i] << " Copy " << copyNumber[i]
<< " Partial type " << partialTypes_[k] << " r " << r2 << ":" << r;
#endif
if (copyNumber[i] == 1) {
if (layerType[i] > 0) {
Expand Down
3 changes: 2 additions & 1 deletion Geometry/HGCalCommonData/src/HGCalCell.cc
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ HGCalCell::HGCalCell(double waferSize, int32_t nFine, int32_t nCoarse) {
cellX_[k] = waferSize / (3 * ncell_[k]);
cellY_[k] = sqrt3By2_ * cellX_[k];
}
edm::LogVerbatim("HGCalGeom") << "HGCalCell initialized with waferSize " << waferSize << " number of cells " << nFine << ":" << nCoarse;
edm::LogVerbatim("HGCalGeom") << "HGCalCell initialized with waferSize " << waferSize << " number of cells " << nFine
<< ":" << nCoarse;
}

std::pair<double, double> HGCalCell::cellUV2XY1(int32_t u, int32_t v, int32_t placementIndex, int32_t type) {
Expand Down

0 comments on commit 2d2112b

Please sign in to comment.