Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 13:08:12

0001 #include "Geometry/HcalTestBeamData/plugins/DDEcalPreshowerAlgoTB.h"
0002 
0003 #include <cmath>
0004 #include <algorithm>
0005 #include <ostream>
0006 
0007 #include "FWCore/MessageLogger/interface/MessageLogger.h"
0008 #include "DetectorDescription/Core/interface/DDTypes.h"
0009 #include "DetectorDescription/Core/interface/DDutils.h"
0010 #include "DetectorDescription/Core/interface/DDLogicalPart.h"
0011 #include "DetectorDescription/Core/interface/DDSolid.h"
0012 #include "DetectorDescription/Core/interface/DDMaterial.h"
0013 #include "DetectorDescription/Core/interface/DDCurrentNamespace.h"
0014 #include "DetectorDescription/Core/interface/DDSplit.h"
0015 #include "DetectorDescription/Core/interface/DDVector.h"
0016 #include "CLHEP/Units/GlobalPhysicalConstants.h"
0017 #include "CLHEP/Units/GlobalSystemOfUnits.h"
0018 
0019 using namespace CLHEP;
0020 
0021 DDEcalPreshowerAlgoTB::DDEcalPreshowerAlgoTB() : DDAlgorithm() {
0022   LogDebug("HCalGeom") << "DDEcalPreshowerAlgoTB info: Creating an instance";
0023 }
0024 
0025 void DDEcalPreshowerAlgoTB::initialize(const DDNumericArguments& nArgs,
0026                                        const DDVectorArguments& vArgs,
0027                                        const DDMapArguments& mArgs,
0028                                        const DDStringArguments& sArgs,
0029                                        const DDStringVectorArguments& vsArgs) {
0030   LogDebug("HCalGeom") << "DDEcalPreshowerAlgoTB info: Initialize";
0031   quadMin_ = vArgs["IQUAD_MIN"];
0032   LogDebug("HCalGeom") << "DDEcalPreshowerAlgoTB IQUAD_MIN";
0033   quadMax_ = vArgs["IQUAD_MAX"];
0034   LogDebug("HCalGeom") << "DDEcalPreshowerAlgoTB IQUAD_MAX";
0035   thickLayers_ = vArgs["Layers"];
0036   LogDebug("HCalGeom") << "DDEcalPreshowerAlgoTB Layers";
0037   thickness_ = double(nArgs["PRESH_Z_TOTAL"]);
0038   LogDebug("HCalGeom") << "DDEcalPreshowerAlgoTB PRESH_Z_TOTAL";
0039   materials_ = vsArgs["LayMat"];
0040   LogDebug("HCalGeom") << "DDEcalPreshowerAlgoTB material";
0041   rmaxVec = vArgs["R_MAX"];  // inner radii
0042   LogDebug("HCalGeom") << "DDEcalPreshowerAlgoTB R_MAX";
0043   rminVec = vArgs["R_MIN"];  // outer radii
0044   LogDebug("HCalGeom") << "DDEcalPreshowerAlgoTB R_MIN";
0045   waf_intra_col_sep = double(nArgs["waf_intra_col_sep"]);
0046   LogDebug("HCalGeom") << "DDEcalPreshowerAlgoTB waf_intra_col_sep";
0047   waf_inter_col_sep = double(nArgs["waf_inter_col_sep"]);
0048   LogDebug("HCalGeom") << "DDEcalPreshowerAlgoTB waf_intra_col_sep = " << waf_inter_col_sep;
0049   waf_active = double(nArgs["waf_active"]);
0050   LogDebug("HCalGeom") << "DDEcalPreshowerAlgoTB waf_active = " << waf_active;
0051   wedge_length = double(nArgs["wedge_length"]);
0052   LogDebug("HCalGeom") << "DDEcalPreshowerAlgoTB wedge_length = " << wedge_length;
0053   wedge_offset = double(nArgs["wedge_offset"]);
0054   zwedge_ceramic_diff = double(nArgs["zwedge_ceramic_diff"]);
0055   ywedge_ceramic_diff = double(nArgs["ywedge_ceramic_diff"]);
0056   micromodulesx = vArgs["MicromodulesX"];  // micromodules in X plane
0057   micromodulesy = vArgs["MicromodulesY"];  // micromodules in Y plane
0058   absorbx = double(nArgs["absorbx"]);
0059   absorby = double(nArgs["absorby"]);
0060   trabsorbx = double(nArgs["trabsorbx"]);
0061   trabsorby = double(nArgs["trabsorby"]);
0062   ScndplaneXshift = double(nArgs["2ndPlaneXshift"]);
0063   ScndplaneYshift = double(nArgs["2ndPlaneYshift"]);
0064   TotSFXshift = double(nArgs["SF07vsSF_Xshift"]);
0065   TotSFYshift = double(nArgs["SF07vsSF_Yshift"]);
0066   dummyMaterial = sArgs["DummyMaterial"];
0067   LogDebug("HCalGeom") << "DDEcalPreshowerAlgoTB Dummy Material = " << dummyMaterial;
0068 
0069   idNameSpace = DDCurrentNamespace::ns();
0070 
0071   LogDebug("HCalGeom") << "DDEcalPreshowerAlgoTB info: end initialize";
0072 }
0073 
0074 void DDEcalPreshowerAlgoTB::execute(DDCompactView& cpv) {
0075   LogDebug("HCalGeom") << "******** DDEcalPreshowerAlgoTB execute!";
0076 
0077   // creates all the tube-like layers of the preshower
0078   doLayers(cpv);
0079   // places the wedges and silicon strip detectors in their x and y layer
0080   doWedges(cpv);
0081   // places the slicon strips in active silicon wafers
0082   doSens(cpv);
0083 }
0084 
0085 void DDEcalPreshowerAlgoTB::doLayers(DDCompactView& cpv) {
0086   //double sum_z=0;
0087   double zpos = -thickness_ / 2.;
0088   for (size_t i = 0; i < rminVec.size(); ++i) {
0089     int I = int(i) + 1;  // FOTRAN I (offset +1)
0090 
0091     double zHalf(0);
0092 
0093     // create the name
0094     std::ostringstream name;
0095     name << "SF" << int((50 + I) / 10) << I - int(I / 10) * 10;
0096     DDName ddname(name.str(), idNameSpace);  // namespace:name
0097 
0098     // tube dimensions
0099     //     rIn = rmaxVec[i];
0100     //     rOut = rminVec[i];
0101     zHalf = thickLayers_[i] / 2.;
0102 
0103     // position the logical part w.r.t. the parent volume
0104     zpos += zHalf;
0105     //sum_z += thickLayers_[i];
0106     if (I == 7 || I == 15) {  // skip layers with detectors
0107       zpos += zHalf;
0108       continue;
0109     }
0110     if (I == 2) {
0111       zfoam1_ = zpos;
0112     }
0113     if (I == 6) {
0114       zlead1_ = zpos + zHalf;
0115     }
0116     if (I == 14) {
0117       zlead2_ = zpos + zHalf;
0118     }
0119 
0120     if (getMaterial(i) != dummyMaterial) {
0121       // create a logical part representing a single layer in the preshower
0122       //DDSolid solid = DDSolidFactory::tubs(ddname,zHalf,rIn,rOut,0.,360.*deg);
0123 
0124       DDSolid solid = DDSolidFactory::box(ddname, absorbx, absorby, zHalf);
0125 
0126       DDName matname(getMaterial(i), "materials");
0127       DDMaterial material(matname);
0128       DDLogicalPart layer = DDLogicalPart(ddname, material, solid);
0129 
0130       DDTranslation tran = DDTranslation(trabsorbx + TotSFXshift, trabsorby + TotSFYshift, zpos);
0131       cpv.position(layer, parent(), 1, tran, DDRotation());
0132       LogDebug("HCalGeom") << "DDEcalPreshowerAlgoTB debug : Child " << layer << " Copy 1 in " << parent().name()
0133                            << " with translation " << tran << " and rotation " << DDRotation();
0134     }
0135     zpos += zHalf;
0136   }
0137 }
0138 
0139 void DDEcalPreshowerAlgoTB::doWedges(DDCompactView& cpv) {
0140   LogDebug("HCalGeom") << "DDEcalPreshowerAlgoTB::debug : doWedges()";
0141   int nx(0), ny(0), icopy(0), icopyt(0);
0142   double xpos(0), ypos(0), zpos(0);  // zposY(0);
0143   int sz = int(quadMax_.size());
0144 
0145   DDTranslation tran;
0146   DDName name1("SWED", idNameSpace);
0147   DDName name2("SFBX", idNameSpace);
0148   DDRotation rot1("rotations:RM1299");
0149   DDRotation rot2("rotations:RM1298");
0150   // Do Plane X
0151   for (int I = 1; I <= sz; ++I) {
0152     for (int J = int(quadMax_[I - 1]); J >= int(quadMin_[I - 1]); --J) {
0153       //LogDebug("HCalGeom") <<"DDEcalPreshowerAlgoTB::I=" << I << " J="  << J;
0154       nx += 1;
0155       icopy += 1;
0156       go = 0;
0157       for (double m : micromodulesx)
0158         if (m == icopy) {
0159           go = 1;
0160           icopyt += 1;
0161         }
0162       xpos = -1. * (J * waf_intra_col_sep + (int(J / 2)) * waf_inter_col_sep - waf_intra_col_sep / 2.);
0163       ypos = (sz - int(I)) * waf_active + wedge_length / 2. + 0.05 * cm;
0164       xpos = xpos + TotSFXshift;
0165       ypos = ypos + TotSFYshift;
0166       zpos = zlead1_ + wedge_offset;
0167       // place the wedge
0168       if (go == 1) {
0169         tran = DDTranslation(xpos, ypos, zpos);
0170         cpv.position(DDLogicalPart(name1), parent(), icopyt, tran, rot1);
0171         LogDebug("HCalGeom") << "DDEcalPreshowerAlgoTB::debug : Child " << name1 << " copy = " << icopy << " ("
0172                              << icopyt << ") in Mother " << parent().name() << " translation " << tran << " rotation "
0173                              << rot1;
0174       }
0175       zpos = zlead1_ + zwedge_ceramic_diff;
0176       ypos = ypos + ywedge_ceramic_diff;
0177       if (go == 1) {
0178         tran = DDTranslation(xpos, ypos, zpos);
0179         cpv.position(DDLogicalPart(name2), parent(), icopyt, tran, rot2);
0180         LogDebug("HCalGeom") << "DDEcalPreshowerAlgoTB::debug : Child " << name2 << " copy = " << icopy << " ("
0181                              << icopyt << ") in Mother " << parent().name() << " translation " << tran << " rotation "
0182                              << rot2;
0183       }
0184     }
0185 
0186     for (int J = int(quadMin_[I - 1]); J <= int(quadMax_[I - 1]); ++J) {
0187       nx += 1;
0188       icopy += 1;
0189       go = 0;
0190       for (double m : micromodulesx)
0191         if (m == icopy) {
0192           go = 1;
0193           icopyt += 1;
0194         }
0195       xpos = 1. * (J * waf_intra_col_sep + (int(J / 2)) * waf_inter_col_sep - waf_intra_col_sep / 2.);
0196       ypos = (sz - int(I)) * waf_active + wedge_length / 2. + 0.05 * cm;
0197       xpos = xpos + TotSFXshift;
0198       ypos = ypos + TotSFYshift;
0199       zpos = zlead1_ + wedge_offset;
0200       if (go == 1) {
0201         tran = DDTranslation(xpos, ypos, zpos);
0202         cpv.position(DDLogicalPart(name1), parent(), icopyt, tran, rot1);
0203         LogDebug("HCalGeom") << "DDEcalPreshowerAlgoTB::debug : Child " << name1 << " copy = " << icopy << " ("
0204                              << icopyt << ") in Mother " << parent().name() << " translation " << tran << " rotation "
0205                              << rot1;
0206       }
0207       zpos = zlead1_ + zwedge_ceramic_diff;
0208       ypos = ypos + ywedge_ceramic_diff;
0209       if (go == 1) {
0210         tran = DDTranslation(xpos, ypos, zpos);
0211         cpv.position(DDLogicalPart(name2), parent(), icopyt, tran, rot2);
0212         LogDebug("HCalGeom") << "DDEcalPreshowerAlgoTB::debug : Child " << name2 << " copy = " << icopy << " ("
0213                              << icopyt << ") in Mother " << parent().name() << " translation " << tran << " rotation "
0214                              << rot2;
0215       }
0216     }
0217   }
0218 
0219   // mirror image system
0220   rot1 = DDRotation("rotations:RM1303");
0221   rot2 = DDRotation("rotations:RM1302");
0222   for (int I = sz; I >= 1; --I) {
0223     for (int J = int(quadMax_[I - 1]); J >= int(quadMin_[I - 1]); --J) {
0224       nx += 1;
0225       icopy += 1;
0226       go = 0;
0227       for (double m : micromodulesx)
0228         if (m == icopy) {
0229           go = 1;
0230           icopyt += 1;
0231         }
0232       //LogDebug("HCalGeom") <<"DDEcalPreshowerAlgoTB::I=" << I << " J="  << J;
0233       xpos = -1. * (J * waf_intra_col_sep + (int(J / 2)) * waf_inter_col_sep - waf_intra_col_sep / 2.);
0234       ypos = -1. * (sz - int(I)) * waf_active - wedge_length / 2. - 0.05 * cm;
0235       xpos = xpos + TotSFXshift;
0236       ypos = ypos + TotSFYshift;
0237       zpos = zlead1_ + wedge_offset;
0238       if (go == 1) {
0239         tran = DDTranslation(xpos, ypos, zpos);
0240         cpv.position(DDLogicalPart(name1), parent(), icopyt, tran, rot1);
0241         LogDebug("HCalGeom") << "DDEcalPreshowerAlgoTB::debug : Child " << name1 << " copy = " << icopy << " ("
0242                              << icopyt << ") in Mother " << parent().name() << " translation " << tran << " rotation "
0243                              << rot1;
0244       }
0245       zpos = zlead1_ + zwedge_ceramic_diff;
0246       ypos = ypos - ywedge_ceramic_diff;
0247       if (go == 1) {
0248         tran = DDTranslation(xpos, ypos, zpos);
0249         cpv.position(DDLogicalPart(name2), parent(), icopyt, tran, rot2);
0250         LogDebug("HCalGeom") << "DDEcalPreshowerAlgoTB::debug : Child " << name2 << " copy = " << icopy << " ("
0251                              << icopyt << ") in Mother " << parent().name() << " translation " << tran << " rotation "
0252                              << rot2;
0253       }
0254     }
0255 
0256     for (int J = int(quadMin_[I - 1]); J <= int(quadMax_[I - 1]); ++J) {
0257       nx += 1;
0258       icopy += 1;
0259       go = 0;
0260       for (double m : micromodulesx)
0261         if (m == icopy) {
0262           go = 1;
0263           icopyt += 1;
0264         }
0265       xpos = 1. * (J * waf_intra_col_sep + (int(J / 2)) * waf_inter_col_sep - waf_intra_col_sep / 2.);
0266       ypos = -1. * (sz - int(I)) * waf_active - wedge_length / 2. - 0.05 * cm;
0267       xpos = xpos + TotSFXshift;
0268       ypos = ypos + TotSFYshift;
0269       zpos = zlead1_ + wedge_offset;
0270       if (go == 1) {
0271         tran = DDTranslation(xpos, ypos, zpos);
0272         cpv.position(DDLogicalPart(name1), parent(), icopyt, tran, rot1);
0273         LogDebug("HCalGeom") << "DDEcalPreshowerAlgoTB::debug : Child " << name1 << " copy = " << icopy << " ("
0274                              << icopyt << ") in Mother " << parent().name() << " translation " << tran << " rotation "
0275                              << rot1;
0276       }
0277       zpos = zlead1_ + zwedge_ceramic_diff;
0278       ypos = ypos - ywedge_ceramic_diff;
0279       if (go == 1) {
0280         tran = DDTranslation(xpos, ypos, zpos);
0281         cpv.position(DDLogicalPart(name2), parent(), icopyt, tran, rot2);
0282         LogDebug("HCalGeom") << "DDEcalPreshowerAlgoTB::debug : Child " << name2 << " copy = " << icopy << " ("
0283                              << icopyt << ") in Mother " << parent().name() << " translation " << tran << " rotation "
0284                              << rot2;
0285       }
0286     }
0287   }
0288 
0289   // Do Plane Y
0290   icopy = 0;
0291   int nxt = micromodulesy.size();
0292   name1 = DDName("SWED", idNameSpace);
0293   name2 = DDName("SFBY", idNameSpace);
0294   rot1 = DDRotation(DDName("RM1301B", idNameSpace));
0295   rot2 = DDRotation(DDName("RM1300B", idNameSpace));
0296   for (int I = 1; I <= sz; ++I) {
0297     for (int J = int(quadMax_[I - 1]); J >= int(quadMin_[I - 1]); --J) {
0298       ny += 1;
0299       icopy += 1;
0300       go = 0;
0301       for (double m : micromodulesy)
0302         if (m == icopy) {
0303           go = 1;
0304           icopyt += 1;
0305         }
0306       //LogDebug("HCalGeom") <<"DDEcalPreshowerAlgoTB::I=" << I << " J="  << J;
0307       ypos = -1. * (J * waf_intra_col_sep + (int(J / 2)) * waf_inter_col_sep - waf_intra_col_sep / 2.);
0308       xpos = (sz - int(I)) * waf_active + wedge_length / 2. + 0.05 * cm + ScndplaneXshift;
0309       xpos = xpos + TotSFXshift;
0310       ypos = ypos + TotSFYshift;
0311       zpos = zlead2_ + wedge_offset;
0312       if (go == 1) {
0313         tran = DDTranslation(xpos, ypos, zpos);
0314         cpv.position(DDLogicalPart(name1), parent(), icopy + nxt, tran, rot1);
0315         LogDebug("HCalGeom") << "DDEcalPreshowerAlgoTB::debug : Child " << name1 << " copy = " << icopy << " ("
0316                              << icopyt + nxt << ") in Mother " << parent().name() << " translation " << tran
0317                              << " rotation " << rot1;
0318       }
0319       zpos = zlead2_ + zwedge_ceramic_diff;
0320       xpos = xpos - ywedge_ceramic_diff;
0321       if (go == 1) {
0322         tran = DDTranslation(xpos, ypos, zpos);
0323         cpv.position(DDLogicalPart(name2), parent(), icopyt, tran, rot2);
0324         LogDebug("HCalGeom") << "DDEcalPreshowerAlgoTB::debug : Child " << name2 << " copy = " << icopy << " ("
0325                              << icopyt << ") in Mother " << parent().name() << " translation " << tran << " rotation "
0326                              << rot2;
0327       }
0328     }
0329 
0330     for (int J = int(quadMin_[I - 1]); J <= int(quadMax_[I - 1]); ++J) {
0331       ny += 1;
0332       icopy += 1;
0333       go = 0;
0334       for (double m : micromodulesy)
0335         if (m == icopy) {
0336           go = 1;
0337           icopyt += 1;
0338         }
0339       //LogDebug("HCalGeom") <<"DDEcalPreshowerAlgoTB::I=" << I << " J="  << J;
0340       ypos = 1. * (J * waf_intra_col_sep + (int(J / 2)) * waf_inter_col_sep - waf_intra_col_sep / 2.);
0341       xpos = (sz - int(I)) * waf_active + wedge_length / 2. + 0.05 * cm + ScndplaneXshift;
0342       xpos = xpos + TotSFXshift;
0343       ypos = ypos + TotSFYshift;
0344       zpos = zlead2_ + wedge_offset;
0345       if (go == 1) {
0346         tran = DDTranslation(xpos, ypos, zpos);
0347         cpv.position(DDLogicalPart(name1), parent(), icopyt + nxt, tran, rot1);
0348         LogDebug("HCalGeom") << "DDEcalPreshowerAlgoTB::debug : Child " << name1 << " copy = " << icopy << " ("
0349                              << icopyt + nxt << ") in Mother " << parent().name() << " translation " << tran
0350                              << " rotation " << rot1;
0351       }
0352       zpos = zlead2_ + zwedge_ceramic_diff;
0353       xpos = xpos - ywedge_ceramic_diff;
0354       if (go == 1) {
0355         tran = DDTranslation(xpos, ypos, zpos);
0356         cpv.position(DDLogicalPart(name2), parent(), icopyt, tran, rot2);
0357         LogDebug("HCalGeom") << "DDEcalPreshowerAlgoTB::debug : Child " << name2 << " copy = " << icopy << " ("
0358                              << icopyt << ") in Mother " << parent().name() << " translation " << tran << " rotation "
0359                              << rot2;
0360       }
0361     }
0362   }
0363 
0364   // mirror image system
0365   rot1 = DDRotation(DDName("RM1305B", idNameSpace));
0366   rot2 = DDRotation(DDName("RM1304B", idNameSpace));
0367   for (int I = sz; I >= 1; --I) {
0368     for (int J = int(quadMax_[I - 1]); J >= int(quadMin_[I - 1]); --J) {
0369       ny += 1;
0370       icopy += 1;
0371       go = 0;
0372       for (double m : micromodulesy)
0373         if (m == icopy) {
0374           go = 1;
0375           icopyt += 1;
0376         }
0377       //LogDebug("HCalGeom") <<"DDEcalPreshowerAlgoTB::I=" << I << " J="  << J;
0378       ypos = -1. * (J * waf_intra_col_sep + (int(J / 2)) * waf_inter_col_sep - waf_intra_col_sep / 2.);
0379       xpos = -1. * (sz - int(I)) * waf_active - wedge_length / 2. - 0.05 * cm + ScndplaneXshift;
0380       xpos = xpos + TotSFXshift;
0381       ypos = ypos + TotSFYshift;
0382       zpos = zlead2_ + wedge_offset;
0383       if (go == 1) {
0384         tran = DDTranslation(xpos, ypos, zpos);
0385         cpv.position(DDLogicalPart(name1), parent(), icopyt + nxt, tran, rot1);
0386         LogDebug("HCalGeom") << "DDEcalPreshowerAlgoTB::debug : Child " << name1 << " copy = " << icopy << " ("
0387                              << icopyt + nxt << ") in Mother " << parent().name() << " translation " << tran
0388                              << " rotation " << rot1;
0389       }
0390       zpos = zlead2_ + zwedge_ceramic_diff;
0391       xpos = xpos + ywedge_ceramic_diff;
0392       if (go == 1) {
0393         tran = DDTranslation(xpos, ypos, zpos);
0394         cpv.position(DDLogicalPart(name2), parent(), icopyt, tran, rot2);
0395         LogDebug("HCalGeom") << "DDEcalPreshowerAlgoTB::debug : Child " << name2 << " copy = " << icopy << " ("
0396                              << icopyt << ") in Mother " << parent().name() << " translation " << tran << " rotation "
0397                              << rot2;
0398       }
0399     }
0400 
0401     for (int J = int(quadMin_[I - 1]); J <= int(quadMax_[I - 1]); ++J) {
0402       ny += 1;
0403       icopy += 1;
0404       go = 0;
0405       for (double m : micromodulesy)
0406         if (m == icopy) {
0407           go = 1;
0408           icopyt += 1;
0409         }
0410       //LogDebug("HCalGeom") <<"DDEcalPreshowerAlgoTB::I=" << I << " J="  << J;
0411       ypos = 1. * (J * waf_intra_col_sep + (int(J / 2)) * waf_inter_col_sep - waf_intra_col_sep / 2.);
0412       xpos = -1. * (sz - int(I)) * waf_active - wedge_length / 2. - 0.05 * cm + ScndplaneXshift;
0413       xpos = xpos + TotSFXshift;
0414       ypos = ypos + TotSFYshift;
0415       zpos = zlead2_ + wedge_offset;
0416       if (go == 1) {
0417         tran = DDTranslation(xpos, ypos, zpos);
0418         cpv.position(DDLogicalPart(name1), parent(), icopyt + nxt, tran, rot1);
0419         LogDebug("HCalGeom") << "DDEcalPreshowerAlgoTB::debug : Child " << name1 << " copy = " << icopy << " ("
0420                              << icopyt + nxt << ") in Mother " << parent().name() << " translation " << tran
0421                              << " rotation " << rot1;
0422       }
0423       zpos = zlead2_ + zwedge_ceramic_diff;
0424       xpos = xpos + ywedge_ceramic_diff;
0425       if (go == 1) {
0426         tran = DDTranslation(xpos, ypos, zpos);
0427         cpv.position(DDLogicalPart(name2), parent(), icopyt, tran, rot2);
0428         LogDebug("HCalGeom") << "DDEcalPreshowerAlgoTB::debug : Child " << name2 << " copy = " << icopy << " ("
0429                              << icopyt << ") in Mother " << parent().name() << " translation " << tran << " rotation "
0430                              << rot2;
0431       }
0432     }
0433   }
0434 }
0435 
0436 void DDEcalPreshowerAlgoTB::doSens(DDCompactView& cpv) {
0437   double xpos(0), ypos(0);
0438   DDTranslation tran;
0439   DDName child1 = DDName("SFSX", idNameSpace);
0440   DDName child2 = DDName("SFSY", idNameSpace);
0441   DDName mother1 = DDName("SFAX", idNameSpace);
0442   DDName mother2 = DDName("SFAY", idNameSpace);
0443   DDRotation rot;
0444   for (size_t i = 0; i < 32; ++i) {
0445     xpos = -waf_active / 2. + i * waf_active / 32. + waf_active / 64.;
0446     tran = DDTranslation(xpos, 0., 0.);
0447     cpv.position(DDLogicalPart(child1), mother1, i + 1, tran, rot);
0448     LogDebug("HCalGeom") << "DDEcalPreshowerAlgoTB::debug : Child " << child1 << "\ncopy number " << i + 1 << " in "
0449                          << mother1 << " translation " << tran << " rotation " << rot;
0450 
0451     ypos = -waf_active / 2. + i * waf_active / 32. + waf_active / 64.;
0452     tran = DDTranslation(0., ypos, 0.);
0453     cpv.position(DDLogicalPart(child2), mother2, i + 1, tran, rot);
0454     LogDebug("HCalGeom") << "DDEcalPreshowerAlgoTB::debug : Child " << child2 << "\ncopy number " << i + 1 << " in "
0455                          << mother2 << " translation " << tran << " rotation " << rot;
0456   }
0457 }