199 const auto& wafers =
args.value<std::vector<std::string> >(
"WaferName");
200 const auto& covers =
args.value<std::vector<std::string> >(
"CoverName");
203 edm::LogVerbatim(
"HGCalGeom") <<
"DDHGCalTBModuleX: Material " << genMat <<
" with " << wafers.size() <<
" wafers";
205 for (
auto wafer : wafers) {
209 edm::LogVerbatim(
"HGCalGeom") <<
"DDHGCalTBModuleX: " << covers.size() <<
" covers";
211 for (
auto cover : covers) {
216 const auto& materials =
args.value<std::vector<std::string> >(
"MaterialNames");
217 const auto&
names =
args.value<std::vector<std::string> >(
"VolumeNames");
218 const auto& layerThick =
args.value<std::vector<double> >(
"Thickness");
219 std::vector<int> copyNumber;
220 for (
unsigned int k = 0;
k < layerThick.size(); ++
k) {
221 copyNumber.emplace_back(1);
224 edm::LogVerbatim(
"HGCalGeom") <<
"DDHGCalTBModuleX: " << materials.size() <<
" types of volumes";
225 for (
unsigned int i = 0;
i < names.size(); ++
i)
226 edm::LogVerbatim(
"HGCalGeom") <<
"Volume [" <<
i <<
"] " << names[
i] <<
" of thickness " 228 <<
" first copy number " << copyNumber[
i];
230 const auto& blockThick =
args.value<std::vector<double> >(
"BlockThick");
231 const auto& inOut =
args.value<
int>(
"InOut");
232 const auto& layerFrontIn =
args.value<std::vector<int> >(
"LayerFrontIn");
233 const auto& layerBackIn =
args.value<std::vector<int> >(
"LayerBackIn");
234 std::vector<int> layerFrontOut;
235 std::vector<int> layerBackOut;
237 layerFrontOut =
args.value<std::vector<int> >(
"LayerFrontOut");
238 layerBackOut =
args.value<std::vector<int> >(
"LayerBackOut");
241 edm::LogVerbatim(
"HGCalGeom") <<
"DDHGCalTBModuleX: " << blockThick.size() <<
" blocks with in/out " << inOut;
242 for (
unsigned int i = 0;
i < blockThick.size(); ++
i) {
245 <<
" with inner layers " << layerFrontIn[
i] <<
":" << layerBackIn[
i]
246 <<
" and outer layers " << layerFrontOut[
i] <<
":" << layerBackOut[
i];
249 <<
" with inner layers " << layerFrontIn[
i] <<
":" << layerBackIn[
i];
252 const auto& layerType =
args.value<std::vector<int> >(
"LayerType");
253 const auto& layerSense =
args.value<std::vector<int> >(
"LayerSense");
254 const auto& maxModule =
args.value<std::vector<int> >(
"MaxModule");
256 edm::LogVerbatim(
"HGCalGeom") <<
"DDHGCalTBModuleX: " << layerType.size() <<
" layers";
257 for (
unsigned int i = 0;
i < layerType.size(); ++
i)
258 edm::LogVerbatim(
"HGCalGeom") <<
"Layer [" <<
i <<
"] with material type " << layerType[
i] <<
" sensitive class " 259 << layerSense[
i] <<
" and " << maxModule[
i] <<
" maximum row/columns";
261 const auto& zMinBlock =
args.value<
double>(
"zMinBlock");
262 const auto& rMaxFine =
args.value<
double>(
"rMaxFine");
263 const auto& waferW =
args.value<
double>(
"waferW");
264 const auto& waferGap =
args.value<
double>(
"waferGap");
265 const auto& absorbW =
args.value<
double>(
"absorberW");
266 const auto& absorbH =
args.value<
double>(
"absorberH");
267 const auto&
rMax =
args.value<
double>(
"rMax");
268 const auto& rMaxB =
args.value<
double>(
"rMaxB");
269 double waferTot = waferW + waferGap;
274 <<
" gap among wafers " <<
convertCmToMm(waferGap) <<
" absorber width " 277 edm::LogVerbatim(
"HGCalGeom") <<
"DDHGCalTBModuleX: NameSpace " << ns.name() <<
" Parent Name " <<
idName;
279 std::unordered_set<int> copies;
283 double zi(zMinBlock);
284 for (
unsigned int i = 0;
i < blockThick.size();
i++) {
285 double zo = zi + blockThick[
i];
293 dd4hep::Solid solid = dd4hep::Tube(0, rMaxB, 0.5 * blockThick[
i], 0.0, 2._pi);
294 ns.addSolidNS(ns.prepend(name), solid);
296 double zz = zi + 0.5 * blockThick[
i];
297 dd4hep::Position
r1(0, 0, zz);
298 parent.placeVolume(glog,
i,
r1);
300 edm::LogVerbatim(
"HGCalGeom") <<
"DDHGCalTBModuleX: " << glog.name() <<
" number " <<
i <<
" positioned in " 301 <<
args.parentName() <<
" at " <<
r1 <<
" with no rotation";
302 edm::LogVerbatim(
"HGCalGeom") <<
"DDHGCalTBModuleX: \t\tInside Block " <<
i <<
" Layers " << layerFrontIn[
i] <<
":" 304 <<
" thickness " <<
convertCmToMm(blockThick[
i]) <<
" ignore Center 0";
324 -0.5 * blockThick[i],
330 edm::LogVerbatim(
"HGCalGeom") <<
"DDHGCalTBModuleX: \t\tInside Block " <<
i <<
" Layers " << layerFrontOut[
i]
331 <<
":" << layerBackOut[
i] <<
" zFront " <<
convertCmToMm(-0.5 * blockThick[
i])
332 <<
" thickness " <<
convertCmToMm(blockThick[
i]) <<
" ignore Center 1";
352 -0.5 * blockThick[i],
361 <<
convertCmToMm(zi) <<
" with " << copies.size() <<
" different wafer copy numbers";
const std::string names[nVars_]
void constructLayers(const cms::DDNamespace &ns, const std::vector< std::string > &wafers, const std::vector< std::string > &covers, const std::vector< int > &layerType, const std::vector< int > &layerSense, const std::vector< int > &maxModule, const std::vector< std::string > &names, const std::vector< std::string > &materials, std::vector< int > ©Number, const std::vector< double > &layerThick, const double &absorbW, const double &absorbH, const double &waferTot, const double &rMax, const double &rMaxFine, std::unordered_set< int > &copies, int firstLayer, int lastLayer, double zFront, double totalWidth, bool ignoreCenter, dd4hep::Volume &module)
constexpr NumType convertCmToMm(NumType centimeters)
std::pair< std::string, std::string > DDSplit(const std::string &n)
split into (name,namespace), separator = ':'