99 G4SDManager* SDman = G4SDManager::GetSDMpointer();
101 besEMCSD =
new BesEmcSD(
"CalorSD",
this,besEMCGeometry);
102 SDman->AddNewDetector( besEMCSD );
112 physiEMC =
new G4PVPlacement(0,
113 G4ThreeVector(0.0 ,0.0 ,0.0),
114 logicEMC,
"physicalEMC",logicBes,
false, 0);
115 G4cout<<
"logicEmc: === "<<logicEMC<<
" physiEmc "<<physiEMC<<G4endl;
126 phiNbCrystals = (*besEMCGeometry).BSCNbPhi;
127 thetaNbCrystals = (*besEMCGeometry).BSCNbTheta*2;
129 G4double da=0.001*deg;
134 solidBSC =
new G4Tubs(
"solidBSC",
135 (*besEMCGeometry).TaperRingRmin1,
136 (*besEMCGeometry).BSCRmax+(*besEMCGeometry).SPBarThickness+(*besEMCGeometry).SPBarThickness1+2.1*mm,
137 (*besEMCGeometry).BSCDz+(*besEMCGeometry).TaperRingThickness3+(*besEMCGeometry).EndRingDz,
141 solidESC =
new G4Cons(
"solidESC",(*emcEnd).WorldRmin1,(*emcEnd).WorldRmax1,
142 (*emcEnd).WorldRmin2,(*emcEnd).WorldRmax2,
143 (*emcEnd).WorldDz/2,0.*deg,360.*deg);
145 solidEMC =
new G4UnionSolid(
"solidEMC0",
149 G4ThreeVector(0,0,(*emcEnd).WorldZPosition));
151 G4RotationMatrix *rotateESC =
new G4RotationMatrix();
152 rotateESC->rotateY(180.*deg);
154 solidEMC =
new G4UnionSolid(
"solidEMC",
158 G4ThreeVector(0,0,-(*emcEnd).WorldZPosition));
160 logicEMC =
new G4LogicalVolume(solidEMC,
161 G4Material::GetMaterial(
"Air"),
164 physiEMC =
new G4PVPlacement(0,
172 solidBSCWorld =
new G4SubtractionSolid(
"solidBSCWorld0",
176 G4ThreeVector(0,0,(*emcEnd).WorldZPosition));
178 solidBSCWorld =
new G4SubtractionSolid(
"solidBSCWorld",
182 G4ThreeVector(0,0,-(*emcEnd).WorldZPosition));
184 logicBSCWorld =
new G4LogicalVolume(solidBSCWorld,
185 G4Material::GetMaterial(
"Air"),
188 G4RotationMatrix *rotBSC =
new G4RotationMatrix();
189 rotBSC->rotateY(180.*deg);
190 physiBSCWorld =
new G4PVPlacement(rotBSC,
198 G4RotationMatrix *rotateMatrix[200];
199 G4double oOp,ox,oy,oz;
200 G4double delta = 0*deg;
201 G4ThreeVector axis = G4ThreeVector(0,0,0);
202 oOp=(*besEMCGeometry).BSCRmin/
sin(0.5*(*besEMCGeometry).BSCPhiDphi+90*deg)
203 *
sin((*besEMCGeometry).BSCAngleRotat);
204 G4double ll=(*besEMCGeometry).BSCCryLength;
205 G4double rr=(*besEMCGeometry).BSCRmin;
206 G4double oj=sqrt(ll*ll+rr*rr-2*ll*rr*
cos(180.*deg-(*besEMCGeometry).BSCAngleRotat));
207 G4double oij=90.*deg-(*besEMCGeometry).BSCPhiDphi/2.-(*besEMCGeometry).BSCAngleRotat;
208 G4double doj=asin(
sin(180.*deg-(*besEMCGeometry).BSCAngleRotat)/oj*ll);
209 G4double ioj=(*besEMCGeometry).BSCPhiDphi/2.+doj;
210 G4double ij=oj/
sin(oij)*
sin(ioj);
211 G4double dOp=rr/
sin(90.*deg-(*besEMCGeometry).BSCPhiDphi/2.)
212 *
sin(90.*deg+(*besEMCGeometry).BSCPhiDphi/2.-(*besEMCGeometry).BSCAngleRotat);
213 G4double cOp=rr/
sin(90.*deg+(*besEMCGeometry).BSCPhiDphi/2.)
214 *
sin(90.*deg-(*besEMCGeometry).BSCPhiDphi/2.-(*besEMCGeometry).BSCAngleRotat);
215 G4double
ch=(dOp+ll)/
cos((*besEMCGeometry).BSCPhiDphi)-cOp;
216 G4double hi=(dOp+ll)*
tan((*besEMCGeometry).BSCPhiDphi)-ij;
217 G4double oh=sqrt(
ch*
ch+rr*rr-2*
ch*rr*
cos(180*deg-(*besEMCGeometry).BSCAngleRotat));
218 G4double hoi=asin(
sin(180*deg-oij)/oh*hi);
219 G4double dok=asin(
sin(180*deg-(*besEMCGeometry).BSCAngleRotat)/oh*
ch);
221 G4cout <<
"oj=" <<oj/cm<<G4endl
222 <<
"oij="<<oij/deg<<G4endl
223 <<
"doj="<<doj/deg<<G4endl
224 <<
"ioj="<<ioj/deg<<G4endl
225 <<
"ij="<<ij/cm<<G4endl
226 <<
"dOp="<<dOp/cm<<G4endl
227 <<
"cOp="<<cOp/cm<<G4endl
228 <<
"ch="<<
ch/cm<<G4endl
229 <<
"hi="<<hi/cm<<G4endl
230 <<
"oh="<<oh/cm<<G4endl
231 <<
"hoi="<<hoi/deg<<G4endl
232 <<
"dok="<<dok/deg<<G4endl;
235 solidBSCPhiTub =
new G4Tubs(
238 (*besEMCGeometry).BSCPhiRmax,
239 (*besEMCGeometry).BSCDz,
240 360.*deg-(*besEMCGeometry).BSCPhiDphi,
241 (*besEMCGeometry).BSCPhiDphi);
242 solidConsPhi =
new G4Cons(
"consPhi1",
243 (*besEMCGeometry).BSCRmin1,
244 (*besEMCGeometry).BSCRmax1,
245 (*besEMCGeometry).BSCRmin2,
246 (*besEMCGeometry).BSCRmax2,
247 (*besEMCGeometry).BSCDz1/2,
250 solidBSCPhi1 =
new G4SubtractionSolid(
"solidBSCPhi1",
254 G4ThreeVector(0,0,(*besEMCGeometry).BSCDz-(*besEMCGeometry).BSCDz1/2));
255 solidConsPhi =
new G4Cons(
"consPhi2",
256 (*besEMCGeometry).BSCRmin2,
257 (*besEMCGeometry).BSCRmax2,
258 (*besEMCGeometry).BSCRmin1,
259 (*besEMCGeometry).BSCRmax1,
260 (*besEMCGeometry).BSCDz1/2,
263 solidBSCPhi =
new G4SubtractionSolid(
"solidBSCPhi",
267 G4ThreeVector(0,0,(*besEMCGeometry).BSCDz1/2-(*besEMCGeometry).BSCDz));
269 logicBSCPhi =
new G4LogicalVolume(solidBSCPhi,
270 G4Material::GetMaterial(
"Air"),
274 for(G4int j=0;j<(*besEMCGeometry).BSCNbPhi;j++)
276 if(j<(*besEMCGeometry).BSCNbPhi/2) {
277 i=(*besEMCGeometry).BSCNbPhi/2-j-1;
279 i=(*besEMCGeometry).BSCNbPhi*3/2-j-1;
281 rotateMatrix[i] =
new G4RotationMatrix();
282 rotateMatrix[i]->rotateZ(-i*(*besEMCGeometry).BSCPhiDphi
283 -(*besEMCGeometry).BSCAngleRotat
284 -(*besEMCGeometry).BSCPhiDphi/2.
286 rotateMatrix[i]->getAngleAxis(delta, axis);
290 ox=oOp*
cos(-90.*deg+(*besEMCGeometry).BSCAngleRotat+hoi
291 +i*(*besEMCGeometry).BSCPhiDphi);
292 oy=oOp*
sin(-90.*deg+(*besEMCGeometry).BSCAngleRotat+hoi
293 +i*(*besEMCGeometry).BSCPhiDphi);
296 ostringstream strPhi;
297 strPhi <<
"physicalBSCPhi" << j;
299 physiBSCPhi =
new G4PVPlacement(rotateMatrix[i],
300 G4ThreeVector(ox,oy,oz),
313 G4double zHalfLength[50];
314 G4double thetaAxis[50];
315 G4double phiAxis[50];
316 G4double yHalfLength1[50];
317 G4double xHalfLength2[50];
318 G4double xHalfLength1[50];
319 G4double tanAlpha1[50];
320 G4double yHalfLength2[50];
321 G4double xHalfLength4[50];
322 G4double xHalfLength3[50];
323 G4double tanAlpha2[50];
324 G4double xPosition[50];
325 G4double yPosition[50];
326 G4double zPosition[50];
327 G4double thetaPosition[50];
328 for(i=0;i<(*besEMCGeometry).BSCNbTheta;i++)
330 zHalfLength[i] = (*besEMCGeometry).zHalfLength[i];
331 thetaAxis[i] = (*besEMCGeometry).thetaAxis[i];
332 phiAxis[i] = (*besEMCGeometry).phiAxis[i];
333 yHalfLength1[i] = (*besEMCGeometry).yHalfLength1[i];
334 xHalfLength2[i] = (*besEMCGeometry).xHalfLength2[i];
335 xHalfLength1[i] = (*besEMCGeometry).xHalfLength1[i];
336 tanAlpha1[i] = (*besEMCGeometry).tanAlpha1[i];
337 yHalfLength2[i] = (*besEMCGeometry).yHalfLength2[i];
338 xHalfLength4[i] = (*besEMCGeometry).xHalfLength4[i];
339 xHalfLength3[i] = (*besEMCGeometry).xHalfLength3[i];
340 tanAlpha2[i] = (*besEMCGeometry).tanAlpha2[i];
341 xPosition[i] = (*besEMCGeometry).xPosition[i];
342 yPosition[i] = (*besEMCGeometry).yPosition[i];
343 zPosition[i] = (*besEMCGeometry).zPosition[i];
344 thetaPosition[i]= (*besEMCGeometry).thetaPosition[i];
346 G4cout <<
"The sizes of the "<<i+1<<
" crystal are:" << G4endl
347 <<
"zHalfLength ="<<zHalfLength[i]/cm<<
"(cm)," << G4endl
348 <<
"thetaAxis ="<<thetaAxis[i]/deg <<
"(deg),"<< G4endl
349 <<
"phiAxis ="<< phiAxis[i]/deg <<
"(deg),"<< G4endl
350 <<
"yHalfLength1="<<yHalfLength1[i]/cm<<
"(cm),"<< G4endl
351 <<
"xHalfLength1="<<xHalfLength1[i]/cm<<
"(cm),"<< G4endl
352 <<
"xHalfLength2="<<xHalfLength2[i]/cm<<
"(cm),"<< G4endl
353 <<
"tanAlpha1 ="<< tanAlpha1[i] << G4endl
354 <<
"yHalfLength2="<<yHalfLength2[i]/cm<<
"(cm),"<< G4endl
355 <<
"xHalfLength3="<<xHalfLength3[i]/cm<<
"(cm),"<< G4endl
356 <<
"xHalfLength4="<<xHalfLength4[i]/cm<<
"(cm),"<< G4endl
357 <<
"tanAlpha2 =" << tanAlpha2[i] <<
"." << G4endl;
361 solidBSCCrystal =
new G4Trap(
"solidCrystal",
362 100*cm, 100*deg, 100*deg,
363 100*cm, 100*cm, 100*cm, 100*deg,
364 100*cm, 100*cm, 100*cm, 100*deg);
366 logicBSCCrystal =
new G4LogicalVolume(solidBSCCrystal,
373 (*besEMCGeometry).BSCNbTheta*2,
379 solidRear =
new G4Box(
"solidRearBox",
380 (*besEMCGeometry).rearBoxLength/2,
381 (*besEMCGeometry).rearBoxLength/2,
382 (*besEMCGeometry).rearBoxDz/2);
384 logicRear =
new G4LogicalVolume(solidRear,
385 G4Material::GetMaterial(
"Air"),
389 solidOrgGlass =
new G4Box(
"solidOrganicGlass",
390 (*besEMCGeometry).orgGlassLengthX/2,
391 (*besEMCGeometry).orgGlassLengthY/2,
392 (*besEMCGeometry).orgGlassLengthZ/2);
394 logicOrgGlass =
new G4LogicalVolume(solidOrgGlass,
396 "logicalOrganicGlass");
398 physiOrgGlass =
new G4PVPlacement(0,
399 G4ThreeVector(0,0,-((*besEMCGeometry).rearBoxDz-(*besEMCGeometry).orgGlassLengthZ)/2),
401 "physicalOrganicGlass",
407 solidCasingBox =
new G4Box(
"solidCasingBox",
408 (*besEMCGeometry).rearBoxLength/2,
409 (*besEMCGeometry).rearBoxLength/2,
410 (*besEMCGeometry).rearCasingThickness/2);
412 solidAirHole =
new G4Box(
"solidAirHole",
413 (*besEMCGeometry).orgGlassLengthX/2,
414 (*besEMCGeometry).orgGlassLengthY/2,
415 (*besEMCGeometry).rearBoxDz/2);
417 solidRearCasing =
new G4SubtractionSolid(
"solidRearCasing",
423 logicRearCasing =
new G4LogicalVolume(solidRearCasing,
425 "logicalRearCasing");
427 physiRearCasing =
new G4PVPlacement(0,
428 G4ThreeVector(0,0,-((*besEMCGeometry).rearBoxDz-(*besEMCGeometry).rearCasingThickness)/2),
430 "physicalRearCasing",
436 solidAlBox =
new G4Box(
"solidAlBox",
437 (*besEMCGeometry).rearBoxLength/2,
438 (*besEMCGeometry).rearBoxLength/2,
439 (*besEMCGeometry).AlPlateDz/2);
441 solidAlPlate =
new G4SubtractionSolid(
"solidAlPlate",
447 logicAlPlate =
new G4LogicalVolume(solidAlPlate,
448 G4Material::GetMaterial(
"Aluminium"),
451 physiAlPlate =
new G4PVPlacement(0,
452 G4ThreeVector(0,0,-((*besEMCGeometry).rearBoxDz/2
453 -(*besEMCGeometry).rearCasingThickness
454 -(*besEMCGeometry).AlPlateDz/2)),
462 solidPD =
new G4Box(
"solidPD",
463 (*besEMCGeometry).PDLengthX,
464 (*besEMCGeometry).PDLengthY/2,
465 (*besEMCGeometry).PDLengthZ/2);
467 logicPD =
new G4LogicalVolume(solidPD,
468 G4Material::GetMaterial(
"M_Silicon"),
471 physiPD =
new G4PVPlacement(0,
472 G4ThreeVector(0,0,-((*besEMCGeometry).rearBoxDz/2
473 -(*besEMCGeometry).orgGlassLengthZ
474 -(*besEMCGeometry).PDLengthZ/2)),
482 solidPreAmpBox =
new G4Box(
"solidPreAmpBox",
483 (*besEMCGeometry).rearBoxLength/2,
484 (*besEMCGeometry).rearBoxLength/2,
485 (*besEMCGeometry).PABoxDz/2);
487 logicPreAmpBox =
new G4LogicalVolume(solidPreAmpBox,
488 G4Material::GetMaterial(
"Aluminium"),
491 physiPreAmpBox =
new G4PVPlacement(0,
492 G4ThreeVector(0,0,-((*besEMCGeometry).rearBoxDz/2
493 -(*besEMCGeometry).rearCasingThickness
494 -(*besEMCGeometry).AlPlateDz
495 -(*besEMCGeometry).PABoxDz/2)),
503 solidAirInPABox =
new G4Box(
"solidAirInPABox",
504 (*besEMCGeometry).rearBoxLength/2-(*besEMCGeometry).PABoxThickness,
505 (*besEMCGeometry).rearBoxLength/2-(*besEMCGeometry).PABoxThickness,
506 (*besEMCGeometry).PABoxDz/2-(*besEMCGeometry).PABoxThickness);
508 logicAirInPABox =
new G4LogicalVolume(solidAirInPABox,
509 G4Material::GetMaterial(
"Air"),
510 "logicalAirInPABox");
512 physiAirInPABox =
new G4PVPlacement(0,
515 "physicalAirInPABox",
521 solidHangingPlate =
new G4Box(
"solidHangingPlate",
522 (*besEMCGeometry).rearBoxLength/2,
523 (*besEMCGeometry).rearBoxLength/2,
524 (*besEMCGeometry).HangingPlateDz/2);
526 logicHangingPlate =
new G4LogicalVolume(solidHangingPlate,stainlessSteel,
"logicalHangingPlate");
528 physiHangingPlate =
new G4PVPlacement(0,
529 G4ThreeVector(0,0,-((*besEMCGeometry).rearBoxDz/2
530 -(*besEMCGeometry).rearCasingThickness
531 -(*besEMCGeometry).AlPlateDz
532 -(*besEMCGeometry).PABoxDz
533 -(*besEMCGeometry).HangingPlateDz/2)),
535 "physicalHangingPlate",
541 solidWaterPipe =
new G4Tubs(
"solidWaterPipe",
543 (*besEMCGeometry).waterPipeDr,
544 (*besEMCGeometry).BSCDz,
548 logicWaterPipe =
new G4LogicalVolume(solidWaterPipe,waterPipe,
"logicalWaterPipe");
550 physiWaterPipe =
new G4PVPlacement(0,
551 G4ThreeVector((*besEMCGeometry).cablePosX[0]-2*(*besEMCGeometry).cableDr,
552 (*besEMCGeometry).cablePosY[0]-(*besEMCGeometry).cableDr-(*besEMCGeometry).waterPipeDr,
565 G4String nameCrystalAndCasing=
"CrystalAndCasing";
568 for(i=startID;i<=thetaNbCrystals;i++)
570 ostringstream strSolidCasing;
571 strSolidCasing <<
"solidBSCCasing" << i-1;
572 ostringstream strVolumeCasing;
573 strVolumeCasing <<
"logicalBSCCasing" << i-1;
574 ostringstream strPhysiCasing;
575 strPhysiCasing <<
"physicalBSCCasing" << i-1;
577 if(i>(*besEMCGeometry).BSCNbTheta)
579 id=i-(*besEMCGeometry).BSCNbTheta-1;
580 solidBSCTheta =
new G4Trap(strSolidCasing.str(),
596 logicBSCTheta =
new G4LogicalVolume(solidBSCTheta,
598 strVolumeCasing.str());
600 rotateMatrix[(*besEMCGeometry).BSCNbPhi+i-1] =
new G4RotationMatrix();
601 rotateMatrix[(*besEMCGeometry).BSCNbPhi+i-1]->rotateZ(-90*deg);
602 rotateMatrix[(*besEMCGeometry).BSCNbPhi+i-1]
603 ->rotateX(-thetaPosition[
id]);
607 new G4PVPlacement(rotateMatrix[(*besEMCGeometry).BSCNbPhi+i-1],
608 G4ThreeVector(xPosition[
id],
611 strPhysiCasing.str(),
619 G4VisAttributes* rightVisAtt=
new G4VisAttributes(G4Colour(1.0,0.,0.));
620 rightVisAtt->SetVisibility(
true);
621 logicBSCTheta->SetVisAttributes(rightVisAtt);
622 logicBSCTheta->SetVisAttributes(G4VisAttributes::Invisible);
625 ostringstream strRear;
626 strRear <<
"physicalRearBox_1_" << i-1;
628 physiRear =
new G4PVPlacement(rotateMatrix[(*besEMCGeometry).BSCNbPhi+i-1],
629 G4ThreeVector((*besEMCGeometry).rearBoxPosX[
id],
630 (*besEMCGeometry).rearBoxPosY[
id],
631 (*besEMCGeometry).rearBoxPosZ[
id]),
638 ostringstream strGirder;
639 strGirder <<
"solidOpenningCutGirder_1_" << i-1;
640 solidOCGirder =
new G4Cons(strGirder.str(),
641 (*besEMCGeometry).OCGirderRmin1[
id],
642 (*besEMCGeometry).BSCPhiRmax,
643 (*besEMCGeometry).OCGirderRmin2[
id],
644 (*besEMCGeometry).BSCPhiRmax,
645 (*besEMCGeometry).OCGirderDz[
id]/2,
646 360.*deg-(*besEMCGeometry).OCGirderAngle/2,
647 (*besEMCGeometry).OCGirderAngle/2-da);
649 ostringstream strVGirder;
650 strVGirder <<
"logicalOpenningCutGirder_1_" << i-1;
651 logicOCGirder =
new G4LogicalVolume(solidOCGirder,stainlessSteel,strVGirder.str());
652 logicOCGirder->SetVisAttributes(G4VisAttributes::Invisible);
654 ostringstream strPGirder;
655 strPGirder <<
"physicalOpenningCutGirder_1_" << i-1;
656 physiOCGirder =
new G4PVPlacement(0,
657 G4ThreeVector(0,0,(*besEMCGeometry).OCGirderPosZ[
id]),
664 if(
id<(*besEMCGeometry).BSCNbTheta-1)
666 G4double zLength = (*besEMCGeometry).OCGirderPosZ[
id+1]
667 -(*besEMCGeometry).OCGirderPosZ[id]
668 -(*besEMCGeometry).OCGirderDz[
id+1]/2-(*besEMCGeometry).OCGirderDz[id]/2;
669 G4double zPosition = (*besEMCGeometry).OCGirderPosZ[
id+1]
670 -(*besEMCGeometry).OCGirderDz[
id+1]/2-zLength/2;
672 ostringstream strGirder2;
673 strGirder2 <<
"solidOpenningCutGirder_2_" << i-1;
674 solidOCGirder =
new G4Cons(strGirder2.str(),
675 (*besEMCGeometry).OCGirderRmin2[
id],
676 (*besEMCGeometry).BSCPhiRmax,
677 (*besEMCGeometry).OCGirderRmin1[
id+1],
678 (*besEMCGeometry).BSCPhiRmax,
680 360.*deg-(*besEMCGeometry).OCGirderAngle/2,
681 (*besEMCGeometry).OCGirderAngle/2-da);
683 ostringstream strVGirder2;
684 strVGirder2 <<
"logicalOpenningCutGirder_2_" << i-1;
685 logicOCGirder =
new G4LogicalVolume(solidOCGirder,stainlessSteel,strVGirder2.str());
686 logicOCGirder->SetVisAttributes(G4VisAttributes::Invisible);
688 ostringstream strPGirder2;
689 strPGirder2 <<
"physicalOpenningCutGirder_2_" << i-1;
690 physiOCGirder =
new G4PVPlacement(0,
691 G4ThreeVector(0,0,zPosition),
699 ostringstream strBSCCable;
700 strBSCCable <<
"solidBSCCable_1_" << i-1;
701 solidCable =
new G4Tubs(strBSCCable.str(),
703 (*besEMCGeometry).cableDr,
704 (*besEMCGeometry).cableLength[
id]/2,
708 ostringstream strVBSCCable;
709 strVBSCCable <<
"logicalBSCCable_1_" << i-1;
710 logicCable =
new G4LogicalVolume(solidCable,cable,strVBSCCable.str());
712 ostringstream strPBSCCable;
713 strPBSCCable <<
"physicalBSCCable_1_" << i-1;
714 physiCable =
new G4PVPlacement(0,
715 G4ThreeVector((*besEMCGeometry).cablePosX[
id],
716 (*besEMCGeometry).cablePosY[
id],
717 (*besEMCGeometry).cablePosZ[
id]),
723 logicCable->SetVisAttributes(G4VisAttributes::Invisible);
727 id=(*besEMCGeometry).BSCNbTheta-i;
728 solidBSCTheta =
new G4Trap(strSolidCasing.str(),
744 logicBSCTheta =
new G4LogicalVolume(solidBSCTheta,
746 strVolumeCasing.str());
748 rotateMatrix[(*besEMCGeometry).BSCNbPhi+i-1] =
new G4RotationMatrix();
749 rotateMatrix[(*besEMCGeometry).BSCNbPhi+i-1]->rotateZ(-90*deg);
750 rotateMatrix[(*besEMCGeometry).BSCNbPhi+i-1]
751 ->rotateX(-180*deg+thetaPosition[
id]);
753 new G4PVPlacement(rotateMatrix[(*besEMCGeometry).BSCNbPhi+i-1],
754 G4ThreeVector(xPosition[
id],
757 strPhysiCasing.str(),
764 G4VisAttributes* rightVisAtt=
new G4VisAttributes(G4Colour(1.0,0.,0.));
765 rightVisAtt->SetVisibility(
true);
766 logicBSCTheta->SetVisAttributes(rightVisAtt);
767 logicBSCTheta->SetVisAttributes(G4VisAttributes::Invisible);
770 ostringstream strRear;
771 strRear <<
"physicalRearBox_2_" << i-1;
773 physiRear =
new G4PVPlacement(rotateMatrix[(*besEMCGeometry).BSCNbPhi+i-1],
774 G4ThreeVector((*besEMCGeometry).rearBoxPosX[
id],
775 (*besEMCGeometry).rearBoxPosY[
id],
776 -(*besEMCGeometry).rearBoxPosZ[
id]),
783 ostringstream strGirder;
784 strGirder <<
"solidOpenningCutGirder_3_" << i-1;
785 solidOCGirder =
new G4Cons(strGirder.str(),
786 (*besEMCGeometry).OCGirderRmin2[
id],
787 (*besEMCGeometry).BSCPhiRmax,
788 (*besEMCGeometry).OCGirderRmin1[
id],
789 (*besEMCGeometry).BSCPhiRmax,
790 (*besEMCGeometry).OCGirderDz[
id]/2,
791 360.*deg-(*besEMCGeometry).OCGirderAngle/2,
792 (*besEMCGeometry).OCGirderAngle/2-da);
794 ostringstream strVGirder;
795 strVGirder <<
"logicalOpenningCutGirder_3_" << i-1;
796 logicOCGirder =
new G4LogicalVolume(solidOCGirder,stainlessSteel,strVGirder.str());
797 logicOCGirder->SetVisAttributes(G4VisAttributes::Invisible);
799 ostringstream strPGirder;
800 strPGirder <<
"physicalOpenningCutGirder_3_" << i-1;
801 physiOCGirder =
new G4PVPlacement(0,
802 G4ThreeVector(0,0,-(*besEMCGeometry).OCGirderPosZ[
id]),
809 if(
id<(*besEMCGeometry).BSCNbTheta-1)
811 G4double zLength = (*besEMCGeometry).OCGirderPosZ[
id+1]-(*besEMCGeometry).OCGirderPosZ[id]
812 -(*besEMCGeometry).OCGirderDz[
id+1]/2-(*besEMCGeometry).OCGirderDz[id]/2;
813 G4double zPosition = (*besEMCGeometry).OCGirderPosZ[
id+1]-(*besEMCGeometry).OCGirderDz[
id+1]/2-zLength/2;
815 ostringstream strGirder2;
816 strGirder2 <<
"solidOpenningCutGirder_4_" << i-1;
817 solidOCGirder =
new G4Cons(strGirder2.str(),
818 (*besEMCGeometry).OCGirderRmin1[
id+1],
819 (*besEMCGeometry).BSCPhiRmax,
820 (*besEMCGeometry).OCGirderRmin2[
id],
821 (*besEMCGeometry).BSCPhiRmax,
823 360.*deg-(*besEMCGeometry).OCGirderAngle/2,
824 (*besEMCGeometry).OCGirderAngle/2-da);
826 ostringstream strVGirder2;
827 strVGirder2 <<
"logicalOpenningCutGirder_4_" << i-1;
829 =
new G4LogicalVolume(solidOCGirder,stainlessSteel,strVGirder2.str());
830 logicOCGirder->SetVisAttributes(G4VisAttributes::Invisible);
832 ostringstream strPGirder2;
833 strPGirder2 <<
"physicalOpenningCutGirder_4_" << i-1;
834 physiOCGirder =
new G4PVPlacement(0,
835 G4ThreeVector(0,0,-zPosition),
843 ostringstream strBSCCable;
844 strBSCCable <<
"solidBSCCable_2_" << i-1;
845 solidCable =
new G4Tubs(strBSCCable.str(),
847 (*besEMCGeometry).cableDr,
848 (*besEMCGeometry).cableLength[
id]/2,
852 ostringstream strVBSCCable;
853 strVBSCCable <<
"logicalBSCCable_2_" << i-1;
854 logicCable =
new G4LogicalVolume(solidCable,cable,strVBSCCable.str());
856 ostringstream strPBSCCable;
857 strPBSCCable <<
"physicalBSCCable_2_" << i-1;
858 physiCable =
new G4PVPlacement(0,
859 G4ThreeVector((*besEMCGeometry).cablePosX[
id],
860 (*besEMCGeometry).cablePosY[
id],
861 -(*besEMCGeometry).cablePosZ[
id]),
867 logicCable->SetVisAttributes(G4VisAttributes::Invisible);
871 ostringstream strCrystal;
872 strCrystal <<
"physicalCrystal" << i-1;
873 physiBSCCrystal =
new G4PVParameterised(
880 (*besEMCGeometry).physiBSCCrystal[i]=physiBSCCrystal;
882 physiBSCCrystal->SetCopyNo(i);
886 G4cout <<
"BesEmcConstruction*****************************"<< G4endl
887 <<
"point of crystal =" <<physiBSCCrystal << G4endl
889 <<
"point of excepted=" <<physiBSCTheta << G4endl;
907 if(logicEMC&&physiEMC&&verboseLevel>4){
908 G4cout<<
"logicEmc "<<logicEMC<<
" physiEmc "<<physiEMC<<G4endl;
909 G4cout<<
"list geo tree"<<G4endl;
911 int NdaughterofEMC = logicEMC->GetNoDaughters();
913 for(
int i = 0; i < NdaughterofEMC; i++)
915 G4LogicalVolume *daughterofEmc = logicEMC->GetDaughter(i)->GetLogicalVolume();
916 G4cout<<i<<
"/"<<NdaughterofEMC<<
" name: "<<daughterofEmc->GetName()<<
" "<<daughterofEmc<<
" shape: "<<daughterofEmc->GetSolid()->GetName()<<G4endl;
917 int NdaughterofEmc_2 = daughterofEmc->GetNoDaughters();
918 for(
int j = 0; j < NdaughterofEmc_2; j++)
920 G4LogicalVolume *daughterofEmc_2 = daughterofEmc->GetDaughter(j)->GetLogicalVolume();
921 G4cout<<
" --> "<<j<<
"/"<<NdaughterofEmc_2<<
" name: "<<daughterofEmc_2->GetName()<<
" "<<daughterofEmc_2<<
" shape: "<<daughterofEmc_2->GetSolid()->GetName()<<G4endl;
922 int NdaughterofEmc_3 = daughterofEmc_2->GetNoDaughters();
923 for(
int k = 0; k < NdaughterofEmc_3; k++)
925 G4LogicalVolume *daughterofEmc_3 = daughterofEmc_2->GetDaughter(k)->GetLogicalVolume();
926 G4cout<<
" --> "<<k<<
"/"<<NdaughterofEmc_3<<
" name: "<<daughterofEmc_3->GetName()<<
" "<<daughterofEmc_3<<
" shape: "<<daughterofEmc_3->GetSolid()->GetName()<<G4endl;
927 int NdaughterofEmc_4 = daughterofEmc_3->GetNoDaughters();
928 for(
int m = 0; m < NdaughterofEmc_4; m++)
930 G4LogicalVolume *daughterofEmc_4 = daughterofEmc_3->GetDaughter(m)->GetLogicalVolume();
931 G4cout<<
" --> "<<m<<
"/"<<NdaughterofEmc_4<<
" name: "<<daughterofEmc_4->GetName()<<
" "<<daughterofEmc_4<<
" shape: "<<daughterofEmc_4->GetSolid()->GetName()<<G4endl;
932 if(daughterofEmc_3->GetSolid()->GetName().contains(
"solidBSCCasing"))
934 G4Trap *Crystal = (G4Trap *)daughterofEmc_3->GetSolid();
935 double hz = Crystal->GetZHalfLength();
936 double hx1 = Crystal->GetXHalfLength1();
937 double hx2 = Crystal->GetXHalfLength2();
938 double hx3 = Crystal->GetXHalfLength3();
939 double hx4 = Crystal->GetXHalfLength4();
940 double hy1 = Crystal->GetYHalfLength1();
941 double hy2 = Crystal->GetYHalfLength2();
942 double tanalpha1 = Crystal->GetTanAlpha1();
943 double tanalpha2 = Crystal->GetTanAlpha2();
944 G4cout<<
" --> "<<hx1<<
" "<<hx2<<
" "<<hx3<<
" "<<hx4<<
" "<<hy1<<
" "<<hy2<<
" "<<hz<<
" "<<tanalpha1<<
" "<<tanalpha2<<G4endl;
958 G4Material* fCrystalMaterial = G4Material::GetMaterial(
"Cesiumiodide");
959 G4VisAttributes* crystalVisAtt=
new G4VisAttributes(G4Colour(0.5,0,1.0));
960 crystalVisAtt->SetVisibility(
false);
961 G4VisAttributes* endPhiVisAtt=
new G4VisAttributes(G4Colour(0,1.0,0));
962 endPhiVisAtt->SetVisibility(
false);
963 const G4double zoomConst = 0.995;
964 const G4double da=0.001*deg;
968 solidEnd =
new G4Cons(
"solidEndWorld",(*emcEnd).WorldRmin1,(*emcEnd).WorldRmax1,
969 (*emcEnd).WorldRmin2,(*emcEnd).WorldRmax2,
970 (*emcEnd).WorldDz/2,0.*deg,360.*deg);
971 logicEnd =
new G4LogicalVolume(solidEnd, G4Material::GetMaterial(
"Aluminium"),
"logicalEndWorld", 0, 0, 0);
972 physiEnd =
new G4PVPlacement(0,
973 G4ThreeVector(0,0,(*emcEnd).WorldZPosition),
980 logicEnd->SetVisAttributes(G4VisAttributes::Invisible);
984 G4RotationMatrix *rotateEnd =
new G4RotationMatrix();
985 rotateEnd->rotateY(180.*deg);
986 physiEnd =
new G4PVPlacement(rotateEnd,
987 G4ThreeVector(0,0,-(*emcEnd).WorldZPosition),
1019 solidEndPhi =
new G4Cons(
"solidEndPhi0",
1020 (*emcEnd).SectorRmin1,(*emcEnd).SectorRmax1,(*emcEnd).SectorRmin2,(*emcEnd).SectorRmax2,
1021 (*emcEnd).SectorDz/2,0.*deg,22.5*deg-da);
1022 logicEndPhi =
new G4LogicalVolume(solidEndPhi, G4Material::GetMaterial(
"Air"),
"logicalEndPhi0", 0, 0, 0);
1023 for(G4int i=0;i<14;i++)
1027 G4RotationMatrix *rotatePhi =
new G4RotationMatrix();
1028 rotatePhi->rotateZ(-i*22.5*deg+67.5*deg);
1029 ostringstream strEndPhi;
1030 strEndPhi <<
"physicalEndPhi" << i;
1031 physiEndPhi =
new G4PVPlacement(rotatePhi,
1032 G4ThreeVector(0,0,(*emcEnd).SectorZPosition),logicEndPhi,strEndPhi.str(),logicEnd,
false,i);
1036 logicEndPhi->SetVisAttributes(endPhiVisAtt);
1038 for(G4int i=0;i<35;i++)
1040 ostringstream strEndCasing;
1041 strEndCasing <<
"solidEndCasing_0_" << i;
1044 G4ThreeVector newfPnt[8];
1045 G4ThreeVector center(0.0, 0.0, 0.0);
1046 G4ThreeVector rotAngle(0.0, 0.0, 0.0);
1050 emcEnd->
Zoom(newfPnt,zoomConst);
1052 G4RotationMatrix *rotatePhiIrregBox =
new G4RotationMatrix();
1053 rotatePhiIrregBox->rotateX(rotAngle.x());
1054 rotatePhiIrregBox->rotateY(rotAngle.y());
1055 rotatePhiIrregBox->rotateZ(rotAngle.z());
1058 solidEndCasing =
new G4IrregBox(strEndCasing.str(),(*emcEnd).zoomPoint);
1060 ostringstream strVEndCasing;
1061 strVEndCasing <<
"logicalEndCasing_0_" << i;
1062 logicEndCasing =
new G4LogicalVolume(solidEndCasing,fCasingMaterial,strVEndCasing.str());
1064 ostringstream strPEndCasing;
1065 strPEndCasing <<
"physicalEndCasing_0_" << i;
1066 physiEndCasing =
new G4PVPlacement(rotatePhiIrregBox,center,
1067 logicEndCasing,strPEndCasing.str(),logicEndPhi,
false,i);
1069 ostringstream strEndCrystal;
1070 strEndCrystal <<
"solidEndCrystal_0_" << i;
1073 solidEndCrystal =
new G4IrregBox(strEndCrystal.str(),(*emcEnd).cryPoint);
1075 ostringstream strVEndCrystal;
1076 strVEndCrystal <<
"logicalEndCrystal_0_" << i;
1077 logicEndCrystal =
new G4LogicalVolume(solidEndCrystal,fCrystalMaterial,strVEndCrystal.str());
1079 ostringstream strPEndCrystal;
1080 strPEndCrystal <<
"physicalEndCrystal_0_" << i;
1081 physiEndCrystal =
new G4PVPlacement(0,0,logicEndCrystal,strPEndCrystal.str(),logicEndCasing,
false,i);
1083 logicEndCasing->SetVisAttributes(G4VisAttributes::Invisible);
1084 logicEndCrystal->SetVisAttributes(crystalVisAtt);
1085 logicEndCrystal->SetSensitiveDetector(besEMCSD);
1090 solidEndPhi =
new G4Cons(
"solidEndPhi1",
1091 (*emcEnd).WorldRmin1,(*emcEnd).WorldRmax1,(*emcEnd).WorldRmin2,(*emcEnd).WorldRmax2,
1092 (*emcEnd).WorldDz/2,67.5*deg,22.5*deg-da);
1093 logicEndPhi =
new G4LogicalVolume(solidEndPhi, G4Material::GetMaterial(
"Air"),
"logicalEndPhi1", 0, 0, 0);
1094 for(G4int i=0;i<2;i++)
1096 G4RotationMatrix *rotatePhi =
new G4RotationMatrix();
1097 rotatePhi->rotateZ(-i*180.*deg);
1098 ostringstream strEndPhi;
1099 strEndPhi <<
"physicalEndPhi" << i*8+6;
1100 physiEndPhi =
new G4PVPlacement(rotatePhi,G4ThreeVector(0,0,(*emcEnd).SectorZPosition),
1101 logicEndPhi,strEndPhi.str(),logicEnd,
false,i*8+6);
1104 logicEndPhi->SetVisAttributes(endPhiVisAtt);
1106 for(G4int i=0;i<35;i++)
1108 ostringstream strEndCasing;
1109 strEndCasing <<
"solidEndCasing_1_" << i;
1112 G4ThreeVector newfPnt[8];
1113 G4ThreeVector center(0.0, 0.0, 0.0);
1114 G4ThreeVector rotAngle(0.0, 0.0, 0.0);
1118 emcEnd->
Zoom(newfPnt,zoomConst);
1120 G4RotationMatrix *rotatePhiIrregBox =
new G4RotationMatrix();
1121 rotatePhiIrregBox->rotateX(rotAngle.x());
1122 rotatePhiIrregBox->rotateY(rotAngle.y());
1123 rotatePhiIrregBox->rotateZ(rotAngle.z());
1126 solidEndCasing =
new G4IrregBox(strEndCasing.str(),(*emcEnd).zoomPoint);
1128 ostringstream strVEndCasing;
1129 strVEndCasing <<
"logicalEndCasing_1_" << i;
1130 logicEndCasing =
new G4LogicalVolume(solidEndCasing,fCasingMaterial,strVEndCasing.str());
1132 ostringstream strPEndCasing;
1133 strPEndCasing <<
"physicalEndCasing_1_" << i;
1134 physiEndCasing =
new G4PVPlacement(rotatePhiIrregBox,center,
1135 logicEndCasing,strPEndCasing.str(),logicEndPhi,
false,i);
1137 ostringstream strEndCrystal;
1138 strEndCrystal <<
"solidEndCrystal_1_" << i;
1141 solidEndCrystal =
new G4IrregBox(strEndCrystal.str(),(*emcEnd).cryPoint);
1143 ostringstream strVEndCrystal;
1144 strVEndCrystal <<
"logicalEndCrystal_1_" << i;
1145 logicEndCrystal =
new G4LogicalVolume(solidEndCrystal,fCrystalMaterial,strVEndCrystal.str());
1147 ostringstream strPEndCrystal;
1148 strPEndCrystal <<
"physicalEndCrystal_1_" << i;
1149 physiEndCrystal =
new G4PVPlacement(0,0,logicEndCrystal,strPEndCrystal.str(),logicEndCasing,
false,i);
1151 logicEndCasing->SetVisAttributes(G4VisAttributes::Invisible);
1152 logicEndCrystal->SetVisAttributes(crystalVisAtt);
1153 logicEndCrystal->SetSensitiveDetector(besEMCSD);
1156 (*emcEnd).ReflectX();
1159 for(G4int i=0;i<35;i++)
1160 for (G4int j=0;j<8;j++)
1161 (*emcEnd).fPnt1[i][j].rotateZ(-90.*deg);
1163 solidEndPhi =
new G4Cons(
"solidEndPhi2",
1164 (*emcEnd).WorldRmin1,(*emcEnd).WorldRmax1,(*emcEnd).WorldRmin2,(*emcEnd).WorldRmax2,
1165 (*emcEnd).WorldDz/2,0*deg,22.5*deg-da);
1166 logicEndPhi =
new G4LogicalVolume(solidEndPhi, G4Material::GetMaterial(
"Air"),
"logicalEndPhi2", 0, 0, 0);
1167 for(G4int i=0;i<2;i++)
1169 G4RotationMatrix *rotatePhi =
new G4RotationMatrix();
1170 rotatePhi->rotateZ(-i*180.*deg-90.*deg);
1171 ostringstream strEndPhi;
1172 strEndPhi <<
"physicalEndPhi" << i*8+7;
1173 physiEndPhi =
new G4PVPlacement(rotatePhi,G4ThreeVector(0,0,(*emcEnd).SectorZPosition),
1174 logicEndPhi,strEndPhi.str(),logicEnd,
false,i*8+7);
1177 logicEndPhi->SetVisAttributes(endPhiVisAtt);
1179 for(G4int i=0;i<35;i++)
1181 ostringstream strEndCasing;
1182 strEndCasing <<
"solidEndCasing_2_" << i;
1185 G4ThreeVector newfPnt[8];
1186 G4ThreeVector center(0.0, 0.0, 0.0);
1187 G4ThreeVector rotAngle(0.0, 0.0, 0.0);
1191 emcEnd->
Zoom(newfPnt,zoomConst);
1193 G4RotationMatrix *rotatePhiIrregBox =
new G4RotationMatrix();
1194 rotatePhiIrregBox->rotateX(rotAngle.x());
1195 rotatePhiIrregBox->rotateY(rotAngle.y());
1196 rotatePhiIrregBox->rotateZ(rotAngle.z());
1199 solidEndCasing =
new G4IrregBox(strEndCasing.str(),(*emcEnd).zoomPoint);
1201 ostringstream strVEndCasing;
1202 strVEndCasing <<
"logicalEndCasing_2_" << i;
1203 logicEndCasing =
new G4LogicalVolume(solidEndCasing,fCasingMaterial,strVEndCasing.str());
1205 ostringstream strPEndCasing;
1206 strPEndCasing <<
"physicalEndCasing_2_" << i;
1207 physiEndCasing =
new G4PVPlacement(rotatePhiIrregBox,center,
1208 logicEndCasing,strPEndCasing.str(),logicEndPhi,
false,i);
1210 ostringstream strEndCrystal;
1211 strEndCrystal <<
"solidEndCrystal_2_" << i;
1214 solidEndCrystal =
new G4IrregBox(strEndCrystal.str(),(*emcEnd).cryPoint);
1216 ostringstream strVEndCrystal;
1217 strVEndCrystal <<
"logicalEndCrystal_2_" << i;
1218 logicEndCrystal =
new G4LogicalVolume(solidEndCrystal,fCrystalMaterial,strVEndCrystal.str());
1220 ostringstream strPEndCrystal;
1221 strPEndCrystal <<
"physicalEndCrystal_2_" << i;
1222 physiEndCrystal =
new G4PVPlacement(0,0,logicEndCrystal,strPEndCrystal.str(),logicEndCasing,
false,i);
1224 logicEndCasing->SetVisAttributes(G4VisAttributes::Invisible);
1225 logicEndCrystal->SetVisAttributes(crystalVisAtt);
1226 logicEndCrystal->SetSensitiveDetector(besEMCSD);
1258 G4double rmax=(*besEMCGeometry).BSCRmax+2.*mm;
1259 solidSupportBar =
new G4Tubs(
"solidSupportBar0",
1260 rmax+(*besEMCGeometry).SPBarThickness1,
1261 rmax+(*besEMCGeometry).SPBarThickness+(*besEMCGeometry).SPBarThickness1,
1262 (*besEMCGeometry).BSCDz
1263 +(*besEMCGeometry).TaperRingThickness3+(*besEMCGeometry).EndRingDz,
1267 logicSupportBar =
new G4LogicalVolume(solidSupportBar,stainlessSteel,
"logicalSupportBar0");
1269 physiSupportBar =
new G4PVPlacement(0,0,logicSupportBar,
"physicalSupportBar0",logicEMC,
false,0);
1271 solidSupportBar1 =
new G4Tubs(
"solidSupportBar1",
1273 rmax+(*besEMCGeometry).SPBarThickness1,
1274 (*besEMCGeometry).BSCDz+(*besEMCGeometry).TaperRingThickness3,
1275 (*besEMCGeometry).BSCPhiDphi-(*besEMCGeometry).SPBarDphi/2,
1276 (*besEMCGeometry).SPBarDphi);
1278 logicSupportBar1 =
new G4LogicalVolume(solidSupportBar1,stainlessSteel,
"logicalSupportBar1");
1280 for(G4int i=0;i<(*besEMCGeometry).BSCNbPhi/2;i++)
1282 G4RotationMatrix *rotateSPBar =
new G4RotationMatrix();
1283 rotateSPBar->rotateZ((*besEMCGeometry).BSCPhiDphi-i*2*(*besEMCGeometry).BSCPhiDphi);
1284 ostringstream strSupportBar1;
1285 strSupportBar1 <<
"physicalSupportBar1_" << i;
1286 physiSupportBar1 =
new G4PVPlacement(rotateSPBar,0,
1287 logicSupportBar1,strSupportBar1.str(),logicEMC,
false,0);
1291 solidEndRing =
new G4Tubs(
"solidEndRing",
1292 (*besEMCGeometry).EndRingRmin,
1293 (*besEMCGeometry).EndRingRmin+(*besEMCGeometry).EndRingDr/2,
1294 (*besEMCGeometry).EndRingDz/2,
1298 solidGear =
new G4Tubs(
"solidGear",
1299 (*besEMCGeometry).EndRingRmin+(*besEMCGeometry).EndRingDr/2,
1300 (*besEMCGeometry).EndRingRmin+(*besEMCGeometry).EndRingDr,
1301 (*besEMCGeometry).EndRingDz/2,
1303 (*besEMCGeometry).BSCPhiDphi);
1306 solidTaperRing1 =
new G4Tubs(
"solidTaperRing1",
1307 (*besEMCGeometry).TaperRingRmin1,
1308 (*besEMCGeometry).TaperRingRmin1+(*besEMCGeometry).TaperRingThickness1,
1309 (*besEMCGeometry).TaperRingInnerLength/2,
1313 solidTaperRing2 =
new G4Cons(
"solidTaperRing2",
1314 (*besEMCGeometry).TaperRingRmin1,
1315 (*besEMCGeometry).TaperRingRmin1+(*besEMCGeometry).TaperRingDr,
1316 (*besEMCGeometry).TaperRingRmin2,
1317 (*besEMCGeometry).TaperRingRmin2+(*besEMCGeometry).TaperRingDr,
1318 (*besEMCGeometry).TaperRingDz/2,
1322 solidTaperRing3 =
new G4Cons(
"solidTaperRing3",
1323 (*besEMCGeometry).BSCRmax2,
1324 (*besEMCGeometry).BSCRmax2+(*besEMCGeometry).TaperRingOuterLength1,
1325 (*besEMCGeometry).TaperRingRmin2+(*besEMCGeometry).TaperRingDr,
1326 (*besEMCGeometry).TaperRingRmin2+(*besEMCGeometry).TaperRingDr+(*besEMCGeometry).TaperRingOuterLength,
1327 (*besEMCGeometry).TaperRingThickness3/2,
1331 logicEndRing =
new G4LogicalVolume(solidEndRing,stainlessSteel,
"logicalEndRing");
1332 logicGear =
new G4LogicalVolume(solidGear,stainlessSteel,
"logicalGear");
1333 logicTaperRing1 =
new G4LogicalVolume(solidTaperRing1,stainlessSteel,
"logicalTaperRing1");
1334 logicTaperRing2 =
new G4LogicalVolume(solidTaperRing2,stainlessSteel,
"logicalTaperRing2");
1335 logicTaperRing3 =
new G4LogicalVolume(solidTaperRing3,stainlessSteel,
"logicalTaperRing3");
1337 for(G4int i=0;i<2;i++)
1339 G4RotationMatrix *rotateSPRing =
new G4RotationMatrix();
1340 G4double zEndRing,z1,z2,z3;
1343 zEndRing = (*besEMCGeometry).BSCDz+(*besEMCGeometry).TaperRingThickness3+(*besEMCGeometry).EndRingDz/2;
1344 z1 = (*besEMCGeometry).BSCDz+(*besEMCGeometry).TaperRingThickness3
1345 -(*besEMCGeometry).TaperRingDz-(*besEMCGeometry).TaperRingInnerLength/2;
1346 z2 = (*besEMCGeometry).BSCDz+(*besEMCGeometry).TaperRingThickness3-(*besEMCGeometry).TaperRingDz/2;
1347 z3 = (*besEMCGeometry).BSCDz+(*besEMCGeometry).TaperRingThickness3/2;
1351 rotateSPRing->rotateY(180.*deg);
1352 zEndRing = -((*besEMCGeometry).BSCDz+(*besEMCGeometry).TaperRingThickness3+(*besEMCGeometry).EndRingDz/2);
1353 z1 = -((*besEMCGeometry).BSCDz+(*besEMCGeometry).TaperRingThickness3
1354 -(*besEMCGeometry).TaperRingDz-(*besEMCGeometry).TaperRingInnerLength/2);
1355 z2 = -((*besEMCGeometry).BSCDz+(*besEMCGeometry).TaperRingThickness3-(*besEMCGeometry).TaperRingDz/2);
1356 z3 = -((*besEMCGeometry).BSCDz+(*besEMCGeometry).TaperRingThickness3/2);
1359 ostringstream strEndRing;
1360 strEndRing <<
"physicalEndRing_" << i;
1361 physiEndRing =
new G4PVPlacement(rotateSPRing,G4ThreeVector(0,0,zEndRing),
1362 logicEndRing,strEndRing.str(),logicEMC,
false,0);
1364 for(G4int j=0;j<(*besEMCGeometry).BSCNbPhi/2;j++)
1366 G4RotationMatrix *rotateGear =
new G4RotationMatrix();
1367 rotateGear->rotateZ((*besEMCGeometry).BSCPhiDphi/2-j*2*(*besEMCGeometry).BSCPhiDphi);
1369 ostringstream strGear;
1370 strGear <<
"physicalGear_" << i <<
"_" <<j;
1371 physiGear =
new G4PVPlacement(rotateGear,G4ThreeVector(0,0,zEndRing),
1372 logicGear,strGear.str(),logicEMC,
false,0);
1375 ostringstream strTaperRing1;
1376 strTaperRing1 <<
"physicalTaperRing1_" << i;
1377 physiTaperRing1 =
new G4PVPlacement(rotateSPRing,G4ThreeVector(0,0,z1),
1378 logicTaperRing1,strTaperRing1.str(),logicEMC,
false,0);
1380 ostringstream strTaperRing2;
1381 strTaperRing2 <<
"physicalTaperRing2_" << i;
1382 physiTaperRing2 =
new G4PVPlacement(rotateSPRing,G4ThreeVector(0,0,z2),
1383 logicTaperRing2,strTaperRing2.str(),logicEMC,
false,0);
1385 ostringstream strTaperRing3;
1386 strTaperRing3 <<
"physicalTaperRing3_" << i;
1387 physiTaperRing3 =
new G4PVPlacement(rotateSPRing,G4ThreeVector(0,0,z3),
1388 logicTaperRing3,strTaperRing3.str(),logicEMC,
false,0);