@@ -39,8 +39,8 @@ struct HGCalPassive {
3939 int parts = args.value <int >(" Parts" ); // number of parts in units of 30 degree
4040 if (parts < 0 )
4141 parts = 1 ;
42- double phi0 = args.value <double >(" PhiStart" ); // Start phi of the first cassette
43- double dphi = (2 ._pi ) / tagSector.size (); // delta phi of the cassette
42+ double phi0 = args.value <double >(" PhiStart" ); // Start phi of the first cassette
43+ double dphi = (2 ._pi ) / tagSector.size (); // delta phi of the cassette
4444#ifdef EDM_ML_DEBUG
4545 edm::LogVerbatim (" HGCalGeom" ) << " DDHGCalPassive: " << tagLayer.size () << " Modules with base name " << parentName
4646 << " made of " << material << " T " << thick << " Sectors " << tagSector.size ()
@@ -105,31 +105,35 @@ struct HGCalPassive {
105105 for (unsigned int k = 0 ; k < tagSector.size (); ++k) {
106106 std::string parentName = args.parentName () + tagLayer[j] + tagSector[k];
107107 double phi1 = phi0 + k * dphi;
108- double dphi0 = dphi / parts;
109- // First the mother
110- int nsec = 2 * parts + 2 ;
111- std::vector<double > xM (nsec, 0 ), yM (nsec, 0 );
112- for (int n = 0 ; n <= parts; ++n) {
113- double phi0 = phi1 + n * dphi0;
114- if (n == 0 ) {
115- xM[0 ] = rinB * cos (phi0); yM[0 ] = rinB * sin (phi0);
116- } else {
117- xM[nsec - n] = rinB * cos (phi0); yM[nsec - n] = rinB * sin (phi0);
118- }
119- xM[n + 1 ] = routF * cos (phi0); yM[n + 1 ] = routF * sin (phi0);
120- }
108+ double dphi0 = dphi / parts;
109+ // First the mother
110+ int nsec = 2 * parts + 2 ;
111+ std::vector<double > xM (nsec, 0 ), yM (nsec, 0 );
112+ for (int n = 0 ; n <= parts; ++n) {
113+ double phi0 = phi1 + n * dphi0;
114+ if (n == 0 ) {
115+ xM[0 ] = rinB * cos (phi0);
116+ yM[0 ] = rinB * sin (phi0);
117+ } else {
118+ xM[nsec - n] = rinB * cos (phi0);
119+ yM[nsec - n] = rinB * sin (phi0);
120+ }
121+ xM[n + 1 ] = routF * cos (phi0);
122+ yM[n + 1 ] = routF * sin (phi0);
123+ }
121124 std::vector<double > zw = {-0.5 * thick, 0.5 * thick};
122125 std::vector<double > zx (2 , 0 ), zy (2 , 0 ), scale (2 , 1.0 );
123126 dd4hep::Solid solid = dd4hep::ExtrudedPolygon (xM, yM, zw, zx, zy, scale);
124127 ns.addSolidNS (ns.prepend (parentName), solid);
125128 dd4hep::Material matter = ns.material (material);
126129 dd4hep::Volume glogM = dd4hep::Volume (solid.name (), solid, matter);
127130#ifdef EDM_ML_DEBUG
128- double phi2 = phi1 + dphi;
131+ double phi2 = phi1 + dphi;
129132 edm::LogVerbatim (" HGCalGeom" ) << " DDHGCalPassive: " << solid.name () << " extruded polygon made of "
130133 << matter.name () << " z|x|y|s (0) " << zw[0 ] << " :" << zx[0 ] << " :" << zy[0 ]
131134 << " :" << scale[0 ] << " z|x|y|s (1) " << zw[1 ] << " :" << zx[1 ] << " :" << zy[1 ]
132- << " :" << scale[1 ] << " and " << xM.size () << " edges with " << parts << " parts between " << convertRadToDeg (phi1) << " and " << convertRadToDeg (phi2);
135+ << " :" << scale[1 ] << " and " << xM.size () << " edges with " << parts
136+ << " parts between " << convertRadToDeg (phi1) << " and " << convertRadToDeg (phi2);
133137 for (unsigned int kk = 0 ; kk < xM.size (); ++kk)
134138 edm::LogVerbatim (" HGCalGeom" ) << " [" << kk << " ] " << xM[kk] << " :" << yM[kk];
135139#endif
0 commit comments