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

Run4-hgx272x Compress the property information of Wafers and tiles to reduce space requirement #32561

Merged
merged 5 commits into from Dec 25, 2020
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3,611 changes: 1,267 additions & 2,344 deletions Geometry/HGCalCommonData/data/hgcalConsData/v13/hgcalConsData.xml

Large diffs are not rendered by default.

1,181 changes: 731 additions & 450 deletions Geometry/HGCalCommonData/data/hgcalEE/v14/hgcalEE.xml

Large diffs are not rendered by default.

391 changes: 237 additions & 154 deletions Geometry/HGCalCommonData/data/hgcalHEmix/v14/hgcalHEmix.xml

Large diffs are not rendered by default.

437 changes: 266 additions & 171 deletions Geometry/HGCalCommonData/data/hgcalHEsil/v14/hgcalHEsil.xml

Large diffs are not rendered by default.

9 changes: 3 additions & 6 deletions Geometry/HGCalCommonData/interface/HGCalGeomParameters.h
Expand Up @@ -109,14 +109,11 @@ class HGCalGeomParameters {
void loadSpecParsHexagon8(HGCalParameters& php);
void loadSpecParsHexagon8(HGCalParameters& php,
const std::vector<int>& waferIndex,
const std::vector<int>& waferTypes,
const std::vector<int>& waferParts,
const std::vector<int>& waferOrien);
const std::vector<int>& waferProperties);
void loadSpecParsTrapezoid(HGCalParameters& php);
void loadSpecParsTrapezoid(HGCalParameters& php,
const std::vector<int>& tileIndx,
const std::vector<int>& tileType,
const std::vector<int>& tileSiPM,
const std::vector<int>& tileIndex,
const std::vector<int>& tileProperty,
const std::vector<int>& tileHEX1,
const std::vector<int>& tileHEX2,
const std::vector<int>& tileHEX3,
Expand Down
44 changes: 44 additions & 0 deletions Geometry/HGCalCommonData/interface/HGCalProperty.h
@@ -0,0 +1,44 @@
#ifndef Geometry_HGCalCommonData_HGCalProperty_h
#define Geometry_HGCalCommonData_HGCalProperty_h

#include <cmath>
#include <cstdint>

namespace HGCalProperty {
int32_t waferProperty(const int32_t thick, const int32_t partial, const int32_t orient);
int32_t waferThick(const int32_t property);
int32_t waferPartial(const int32_t property);
int32_t waferOrient(const int32_t property);
int32_t tileProperty(const int32_t type, const int32_t sipm);
int32_t tileType(const int32_t property);
int32_t tileSiPM(const int32_t property);

const int32_t kHGCalWaferUOffset = 0;
const int32_t kHGCalWaferUMask = 0x1F;
const int32_t kHGCalWaferUSignOffset = 5;
const int32_t kHGCalWaferUSignMask = 0x1;
const int32_t kHGCalWaferVOffset = 6;
const int32_t kHGCalWaferVMask = 0x1F;
const int32_t kHGCalWaferVSignOffset = 11;
const int32_t kHGCalWaferVSignMask = 0x1;
const int32_t kHGCalWaferCopyOffset = 0;
const int32_t kHGCalWaferCopyMask = 0x7FFFF;
const int32_t kHGCalLayerOldMask = 0x1000000;

const int32_t kHGCalLayerOffset = 18;
const int32_t kHGCalLayerMask = 0x1F;

const int32_t kHGCalPhiOffset = 0;
const int32_t kHGCalPhiMask = 0x1FF;
const int32_t kHGCalRingOffset = 9;
const int32_t kHGCalRingMask = 0x1FF;

const int32_t kHGCalFactor = 10;
const int32_t kHGCalOffsetThick = 1;
const int32_t kHGCalOffsetPartial = 10;
const int32_t kHGCalOffsetOrient = 100;
const int32_t kHGCalOffsetType = 1;
const int32_t kHGCalOffsetSiPM = 10;
}; // namespace HGCalProperty

#endif
23 changes: 6 additions & 17 deletions Geometry/HGCalCommonData/interface/HGCalTileIndex.h
Expand Up @@ -4,22 +4,11 @@
#include <cmath>
#include <cstdint>

class HGCalTileIndex {
public:
HGCalTileIndex() {}
~HGCalTileIndex() {}
static int32_t tileIndex(int32_t layer, int32_t ring, int32_t phi);
static int32_t tileLayer(int32_t index);
static int32_t tileRing(int32_t index);
static int32_t tilePhi(int32_t index);

private:
static constexpr int32_t kHGCalLayerOffset = 18;
static constexpr int32_t kHGCalLayerMask = 0x1F;
static constexpr int32_t kHGCalPhiOffset = 0;
static constexpr int32_t kHGCalPhiMask = 0x1FF;
static constexpr int32_t kHGCalRingOffset = 9;
static constexpr int32_t kHGCalRingMask = 0x1FF;
};
namespace HGCalTileIndex {
int32_t tileIndex(int32_t layer, int32_t ring, int32_t phi);
int32_t tileLayer(int32_t index);
int32_t tileRing(int32_t index);
int32_t tilePhi(int32_t index);
}; // namespace HGCalTileIndex

#endif
19 changes: 8 additions & 11 deletions Geometry/HGCalCommonData/interface/HGCalWaferIndex.h
Expand Up @@ -4,16 +4,13 @@
#include <cmath>
#include <cstdint>

class HGCalWaferIndex {
public:
HGCalWaferIndex() {}
~HGCalWaferIndex() {}
static int32_t waferIndex(int32_t layer, int32_t waferU, int32_t waferV, bool old = false);
static int32_t waferLayer(const int32_t index);
static int32_t waferU(const int32_t index);
static int32_t waferV(const int32_t index);
static int32_t waferCopy(const int32_t index);
static bool waferFormat(const int32_t index);
};
namespace HGCalWaferIndex {
int32_t waferIndex(int32_t layer, int32_t waferU, int32_t waferV, bool old = false);
int32_t waferLayer(const int32_t index);
int32_t waferU(const int32_t index);
int32_t waferV(const int32_t index);
int32_t waferCopy(const int32_t index);
bool waferFormat(const int32_t index);
}; // namespace HGCalWaferIndex

#endif
38 changes: 13 additions & 25 deletions Geometry/HGCalCommonData/plugins/DDHGCalEEFileAlgo.cc
Expand Up @@ -18,6 +18,7 @@
#include "FWCore/PluginManager/interface/PluginFactory.h"
#include "Geometry/HGCalCommonData/interface/HGCalGeomTools.h"
#include "Geometry/HGCalCommonData/interface/HGCalParameters.h"
#include "Geometry/HGCalCommonData/interface/HGCalProperty.h"
#include "Geometry/HGCalCommonData/interface/HGCalTypes.h"
#include "Geometry/HGCalCommonData/interface/HGCalWaferIndex.h"
#include "Geometry/HGCalCommonData/interface/HGCalWaferType.h"
Expand Down Expand Up @@ -67,14 +68,8 @@ class DDHGCalEEFileAlgo : public DDAlgorithm {
int absorbMode_; // Absorber mode
int sensitiveMode_; // Sensitive mode
double zMinBlock_; // Starting z-value of the block
std::vector<double> rad100to200_; // Parameters for 120-200mum trans.
std::vector<double> rad200to300_; // Parameters for 200-300mum trans.
double zMinRadPar_; // Minimum z for radius parametriz.
std::vector<int> waferIndex_; // Wafer index for the types
std::vector<int> waferTypes_; // Wafer types
int choiceType_; // Type of parametrization to be used
int nCutRadPar_; // Cut off threshold for corners
double fracAreaMin_; // Minimum fractional conatined area
std::vector<int> waferProperty_; // Wafer property
double waferSize_; // Width of the wafer
double waferSepar_; // Sensor separation
int sectors_; // Sectors
Expand Down Expand Up @@ -160,35 +155,28 @@ void DDHGCalEEFileAlgo::initialize(const DDNumericArguments& nArgs,
<< layerSense_[i];
#endif
zMinBlock_ = nArgs["zMinBlock"];
rad100to200_ = vArgs["rad100to200"];
rad200to300_ = vArgs["rad200to300"];
zMinRadPar_ = nArgs["zMinForRadPar"];
choiceType_ = (int)(nArgs["choiceType"]);
nCutRadPar_ = (int)(nArgs["nCornerCut"]);
fracAreaMin_ = nArgs["fracAreaMin"];
waferSize_ = nArgs["waferSize"];
waferSepar_ = nArgs["SensorSeparation"];
sectors_ = (int)(nArgs["Sectors"]);
alpha_ = (1._pi) / sectors_;
cosAlpha_ = cos(alpha_);
#ifdef EDM_ML_DEBUG
edm::LogVerbatim("HGCalGeom") << "zStart " << zMinBlock_ << " radius for wafer type separation uses "
<< rad100to200_.size() << " parameters; zmin " << zMinRadPar_ << " cutoff "
<< choiceType_ << ":" << nCutRadPar_ << ":" << fracAreaMin_ << " wafer width "
<< waferSize_ << " separations " << waferSepar_ << " sectors " << sectors_ << ":"
<< convertRadToDeg(alpha_) << ":" << cosAlpha_;
for (unsigned int k = 0; k < rad100to200_.size(); ++k)
edm::LogVerbatim("HGCalGeom") << "[" << k << "] 100-200 " << rad100to200_[k] << " 200-300 " << rad200to300_[k];
edm::LogVerbatim("HGCalGeom") << "zStart " << zMinBlock_ << " wafer width " << waferSize_ << " separations "
<< waferSepar_ << " sectors " << sectors_ << ":" << convertRadToDeg(alpha_) << ":"
<< cosAlpha_;
#endif
waferIndex_ = dbl_to_int(vArgs["WaferIndex"]);
waferTypes_ = dbl_to_int(vArgs["WaferTypes"]);
waferProperty_ = dbl_to_int(vArgs["WaferProperties"]);
#ifdef EDM_ML_DEBUG
edm::LogVerbatim("HGCalGeom") << "waferTypes with " << waferTypes_.size() << " entries";
for (unsigned int k = 0; k < waferTypes_.size(); ++k)
edm::LogVerbatim("HGCalGeom") << "waferProperties with " << waferIndex_.size() << " entries";
for (unsigned int k = 0; k < waferIndex_.size(); ++k)
edm::LogVerbatim("HGCalGeom") << "[" << k << "] " << waferIndex_[k] << " ("
<< HGCalWaferIndex::waferLayer(waferIndex_[k]) << ", "
<< HGCalWaferIndex::waferU(waferIndex_[k]) << ", "
<< HGCalWaferIndex::waferV(waferIndex_[k]) << ") : " << waferTypes_[k];
<< HGCalWaferIndex::waferV(waferIndex_[k]) << ") : ("
<< HGCalProperty::waferThick(waferProperty_[k]) << ":"
<< HGCalProperty::waferPartial(waferProperty_[k]) << ":"
<< HGCalProperty::waferOrient(waferProperty_[k]) << ")";
#endif
slopeB_ = vArgs["SlopeBottom"];
zFrontB_ = vArgs["ZFrontBottom"];
Expand Down Expand Up @@ -383,7 +371,7 @@ void DDHGCalEEFileAlgo::positionSensitive(
}
#endif
int indx = HGCalWaferIndex::waferIndex((layer + firstLayer_), u, v, false);
int type = HGCalWaferType::getType(indx, waferIndex_, waferTypes_);
int type = HGCalWaferType::getType(indx, waferIndex_, waferProperty_);
if (corner.first > 0 && type >= 0) {
int copy = HGCalTypes::packTypeUV(type, u, v);
#ifdef EDM_ML_DEBUG
Expand Down
61 changes: 24 additions & 37 deletions Geometry/HGCalCommonData/plugins/DDHGCalHEFileAlgo.cc
Expand Up @@ -17,6 +17,7 @@
#include "FWCore/PluginManager/interface/PluginFactory.h"
#include "Geometry/HGCalCommonData/interface/HGCalGeomTools.h"
#include "Geometry/HGCalCommonData/interface/HGCalParameters.h"
#include "Geometry/HGCalCommonData/interface/HGCalProperty.h"
#include "Geometry/HGCalCommonData/interface/HGCalTypes.h"
#include "Geometry/HGCalCommonData/interface/HGCalWaferIndex.h"
#include "Geometry/HGCalCommonData/interface/HGCalWaferType.h"
Expand Down Expand Up @@ -88,26 +89,20 @@ class DDHGCalHEFileAlgo : public DDAlgorithm {
std::vector<int> layerSenseBot_; // Content of bottom layer (sensitive?)
std::vector<int> layerCenter_; // Centering of the wafers

double zMinBlock_; // Starting z-value of the block
std::vector<double> rad100to200_; // Parameters for 120-200mum trans.
std::vector<double> rad200to300_; // Parameters for 200-300mum trans.
double zMinRadPar_; // Minimum z for radius parametriz.
std::vector<int> waferIndex_; // Wafer index for the types
std::vector<int> waferTypes_; // Wafer types
int choiceType_; // Type of parametrization to be used
int nCutRadPar_; // Cut off threshold for corners
double fracAreaMin_; // Minimum fractional conatined area
double waferSize_; // Width of the wafer
double waferSepar_; // Sensor separation
int sectors_; // Sectors
std::vector<double> slopeB_; // Slope at the lower R
std::vector<double> zFrontB_; // Starting Z values for the slopes
std::vector<double> rMinFront_; // Corresponding rMin's
std::vector<double> slopeT_; // Slopes at the larger R
std::vector<double> zFrontT_; // Starting Z values for the slopes
std::vector<double> rMaxFront_; // Corresponding rMax's
std::string nameSpace_; // Namespace of this and ALL sub-parts
std::unordered_set<int> copies_; // List of copy #'s
double zMinBlock_; // Starting z-value of the block
std::vector<int> waferIndex_; // Wafer index for the types
std::vector<int> waferProperty_; // Wafer property
double waferSize_; // Width of the wafer
double waferSepar_; // Sensor separation
int sectors_; // Sectors
std::vector<double> slopeB_; // Slope at the lower R
std::vector<double> zFrontB_; // Starting Z values for the slopes
std::vector<double> rMinFront_; // Corresponding rMin's
std::vector<double> slopeT_; // Slopes at the larger R
std::vector<double> zFrontT_; // Starting Z values for the slopes
std::vector<double> rMaxFront_; // Corresponding rMax's
std::string nameSpace_; // Namespace of this and ALL sub-parts
std::unordered_set<int> copies_; // List of copy #'s
double alpha_, cosAlpha_;
};

Expand Down Expand Up @@ -214,36 +209,28 @@ void DDHGCalHEFileAlgo::initialize(const DDNumericArguments& nArgs,
<< " sensitive class " << layerSenseBot_[i];
#endif
zMinBlock_ = nArgs["zMinBlock"];
rad100to200_ = vArgs["rad100to200"];
rad200to300_ = vArgs["rad200to300"];
zMinRadPar_ = nArgs["zMinForRadPar"];
choiceType_ = (int)(nArgs["choiceType"]);
nCutRadPar_ = (int)(nArgs["nCornerCut"]);
fracAreaMin_ = nArgs["fracAreaMin"];
waferSize_ = nArgs["waferSize"];
waferSepar_ = nArgs["SensorSeparation"];
sectors_ = (int)(nArgs["Sectors"]);
alpha_ = (1._pi) / sectors_;
cosAlpha_ = cos(alpha_);
#ifdef EDM_ML_DEBUG
edm::LogVerbatim("HGCalGeom") << "DDHGCalHEFileAlgo: zStart " << zMinBlock_
<< " radius for wafer type separation uses " << rad100to200_.size()
<< " parameters; zmin " << zMinRadPar_ << " cutoff " << choiceType_ << ":"
<< nCutRadPar_ << ":" << fracAreaMin_ << " wafer width " << waferSize_
edm::LogVerbatim("HGCalGeom") << "DDHGCalHEFileAlgo: zStart " << zMinBlock_ << " wafer width " << waferSize_
<< " separations " << waferSepar_ << " sectors " << sectors_ << ":"
<< convertRadToDeg(alpha_) << ":" << cosAlpha_;
for (unsigned int k = 0; k < rad100to200_.size(); ++k)
edm::LogVerbatim("HGCalGeom") << "[" << k << "] 100-200 " << rad100to200_[k] << " 200-300 " << rad200to300_[k];
#endif
waferIndex_ = dbl_to_int(vArgs["WaferIndex"]);
waferTypes_ = dbl_to_int(vArgs["WaferTypes"]);
waferProperty_ = dbl_to_int(vArgs["WaferProperties"]);
#ifdef EDM_ML_DEBUG
edm::LogVerbatim("HGCalGeom") << "waferTypes with " << waferTypes_.size() << " entries";
for (unsigned int k = 0; k < waferTypes_.size(); ++k)
edm::LogVerbatim("HGCalGeom") << "waferProperties with " << waferIndex_.size() << " entries";
for (unsigned int k = 0; k < waferIndex_.size(); ++k)
edm::LogVerbatim("HGCalGeom") << "[" << k << "] " << waferIndex_[k] << " ("
<< HGCalWaferIndex::waferLayer(waferIndex_[k]) << ", "
<< HGCalWaferIndex::waferU(waferIndex_[k]) << ", "
<< HGCalWaferIndex::waferV(waferIndex_[k]) << ") : " << waferTypes_[k];
<< HGCalWaferIndex::waferV(waferIndex_[k]) << ") : ("
<< HGCalProperty::waferThick(waferProperty_[k]) << ":"
<< HGCalProperty::waferPartial(waferProperty_[k]) << ":"
<< HGCalProperty::waferOrient(waferProperty_[k]) << ")";
#endif
slopeB_ = vArgs["SlopeBottom"];
zFrontB_ = vArgs["ZFrontBottom"];
Expand Down Expand Up @@ -567,7 +554,7 @@ void DDHGCalHEFileAlgo::positionSensitive(
++ntot;
#endif
int indx = HGCalWaferIndex::waferIndex((layer + firstLayer_), u, v, false);
int type = HGCalWaferType::getType(indx, waferIndex_, waferTypes_);
int type = HGCalWaferType::getType(indx, waferIndex_, waferProperty_);
if (corner.first > 0 && type >= 0) {
int copy = HGCalTypes::packTypeUV(type, u, v);
#ifdef EDM_ML_DEBUG
Expand Down
18 changes: 11 additions & 7 deletions Geometry/HGCalCommonData/plugins/dd4hep/DDHGCalEEFileAlgo.cc
Expand Up @@ -9,8 +9,9 @@
#include <unordered_set>
#include <vector>

#include "Geometry/HGCalCommonData/interface/HGCalParameters.h"
#include "Geometry/HGCalCommonData/interface/HGCalGeomTools.h"
#include "Geometry/HGCalCommonData/interface/HGCalParameters.h"
#include "Geometry/HGCalCommonData/interface/HGCalProperty.h"
#include "Geometry/HGCalCommonData/interface/HGCalTypes.h"
#include "Geometry/HGCalCommonData/interface/HGCalWaferIndex.h"
#include "Geometry/HGCalCommonData/interface/HGCalWaferType.h"
Expand Down Expand Up @@ -106,14 +107,17 @@ struct HGCalEEFileAlgo {
<< convertRadToDeg(alpha_) << ":" << cosAlpha_;
#endif
waferIndex_ = args.value<std::vector<int>>("WaferIndex");
waferTypes_ = args.value<std::vector<int>>("WaferTypes");
waferProperty_ = args.value<std::vector<int>>("WaferProperties");
#ifdef EDM_ML_DEBUG
edm::LogVerbatim("HGCalGeom") << "waferTypes with " << waferTypes_.size() << " entries";
for (unsigned int k = 0; k < waferTypes_.size(); ++k)
edm::LogVerbatim("HGCalGeom") << "waferProperties with " << waferIndex_.size() << " entries";
for (unsigned int k = 0; k < waferIndex_.size(); ++k)
edm::LogVerbatim("HGCalGeom") << "[" << k << "] " << waferIndex_[k] << " ("
<< HGCalWaferIndex::waferLayer(waferIndex_[k]) << ", "
<< HGCalWaferIndex::waferU(waferIndex_[k]) << ", "
<< HGCalWaferIndex::waferV(waferIndex_[k]) << ") : " << waferTypes_[k];
<< HGCalWaferIndex::waferV(waferIndex_[k]) << ") : ("
<< HGCalProperty::waferThick(waferProperty_[k]) << ":"
<< HGCalProperty::waferPartial(waferProperty_[k]) << ":"
<< HGCalProperty::waferOrient(waferProperty_[k]) << ")";
#endif
slopeB_ = args.value<std::vector<double>>("SlopeBottom");
zFrontB_ = args.value<std::vector<double>>("ZFrontBottom");
Expand Down Expand Up @@ -309,7 +313,7 @@ struct HGCalEEFileAlgo {
}
#endif
int indx = HGCalWaferIndex::waferIndex((layer + firstLayer_), u, v, false);
int type = HGCalWaferType::getType(indx, waferIndex_, waferTypes_);
int type = HGCalWaferType::getType(indx, waferIndex_, waferProperty_);
if (corner.first > 0 && type >= 0) {
int copy = HGCalTypes::packTypeUV(type, u, v);
#ifdef EDM_ML_DEBUG
Expand Down Expand Up @@ -374,7 +378,7 @@ struct HGCalEEFileAlgo {
int sensitiveMode_; // Sensitive mode
double zMinBlock_; // Starting z-value of the block
std::vector<int> waferIndex_; // Wafer index for the types
std::vector<int> waferTypes_; // Wafer types
std::vector<int> waferProperty_; // Wafer property
double waferSize_; // Width of the wafer
double waferSepar_; // Sensor separation
int sectors_; // Sectors
Expand Down