Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:05:27

0001 #include <cstdlib>
0002 #include <iostream>
0003 #include <iomanip>
0004 #include <string>
0005 #include <vector>
0006 
0007 #include "DetectorDescription/Core/interface/DDSolidShapes.h"
0008 
0009 std::ostream& operator<<(std::ostream& os, const DDSolidShape s) {
0010   return os << "\tDDSolidShape index: " << static_cast<int>(s) << ", name: " << DDSolidShapesName::name(s);
0011 }
0012 
0013 int main(int /*argc*/, char** /*argv[]*/) {
0014   std::cout << "" << std::endl;
0015   std::vector<std::string> ddShapeTypeNames;
0016   ddShapeTypeNames.emplace_back("dd_not_init");
0017   ddShapeTypeNames.emplace_back("ddbox");
0018   ddShapeTypeNames.emplace_back("ddtubs");
0019   ddShapeTypeNames.emplace_back("ddtrap");
0020   ddShapeTypeNames.emplace_back("ddcons");
0021   ddShapeTypeNames.emplace_back("ddpolycone_rz");
0022   ddShapeTypeNames.emplace_back("ddpolyhedra_rz");
0023   ddShapeTypeNames.emplace_back("ddpolycone_rrz");
0024   ddShapeTypeNames.emplace_back("ddpolyhedra_rrz");
0025   ddShapeTypeNames.emplace_back("ddtorus");
0026   ddShapeTypeNames.emplace_back("ddunion");
0027   ddShapeTypeNames.emplace_back("ddsubtraction");
0028   ddShapeTypeNames.emplace_back("ddintersection");
0029   ddShapeTypeNames.emplace_back("ddshapeless");
0030   ddShapeTypeNames.emplace_back("ddpseudotrap");
0031   ddShapeTypeNames.emplace_back("ddtrunctubs");
0032   ddShapeTypeNames.emplace_back("ddsphere");
0033   ddShapeTypeNames.emplace_back("ddellipticaltube");
0034   ddShapeTypeNames.emplace_back("ddcuttubs");
0035   ddShapeTypeNames.emplace_back("ddextrudedpolygon");
0036 
0037   DDSolidShapesName ssn;
0038   DDSolidShape ish(DDSolidShape::dd_not_init);
0039   int index = static_cast<int>(ish);
0040   std::cout << std::left << std::setfill(' ');
0041   for (; ish <= DDSolidShape::ddextrudedpolygon; index = static_cast<int>(ish) + 1, ish = DDSolidShape(index)) {
0042     switch (index) {
0043       case 0:
0044         std::cout << index << ":" << std::setw(4) << "\t" << ddShapeTypeNames[index] << std::setw(9) << "\t"
0045                   << ssn.name(ish) << std::setw(1) << " " << DDSolidShape::dd_not_init;
0046         break;
0047       case 1:
0048         std::cout << index << ":" << std::setw(4) << "\t" << ddShapeTypeNames[index] << std::setw(9) << "\t"
0049                   << ssn.name(ish) << std::setw(9) << "\t" << DDSolidShape::ddbox;
0050         break;
0051       case 2:
0052         std::cout << index << ":" << std::setw(4) << "\t" << ddShapeTypeNames[index] << std::setw(9) << "\t"
0053                   << ssn.name(ish) << std::setw(3) << "\t" << DDSolidShape::ddtubs;
0054         break;
0055       case 3:
0056         std::cout << index << ":" << std::setw(4) << "\t" << ddShapeTypeNames[index] << std::setw(9) << "\t"
0057                   << ssn.name(ish) << std::setw(3) << "\t" << DDSolidShape::ddtrap;
0058         break;
0059       case 4:
0060         std::cout << index << ":" << std::setw(4) << "\t" << ddShapeTypeNames[index] << std::setw(9) << "\t"
0061                   << ssn.name(ish) << std::setw(3) << "\t" << DDSolidShape::ddcons;
0062         break;
0063       case 5:
0064         std::cout << index << ":" << std::setw(4) << "\t" << ddShapeTypeNames[index] << std::setw(1) << "\t"
0065                   << ssn.name(ish) << std::setw(3) << "\t" << DDSolidShape::ddpolycone_rz;
0066         break;
0067       case 6:
0068         std::cout << index << ":" << std::setw(4) << "\t" << ddShapeTypeNames[index] << std::setw(1) << "\t"
0069                   << ssn.name(ish) << std::setw(3) << "\t" << DDSolidShape::ddpolyhedra_rz;
0070         break;
0071       case 7:
0072         std::cout << index << ":" << std::setw(4) << "\t" << ddShapeTypeNames[index] << std::setw(1) << "\t"
0073                   << ssn.name(ish) << std::setw(3) << "\t" << DDSolidShape::ddpolycone_rrz;
0074         break;
0075       case 8:
0076         std::cout << index << ":" << std::setw(4) << "\t" << ddShapeTypeNames[index] << std::setw(1) << "\t"
0077                   << ssn.name(ish) << std::setw(3) << "\t" << DDSolidShape::ddpolyhedra_rrz;
0078         break;
0079       case 9:
0080         std::cout << index << ":" << std::setw(4) << "\t" << ddShapeTypeNames[index] << std::setw(9) << "\t"
0081                   << ssn.name(ish) << std::setw(9) << "\t" << DDSolidShape::ddtorus;
0082         break;
0083       case 10:
0084         std::cout << index << ":" << std::setw(4) << "\t" << ddShapeTypeNames[index] << std::setw(9) << "\t"
0085                   << ssn.name(ish) << std::setw(3) << "\t" << DDSolidShape::ddunion;
0086         break;
0087       case 11:
0088         std::cout << index << ":" << std::setw(4) << "\t" << ddShapeTypeNames[index] << std::setw(1) << "\t"
0089                   << ssn.name(ish) << std::setw(1) << " " << DDSolidShape::ddsubtraction;
0090         break;
0091       case 12:
0092         std::cout << index << ":" << std::setw(4) << "\t" << ddShapeTypeNames[index] << std::setw(1) << "\t"
0093                   << ssn.name(ish) << std::setw(1) << " " << DDSolidShape::ddintersection;
0094         break;
0095       case 13:
0096         std::cout << index << ":" << std::setw(4) << "\t" << ddShapeTypeNames[index] << std::setw(9) << "\t"
0097                   << ssn.name(ish) << std::setw(3) << "\t" << DDSolidShape::ddshapeless;
0098         break;
0099       case 14:
0100         std::cout << index << ":" << std::setw(4) << "\t" << ddShapeTypeNames[index] << std::setw(9) << "\t"
0101                   << ssn.name(ish) << std::setw(3) << "\t" << DDSolidShape::ddpseudotrap;
0102         break;
0103       case 15:
0104         std::cout << index << ":" << std::setw(4) << "\t" << ddShapeTypeNames[index] << std::setw(9) << "\t"
0105                   << ssn.name(ish) << std::setw(1) << " " << DDSolidShape::ddtrunctubs;
0106         break;
0107       case 16:
0108         std::cout << index << ":" << std::setw(4) << "\t" << ddShapeTypeNames[index] << std::setw(9) << "\t"
0109                   << ssn.name(ish) << std::setw(3) << "\t" << DDSolidShape::ddsphere;
0110         break;
0111       case 17:
0112         std::cout << index << ":" << std::setw(4) << "\t" << ddShapeTypeNames[index] << std::setw(1) << "\t"
0113                   << ssn.name(ish) << std::setw(3) << "\t" << DDSolidShape::ddellipticaltube;
0114         break;
0115       case 18:
0116         std::cout << index << ":" << std::setw(4) << "\t" << ddShapeTypeNames[index] << std::setw(9) << "\t"
0117                   << ssn.name(ish) << std::setw(9) << "\t" << DDSolidShape::ddcuttubs;
0118         break;
0119       case 19:
0120         std::cout << index << ":" << std::setw(4) << "\t" << ddShapeTypeNames[index] << std::setw(1) << "\t"
0121                   << ssn.name(ish) << std::setw(3) << "\t" << DDSolidShape::ddextrudedpolygon;
0122         break;
0123       default:
0124         std::cout << "ERROR! No such shape!";
0125         break;
0126     }
0127     std::cout << std::endl;
0128   }
0129   return EXIT_SUCCESS;
0130 }