Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2022-05-24 22:29:48

0001 ///////////////////////////////////////////////////////////////////////////////
0002 // File: DDHGCalSiliconModule.cc
0003 // Description: Geometry factory class for HGCal (EE and HESil) using
0004 //              information from the file for dd4hep
0005 ///////////////////////////////////////////////////////////////////////////////
0006 #include <cmath>
0007 #include <memory>
0008 #include <sstream>
0009 #include <string>
0010 #include <unordered_set>
0011 #include <vector>
0012 
0013 #include "Geometry/HGCalCommonData/interface/HGCalGeomTools.h"
0014 #include "Geometry/HGCalCommonData/interface/HGCalParameters.h"
0015 #include "Geometry/HGCalCommonData/interface/HGCalProperty.h"
0016 #include "Geometry/HGCalCommonData/interface/HGCalTypes.h"
0017 #include "Geometry/HGCalCommonData/interface/HGCalWaferIndex.h"
0018 #include "Geometry/HGCalCommonData/interface/HGCalWaferType.h"
0019 #include "DD4hep/DetFactoryHelper.h"
0020 #include "DataFormats/Math/interface/angle_units.h"
0021 #include "DetectorDescription/DDCMS/interface/DDPlugins.h"
0022 #include "DetectorDescription/DDCMS/interface/DDutils.h"
0023 #include "FWCore/MessageLogger/interface/MessageLogger.h"
0024 
0025 //#define EDM_ML_DEBUG
0026 using namespace angle_units::operators;
0027 
0028 struct HGCalSiliconModule {
0029   HGCalSiliconModule() { throw cms::Exception("HGCalGeom") << "Wrong initialization to HGCalSiliconModule"; }
0030   HGCalSiliconModule(cms::DDParsingContext& ctxt, xml_h e) {
0031     cms::DDNamespace ns(ctxt, e, true);
0032     cms::DDAlgoArguments args(ctxt, e);
0033 
0034 #ifdef EDM_ML_DEBUG
0035     edm::LogVerbatim("HGCalGeom") << "DDHGCalSiliconModule: Creating an instance";
0036 #endif
0037     static constexpr double tol1 = 0.01 * dd4hep::mm;
0038     static constexpr double tol2 = 0.00001 * dd4hep::mm;
0039 
0040     dd4hep::Volume mother = ns.volume(args.parentName());
0041     waferTypes_ = args.value<int>("WaferTypes");
0042     facingTypes_ = args.value<int>("FacingTypes");
0043     partialTypes_ = args.value<int>("PartialTypes");
0044     orientationTypes_ = args.value<int>("OrientationTypes");
0045 #ifdef EDM_ML_DEBUG
0046     edm::LogVerbatim("HGCalGeom") << "Number of types of wafers: " << waferTypes_ << " facings: " << facingTypes_
0047                                   << " partials: " << partialTypes_ << " Orientations: " << orientationTypes_;
0048 #endif
0049     firstLayer_ = args.value<int>("FirstLayer");
0050     absorbMode_ = args.value<int>("AbsorberMode");
0051     sensitiveMode_ = args.value<int>("SensitiveMode");
0052 #ifdef EDM_ML_DEBUG
0053     edm::LogVerbatim("HGCalGeom") << "First Layer " << firstLayer_ << " and "
0054                                   << "Absober:Sensitive mode " << absorbMode_ << ":" << sensitiveMode_;
0055 #endif
0056     zMinBlock_ = args.value<double>("zMinBlock");
0057     waferSize_ = args.value<double>("waferSize");
0058     waferSepar_ = args.value<double>("SensorSeparation");
0059     sectors_ = args.value<int>("Sectors");
0060     alpha_ = (1._pi) / sectors_;
0061     cosAlpha_ = cos(alpha_);
0062     rotstr_ = args.value<std::string>("LayerRotation");
0063 #ifdef EDM_ML_DEBUG
0064     edm::LogVerbatim("HGCalGeom") << "zStart " << cms::convert2mm(zMinBlock_) << " wafer width "
0065                                   << cms::convert2mm(waferSize_) << " separations " << cms::convert2mm(waferSepar_)
0066                                   << " sectors " << sectors_ << ":" << convertRadToDeg(alpha_) << ":" << cosAlpha_
0067                                   << " rotation matrix " << rotstr_;
0068 #endif
0069     waferFull_ = args.value<std::vector<std::string>>("WaferNamesFull");
0070     waferPart_ = args.value<std::vector<std::string>>("WaferNamesPartial");
0071 #ifdef EDM_ML_DEBUG
0072     edm::LogVerbatim("HGCalGeom") << "DDHGCalSiliconModule: " << waferFull_.size() << " full and " << waferPart_.size()
0073                                   << " partial modules\nDDHGCalSiliconModule:Full Modules:";
0074     unsigned int i1max = static_cast<unsigned int>(waferFull_.size());
0075     for (unsigned int i1 = 0; i1 < i1max; i1 += 2) {
0076       std::ostringstream st1;
0077       unsigned int i2 = std::min((i1 + 2), i1max);
0078       for (unsigned int i = i1; i < i2; ++i)
0079         st1 << " [" << i << "] " << waferFull_[i];
0080       edm::LogVerbatim("HGCalGeom") << st1.str() << std::endl;
0081     }
0082     edm::LogVerbatim("HGCalGeom") << "DDHGCalSiliconModule: Partial Modules:";
0083     i1max = static_cast<unsigned int>(waferPart_.size());
0084     for (unsigned int i1 = 0; i1 < i1max; i1 += 2) {
0085       std::ostringstream st1;
0086       unsigned int i2 = std::min((i1 + 2), i1max);
0087       for (unsigned int i = i1; i < i2; ++i)
0088         st1 << " [" << i << "] " << waferPart_[i];
0089       edm::LogVerbatim("HGCalGeom") << st1.str() << std::endl;
0090     }
0091 #endif
0092     materials_ = args.value<std::vector<std::string>>("MaterialNames");
0093     names_ = args.value<std::vector<std::string>>("VolumeNames");
0094     thick_ = args.value<std::vector<double>>("Thickness");
0095     copyNumber_.resize(materials_.size(), 1);
0096 #ifdef EDM_ML_DEBUG
0097     edm::LogVerbatim("HGCalGeom") << "DDHGCalSiliconModule: " << materials_.size() << " types of volumes";
0098     for (unsigned int i = 0; i < names_.size(); ++i)
0099       edm::LogVerbatim("HGCalGeom") << "Volume [" << i << "] " << names_[i] << " of thickness "
0100                                     << cms::convert2mm(thick_[i]) << " filled with " << materials_[i]
0101                                     << " first copy number " << copyNumber_[i];
0102 #endif
0103     layers_ = args.value<std::vector<int>>("Layers");
0104     layerThick_ = args.value<std::vector<double>>("LayerThick");
0105 #ifdef EDM_ML_DEBUG
0106     edm::LogVerbatim("HGCalGeom") << "There are " << layers_.size() << " blocks";
0107     for (unsigned int i = 0; i < layers_.size(); ++i)
0108       edm::LogVerbatim("HGCalGeom") << "Block [" << i << "] of thickness " << cms::convert2mm(layerThick_[i])
0109                                     << " with " << layers_[i] << " layers";
0110 #endif
0111     layerType_ = args.value<std::vector<int>>("LayerType");
0112     layerSense_ = args.value<std::vector<int>>("LayerSense");
0113     layerOrient_ = args.value<std::vector<int>>("LayerTypes");
0114     for (unsigned int k = 0; k < layerOrient_.size(); ++k)
0115       layerOrient_[k] = HGCalTypes::layerType(layerOrient_[k]);
0116 #ifdef EDM_ML_DEBUG
0117     for (unsigned int i = 0; i < layerOrient_.size(); ++i)
0118       edm::LogVerbatim("HGCalGeom") << "LayerTypes [" << i << "] " << layerOrient_[i];
0119 #endif
0120     if (firstLayer_ > 0) {
0121       for (unsigned int i = 0; i < layerType_.size(); ++i) {
0122         if (layerSense_[i] > 0) {
0123           int ii = layerType_[i];
0124           copyNumber_[ii] = (layerSense_[i] == 1) ? firstLayer_ : (firstLayer_ + 1);
0125 #ifdef EDM_ML_DEBUG
0126           edm::LogVerbatim("HGCalGeom") << "First copy number for layer type " << i << ":" << ii << " with "
0127                                         << materials_[ii] << " changed to " << copyNumber_[ii];
0128 #endif
0129         }
0130       }
0131     } else {
0132       firstLayer_ = 1;
0133     }
0134 #ifdef EDM_ML_DEBUG
0135     edm::LogVerbatim("HGCalGeom") << "There are " << layerType_.size() << " layers";
0136     for (unsigned int i = 0; i < layerType_.size(); ++i)
0137       edm::LogVerbatim("HGCalGeom") << "Layer [" << i << "] with material type " << layerType_[i] << " sensitive class "
0138                                     << layerSense_[i];
0139 #endif
0140     slopeB_ = args.value<std::vector<double>>("SlopeBottom");
0141     zFrontB_ = args.value<std::vector<double>>("ZFrontBottom");
0142     rMinFront_ = args.value<std::vector<double>>("RMinFront");
0143     slopeT_ = args.value<std::vector<double>>("SlopeTop");
0144     zFrontT_ = args.value<std::vector<double>>("ZFrontTop");
0145     rMaxFront_ = args.value<std::vector<double>>("RMaxFront");
0146 #ifdef EDM_ML_DEBUG
0147     for (unsigned int i = 0; i < slopeB_.size(); ++i)
0148       edm::LogVerbatim("HGCalGeom") << "Bottom Block [" << i << "] Zmin " << cms::convert2mm(zFrontB_[i]) << " Rmin "
0149                                     << cms::convert2mm(rMinFront_[i]) << " Slope " << slopeB_[i];
0150     for (unsigned int i = 0; i < slopeT_.size(); ++i)
0151       edm::LogVerbatim("HGCalGeom") << "Top Block [" << i << "] Zmin " << cms::convert2mm(zFrontT_[i]) << " Rmax "
0152                                     << cms::convert2mm(rMaxFront_[i]) << " Slope " << slopeT_[i];
0153 #endif
0154     waferIndex_ = args.value<std::vector<int>>("WaferIndex");
0155     waferProperty_ = args.value<std::vector<int>>("WaferProperties");
0156     waferLayerStart_ = args.value<std::vector<int>>("WaferLayerStart");
0157 #ifdef EDM_ML_DEBUG
0158     edm::LogVerbatim("HGCalGeom") << "waferProperties with " << waferIndex_.size() << " entries in "
0159                                   << waferLayerStart_.size() << " layers";
0160     for (unsigned int k = 0; k < waferLayerStart_.size(); ++k)
0161       edm::LogVerbatim("HGCalGeom") << "LayerStart[" << k << "] " << waferLayerStart_[k];
0162     for (unsigned int k = 0; k < waferIndex_.size(); ++k)
0163       edm::LogVerbatim("HGCalGeom") << "Wafer[" << k << "] " << waferIndex_[k] << " ("
0164                                     << HGCalWaferIndex::waferLayer(waferIndex_[k]) << ", "
0165                                     << HGCalWaferIndex::waferU(waferIndex_[k]) << ", "
0166                                     << HGCalWaferIndex::waferV(waferIndex_[k]) << ") : ("
0167                                     << HGCalProperty::waferThick(waferProperty_[k]) << ":"
0168                                     << HGCalProperty::waferPartial(waferProperty_[k]) << ":"
0169                                     << HGCalProperty::waferOrient(waferProperty_[k]) << ")";
0170     edm::LogVerbatim("HGCalGeom") << "DDHGCalSiliconModule: NameSpace " << ns.name();
0171 #endif
0172 
0173 #ifdef EDM_ML_DEBUG
0174     edm::LogVerbatim("HGCalGeom") << "==>> Constructing DDHGCalSiliconModule...";
0175     copies_.clear();
0176 #endif
0177 
0178     double zi(zMinBlock_);
0179     int laymin(0);
0180     for (unsigned int i = 0; i < layers_.size(); ++i) {
0181       double zo = zi + layerThick_[i];
0182       double routF = HGCalGeomTools::radius(zi, zFrontT_, rMaxFront_, slopeT_);
0183       int laymax = laymin + layers_[i];
0184       double zz = zi;
0185       double thickTot(0);
0186       for (int ly = laymin; ly < laymax; ++ly) {
0187         int ii = layerType_[ly];
0188         int copy = copyNumber_[ii];
0189         double hthick = 0.5 * thick_[ii];
0190         double rinB = HGCalGeomTools::radius(zo - tol1, zFrontB_, rMinFront_, slopeB_);
0191         zz += hthick;
0192         thickTot += thick_[ii];
0193 
0194         std::string name = names_[ii] + std::to_string(copy);
0195 #ifdef EDM_ML_DEBUG
0196         edm::LogVerbatim("HGCalGeom") << "DDHGCalSiliconModule: Layer " << ly << ":" << ii << " Front "
0197                                       << cms::convert2mm(zi) << ", " << cms::convert2mm(routF) << " Back "
0198                                       << cms::convert2mm(zo) << ", " << cms::convert2mm(rinB)
0199                                       << " superlayer thickness " << cms::convert2mm(layerThick_[i]);
0200 #endif
0201 
0202         dd4hep::Material matter = ns.material(materials_[ii]);
0203         dd4hep::Volume glog;
0204 
0205         if (layerSense_[ly] < 1) {
0206           std::vector<double> pgonZ, pgonRin, pgonRout;
0207           double rmax = routF * cosAlpha_ - tol1;
0208           HGCalGeomTools::radius(zz - hthick,
0209                                  zz + hthick,
0210                                  zFrontB_,
0211                                  rMinFront_,
0212                                  slopeB_,
0213                                  zFrontT_,
0214                                  rMaxFront_,
0215                                  slopeT_,
0216                                  -layerSense_[ly],
0217                                  pgonZ,
0218                                  pgonRin,
0219                                  pgonRout);
0220           for (unsigned int isec = 0; isec < pgonZ.size(); ++isec) {
0221             pgonZ[isec] -= zz;
0222             if (layerSense_[ly] == 0 || absorbMode_ == 0)
0223               pgonRout[isec] = rmax;
0224             else
0225               pgonRout[isec] = pgonRout[isec] * cosAlpha_ - tol1;
0226           }
0227           dd4hep::Solid solid = dd4hep::Polyhedra(sectors_, -alpha_, 2._pi, pgonZ, pgonRin, pgonRout);
0228           ns.addSolidNS(ns.prepend(name), solid);
0229           glog = dd4hep::Volume(solid.name(), solid, matter);
0230           ns.addVolumeNS(glog);
0231 #ifdef EDM_ML_DEBUG
0232           edm::LogVerbatim("HGCalGeom") << "DDHGCalSiliconModule: " << solid.name() << " polyhedra of " << sectors_
0233                                         << " sectors covering " << convertRadToDeg(-alpha_) << ":"
0234                                         << convertRadToDeg(-alpha_ + 2._pi) << " with " << pgonZ.size()
0235                                         << " sections and filled with " << matter.name();
0236           for (unsigned int k = 0; k < pgonZ.size(); ++k)
0237             edm::LogVerbatim("HGCalGeom") << "[" << k << "] z " << cms::convert2mm(pgonZ[k]) << " R "
0238                                           << cms::convert2mm(pgonRin[k]) << ":" << cms::convert2mm(pgonRout[k]);
0239 #endif
0240         } else {
0241           double rins =
0242               (sensitiveMode_ < 1) ? rinB : HGCalGeomTools::radius(zz + hthick - tol1, zFrontB_, rMinFront_, slopeB_);
0243           double routs =
0244               (sensitiveMode_ < 1) ? routF : HGCalGeomTools::radius(zz - hthick, zFrontT_, rMaxFront_, slopeT_);
0245           dd4hep::Solid solid = dd4hep::Tube(rins, routs, hthick, 0.0, 2._pi);
0246           ns.addSolidNS(ns.prepend(name), solid);
0247           glog = dd4hep::Volume(solid.name(), solid, matter);
0248           ns.addVolumeNS(glog);
0249 
0250 #ifdef EDM_ML_DEBUG
0251           edm::LogVerbatim("HGCalGeom") << "DDHGCalSiliconModule: " << solid.name() << " Tubs made of " << matter.name()
0252                                         << " of dimensions " << cms::convert2mm(rinB) << ":" << cms::convert2mm(rins)
0253                                         << ", " << cms::convert2mm(routF) << ":" << cms::convert2mm(routs) << ", "
0254                                         << cms::convert2mm(hthick) << ", 0.0, 360.0 and position " << glog.name()
0255                                         << " number " << copy << ":" << layerOrient_[copy - firstLayer_];
0256 #endif
0257           positionSensitive(ctxt, e, glog, (copy - firstLayer_));
0258         }
0259 
0260         dd4hep::Position r1(0, 0, zz);
0261         dd4hep::Rotation3D rot;
0262 #ifdef EDM_ML_DEBUG
0263         std::string rotName("Null");
0264 #endif
0265         if ((layerSense_[ly] > 0) && (layerOrient_[copy - firstLayer_] == HGCalTypes::WaferCenterR)) {
0266           rot = ns.rotation(rotstr_);
0267 #ifdef EDM_ML_DEBUG
0268           rotName = rotstr_;
0269 #endif
0270         }
0271         mother.placeVolume(glog, copy, dd4hep::Transform3D(rot, r1));
0272         int inc = ((layerSense_[ly] > 0) && (facingTypes_ > 1)) ? 2 : 1;
0273         copyNumber_[ii] = copy + inc;
0274 #ifdef EDM_ML_DEBUG
0275         edm::LogVerbatim("HGCalGeom") << "DDHGCalSiliconModule: " << glog.name() << " number " << copy
0276                                       << " positioned in " << mother.name() << " at (0,0," << cms::convert2mm(zz)
0277                                       << ") with " << rotName << " rotation";
0278 #endif
0279         zz += hthick;
0280       }  // End of loop over layers in a block
0281       zi = zo;
0282       laymin = laymax;
0283       // Make consistency check of all the partitions of the block
0284       if (std::abs(thickTot - layerThick_[i]) >= tol2) {
0285         if (thickTot > layerThick_[i]) {
0286           edm::LogError("HGCalGeom") << "Thickness of the partition " << cms::convert2mm(layerThick_[i])
0287                                      << " is smaller than " << cms::convert2mm(thickTot)
0288                                      << ": thickness of all its components **** ERROR ****";
0289         } else {
0290           edm::LogWarning("HGCalGeom") << "Thickness of the partition " << cms::convert2mm(layerThick_[i])
0291                                        << " does not match with " << cms::convert2mm(thickTot) << " of the components";
0292         }
0293       }
0294     }  // End of loop over blocks
0295 
0296 #ifdef EDM_ML_DEBUG
0297     edm::LogVerbatim("HGCalGeom") << "DDHGCalSiliconModule: " << copies_.size() << " different wafer copy numbers";
0298     int k(0);
0299     for (std::unordered_set<int>::const_iterator itr = copies_.begin(); itr != copies_.end(); ++itr, ++k) {
0300       edm::LogVerbatim("HGCalGeom") << "Copy [" << k << "] : " << (*itr);
0301     }
0302     copies_.clear();
0303     edm::LogVerbatim("HGCalGeom") << "<<== End of DDHGCalSiliconModule construction...";
0304 #endif
0305   }
0306 
0307   void positionSensitive(cms::DDParsingContext& ctxt, xml_h e, const dd4hep::Volume& glog, int layer) {
0308     cms::DDNamespace ns(ctxt, e, true);
0309     static const double sqrt3 = std::sqrt(3.0);
0310     int layercenter = layerOrient_[layer];
0311     int layertype = (layerOrient_[layer] == HGCalTypes::WaferCenterB) ? 1 : 0;
0312     int firstWafer = waferLayerStart_[layer];
0313     int lastWafer = ((layer + 1 < static_cast<int>(waferLayerStart_.size())) ? waferLayerStart_[layer + 1]
0314                                                                              : static_cast<int>(waferIndex_.size()));
0315     double r = 0.5 * (waferSize_ + waferSepar_);
0316     double R = 2.0 * r / sqrt3;
0317     double dy = 0.75 * R;
0318     const auto& xyoff = geomTools_.shiftXY(layercenter, (waferSize_ + waferSepar_));
0319 #ifdef EDM_ML_DEBUG
0320     int ium(0), ivm(0), kount(0);
0321     std::vector<int> ntype(3, 0);
0322     edm::LogVerbatim("HGCalGeom") << "DDHGCalSiliconModule: " << glog.name() << " r " << cms::convert2mm(r) << " R "
0323                                   << cms::convert2mm(R) << " dy " << cms::convert2mm(dy) << " Shift "
0324                                   << cms::convert2mm(xyoff.first) << ":" << cms::convert2mm(xyoff.second)
0325                                   << " WaferSize " << cms::convert2mm((waferSize_ + waferSepar_)) << " index "
0326                                   << firstWafer << ":" << (lastWafer - 1);
0327 #endif
0328     for (int k = firstWafer; k < lastWafer; ++k) {
0329       int u = HGCalWaferIndex::waferU(waferIndex_[k]);
0330       int v = HGCalWaferIndex::waferV(waferIndex_[k]);
0331 #ifdef EDM_ML_DEBUG
0332       int iu = std::abs(u);
0333       int iv = std::abs(v);
0334 #endif
0335       int nr = 2 * v;
0336       int nc = -2 * u + v;
0337       double xpos = xyoff.first + nc * r;
0338       double ypos = xyoff.second + nr * dy;
0339       int type = HGCalProperty::waferThick(waferProperty_[k]);
0340       int part = HGCalProperty::waferPartial(waferProperty_[k]);
0341       int orien = HGCalProperty::waferOrient(waferProperty_[k]);
0342       std::string wafer;
0343       int i(999);
0344       if (part == HGCalTypes::WaferFull) {
0345         i = layertype * waferTypes_ + type;
0346         wafer = waferFull_[i];
0347       } else {
0348         i = (part - 1) * waferTypes_ * facingTypes_ * orientationTypes_ + layertype * waferTypes_ * orientationTypes_ +
0349             type * orientationTypes_ + orien;
0350 #ifdef EDM_ML_DEBUG
0351         edm::LogVerbatim("HGCalGeom") << " layertype:type:part:orien:ind " << layertype << ":" << type << ":" << part
0352                                       << ":" << orien << ":" << i << ":" << waferPart_.size();
0353 #endif
0354         wafer = waferPart_[i];
0355       }
0356       int copy = HGCalTypes::packTypeUV(type, u, v);
0357 #ifdef EDM_ML_DEBUG
0358       edm::LogVerbatim("HGCalGeom") << " DDHGCalSiliconModule: Layer" << HGCalWaferIndex::waferLayer(waferIndex_[k])
0359                                     << " Wafer " << wafer << " number " << copy << " type:part:orien:ind " << type
0360                                     << ":" << part << ":" << orien << ":" << i << " layer:u:v:indx "
0361                                     << (layer + firstLayer_) << ":" << u << ":" << v;
0362       if (iu > ium)
0363         ium = iu;
0364       if (iv > ivm)
0365         ivm = iv;
0366       kount++;
0367       if (copies_.count(copy) == 0)
0368         copies_.insert(copy);
0369 #endif
0370       dd4hep::Position tran(xpos, ypos, 0.0);
0371       glog.placeVolume(ns.volume(wafer), copy, tran);
0372 #ifdef EDM_ML_DEBUG
0373       ++ntype[type];
0374       edm::LogVerbatim("HGCalGeom") << " DDHGCalSiliconModule: " << wafer << " number " << copy << " type " << layertype
0375                                     << ":" << type << " positioned in " << glog.name() << " at ("
0376                                     << cms::convert2mm(xpos) << "," << cms::convert2mm(ypos) << ",0) with no rotation";
0377 #endif
0378     }
0379 
0380 #ifdef EDM_ML_DEBUG
0381     edm::LogVerbatim("HGCalGeom") << "DDHGCalSiliconModule: Maximum # of u " << ium << " # of v " << ivm << " and "
0382                                   << kount << " wafers (" << ntype[0] << ":" << ntype[1] << ":" << ntype[2] << ") for "
0383                                   << glog.name();
0384 #endif
0385   }
0386 
0387   //Required data members to cache the values from XML file
0388   HGCalGeomTools geomTools_;
0389 
0390   int waferTypes_;                      // Number of wafer types
0391   int facingTypes_;                     // Types of facings of modules toward IP
0392   int partialTypes_;                    // Number of partial wafer types
0393   int orientationTypes_;                // Number of partial wafer orienations
0394   int firstLayer_;                      // Copy # of the first sensitive layer
0395   int absorbMode_;                      // Absorber mode
0396   int sensitiveMode_;                   // Sensitive mode
0397   double zMinBlock_;                    // Starting z-value of the block
0398   double waferSize_;                    // Width of the wafer
0399   double waferSepar_;                   // Sensor separation
0400   int sectors_;                         // Sectors
0401   std::string rotstr_;                  // Rotation matrix (if needed)
0402   std::vector<std::string> waferFull_;  // Names of full wafer modules
0403   std::vector<std::string> waferPart_;  // Names of partial wafer modules
0404   std::vector<std::string> materials_;  // names of materials
0405   std::vector<std::string> names_;      // Names of volumes
0406   std::vector<double> thick_;           // Thickness of the material
0407   std::vector<int> copyNumber_;         // Initial copy numbers
0408   std::vector<int> layers_;             // Number of layers in a section
0409   std::vector<double> layerThick_;      // Thickness of each section
0410   std::vector<int> layerType_;          // Type of the layer
0411   std::vector<int> layerSense_;         // Content of a layer (sensitive?)
0412   std::vector<double> slopeB_;          // Slope at the lower R
0413   std::vector<double> zFrontB_;         // Starting Z values for the slopes
0414   std::vector<double> rMinFront_;       // Corresponding rMin's
0415   std::vector<double> slopeT_;          // Slopes at the larger R
0416   std::vector<double> zFrontT_;         // Starting Z values for the slopes
0417   std::vector<double> rMaxFront_;       // Corresponding rMax's
0418   std::vector<int> layerOrient_;        // Layer orientation (Centering, rotations..)
0419   std::vector<int> waferIndex_;         // Wafer index for the types
0420   std::vector<int> waferProperty_;      // Wafer property
0421   std::vector<int> waferLayerStart_;    // Index of wafers in each layer
0422   std::unordered_set<int> copies_;      // List of copy #'s
0423   double alpha_, cosAlpha_;
0424 };
0425 
0426 static long algorithm(dd4hep::Detector& /* description */, cms::DDParsingContext& ctxt, xml_h e) {
0427   HGCalSiliconModule eealgo(ctxt, e);
0428   return cms::s_executed;
0429 }
0430 
0431 DECLARE_DDCMS_DETELEMENT(DDCMS_hgcal_DDHGCalSiliconModule, algorithm)