diff --git a/Geometry/HGCalCommonData/plugins/DDHGCalCell.cc b/Geometry/HGCalCommonData/plugins/DDHGCalCell.cc index 28b28d00e4748..85853773f6b2c 100644 --- a/Geometry/HGCalCommonData/plugins/DDHGCalCell.cc +++ b/Geometry/HGCalCommonData/plugins/DDHGCalCell.cc @@ -1,14 +1,47 @@ -#include "Geometry/HGCalCommonData/plugins/DDHGCalCell.h" +#include "DetectorDescription/Core/interface/DDAlgorithm.h" +#include "DetectorDescription/Core/interface/DDAlgorithmFactory.h" #include "DetectorDescription/Core/interface/DDCurrentNamespace.h" #include "DetectorDescription/Core/interface/DDLogicalPart.h" #include "DetectorDescription/Core/interface/DDMaterial.h" #include "DetectorDescription/Core/interface/DDSolid.h" #include "DetectorDescription/Core/interface/DDSplit.h" +#include "DetectorDescription/Core/interface/DDTypes.h" #include "DetectorDescription/Core/interface/DDutils.h" #include "FWCore/MessageLogger/interface/MessageLogger.h" +#include "FWCore/PluginManager/interface/PluginFactory.h" + +#include +#include //#define EDM_ML_DEBUG +class DDHGCalCell : public DDAlgorithm { +public: + // Constructor and Destructor + DDHGCalCell(); + ~DDHGCalCell() override; + + void initialize(const DDNumericArguments& nArgs, + const DDVectorArguments& vArgs, + const DDMapArguments& mArgs, + const DDStringArguments& sArgs, + const DDStringVectorArguments& vsArgs) override; + void execute(DDCompactView& cpv) override; + +private: + double waferSize_; // Wafer Size + double waferT_; // Wafer Thickness + double cellT_; // Cell Thickness + int nCells_; // Number of columns (8:12) + int posSens_; // Position depleted layer + std::string material_; // Name of the material + std::string fullCN_, fullSensN_; // Name of full cell + std::vector truncCN_, truncSensN_; // Names of truncated cells + std::vector extenCN_, extenSensN_; // Names of extended cells + std::vector cornrCN_, cornrSensN_; // Names of corner cells + std::string nameSpace_; // Namespace to be used +}; + DDHGCalCell::DDHGCalCell() { #ifdef EDM_ML_DEBUG edm::LogVerbatim("HGCalGeom") << "DDHGCalCell: Creating an instance"; @@ -17,11 +50,11 @@ DDHGCalCell::DDHGCalCell() { DDHGCalCell::~DDHGCalCell() {} -void DDHGCalCell::initialize(const DDNumericArguments &nArgs, - const DDVectorArguments &, - const DDMapArguments &, - const DDStringArguments &sArgs, - const DDStringVectorArguments &vsArgs) { +void DDHGCalCell::initialize(const DDNumericArguments& nArgs, + const DDVectorArguments&, + const DDMapArguments&, + const DDStringArguments& sArgs, + const DDStringVectorArguments& vsArgs) { waferSize_ = nArgs["WaferSize"]; waferT_ = nArgs["WaferThick"]; cellT_ = nArgs["CellThick"]; @@ -63,7 +96,7 @@ void DDHGCalCell::initialize(const DDNumericArguments &nArgs, #endif } -void DDHGCalCell::execute(DDCompactView &cpv) { +void DDHGCalCell::execute(DDCompactView& cpv) { #ifdef EDM_ML_DEBUG edm::LogVerbatim("HGCalGeom") << "==>> Executing DDHGCalCell..."; #endif @@ -228,3 +261,5 @@ void DDHGCalCell::execute(DDCompactView &cpv) { #endif } } + +DEFINE_EDM_PLUGIN(DDAlgorithmFactory, DDHGCalCell, "hgcal:DDHGCalCell"); diff --git a/Geometry/HGCalCommonData/plugins/DDHGCalCell.h b/Geometry/HGCalCommonData/plugins/DDHGCalCell.h deleted file mode 100644 index f95d4c474c515..0000000000000 --- a/Geometry/HGCalCommonData/plugins/DDHGCalCell.h +++ /dev/null @@ -1,36 +0,0 @@ -#ifndef HGCalCommonData_DDHGCalCell_h -#define HGCalCommonData_DDHGCalCell_h - -#include -#include -#include "DetectorDescription/Core/interface/DDAlgorithm.h" -#include "DetectorDescription/Core/interface/DDTypes.h" - -class DDHGCalCell : public DDAlgorithm { -public: - // Constructor and Destructor - DDHGCalCell(); - ~DDHGCalCell() override; - - void initialize(const DDNumericArguments& nArgs, - const DDVectorArguments& vArgs, - const DDMapArguments& mArgs, - const DDStringArguments& sArgs, - const DDStringVectorArguments& vsArgs) override; - void execute(DDCompactView& cpv) override; - -private: - double waferSize_; // Wafer Size - double waferT_; // Wafer Thickness - double cellT_; // Cell Thickness - int nCells_; // Number of columns (8:12) - int posSens_; // Position depleted layer - std::string material_; // Name of the material - std::string fullCN_, fullSensN_; // Name of full cell - std::vector truncCN_, truncSensN_; // Names of truncated cells - std::vector extenCN_, extenSensN_; // Names of extended cells - std::vector cornrCN_, cornrSensN_; // Names of corner cells - std::string nameSpace_; // Namespace to be used -}; - -#endif diff --git a/Geometry/HGCalCommonData/plugins/DDHGCalEEAlgo.cc b/Geometry/HGCalCommonData/plugins/DDHGCalEEAlgo.cc index 113ffd848c91b..40be0ef1cb3b7 100644 --- a/Geometry/HGCalCommonData/plugins/DDHGCalEEAlgo.cc +++ b/Geometry/HGCalCommonData/plugins/DDHGCalEEAlgo.cc @@ -3,19 +3,91 @@ // Description: Geometry factory class for HGCal (EE and HESil) /////////////////////////////////////////////////////////////////////////////// -#include "Geometry/HGCalCommonData/plugins/DDHGCalEEAlgo.h" #include "DataFormats/Math/interface/GeantUnits.h" +#include "DetectorDescription/Core/interface/DDAlgorithm.h" +#include "DetectorDescription/Core/interface/DDAlgorithmFactory.h" #include "DetectorDescription/Core/interface/DDCurrentNamespace.h" +#include "DetectorDescription/Core/interface/DDLogicalPart.h" #include "DetectorDescription/Core/interface/DDMaterial.h" #include "DetectorDescription/Core/interface/DDSolid.h" #include "DetectorDescription/Core/interface/DDSplit.h" +#include "DetectorDescription/Core/interface/DDTypes.h" #include "DetectorDescription/Core/interface/DDutils.h" #include "FWCore/MessageLogger/interface/MessageLogger.h" +#include "FWCore/PluginManager/interface/PluginFactory.h" +#include "Geometry/HGCalCommonData/interface/HGCalGeomTools.h" #include "Geometry/HGCalCommonData/interface/HGCalParameters.h" +#include "Geometry/HGCalCommonData/interface/HGCalWaferType.h" + +#include +#include +#include +#include +#include //#define EDM_ML_DEBUG using namespace geant_units::operators; +class DDHGCalEEAlgo : public DDAlgorithm { +public: + // Constructor and Destructor + DDHGCalEEAlgo(); // const std::string & name); + ~DDHGCalEEAlgo() override; + + void initialize(const DDNumericArguments& nArgs, + const DDVectorArguments& vArgs, + const DDMapArguments& mArgs, + const DDStringArguments& sArgs, + const DDStringVectorArguments& vsArgs) override; + void execute(DDCompactView& cpv) override; + +protected: + void constructLayers(const DDLogicalPart&, DDCompactView& cpv); + void positionSensitive(const DDLogicalPart& glog, + double rin, + double rout, + double zpos, + int layertype, + int layercenter, + DDCompactView& cpv); + +private: + HGCalGeomTools geomTools_; + std::unique_ptr waferType_; + + std::vector wafers_; // Wafers + std::vector materials_; // Materials + std::vector names_; // Names + std::vector thick_; // Thickness of the material + std::vector copyNumber_; // Initial copy numbers + std::vector layers_; // Number of layers in a section + std::vector layerThick_; // Thickness of each section + std::vector layerType_; // Type of the layer + std::vector layerSense_; // Content of a layer (sensitive?) + std::vector layerCenter_; // Centering of the wafers + int firstLayer_; // Copy # of the first sensitive layer + int absorbMode_; // Absorber mode + double zMinBlock_; // Starting z-value of the block + std::vector rad100to200_; // Parameters for 120-200mum trans. + std::vector rad200to300_; // Parameters for 200-300mum trans. + double zMinRadPar_; // Minimum z for radius parametriz. + 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 slopeB_; // Slope at the lower R + std::vector zFrontB_; // Starting Z values for the slopes + std::vector rMinFront_; // Corresponding rMin's + std::vector slopeT_; // Slopes at the larger R + std::vector zFrontT_; // Starting Z values for the slopes + std::vector rMaxFront_; // Corresponding rMax's + std::string nameSpace_; // Namespace of this and ALL sub-parts + std::unordered_set copies_; // List of copy #'s + double alpha_, cosAlpha_; +}; + DDHGCalEEAlgo::DDHGCalEEAlgo() { #ifdef EDM_ML_DEBUG edm::LogVerbatim("HGCalGeom") << "DDHGCalEEAlgo: Creating an instance"; @@ -338,3 +410,5 @@ void DDHGCalEEAlgo::positionSensitive(const DDLogicalPart& glog, << ntype[5] << ") for " << glog.ddname() << " R " << rin << ":" << rout; #endif } + +DEFINE_EDM_PLUGIN(DDAlgorithmFactory, DDHGCalEEAlgo, "hgcal:DDHGCalEEAlgo"); diff --git a/Geometry/HGCalCommonData/plugins/DDHGCalEEAlgo.h b/Geometry/HGCalCommonData/plugins/DDHGCalEEAlgo.h deleted file mode 100644 index 60f04f130b776..0000000000000 --- a/Geometry/HGCalCommonData/plugins/DDHGCalEEAlgo.h +++ /dev/null @@ -1,76 +0,0 @@ -#ifndef HGCalCommonData_DDHGCalEEAlgo_h -#define HGCalCommonData_DDHGCalEEAlgo_h - -#include -#include -#include -#include -#include - -#include "DetectorDescription/Core/interface/DDAlgorithm.h" -#include "DetectorDescription/Core/interface/DDLogicalPart.h" -#include "DetectorDescription/Core/interface/DDTypes.h" -#include "Geometry/HGCalCommonData/interface/HGCalGeomTools.h" -#include "Geometry/HGCalCommonData/interface/HGCalWaferType.h" - -class DDHGCalEEAlgo : public DDAlgorithm { -public: - // Constructor and Destructor - DDHGCalEEAlgo(); // const std::string & name); - ~DDHGCalEEAlgo() override; - - void initialize(const DDNumericArguments& nArgs, - const DDVectorArguments& vArgs, - const DDMapArguments& mArgs, - const DDStringArguments& sArgs, - const DDStringVectorArguments& vsArgs) override; - void execute(DDCompactView& cpv) override; - -protected: - void constructLayers(const DDLogicalPart&, DDCompactView& cpv); - void positionSensitive(const DDLogicalPart& glog, - double rin, - double rout, - double zpos, - int layertype, - int layercenter, - DDCompactView& cpv); - -private: - HGCalGeomTools geomTools_; - std::unique_ptr waferType_; - - std::vector wafers_; // Wafers - std::vector materials_; // Materials - std::vector names_; // Names - std::vector thick_; // Thickness of the material - std::vector copyNumber_; // Initial copy numbers - std::vector layers_; // Number of layers in a section - std::vector layerThick_; // Thickness of each section - std::vector layerType_; // Type of the layer - std::vector layerSense_; // Content of a layer (sensitive?) - std::vector layerCenter_; // Centering of the wafers - int firstLayer_; // Copy # of the first sensitive layer - int absorbMode_; // Absorber mode - double zMinBlock_; // Starting z-value of the block - std::vector rad100to200_; // Parameters for 120-200mum trans. - std::vector rad200to300_; // Parameters for 200-300mum trans. - double zMinRadPar_; // Minimum z for radius parametriz. - 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 slopeB_; // Slope at the lower R - std::vector zFrontB_; // Starting Z values for the slopes - std::vector rMinFront_; // Corresponding rMin's - std::vector slopeT_; // Slopes at the larger R - std::vector zFrontT_; // Starting Z values for the slopes - std::vector rMaxFront_; // Corresponding rMax's - std::string nameSpace_; // Namespace of this and ALL sub-parts - std::unordered_set copies_; // List of copy #'s - double alpha_, cosAlpha_; -}; - -#endif diff --git a/Geometry/HGCalCommonData/plugins/DDHGCalHEAlgo.cc b/Geometry/HGCalCommonData/plugins/DDHGCalHEAlgo.cc index de8be6c7d4473..1c9c87462ea59 100644 --- a/Geometry/HGCalCommonData/plugins/DDHGCalHEAlgo.cc +++ b/Geometry/HGCalCommonData/plugins/DDHGCalHEAlgo.cc @@ -3,18 +3,114 @@ // Description: Geometry factory class for HGCal (Mix) /////////////////////////////////////////////////////////////////////////////// -#include "Geometry/HGCalCommonData/plugins/DDHGCalHEAlgo.h" #include "DataFormats/Math/interface/GeantUnits.h" +#include "DetectorDescription/Core/interface/DDAlgorithm.h" +#include "DetectorDescription/Core/interface/DDAlgorithmFactory.h" #include "DetectorDescription/Core/interface/DDCurrentNamespace.h" +#include "DetectorDescription/Core/interface/DDLogicalPart.h" +#include "DetectorDescription/Core/interface/DDMaterial.h" #include "DetectorDescription/Core/interface/DDSolid.h" #include "DetectorDescription/Core/interface/DDSplit.h" +#include "DetectorDescription/Core/interface/DDTypes.h" #include "DetectorDescription/Core/interface/DDutils.h" #include "FWCore/MessageLogger/interface/MessageLogger.h" +#include "FWCore/PluginManager/interface/PluginFactory.h" +#include "Geometry/HGCalCommonData/interface/HGCalGeomTools.h" #include "Geometry/HGCalCommonData/interface/HGCalParameters.h" +#include "Geometry/HGCalCommonData/interface/HGCalWaferType.h" + +#include +#include +#include +#include +#include //#define EDM_ML_DEBUG using namespace geant_units::operators; +class DDHGCalHEAlgo : public DDAlgorithm { +public: + // Constructor and Destructor + DDHGCalHEAlgo(); // const std::string & name); + ~DDHGCalHEAlgo() override; + + void initialize(const DDNumericArguments& nArgs, + const DDVectorArguments& vArgs, + const DDMapArguments& mArgs, + const DDStringArguments& sArgs, + const DDStringVectorArguments& vsArgs) override; + void execute(DDCompactView& cpv) override; + +protected: + void constructLayers(const DDLogicalPart&, DDCompactView& cpv); + void positionMix(const DDLogicalPart& glog, + const std::string& name, + int copy, + double thick, + const DDMaterial& matter, + double rin, + double rmid, + double routF, + double zz, + DDCompactView& cpv); + void positionSensitive(const DDLogicalPart& glog, + double rin, + double rout, + double zpos, + int layertype, + int layercenter, + DDCompactView& cpv); + +private: + HGCalGeomTools geomTools_; + std::unique_ptr waferType_; + + std::vector wafers_; // Wafers + std::vector materials_; // Materials + std::vector names_; // Names + std::vector thick_; // Thickness of the material + std::vector copyNumber_; // Initial copy numbers + std::vector layers_; // Number of layers in a section + std::vector layerThick_; // Thickness of each section + std::vector rMixLayer_; // Partition between Si/Sci part + std::vector layerType_; // Type of the layer + std::vector layerSense_; // Content of a layer (sensitive?) + int firstLayer_; // Copy # of the first sensitive layer + int absorbMode_; // Absorber mode + std::vector materialsTop_; // Materials of top layers + std::vector namesTop_; // Names of top layers + std::vector layerThickTop_; // Thickness of the top sections + std::vector layerTypeTop_; // Type of the Top layer + std::vector copyNumberTop_; // Initial copy numbers (top section) + std::vector materialsBot_; // Materials of bottom layers + std::vector namesBot_; // Names of bottom layers + std::vector layerThickBot_; // Thickness of the bottom sections + std::vector layerTypeBot_; // Type of the bottom layers + std::vector copyNumberBot_; // Initial copy numbers (bot section) + std::vector layerSenseBot_; // Content of bottom layer (sensitive?) + std::vector layerCenter_; // Centering of the wafers + + double zMinBlock_; // Starting z-value of the block + std::vector rad100to200_; // Parameters for 120-200mum trans. + std::vector rad200to300_; // Parameters for 200-300mum trans. + double zMinRadPar_; // Minimum z for radius parametriz. + 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 slopeB_; // Slope at the lower R + std::vector zFrontB_; // Starting Z values for the slopes + std::vector rMinFront_; // Corresponding rMin's + std::vector slopeT_; // Slopes at the larger R + std::vector zFrontT_; // Starting Z values for the slopes + std::vector rMaxFront_; // Corresponding rMax's + std::string nameSpace_; // Namespace of this and ALL sub-parts + std::unordered_set copies_; // List of copy #'s + double alpha_, cosAlpha_; +}; + DDHGCalHEAlgo::DDHGCalHEAlgo() { #ifdef EDM_ML_DEBUG edm::LogVerbatim("HGCalGeom") << "DDHGCalHEAlgo: Creating an instance"; @@ -509,3 +605,5 @@ void DDHGCalHEAlgo::positionSensitive(const DDLogicalPart& glog, << ntype[5] << ") for " << glog.ddname() << " R " << rin << ":" << rout; #endif } + +DEFINE_EDM_PLUGIN(DDAlgorithmFactory, DDHGCalHEAlgo, "hgcal:DDHGCalHEAlgo"); diff --git a/Geometry/HGCalCommonData/plugins/DDHGCalHEAlgo.h b/Geometry/HGCalCommonData/plugins/DDHGCalHEAlgo.h deleted file mode 100644 index 881ef4ad89506..0000000000000 --- a/Geometry/HGCalCommonData/plugins/DDHGCalHEAlgo.h +++ /dev/null @@ -1,100 +0,0 @@ -#ifndef HGCalCommonData_DDHGCalHEAlgo_h -#define HGCalCommonData_DDHGCalHEAlgo_h - -#include -#include -#include -#include -#include - -#include "DetectorDescription/Core/interface/DDAlgorithm.h" -#include "DetectorDescription/Core/interface/DDLogicalPart.h" -#include "DetectorDescription/Core/interface/DDMaterial.h" -#include "DetectorDescription/Core/interface/DDTypes.h" -#include "Geometry/HGCalCommonData/interface/HGCalGeomTools.h" -#include "Geometry/HGCalCommonData/interface/HGCalWaferType.h" - -class DDHGCalHEAlgo : public DDAlgorithm { -public: - // Constructor and Destructor - DDHGCalHEAlgo(); // const std::string & name); - ~DDHGCalHEAlgo() override; - - void initialize(const DDNumericArguments& nArgs, - const DDVectorArguments& vArgs, - const DDMapArguments& mArgs, - const DDStringArguments& sArgs, - const DDStringVectorArguments& vsArgs) override; - void execute(DDCompactView& cpv) override; - -protected: - void constructLayers(const DDLogicalPart&, DDCompactView& cpv); - void positionMix(const DDLogicalPart& glog, - const std::string& name, - int copy, - double thick, - const DDMaterial& matter, - double rin, - double rmid, - double routF, - double zz, - DDCompactView& cpv); - void positionSensitive(const DDLogicalPart& glog, - double rin, - double rout, - double zpos, - int layertype, - int layercenter, - DDCompactView& cpv); - -private: - HGCalGeomTools geomTools_; - std::unique_ptr waferType_; - - std::vector wafers_; // Wafers - std::vector materials_; // Materials - std::vector names_; // Names - std::vector thick_; // Thickness of the material - std::vector copyNumber_; // Initial copy numbers - std::vector layers_; // Number of layers in a section - std::vector layerThick_; // Thickness of each section - std::vector rMixLayer_; // Partition between Si/Sci part - std::vector layerType_; // Type of the layer - std::vector layerSense_; // Content of a layer (sensitive?) - int firstLayer_; // Copy # of the first sensitive layer - int absorbMode_; // Absorber mode - std::vector materialsTop_; // Materials of top layers - std::vector namesTop_; // Names of top layers - std::vector layerThickTop_; // Thickness of the top sections - std::vector layerTypeTop_; // Type of the Top layer - std::vector copyNumberTop_; // Initial copy numbers (top section) - std::vector materialsBot_; // Materials of bottom layers - std::vector namesBot_; // Names of bottom layers - std::vector layerThickBot_; // Thickness of the bottom sections - std::vector layerTypeBot_; // Type of the bottom layers - std::vector copyNumberBot_; // Initial copy numbers (bot section) - std::vector layerSenseBot_; // Content of bottom layer (sensitive?) - std::vector layerCenter_; // Centering of the wafers - - double zMinBlock_; // Starting z-value of the block - std::vector rad100to200_; // Parameters for 120-200mum trans. - std::vector rad200to300_; // Parameters for 200-300mum trans. - double zMinRadPar_; // Minimum z for radius parametriz. - 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 slopeB_; // Slope at the lower R - std::vector zFrontB_; // Starting Z values for the slopes - std::vector rMinFront_; // Corresponding rMin's - std::vector slopeT_; // Slopes at the larger R - std::vector zFrontT_; // Starting Z values for the slopes - std::vector rMaxFront_; // Corresponding rMax's - std::string nameSpace_; // Namespace of this and ALL sub-parts - std::unordered_set copies_; // List of copy #'s - double alpha_, cosAlpha_; -}; - -#endif diff --git a/Geometry/HGCalCommonData/plugins/DDHGCalModule.cc b/Geometry/HGCalCommonData/plugins/DDHGCalModule.cc index e054fa28cfd49..d160a182dfff1 100644 --- a/Geometry/HGCalCommonData/plugins/DDHGCalModule.cc +++ b/Geometry/HGCalCommonData/plugins/DDHGCalModule.cc @@ -5,22 +5,70 @@ #include #include +#include +#include +#include +#include #include "DataFormats/Math/interface/GeantUnits.h" +#include "DetectorDescription/Core/interface/DDAlgorithm.h" +#include "DetectorDescription/Core/interface/DDAlgorithmFactory.h" #include "DetectorDescription/Core/interface/DDCurrentNamespace.h" #include "DetectorDescription/Core/interface/DDLogicalPart.h" #include "DetectorDescription/Core/interface/DDMaterial.h" #include "DetectorDescription/Core/interface/DDSolid.h" #include "DetectorDescription/Core/interface/DDSplit.h" +#include "DetectorDescription/Core/interface/DDTypes.h" #include "DetectorDescription/Core/interface/DDutils.h" #include "FWCore/MessageLogger/interface/MessageLogger.h" +#include "FWCore/PluginManager/interface/PluginFactory.h" #include "Geometry/HGCalCommonData/interface/HGCalGeomTools.h" #include "Geometry/HGCalCommonData/interface/HGCalParameters.h" -#include "Geometry/HGCalCommonData/plugins/DDHGCalModule.h" //#define EDM_ML_DEBUG using namespace geant_units::operators; +class DDHGCalModule : public DDAlgorithm { +public: + // Constructor and Destructor + DDHGCalModule(); // const std::string & name); + ~DDHGCalModule() override; + + void initialize(const DDNumericArguments& nArgs, + const DDVectorArguments& vArgs, + const DDMapArguments& mArgs, + const DDStringArguments& sArgs, + const DDStringVectorArguments& vsArgs) override; + void execute(DDCompactView& cpv) override; + +protected: + void constructLayers(const DDLogicalPart&, DDCompactView& cpv); + double rMax(double z); + void positionSensitive(DDLogicalPart& glog, double rin, double rout, DDCompactView& cpv); + +private: + std::vector wafer; // Wafers + std::vector materials; // Materials + std::vector names; // Names + std::vector thick; // Thickness of the material + std::vector copyNumber; // Initial copy numbers + std::vector layers; // Number of layers in a section + std::vector layerThick; // Thickness of each section + std::vector layerType; // Type of the layer + std::vector layerSense; // COntent of a layer (sensitive?) + double zMinBlock; // Starting z-value of the block + double rMaxFine; // Maximum r-value for fine wafer + double waferW; // Width of the wafer + int sectors; // Sectors + std::vector slopeB; // Slope at the lower R + std::vector slopeT; // Slopes at the larger R + std::vector zFront; // Starting Z values for the slopes + std::vector rMaxFront; // Corresponding rMax's + std::string idName; // Name of the "parent" volume. + std::string idNameSpace; // Namespace of this and ALL sub-parts + std::unordered_set copies; // List of copy #'s +}; + DDHGCalModule::DDHGCalModule() { #ifdef EDM_ML_DEBUG edm::LogVerbatim("HGCalGeom") << "DDHGCalModule: Creating an instance"; @@ -276,3 +324,5 @@ void DDHGCalModule::positionSensitive(DDLogicalPart& glog, double rin, double ro << glog.ddname() << " R " << rin << ":" << rout; #endif } + +DEFINE_EDM_PLUGIN(DDAlgorithmFactory, DDHGCalModule, "hgcal:DDHGCalModule"); diff --git a/Geometry/HGCalCommonData/plugins/DDHGCalModule.h b/Geometry/HGCalCommonData/plugins/DDHGCalModule.h deleted file mode 100644 index e5e058f9d9a7f..0000000000000 --- a/Geometry/HGCalCommonData/plugins/DDHGCalModule.h +++ /dev/null @@ -1,52 +0,0 @@ -#ifndef HGCalCommonData_DDHGCalModule_h -#define HGCalCommonData_DDHGCalModule_h - -#include -#include -#include -#include -#include "DetectorDescription/Core/interface/DDAlgorithm.h" -#include "DetectorDescription/Core/interface/DDTypes.h" - -class DDHGCalModule : public DDAlgorithm { -public: - // Constructor and Destructor - DDHGCalModule(); // const std::string & name); - ~DDHGCalModule() override; - - void initialize(const DDNumericArguments& nArgs, - const DDVectorArguments& vArgs, - const DDMapArguments& mArgs, - const DDStringArguments& sArgs, - const DDStringVectorArguments& vsArgs) override; - void execute(DDCompactView& cpv) override; - -protected: - void constructLayers(const DDLogicalPart&, DDCompactView& cpv); - double rMax(double z); - void positionSensitive(DDLogicalPart& glog, double rin, double rout, DDCompactView& cpv); - -private: - std::vector wafer; // Wafers - std::vector materials; // Materials - std::vector names; // Names - std::vector thick; // Thickness of the material - std::vector copyNumber; // Initial copy numbers - std::vector layers; // Number of layers in a section - std::vector layerThick; // Thickness of each section - std::vector layerType; // Type of the layer - std::vector layerSense; // COntent of a layer (sensitive?) - double zMinBlock; // Starting z-value of the block - double rMaxFine; // Maximum r-value for fine wafer - double waferW; // Width of the wafer - int sectors; // Sectors - std::vector slopeB; // Slope at the lower R - std::vector slopeT; // Slopes at the larger R - std::vector zFront; // Starting Z values for the slopes - std::vector rMaxFront; // Corresponding rMax's - std::string idName; // Name of the "parent" volume. - std::string idNameSpace; // Namespace of this and ALL sub-parts - std::unordered_set copies; // List of copy #'s -}; - -#endif diff --git a/Geometry/HGCalCommonData/plugins/DDHGCalModuleAlgo.cc b/Geometry/HGCalCommonData/plugins/DDHGCalModuleAlgo.cc index fdca8767cc9a8..e65c69e34d584 100644 --- a/Geometry/HGCalCommonData/plugins/DDHGCalModuleAlgo.cc +++ b/Geometry/HGCalCommonData/plugins/DDHGCalModuleAlgo.cc @@ -5,22 +5,71 @@ #include #include +#include +#include +#include +#include #include "DataFormats/Math/interface/GeantUnits.h" +#include "DetectorDescription/Core/interface/DDAlgorithm.h" +#include "DetectorDescription/Core/interface/DDAlgorithmFactory.h" #include "DetectorDescription/Core/interface/DDCurrentNamespace.h" #include "DetectorDescription/Core/interface/DDLogicalPart.h" #include "DetectorDescription/Core/interface/DDMaterial.h" #include "DetectorDescription/Core/interface/DDSolid.h" #include "DetectorDescription/Core/interface/DDSplit.h" +#include "DetectorDescription/Core/interface/DDTypes.h" #include "DetectorDescription/Core/interface/DDutils.h" #include "FWCore/MessageLogger/interface/MessageLogger.h" +#include "FWCore/PluginManager/interface/PluginFactory.h" #include "Geometry/HGCalCommonData/interface/HGCalGeomTools.h" #include "Geometry/HGCalCommonData/interface/HGCalParameters.h" -#include "Geometry/HGCalCommonData/plugins/DDHGCalModuleAlgo.h" //#define EDM_ML_DEBUG using namespace geant_units::operators; +class DDHGCalModuleAlgo : public DDAlgorithm { +public: + // Constructor and Destructor + DDHGCalModuleAlgo(); // const std::string & name); + ~DDHGCalModuleAlgo() override; + + void initialize(const DDNumericArguments& nArgs, + const DDVectorArguments& vArgs, + const DDMapArguments& mArgs, + const DDStringArguments& sArgs, + const DDStringVectorArguments& vsArgs) override; + void execute(DDCompactView& cpv) override; + +protected: + void constructLayers(const DDLogicalPart&, DDCompactView& cpv); + double rMax(double z); + void positionSensitive(DDLogicalPart& glog, double rin, double rout, DDCompactView& cpv); + +private: + std::vector wafer; // Wafers + std::vector materials; // Materials + std::vector names; // Names + std::vector thick; // Thickness of the material + std::vector copyNumber; // Initial copy numbers + std::vector layers; // Number of layers in a section + std::vector layerThick; // Thickness of each section + std::vector layerType; // Type of the layer + std::vector layerSense; // COntent of a layer (sensitive?) + double zMinBlock; // Starting z-value of the block + double rMaxFine; // Maximum r-value for fine wafer + double waferW; // Width of the wafer + double waferGap; // Gap between 2 wafers + int sectors; // Sectors + std::vector slopeB; // Slope at the lower R + std::vector slopeT; // Slopes at the larger R + std::vector zFront; // Starting Z values for the slopes + std::vector rMaxFront; // Corresponding rMax's + std::string idName; // Name of the "parent" volume. + std::string idNameSpace; // Namespace of this and ALL sub-parts + std::unordered_set copies; // List of copy #'s +}; + DDHGCalModuleAlgo::DDHGCalModuleAlgo() { #ifdef EDM_ML_DEBUG edm::LogVerbatim("HGCalGeom") << "DDHGCalModuleAlgo: Creating an instance"; @@ -268,3 +317,5 @@ void DDHGCalModuleAlgo::positionSensitive(DDLogicalPart& glog, double rin, doubl << kount << " wafers for " << glog.ddname(); #endif } + +DEFINE_EDM_PLUGIN(DDAlgorithmFactory, DDHGCalModuleAlgo, "hgcal:DDHGCalModuleAlgo"); diff --git a/Geometry/HGCalCommonData/plugins/DDHGCalModuleAlgo.h b/Geometry/HGCalCommonData/plugins/DDHGCalModuleAlgo.h deleted file mode 100644 index d5f8847933865..0000000000000 --- a/Geometry/HGCalCommonData/plugins/DDHGCalModuleAlgo.h +++ /dev/null @@ -1,53 +0,0 @@ -#ifndef HGCalCommonData_DDHGCalModuleAlgo_h -#define HGCalCommonData_DDHGCalModuleAlgo_h - -#include -#include -#include -#include -#include "DetectorDescription/Core/interface/DDAlgorithm.h" -#include "DetectorDescription/Core/interface/DDTypes.h" - -class DDHGCalModuleAlgo : public DDAlgorithm { -public: - // Constructor and Destructor - DDHGCalModuleAlgo(); // const std::string & name); - ~DDHGCalModuleAlgo() override; - - void initialize(const DDNumericArguments& nArgs, - const DDVectorArguments& vArgs, - const DDMapArguments& mArgs, - const DDStringArguments& sArgs, - const DDStringVectorArguments& vsArgs) override; - void execute(DDCompactView& cpv) override; - -protected: - void constructLayers(const DDLogicalPart&, DDCompactView& cpv); - double rMax(double z); - void positionSensitive(DDLogicalPart& glog, double rin, double rout, DDCompactView& cpv); - -private: - std::vector wafer; // Wafers - std::vector materials; // Materials - std::vector names; // Names - std::vector thick; // Thickness of the material - std::vector copyNumber; // Initial copy numbers - std::vector layers; // Number of layers in a section - std::vector layerThick; // Thickness of each section - std::vector layerType; // Type of the layer - std::vector layerSense; // COntent of a layer (sensitive?) - double zMinBlock; // Starting z-value of the block - double rMaxFine; // Maximum r-value for fine wafer - double waferW; // Width of the wafer - double waferGap; // Gap between 2 wafers - int sectors; // Sectors - std::vector slopeB; // Slope at the lower R - std::vector slopeT; // Slopes at the larger R - std::vector zFront; // Starting Z values for the slopes - std::vector rMaxFront; // Corresponding rMax's - std::string idName; // Name of the "parent" volume. - std::string idNameSpace; // Namespace of this and ALL sub-parts - std::unordered_set copies; // List of copy #'s -}; - -#endif diff --git a/Geometry/HGCalCommonData/plugins/DDHGCalNoTaperEndcap.cc b/Geometry/HGCalCommonData/plugins/DDHGCalNoTaperEndcap.cc index ba8ce75b70511..2ba131378cee0 100644 --- a/Geometry/HGCalCommonData/plugins/DDHGCalNoTaperEndcap.cc +++ b/Geometry/HGCalCommonData/plugins/DDHGCalNoTaperEndcap.cc @@ -1,18 +1,53 @@ #include #include +#include +#include #include "DataFormats/Math/interface/GeantUnits.h" +#include "DetectorDescription/Core/interface/DDAlgorithm.h" +#include "DetectorDescription/Core/interface/DDAlgorithmFactory.h" #include "DetectorDescription/Core/interface/DDCurrentNamespace.h" #include "DetectorDescription/Core/interface/DDLogicalPart.h" #include "DetectorDescription/Core/interface/DDMaterial.h" #include "DetectorDescription/Core/interface/DDSolid.h" #include "DetectorDescription/Core/interface/DDSplit.h" +#include "DetectorDescription/Core/interface/DDTypes.h" #include "FWCore/MessageLogger/interface/MessageLogger.h" -#include "Geometry/HGCalCommonData/plugins/DDHGCalNoTaperEndcap.h" +#include "FWCore/PluginManager/interface/PluginFactory.h" //#define EDM_ML_DEBUG using namespace geant_units::operators; +class DDHGCalNoTaperEndcap : public DDAlgorithm { +public: + DDHGCalNoTaperEndcap(void); + ~DDHGCalNoTaperEndcap(void) override; + + void initialize(const DDNumericArguments& nArgs, + const DDVectorArguments& vArgs, + const DDMapArguments& mArgs, + const DDStringArguments& sArgs, + const DDStringVectorArguments& vsArgs) override; + + void execute(DDCompactView& cpv) override; + +private: + int createQuarter(DDCompactView& cpv, int xQuadrant, int yQuadrant, int startCopyNo); + + double m_startAngle; // Start angle + double m_tiltAngle; // Tilt angle + int m_invert; // Inverted or forward + double m_rMin; // Inner radius + double m_rMax; // Outer radius + double m_zoffset; // Offset in z + double m_xyoffset; // Offset in x or y + int m_n; // Mumber of copies + int m_startCopyNo; // Start copy Number + int m_incrCopyNo; // Increment copy Number + std::string m_childName; // Children name + std::string m_idNameSpace; // Namespace of this and ALL sub-parts +}; + DDHGCalNoTaperEndcap::DDHGCalNoTaperEndcap() { edm::LogVerbatim("HGCalGeom") << "DDHGCalNoTaperEndcap test: Creating an instance"; } @@ -132,3 +167,5 @@ int DDHGCalNoTaperEndcap::createQuarter(DDCompactView& cpv, int xQuadrant, int y #endif return copyNo; } + +DEFINE_EDM_PLUGIN(DDAlgorithmFactory, DDHGCalNoTaperEndcap, "hgcal:DDHGCalNoTaperEndcap"); diff --git a/Geometry/HGCalCommonData/plugins/DDHGCalNoTaperEndcap.h b/Geometry/HGCalCommonData/plugins/DDHGCalNoTaperEndcap.h deleted file mode 100644 index 277f52b40beed..0000000000000 --- a/Geometry/HGCalCommonData/plugins/DDHGCalNoTaperEndcap.h +++ /dev/null @@ -1,39 +0,0 @@ -#ifndef HGCalCommonData_DDHGCalNoTaperEndcap_h -#define HGCalCommonData_DDHGCalNoTaperEndcap_h - -#include -#include -#include "DetectorDescription/Core/interface/DDAlgorithm.h" -#include "DetectorDescription/Core/interface/DDTypes.h" - -class DDHGCalNoTaperEndcap : public DDAlgorithm { -public: - DDHGCalNoTaperEndcap(void); - ~DDHGCalNoTaperEndcap(void) override; - - void initialize(const DDNumericArguments& nArgs, - const DDVectorArguments& vArgs, - const DDMapArguments& mArgs, - const DDStringArguments& sArgs, - const DDStringVectorArguments& vsArgs) override; - - void execute(DDCompactView& cpv) override; - -private: - int createQuarter(DDCompactView& cpv, int xQuadrant, int yQuadrant, int startCopyNo); - - double m_startAngle; // Start angle - double m_tiltAngle; // Tilt angle - int m_invert; // Inverted or forward - double m_rMin; // Inner radius - double m_rMax; // Outer radius - double m_zoffset; // Offset in z - double m_xyoffset; // Offset in x or y - int m_n; // Mumber of copies - int m_startCopyNo; // Start copy Number - int m_incrCopyNo; // Increment copy Number - std::string m_childName; // Children name - std::string m_idNameSpace; // Namespace of this and ALL sub-parts -}; - -#endif diff --git a/Geometry/HGCalCommonData/plugins/DDHGCalTBModule.cc b/Geometry/HGCalCommonData/plugins/DDHGCalTBModule.cc index 6de20384b7eb4..b951740b3b8d7 100644 --- a/Geometry/HGCalCommonData/plugins/DDHGCalTBModule.cc +++ b/Geometry/HGCalCommonData/plugins/DDHGCalTBModule.cc @@ -1,19 +1,71 @@ #include #include +#include +#include +#include +#include #include "DataFormats/Math/interface/GeantUnits.h" +#include "DetectorDescription/Core/interface/DDAlgorithm.h" +#include "DetectorDescription/Core/interface/DDAlgorithmFactory.h" #include "DetectorDescription/Core/interface/DDCurrentNamespace.h" #include "DetectorDescription/Core/interface/DDLogicalPart.h" #include "DetectorDescription/Core/interface/DDMaterial.h" #include "DetectorDescription/Core/interface/DDSolid.h" #include "DetectorDescription/Core/interface/DDSplit.h" +#include "DetectorDescription/Core/interface/DDTypes.h" #include "DetectorDescription/Core/interface/DDutils.h" #include "FWCore/MessageLogger/interface/MessageLogger.h" -#include "Geometry/HGCalCommonData/plugins/DDHGCalTBModule.h" +#include "FWCore/PluginManager/interface/PluginFactory.h" //#define EDM_ML_DEBUG using namespace geant_units::operators; +class DDHGCalTBModule : public DDAlgorithm { +public: + // Constructor and Destructor + DDHGCalTBModule(); // const std::string & name); + ~DDHGCalTBModule() override; + + void initialize(const DDNumericArguments& nArgs, + const DDVectorArguments& vArgs, + const DDMapArguments& mArgs, + const DDStringArguments& sArgs, + const DDStringVectorArguments& vsArgs) override; + void execute(DDCompactView& cpv) override; + +protected: + void constructLayers(const DDLogicalPart&, DDCompactView& cpv); + double rMax(double z); + void positionSensitive(DDLogicalPart& glog, int type, double rin, double rout, DDCompactView& cpv); + +private: + std::vector wafer_; // Wafers + std::vector covers_; // Insensitive layers of hexagonal size + std::vector materials_; // Materials + std::vector names_; // Names + std::vector thick_; // Thickness of the material + std::vector copyNumber_; // Initial copy numbers + std::vector layers_; // Number of layers in a section + std::vector layerThick_; // Thickness of each section + std::vector layerType_; // Type of the layer + std::vector layerSense_; // COntent of a layer (sensitive?) + double zMinBlock_; // Starting z-value of the block + double rMaxFine_; // Maximum r-value for fine wafer + double waferW_; // Width of the wafer + double waferGap_; // Gap between 2 wafers + double absorbW_; // Width of the absorber + double absorbH_; // Height of the absorber + int sectors_; // Sectors + std::vector slopeB_; // Slope at the lower R + std::vector slopeT_; // Slopes at the larger R + std::vector zFront_; // Starting Z values for the slopes + std::vector rMaxFront_; // Corresponding rMax's + std::string idName_; // Name of the "parent" volume. + std::string idNameSpace_; // Namespace of this and ALL sub-parts + std::unordered_set copies_; // List of copy #'s +}; + DDHGCalTBModule::DDHGCalTBModule() { #ifdef EDM_ML_DEBUG edm::LogVerbatim("HGCalGeom") << "DDHGCalTBModule info: Creating an instance"; @@ -280,3 +332,5 @@ void DDHGCalTBModule::positionSensitive(DDLogicalPart& glog, int type, double ri << " wafers for " << glog.ddname(); #endif } + +DEFINE_EDM_PLUGIN(DDAlgorithmFactory, DDHGCalTBModule, "hgcal:DDHGCalTBModule"); diff --git a/Geometry/HGCalCommonData/plugins/DDHGCalTBModule.h b/Geometry/HGCalCommonData/plugins/DDHGCalTBModule.h deleted file mode 100644 index a01547e3e2f68..0000000000000 --- a/Geometry/HGCalCommonData/plugins/DDHGCalTBModule.h +++ /dev/null @@ -1,56 +0,0 @@ -#ifndef HGCalCommonData_DDHGCalTBModule_h -#define HGCalCommonData_DDHGCalTBModule_h - -#include -#include -#include -#include -#include "DetectorDescription/Core/interface/DDAlgorithm.h" -#include "DetectorDescription/Core/interface/DDTypes.h" - -class DDHGCalTBModule : public DDAlgorithm { -public: - // Constructor and Destructor - DDHGCalTBModule(); // const std::string & name); - ~DDHGCalTBModule() override; - - void initialize(const DDNumericArguments& nArgs, - const DDVectorArguments& vArgs, - const DDMapArguments& mArgs, - const DDStringArguments& sArgs, - const DDStringVectorArguments& vsArgs) override; - void execute(DDCompactView& cpv) override; - -protected: - void constructLayers(const DDLogicalPart&, DDCompactView& cpv); - double rMax(double z); - void positionSensitive(DDLogicalPart& glog, int type, double rin, double rout, DDCompactView& cpv); - -private: - std::vector wafer_; // Wafers - std::vector covers_; // Insensitive layers of hexagonal size - std::vector materials_; // Materials - std::vector names_; // Names - std::vector thick_; // Thickness of the material - std::vector copyNumber_; // Initial copy numbers - std::vector layers_; // Number of layers in a section - std::vector layerThick_; // Thickness of each section - std::vector layerType_; // Type of the layer - std::vector layerSense_; // COntent of a layer (sensitive?) - double zMinBlock_; // Starting z-value of the block - double rMaxFine_; // Maximum r-value for fine wafer - double waferW_; // Width of the wafer - double waferGap_; // Gap between 2 wafers - double absorbW_; // Width of the absorber - double absorbH_; // Height of the absorber - int sectors_; // Sectors - std::vector slopeB_; // Slope at the lower R - std::vector slopeT_; // Slopes at the larger R - std::vector zFront_; // Starting Z values for the slopes - std::vector rMaxFront_; // Corresponding rMax's - std::string idName_; // Name of the "parent" volume. - std::string idNameSpace_; // Namespace of this and ALL sub-parts - std::unordered_set copies_; // List of copy #'s -}; - -#endif diff --git a/Geometry/HGCalCommonData/plugins/DDHGCalTBModuleX.cc b/Geometry/HGCalCommonData/plugins/DDHGCalTBModuleX.cc index 2294f4bbcff2a..849a02d84271c 100644 --- a/Geometry/HGCalCommonData/plugins/DDHGCalTBModuleX.cc +++ b/Geometry/HGCalCommonData/plugins/DDHGCalTBModuleX.cc @@ -1,17 +1,92 @@ #include #include +#include +#include +#include #include "DataFormats/Math/interface/GeantUnits.h" +#include "DetectorDescription/Core/interface/DDAlgorithm.h" +#include "DetectorDescription/Core/interface/DDAlgorithmFactory.h" #include "DetectorDescription/Core/interface/DDCurrentNamespace.h" +#include "DetectorDescription/Core/interface/DDLogicalPart.h" +#include "DetectorDescription/Core/interface/DDMaterial.h" #include "DetectorDescription/Core/interface/DDSolid.h" #include "DetectorDescription/Core/interface/DDSplit.h" +#include "DetectorDescription/Core/interface/DDTypes.h" #include "DetectorDescription/Core/interface/DDutils.h" #include "FWCore/MessageLogger/interface/MessageLogger.h" -#include "Geometry/HGCalCommonData/plugins/DDHGCalTBModuleX.h" +#include "FWCore/PluginManager/interface/PluginFactory.h" //#define EDM_ML_DEBUG using namespace geant_units::operators; +class DDHGCalTBModuleX : public DDAlgorithm { +public: + // Constructor and Destructor + DDHGCalTBModuleX(); // + ~DDHGCalTBModuleX() override; + + void initialize(const DDNumericArguments& nArgs, + const DDVectorArguments& vArgs, + const DDMapArguments& mArgs, + const DDStringArguments& sArgs, + const DDStringVectorArguments& vsArgs) override; + void execute(DDCompactView& cpv) override; + +protected: + void constructBlocks(const DDLogicalPart&, DDCompactView& cpv); + void constructLayers(int block, + int layerFront, + int layerBack, + double zFront, + double thick, + bool ignore, + const DDLogicalPart&, + DDCompactView&); + void positionSensitive(double zpos, + int copyIn, + int type, + double rmax, + int ncrMax, + bool ignoreCenter, + const std::string&, + const DDMaterial&, + const DDLogicalPart&, + DDCompactView& cpv); + +private: + static constexpr double tolerance_ = 0.00001; + const double factor_, tan30deg_; + + std::vector wafer_; // Wafers + std::vector covers_; // Insensitive layers of hexagonal size + std::string genMat_; // General material used for blocks + std::vector materials_; // Material names in each layer + std::vector names_; // Names of each layer + std::vector layerThick_; // Thickness of the material + std::vector copyNumber_; // Copy numbers (initiated to 1) + std::vector blockThick_; // Thickness of each section + int inOut_; // Number of inner+outer parts + std::vector layerFrontIn_; // First layer index (inner) in block + std::vector layerBackIn_; // Last layer index (inner) in block + std::vector layerFrontOut_; // First layer index (outner) in block + std::vector layerBackOut_; // Last layer index (outner) in block + std::vector layerType_; // Type of the layer + std::vector layerSense_; // Content of a layer + std::vector maxModule_; // Maximum # of row/column + double zMinBlock_; // Starting z-value of the block + double rMaxFine_; // Maximum r-value for fine wafer + double waferW_; // Width of the wafer + double waferGap_; // Gap between 2 wafers + double absorbW_; // Width of the absorber + double absorbH_; // Height of the absorber + double rMax_; // Maximum radial extent + double rMaxB_; // Maximum radial extent of a block + std::string idName_; // Name of the "parent" volume. + std::string idNameSpace_; // Namespace of this and ALL sub-parts + std::unordered_set copies_; // List of copy #'s +}; + DDHGCalTBModuleX::DDHGCalTBModuleX() : factor_(0.5 * sqrt(2.0)), tan30deg_(tan(30._deg)) { #ifdef EDM_ML_DEBUG edm::LogVerbatim("HGCalGeom") << "DDHGCalTBModuleX info: Creating instance"; @@ -326,3 +401,5 @@ void DDHGCalTBModuleX::positionSensitive(double zpos, << kount << " wafers for " << glog.ddname(); #endif } + +DEFINE_EDM_PLUGIN(DDAlgorithmFactory, DDHGCalTBModuleX, "hgcal:DDHGCalTBModuleX"); diff --git a/Geometry/HGCalCommonData/plugins/DDHGCalTBModuleX.h b/Geometry/HGCalCommonData/plugins/DDHGCalTBModuleX.h deleted file mode 100644 index db3b2306ed597..0000000000000 --- a/Geometry/HGCalCommonData/plugins/DDHGCalTBModuleX.h +++ /dev/null @@ -1,79 +0,0 @@ -#ifndef HGCalCommonData_DDHGCalTBModuleX_h -#define HGCalCommonData_DDHGCalTBModuleX_h - -#include -#include -#include -#include "DetectorDescription/Core/interface/DDAlgorithm.h" -#include "DetectorDescription/Core/interface/DDLogicalPart.h" -#include "DetectorDescription/Core/interface/DDMaterial.h" -#include "DetectorDescription/Core/interface/DDTypes.h" - -class DDHGCalTBModuleX : public DDAlgorithm { -public: - // Constructor and Destructor - DDHGCalTBModuleX(); // - ~DDHGCalTBModuleX() override; - - void initialize(const DDNumericArguments& nArgs, - const DDVectorArguments& vArgs, - const DDMapArguments& mArgs, - const DDStringArguments& sArgs, - const DDStringVectorArguments& vsArgs) override; - void execute(DDCompactView& cpv) override; - -protected: - void constructBlocks(const DDLogicalPart&, DDCompactView& cpv); - void constructLayers(int block, - int layerFront, - int layerBack, - double zFront, - double thick, - bool ignore, - const DDLogicalPart&, - DDCompactView&); - void positionSensitive(double zpos, - int copyIn, - int type, - double rmax, - int ncrMax, - bool ignoreCenter, - const std::string&, - const DDMaterial&, - const DDLogicalPart&, - DDCompactView& cpv); - -private: - static constexpr double tolerance_ = 0.00001; - const double factor_, tan30deg_; - - std::vector wafer_; // Wafers - std::vector covers_; // Insensitive layers of hexagonal size - std::string genMat_; // General material used for blocks - std::vector materials_; // Material names in each layer - std::vector names_; // Names of each layer - std::vector layerThick_; // Thickness of the material - std::vector copyNumber_; // Copy numbers (initiated to 1) - std::vector blockThick_; // Thickness of each section - int inOut_; // Number of inner+outer parts - std::vector layerFrontIn_; // First layer index (inner) in block - std::vector layerBackIn_; // Last layer index (inner) in block - std::vector layerFrontOut_; // First layer index (outner) in block - std::vector layerBackOut_; // Last layer index (outner) in block - std::vector layerType_; // Type of the layer - std::vector layerSense_; // Content of a layer - std::vector maxModule_; // Maximum # of row/column - double zMinBlock_; // Starting z-value of the block - double rMaxFine_; // Maximum r-value for fine wafer - double waferW_; // Width of the wafer - double waferGap_; // Gap between 2 wafers - double absorbW_; // Width of the absorber - double absorbH_; // Height of the absorber - double rMax_; // Maximum radial extent - double rMaxB_; // Maximum radial extent of a block - std::string idName_; // Name of the "parent" volume. - std::string idNameSpace_; // Namespace of this and ALL sub-parts - std::unordered_set copies_; // List of copy #'s -}; - -#endif diff --git a/Geometry/HGCalCommonData/plugins/DDHGCalWafer.cc b/Geometry/HGCalCommonData/plugins/DDHGCalWafer.cc index e04a249dde571..5f6a28b8b9099 100644 --- a/Geometry/HGCalCommonData/plugins/DDHGCalWafer.cc +++ b/Geometry/HGCalCommonData/plugins/DDHGCalWafer.cc @@ -1,17 +1,49 @@ #include #include +#include +#include +#include #include "DataFormats/Math/interface/GeantUnits.h" +#include "DetectorDescription/Core/interface/DDAlgorithm.h" +#include "DetectorDescription/Core/interface/DDAlgorithmFactory.h" #include "DetectorDescription/Core/interface/DDCurrentNamespace.h" #include "DetectorDescription/Core/interface/DDLogicalPart.h" #include "DetectorDescription/Core/interface/DDSplit.h" +#include "DetectorDescription/Core/interface/DDTypes.h" #include "DetectorDescription/Core/interface/DDutils.h" #include "FWCore/MessageLogger/interface/MessageLogger.h" -#include "Geometry/HGCalCommonData/plugins/DDHGCalWafer.h" +#include "FWCore/PluginManager/interface/PluginFactory.h" //#define EDM_ML_DEBUG using namespace geant_units::operators; +class DDHGCalWafer : public DDAlgorithm { +public: + // Constructor and Destructor + DDHGCalWafer(); + ~DDHGCalWafer() override; + + void initialize(const DDNumericArguments& nArgs, + const DDVectorArguments& vArgs, + const DDMapArguments& mArgs, + const DDStringArguments& sArgs, + const DDStringVectorArguments& vsArgs) override; + void execute(DDCompactView& cpv) override; + +private: + double waferSize_; // Wafer Size + int cellType_; // Type (1 fine; 2 coarse) + int nColumns_; // Maximum number of columns + int nBottomY_; // Index of cell position of bottom row + std::vector childNames_; // Names of children + std::vector nCellsRow_; // Number of cells in a row + std::vector angleEdges_; // Rotation angles to be used for edges + std::vector detectorType_; // Detector type of edge cells + std::string idNameSpace_; // Namespace of this and ALL sub-parts + DDName parentName_; // Parent name +}; + DDHGCalWafer::DDHGCalWafer() { #ifdef EDM_ML_DEBUG edm::LogVerbatim("HGCalGeom") << "DDHGCalWafer: Creating an instance"; @@ -96,3 +128,5 @@ void DDHGCalWafer::execute(DDCompactView& cpv) { ny += 6; } } + +DEFINE_EDM_PLUGIN(DDAlgorithmFactory, DDHGCalWafer, "hgcal:DDHGCalWafer"); diff --git a/Geometry/HGCalCommonData/plugins/DDHGCalWafer.h b/Geometry/HGCalCommonData/plugins/DDHGCalWafer.h deleted file mode 100644 index 476d1a1e08726..0000000000000 --- a/Geometry/HGCalCommonData/plugins/DDHGCalWafer.h +++ /dev/null @@ -1,36 +0,0 @@ -#ifndef HGCalCommonData_DDHGCalWafer_h -#define HGCalCommonData_DDHGCalWafer_h - -#include -#include -#include -#include "DetectorDescription/Core/interface/DDAlgorithm.h" -#include "DetectorDescription/Core/interface/DDTypes.h" - -class DDHGCalWafer : public DDAlgorithm { -public: - // Constructor and Destructor - DDHGCalWafer(); - ~DDHGCalWafer() override; - - void initialize(const DDNumericArguments& nArgs, - const DDVectorArguments& vArgs, - const DDMapArguments& mArgs, - const DDStringArguments& sArgs, - const DDStringVectorArguments& vsArgs) override; - void execute(DDCompactView& cpv) override; - -private: - double waferSize_; // Wafer Size - int cellType_; // Type (1 fine; 2 coarse) - int nColumns_; // Maximum number of columns - int nBottomY_; // Index of cell position of bottom row - std::vector childNames_; // Names of children - std::vector nCellsRow_; // Number of cells in a row - std::vector angleEdges_; // Rotation angles to be used for edges - std::vector detectorType_; // Detector type of edge cells - std::string idNameSpace_; // Namespace of this and ALL sub-parts - DDName parentName_; // Parent name -}; - -#endif diff --git a/Geometry/HGCalCommonData/plugins/DDHGCalWafer8.cc b/Geometry/HGCalCommonData/plugins/DDHGCalWafer8.cc index ba83bae37cd3b..08402861051c5 100644 --- a/Geometry/HGCalCommonData/plugins/DDHGCalWafer8.cc +++ b/Geometry/HGCalCommonData/plugins/DDHGCalWafer8.cc @@ -1,14 +1,45 @@ -#include "Geometry/HGCalCommonData/plugins/DDHGCalWafer8.h" +#include "DetectorDescription/Core/interface/DDAlgorithm.h" +#include "DetectorDescription/Core/interface/DDAlgorithmFactory.h" #include "DetectorDescription/Core/interface/DDCurrentNamespace.h" #include "DetectorDescription/Core/interface/DDLogicalPart.h" #include "DetectorDescription/Core/interface/DDMaterial.h" #include "DetectorDescription/Core/interface/DDSolid.h" #include "DetectorDescription/Core/interface/DDSplit.h" +#include "DetectorDescription/Core/interface/DDTypes.h" #include "DetectorDescription/Core/interface/DDutils.h" #include "FWCore/MessageLogger/interface/MessageLogger.h" +#include "FWCore/PluginManager/interface/PluginFactory.h" + +#include +#include //#define EDM_ML_DEBUG +class DDHGCalWafer8 : public DDAlgorithm { +public: + // Constructor and Destructor + DDHGCalWafer8(); + ~DDHGCalWafer8() override; + + void initialize(const DDNumericArguments& nArgs, + const DDVectorArguments& vArgs, + const DDMapArguments& mArgs, + const DDStringArguments& sArgs, + const DDStringVectorArguments& vsArgs) override; + void execute(DDCompactView& cpv) override; + +private: + double waferSize_; // Wafer size + double waferT_; // Wafer thickness + double waferSepar_; // Sensor separation + double mouseBite_; // MouseBite radius + int nCells_; // Half number of cells along u-v axis + int cellType_; // Cell Type (0,1,2: Fine, Course 2/3) + std::string material_; // Material name for module with gap + std::vector cellNames_; // Name of the cells + std::string nameSpace_; // Namespace to be used +}; + DDHGCalWafer8::DDHGCalWafer8() { #ifdef EDM_ML_DEBUG edm::LogVerbatim("HGCalGeom") << "DDHGCalWafer8: Creating an instance"; @@ -17,11 +48,11 @@ DDHGCalWafer8::DDHGCalWafer8() { DDHGCalWafer8::~DDHGCalWafer8() {} -void DDHGCalWafer8::initialize(const DDNumericArguments &nArgs, - const DDVectorArguments &, - const DDMapArguments &, - const DDStringArguments &sArgs, - const DDStringVectorArguments &vsArgs) { +void DDHGCalWafer8::initialize(const DDNumericArguments& nArgs, + const DDVectorArguments&, + const DDMapArguments&, + const DDStringArguments& sArgs, + const DDStringVectorArguments& vsArgs) { waferSize_ = nArgs["WaferSize"]; waferT_ = nArgs["WaferThick"]; waferSepar_ = nArgs["SensorSeparation"]; @@ -42,7 +73,7 @@ void DDHGCalWafer8::initialize(const DDNumericArguments &nArgs, #endif } -void DDHGCalWafer8::execute(DDCompactView &cpv) { +void DDHGCalWafer8::execute(DDCompactView& cpv) { #ifdef EDM_ML_DEBUG edm::LogVerbatim("HGCalGeom") << "==>> Executing DDHGCalWafer8..."; #endif @@ -115,3 +146,5 @@ void DDHGCalWafer8::execute(DDCompactView &cpv) { } } } + +DEFINE_EDM_PLUGIN(DDAlgorithmFactory, DDHGCalWafer8, "hgcal:DDHGCalWafer8"); diff --git a/Geometry/HGCalCommonData/plugins/DDHGCalWafer8.h b/Geometry/HGCalCommonData/plugins/DDHGCalWafer8.h deleted file mode 100644 index dfd5c4082cffa..0000000000000 --- a/Geometry/HGCalCommonData/plugins/DDHGCalWafer8.h +++ /dev/null @@ -1,34 +0,0 @@ -#ifndef HGCalCommonData_DDHGCalWafer8_h -#define HGCalCommonData_DDHGCalWafer8_h - -#include -#include -#include "DetectorDescription/Core/interface/DDAlgorithm.h" -#include "DetectorDescription/Core/interface/DDTypes.h" - -class DDHGCalWafer8 : public DDAlgorithm { -public: - // Constructor and Destructor - DDHGCalWafer8(); - ~DDHGCalWafer8() override; - - void initialize(const DDNumericArguments& nArgs, - const DDVectorArguments& vArgs, - const DDMapArguments& mArgs, - const DDStringArguments& sArgs, - const DDStringVectorArguments& vsArgs) override; - void execute(DDCompactView& cpv) override; - -private: - double waferSize_; // Wafer size - double waferT_; // Wafer thickness - double waferSepar_; // Sensor separation - double mouseBite_; // MouseBite radius - int nCells_; // Half number of cells along u-v axis - int cellType_; // Cell Type (0,1,2: Fine, Course 2/3) - std::string material_; // Material name for module with gap - std::vector cellNames_; // Name of the cells - std::string nameSpace_; // Namespace to be used -}; - -#endif diff --git a/Geometry/HGCalCommonData/plugins/DDHGCalWaferAlgo.cc b/Geometry/HGCalCommonData/plugins/DDHGCalWaferAlgo.cc index d1ea0f78ae840..b8a4a7cc5f4bb 100644 --- a/Geometry/HGCalCommonData/plugins/DDHGCalWaferAlgo.cc +++ b/Geometry/HGCalCommonData/plugins/DDHGCalWaferAlgo.cc @@ -5,17 +5,50 @@ #include #include +#include +#include +#include #include "DataFormats/Math/interface/GeantUnits.h" +#include "DetectorDescription/Core/interface/DDAlgorithm.h" +#include "DetectorDescription/Core/interface/DDAlgorithmFactory.h" #include "DetectorDescription/Core/interface/DDCurrentNamespace.h" #include "DetectorDescription/Core/interface/DDLogicalPart.h" +#include "DetectorDescription/Core/interface/DDTypes.h" #include "DetectorDescription/Core/interface/DDutils.h" #include "FWCore/MessageLogger/interface/MessageLogger.h" -#include "Geometry/HGCalCommonData/plugins/DDHGCalWaferAlgo.h" +#include "FWCore/PluginManager/interface/PluginFactory.h" //#define EDM_ML_DEBUG using namespace geant_units::operators; +class DDHGCalWaferAlgo : public DDAlgorithm { +public: + // Constructor and Destructor + DDHGCalWaferAlgo(); + ~DDHGCalWaferAlgo() override; + + void initialize(const DDNumericArguments& nArgs, + const DDVectorArguments& vArgs, + const DDMapArguments& mArgs, + const DDStringArguments& sArgs, + const DDStringVectorArguments& vsArgs) override; + void execute(DDCompactView& cpv) override; + +private: + double cellSize; // Cell Size + int cellType; // Type (1 fine; 2 coarse) + std::vector childNames; // Names of children + std::vector positionX; // Position in X + std::vector positionY; // Position in Y + std::vector angles; // Rotation angle + std::vector detectorType; // Detector type + std::string idName; // Name of the "parent" volume. + std::string rotns; // Namespace for rotation matrix + std::string idNameSpace; // Namespace of this and ALL sub-parts + DDName parentName; // Parent name +}; + DDHGCalWaferAlgo::DDHGCalWaferAlgo() { #ifdef EDM_ML_DEBUG edm::LogVerbatim("HGCalGeom") << "DDHGCalWaferAlgo: Creating an instance"; @@ -86,3 +119,5 @@ void DDHGCalWaferAlgo::execute(DDCompactView& cpv) { #endif } } + +DEFINE_EDM_PLUGIN(DDAlgorithmFactory, DDHGCalWaferAlgo, "hgcal:DDHGCalWaferAlgo"); diff --git a/Geometry/HGCalCommonData/plugins/DDHGCalWaferAlgo.h b/Geometry/HGCalCommonData/plugins/DDHGCalWaferAlgo.h deleted file mode 100644 index 6714e57e7ec6e..0000000000000 --- a/Geometry/HGCalCommonData/plugins/DDHGCalWaferAlgo.h +++ /dev/null @@ -1,37 +0,0 @@ -#ifndef HGCalCommonData_DDHGCalWaferAlgo_h -#define HGCalCommonData_DDHGCalWaferAlgo_h - -#include -#include -#include -#include "DetectorDescription/Core/interface/DDAlgorithm.h" -#include "DetectorDescription/Core/interface/DDTypes.h" - -class DDHGCalWaferAlgo : public DDAlgorithm { -public: - // Constructor and Destructor - DDHGCalWaferAlgo(); - ~DDHGCalWaferAlgo() override; - - void initialize(const DDNumericArguments& nArgs, - const DDVectorArguments& vArgs, - const DDMapArguments& mArgs, - const DDStringArguments& sArgs, - const DDStringVectorArguments& vsArgs) override; - void execute(DDCompactView& cpv) override; - -private: - double cellSize; // Cell Size - int cellType; // Type (1 fine; 2 coarse) - std::vector childNames; // Names of children - std::vector positionX; // Position in X - std::vector positionY; // Position in Y - std::vector angles; // Rotation angle - std::vector detectorType; // Detector type - std::string idName; // Name of the "parent" volume. - std::string rotns; // Namespace for rotation matrix - std::string idNameSpace; // Namespace of this and ALL sub-parts - DDName parentName; // Parent name -}; - -#endif diff --git a/Geometry/HGCalCommonData/plugins/module.cc b/Geometry/HGCalCommonData/plugins/module.cc index 5fc2a09de1bff..5640174b23068 100644 --- a/Geometry/HGCalCommonData/plugins/module.cc +++ b/Geometry/HGCalCommonData/plugins/module.cc @@ -1,26 +1,4 @@ #include "DetectorDescription/Core/interface/DDAlgorithmFactory.h" #include "Geometry/HGCalCommonData/plugins/DDAHcalModuleAlgo.h" -#include "Geometry/HGCalCommonData/plugins/DDHGCalCell.h" -#include "Geometry/HGCalCommonData/plugins/DDHGCalEEAlgo.h" -#include "Geometry/HGCalCommonData/plugins/DDHGCalHEAlgo.h" -#include "Geometry/HGCalCommonData/plugins/DDHGCalModule.h" -#include "Geometry/HGCalCommonData/plugins/DDHGCalModuleAlgo.h" -#include "Geometry/HGCalCommonData/plugins/DDHGCalNoTaperEndcap.h" -#include "Geometry/HGCalCommonData/plugins/DDHGCalTBModule.h" -#include "Geometry/HGCalCommonData/plugins/DDHGCalTBModuleX.h" -#include "Geometry/HGCalCommonData/plugins/DDHGCalWafer.h" -#include "Geometry/HGCalCommonData/plugins/DDHGCalWafer8.h" -#include "Geometry/HGCalCommonData/plugins/DDHGCalWaferAlgo.h" -DEFINE_EDM_PLUGIN(DDAlgorithmFactory, DDHGCalEEAlgo, "hgcal:DDHGCalEEAlgo"); -DEFINE_EDM_PLUGIN(DDAlgorithmFactory, DDHGCalHEAlgo, "hgcal:DDHGCalHEAlgo"); -DEFINE_EDM_PLUGIN(DDAlgorithmFactory, DDHGCalCell, "hgcal:DDHGCalCell"); -DEFINE_EDM_PLUGIN(DDAlgorithmFactory, DDHGCalWaferAlgo, "hgcal:DDHGCalWaferAlgo"); -DEFINE_EDM_PLUGIN(DDAlgorithmFactory, DDHGCalWafer, "hgcal:DDHGCalWafer"); -DEFINE_EDM_PLUGIN(DDAlgorithmFactory, DDHGCalWafer8, "hgcal:DDHGCalWafer8"); -DEFINE_EDM_PLUGIN(DDAlgorithmFactory, DDHGCalModule, "hgcal:DDHGCalModule"); -DEFINE_EDM_PLUGIN(DDAlgorithmFactory, DDHGCalModuleAlgo, "hgcal:DDHGCalModuleAlgo"); -DEFINE_EDM_PLUGIN(DDAlgorithmFactory, DDHGCalTBModule, "hgcal:DDHGCalTBModule"); -DEFINE_EDM_PLUGIN(DDAlgorithmFactory, DDHGCalTBModuleX, "hgcal:DDHGCalTBModuleX"); -DEFINE_EDM_PLUGIN(DDAlgorithmFactory, DDHGCalNoTaperEndcap, "hgcal:DDHGCalNoTaperEndcap"); DEFINE_EDM_PLUGIN(DDAlgorithmFactory, DDAHcalModuleAlgo, "hgcal:DDAHcalModuleAlgo"); diff --git a/Geometry/HGCalCommonData/python/testGeometryExtended_cff.py b/Geometry/HGCalCommonData/python/testGeometryExtended_cff.py index d41fa01b1eb07..f3283d4b7a3dd 100644 --- a/Geometry/HGCalCommonData/python/testGeometryExtended_cff.py +++ b/Geometry/HGCalCommonData/python/testGeometryExtended_cff.py @@ -1,6 +1,6 @@ import FWCore.ParameterSet.Config as cms -from Geometry.CMSCommonData.cmsExtendedGeometry2026D28XML_cfi import * +from Geometry.CMSCommonData.cmsExtendedGeometry2026D41XML_cfi import * from Geometry.TrackerNumberingBuilder.trackerNumberingGeometry_cfi import * from Geometry.HcalCommonData.hcalDDConstants_cff import * from Geometry.HGCalCommonData.hgcalParametersInitialization_cfi import * diff --git a/Geometry/HGCalCommonData/test/dumpExtended2023HGCalGeometry_cfg.py b/Geometry/HGCalCommonData/test/dumpExtendedHGCalGeometry_cfg.py similarity index 100% rename from Geometry/HGCalCommonData/test/dumpExtended2023HGCalGeometry_cfg.py rename to Geometry/HGCalCommonData/test/dumpExtendedHGCalGeometry_cfg.py