12#include "G4ThreeVector.hh"
13#include "G4ReflectionFactory.hh"
24#include "G4IrregBox.hh"
26#include "G4Transform3D.hh"
30#include "G4UnionSolid.hh"
31#include "G4SubtractionSolid.hh"
32#include "G4IntersectionSolid.hh"
33#include "G4Polyhedra.hh"
34#include "G4Polycone.hh"
35#include "G4LogicalVolume.hh"
36#include "G4VPhysicalVolume.hh"
37#include "G4Material.hh"
38#include "G4PVPlacement.hh"
39#include "G4PVParameterised.hh"
40#include "G4PVReplica.hh"
42#include "G4UniformMagField.hh"
43#include "G4FieldManager.hh"
44#include "G4TransportationManager.hh"
45#include "G4SDManager.hh"
46#include "G4RunManager.hh"
47#include "G4VisAttributes.hh"
49#include "G4AffineTransform.hh"
55#include <TGraphErrors.h>
64#define CHECKIrreg false
69{
return fBesEmcConstruction;}
73 solidEMC(0),logicEMC(0),physiEMC(0),logicBSCWorld(0),
74 solidBSCPhi(0),logicBSCPhi(0),physiBSCPhi(0),
75 solidBSCTheta(0),logicBSCTheta(0),physiBSCTheta(0),
76 solidBSCCrystal(0),logicBSCCrystal(0),physiBSCCrystal(0),
77 magField(0),detectorMessenger(0),besEMCSD(0),crystalParam(0),
78 logicEnd(0),logicEndPhi(0),logicEndCasing(0),logicEndCrystal(0),
79 logicRear(0),logicRearCasing(0),logicOrgGlass(0),logicPD(0),
80 logicAlPlate(0),logicPreAmpBox(0),logicAirInPABox(0),
81 logicHangingPlate(0),logicOCGirder(0),logicCable(0),logicWaterPipe(0),
82 logicSupportBar(0),logicSupportBar1(0),logicEndRing(0),logicGear(0),
83 logicTaperRing1(0),logicTaperRing2(0),logicTaperRing3(0)
85 if(fBesEmcConstruction)
86 { G4cout<<
"BesEmcConstruction constructed twice."<<G4endl; exit(-1);
88 fBesEmcConstruction=
this;
100 if(detectorMessenger)
delete detectorMessenger;
101 if(crystalParam)
delete crystalParam;
102 if(besEMCGeometry)
delete besEMCGeometry;
103 if(emcEnd)
delete emcEnd;
110 gErrorIgnoreLevel = kFatal;
115 G4SDManager* SDman = G4SDManager::GetSDMpointer();
117 besEMCSD =
new BesEmcSD(
"CalorSD",
this,besEMCGeometry);
118 SDman->AddNewDetector( besEMCSD );
128 physiEMC =
new G4PVPlacement(0,
129 G4ThreeVector(0.0 ,0.0 ,0.0),
130 logicEMC,
"physicalEMC",logicBes,
false, 0,
CHECKLV0);
131 G4cout<<
"logicEmc: === "<<logicEMC<<
" physiEmc "<<physiEMC<<G4endl;
142 phiNbCrystals = (*besEMCGeometry).BSCNbPhi;
143 thetaNbCrystals = (*besEMCGeometry).BSCNbTheta*2;
145 G4double da=0.001*deg;
150 solidBSC =
new G4Tubs(
"solidBSC",
151 (*besEMCGeometry).TaperRingRmin1,
152 (*besEMCGeometry).BSCRmax+(*besEMCGeometry).SPBarThickness+(*besEMCGeometry).SPBarThickness1+2.1*mm,
153 (*besEMCGeometry).BSCDz+(*besEMCGeometry).TaperRingThickness3+(*besEMCGeometry).EndRingDz,
157 solidESC =
new G4Cons(
"solidESC",(*emcEnd).WorldRmin1,(*emcEnd).WorldRmax1,
158 (*emcEnd).WorldRmin2,(*emcEnd).WorldRmax2,
159 (*emcEnd).WorldDz/2,0.*deg,360.*deg);
161 solidEMC =
new G4UnionSolid(
"solidEMC0",
165 G4ThreeVector(0,0,(*emcEnd).WorldZPosition));
167 G4RotationMatrix *rotateESC =
new G4RotationMatrix();
168 rotateESC->rotateY(180.*deg);
170 solidEMC =
new G4UnionSolid(
"solidEMC",
174 G4ThreeVector(0,0,-(*emcEnd).WorldZPosition));
176 logicEMC =
new G4LogicalVolume(solidEMC,
177 G4Material::GetMaterial(
"Air"),
180 physiEMC =
new G4PVPlacement(0,
188 solidBSCWorld =
new G4SubtractionSolid(
"solidBSCWorld0",
192 G4ThreeVector(0,0,(*emcEnd).WorldZPosition));
194 solidBSCWorld =
new G4SubtractionSolid(
"solidBSCWorld",
198 G4ThreeVector(0,0,-(*emcEnd).WorldZPosition));
200 logicBSCWorld =
new G4LogicalVolume(solidBSCWorld,
201 G4Material::GetMaterial(
"Air"),
204 G4RotationMatrix *rotBSC =
new G4RotationMatrix();
205 rotBSC->rotateY(180.*deg);
206 physiBSCWorld =
new G4PVPlacement(rotBSC,
214 G4RotationMatrix *rotateMatrix[200];
215 G4double oOp,ox,oy,oz;
216 G4double
delta = 0*deg;
217 G4ThreeVector axis = G4ThreeVector(0,0,0);
218 oOp=(*besEMCGeometry).BSCRmin/
sin(0.5*(*besEMCGeometry).BSCPhiDphi+90*deg)
219 *
sin((*besEMCGeometry).BSCAngleRotat);
220 G4double ll=(*besEMCGeometry).BSCCryLength;
221 G4double rr=(*besEMCGeometry).BSCRmin;
222 G4double oj=sqrt(ll*ll+rr*rr-2*ll*rr*
cos(180.*deg-(*besEMCGeometry).BSCAngleRotat));
223 G4double oij=90.*deg-(*besEMCGeometry).BSCPhiDphi/2.-(*besEMCGeometry).BSCAngleRotat;
224 G4double doj=asin(
sin(180.*deg-(*besEMCGeometry).BSCAngleRotat)/oj*ll);
225 G4double ioj=(*besEMCGeometry).BSCPhiDphi/2.+doj;
226 G4double ij=oj/
sin(oij)*
sin(ioj);
227 G4double dOp=rr/
sin(90.*deg-(*besEMCGeometry).BSCPhiDphi/2.)
228 *
sin(90.*deg+(*besEMCGeometry).BSCPhiDphi/2.-(*besEMCGeometry).BSCAngleRotat);
229 G4double cOp=rr/
sin(90.*deg+(*besEMCGeometry).BSCPhiDphi/2.)
230 *
sin(90.*deg-(*besEMCGeometry).BSCPhiDphi/2.-(*besEMCGeometry).BSCAngleRotat);
231 G4double ch=(dOp+ll)/
cos((*besEMCGeometry).BSCPhiDphi)-cOp;
232 G4double hi=(dOp+ll)*
tan((*besEMCGeometry).BSCPhiDphi)-ij;
233 G4double oh=sqrt(ch*ch+rr*rr-2*ch*rr*
cos(180*deg-(*besEMCGeometry).BSCAngleRotat));
234 G4double hoi=asin(
sin(180*deg-oij)/oh*hi);
235 G4double dok=asin(
sin(180*deg-(*besEMCGeometry).BSCAngleRotat)/oh*ch);
237 G4cout <<
"oj=" <<oj/cm<<G4endl
238 <<
"oij="<<oij/deg<<G4endl
239 <<
"doj="<<doj/deg<<G4endl
240 <<
"ioj="<<ioj/deg<<G4endl
241 <<
"ij="<<ij/cm<<G4endl
242 <<
"dOp="<<dOp/cm<<G4endl
243 <<
"cOp="<<cOp/cm<<G4endl
244 <<
"ch="<<ch/cm<<G4endl
245 <<
"hi="<<hi/cm<<G4endl
246 <<
"oh="<<oh/cm<<G4endl
247 <<
"hoi="<<hoi/deg<<G4endl
248 <<
"dok="<<dok/deg<<G4endl;
251 G4double cmo = asin(
sin(180*degree-(*besEMCGeometry).BSCAngleRotat)/(*besEMCGeometry).BSCRmax2*dOp);
252 G4double cm = (*besEMCGeometry).BSCRmax2/
sin(180*degree-(*besEMCGeometry).BSCAngleRotat)*
sin((*besEMCGeometry).BSCAngleRotat-cmo);
253 G4ThreeVector Pout(dOp+cm*
cos((*besEMCGeometry).BSCAngleRotat),-cm*
sin((*besEMCGeometry).BSCAngleRotat),(*besEMCGeometry).BSCDz);
255 G4double rTaperRingOuter1 = (*besEMCGeometry).TaperRingRmin1+(*besEMCGeometry).TaperRingThickness1;
256 G4double rTaperRingOuter2 = (*besEMCGeometry).TaperRingRmin2+(*besEMCGeometry).TaperRingDr;
257 G4double zTaperRing1 = (*besEMCGeometry).BSCDz+(*besEMCGeometry).TaperRingThickness3-(*besEMCGeometry).TaperRingDz;
258 G4double zTaperRing2 = (*besEMCGeometry).BSCDz+(*besEMCGeometry).TaperRingThickness3;
260 G4RotationMatrix* rotIntersection =
new G4RotationMatrix();
261 rotIntersection->rotateZ(-(*besEMCGeometry).BSCAngleRotat-(*besEMCGeometry).BSCPhiDphi/2.-hoi);
262 G4ThreeVector
P(oOp*
cos(-90.*deg+(*besEMCGeometry).BSCAngleRotat+hoi), oOp*
sin(-90.*deg+(*besEMCGeometry).BSCAngleRotat+hoi), 0);
263 G4AffineTransform Td(rotIntersection,
P);
264 G4ThreeVector md = Td.Inverse().TransformPoint(G4ThreeVector(0,0,0));
265 G4ThreeVector vd = Td.Inverse().TransformPoint(Pout);
267 G4double zPlane0[4]={-(*besEMCGeometry).BSCDz,-zTaperRing1,zTaperRing1,(*besEMCGeometry).BSCDz};
268 G4double rInner0[4]={vd.perp(),cOp,cOp,vd.perp()};
269 G4double rOuter0[4]={(*besEMCGeometry).BSCPhiRmax,(*besEMCGeometry).BSCPhiRmax,(*besEMCGeometry).BSCPhiRmax,(*besEMCGeometry).BSCPhiRmax};
271 G4double zPlane1[4]={-zTaperRing2,-zTaperRing1,zTaperRing1,zTaperRing2};
272 G4double rInner1[4]={rTaperRingOuter2,rTaperRingOuter1,rTaperRingOuter1,rTaperRingOuter2};
273 G4double rOuter1[4]={(*besEMCGeometry).BSCRmax,(*besEMCGeometry).BSCRmax,(*besEMCGeometry).BSCRmax,(*besEMCGeometry).BSCRmax};
275 G4VSolid* solidBSCPhi1 =
new G4Polycone(
"solidBSCPhi1",0,360*deg,4,zPlane1,rInner1,rOuter1);
276 G4VSolid* solidBSCPhi0 =
new G4Polyhedra(
"solidBSCPhi0",360.*deg-(*besEMCGeometry).BSCPhiDphi,(*besEMCGeometry).BSCPhiDphi,(*besEMCGeometry).BSCNbPhi/2,4,zPlane0,rInner0,rOuter0);
277 G4IntersectionSolid* solidBSCPhi =
new G4IntersectionSolid(
"solidBSCPhi", solidBSCPhi0, solidBSCPhi1, 0, md);
279 logicBSCPhi =
new G4LogicalVolume(solidBSCPhi,
280 G4Material::GetMaterial(
"Air"),
284 for(G4int j=0;j<(*besEMCGeometry).BSCNbPhi;j++)
286 if(j<(*besEMCGeometry).BSCNbPhi/2) {
287 i=(*besEMCGeometry).BSCNbPhi/2-j-1;
289 i=(*besEMCGeometry).BSCNbPhi*3/2-j-1;
291 rotateMatrix[i] =
new G4RotationMatrix();
292 rotateMatrix[i]->rotateZ(-i*(*besEMCGeometry).BSCPhiDphi
293 -(*besEMCGeometry).BSCAngleRotat
294 -(*besEMCGeometry).BSCPhiDphi/2.
296 rotateMatrix[i]->getAngleAxis(
delta, axis);
300 ox=oOp*
cos(-90.*deg+(*besEMCGeometry).BSCAngleRotat+hoi
301 +i*(*besEMCGeometry).BSCPhiDphi);
302 oy=oOp*
sin(-90.*deg+(*besEMCGeometry).BSCAngleRotat+hoi
303 +i*(*besEMCGeometry).BSCPhiDphi);
306 ostringstream strPhi;
307 strPhi <<
"physicalBSCPhi" << j;
309 physiBSCPhi =
new G4PVPlacement(rotateMatrix[i],
310 G4ThreeVector(ox,oy,oz),
323 G4double zHalfLength[50];
324 G4double thetaAxis[50];
325 G4double phiAxis[50];
326 G4double yHalfLength1[50];
327 G4double xHalfLength2[50];
328 G4double xHalfLength1[50];
329 G4double tanAlpha1[50];
330 G4double yHalfLength2[50];
331 G4double xHalfLength4[50];
332 G4double xHalfLength3[50];
333 G4double tanAlpha2[50];
334 G4double xPosition[50];
335 G4double yPosition[50];
336 G4double zPosition[50];
337 G4double thetaPosition[50];
338 for(i=0;i<(*besEMCGeometry).BSCNbTheta;i++)
340 zHalfLength[i] = (*besEMCGeometry).zHalfLength[i];
341 thetaAxis[i] = (*besEMCGeometry).thetaAxis[i];
342 phiAxis[i] = (*besEMCGeometry).phiAxis[i];
343 yHalfLength1[i] = (*besEMCGeometry).yHalfLength1[i];
344 xHalfLength2[i] = (*besEMCGeometry).xHalfLength2[i];
345 xHalfLength1[i] = (*besEMCGeometry).xHalfLength1[i];
346 tanAlpha1[i] = (*besEMCGeometry).tanAlpha1[i];
347 yHalfLength2[i] = (*besEMCGeometry).yHalfLength2[i];
348 xHalfLength4[i] = (*besEMCGeometry).xHalfLength4[i];
349 xHalfLength3[i] = (*besEMCGeometry).xHalfLength3[i];
350 tanAlpha2[i] = (*besEMCGeometry).tanAlpha2[i];
351 xPosition[i] = (*besEMCGeometry).xPosition[i];
352 yPosition[i] = (*besEMCGeometry).yPosition[i];
353 zPosition[i] = (*besEMCGeometry).zPosition[i];
354 thetaPosition[i]= (*besEMCGeometry).thetaPosition[i];
356 G4cout <<
"The sizes of the "<<i+1<<
" crystal are:" << G4endl
357 <<
"zHalfLength ="<<zHalfLength[i]/cm<<
"(cm)," << G4endl
358 <<
"thetaAxis ="<<thetaAxis[i]/deg <<
"(deg),"<< G4endl
359 <<
"phiAxis ="<< phiAxis[i]/deg <<
"(deg),"<< G4endl
360 <<
"yHalfLength1="<<yHalfLength1[i]/cm<<
"(cm),"<< G4endl
361 <<
"xHalfLength1="<<xHalfLength1[i]/cm<<
"(cm),"<< G4endl
362 <<
"xHalfLength2="<<xHalfLength2[i]/cm<<
"(cm),"<< G4endl
363 <<
"tanAlpha1 ="<< tanAlpha1[i] << G4endl
364 <<
"yHalfLength2="<<yHalfLength2[i]/cm<<
"(cm),"<< G4endl
365 <<
"xHalfLength3="<<xHalfLength3[i]/cm<<
"(cm),"<< G4endl
366 <<
"xHalfLength4="<<xHalfLength4[i]/cm<<
"(cm),"<< G4endl
367 <<
"tanAlpha2 =" << tanAlpha2[i] <<
"." << G4endl;
371 solidBSCCrystal =
new G4Trap(
"solidCrystal",
372 100*cm, 100*deg, 100*deg,
373 100*cm, 100*cm, 100*cm, 100*deg,
374 100*cm, 100*cm, 100*cm, 100*deg);
376 logicBSCCrystal =
new G4LogicalVolume(solidBSCCrystal,
383 (*besEMCGeometry).BSCNbTheta*2,
389 solidRear =
new G4Box(
"solidRearBox",
390 (*besEMCGeometry).rearBoxLength/2,
391 (*besEMCGeometry).rearBoxLength/2,
392 (*besEMCGeometry).rearBoxDz/2);
394 logicRear =
new G4LogicalVolume(solidRear,
395 G4Material::GetMaterial(
"Air"),
399 solidOrgGlass =
new G4Box(
"solidOrganicGlass",
400 (*besEMCGeometry).orgGlassLengthX/2,
401 (*besEMCGeometry).orgGlassLengthY/2,
402 (*besEMCGeometry).orgGlassLengthZ/2);
404 logicOrgGlass =
new G4LogicalVolume(solidOrgGlass,
406 "logicalOrganicGlass");
408 physiOrgGlass =
new G4PVPlacement(0,
409 G4ThreeVector(0,0,-((*besEMCGeometry).rearBoxDz-(*besEMCGeometry).orgGlassLengthZ)/2),
411 "physicalOrganicGlass",
417 solidCasingBox =
new G4Box(
"solidCasingBox",
418 (*besEMCGeometry).rearBoxLength/2,
419 (*besEMCGeometry).rearBoxLength/2,
420 (*besEMCGeometry).rearCasingThickness/2);
422 solidAirHole =
new G4Box(
"solidAirHole",
423 (*besEMCGeometry).orgGlassLengthX/2,
424 (*besEMCGeometry).orgGlassLengthY/2,
425 (*besEMCGeometry).rearBoxDz/2);
427 solidRearCasing =
new G4SubtractionSolid(
"solidRearCasing",
433 logicRearCasing =
new G4LogicalVolume(solidRearCasing,
435 "logicalRearCasing");
437 physiRearCasing =
new G4PVPlacement(0,
438 G4ThreeVector(0,0,-((*besEMCGeometry).rearBoxDz-(*besEMCGeometry).rearCasingThickness)/2),
440 "physicalRearCasing",
446 solidAlBox =
new G4Box(
"solidAlBox",
447 (*besEMCGeometry).rearBoxLength/2,
448 (*besEMCGeometry).rearBoxLength/2,
449 (*besEMCGeometry).AlPlateDz/2);
451 solidAlPlate =
new G4SubtractionSolid(
"solidAlPlate",
457 logicAlPlate =
new G4LogicalVolume(solidAlPlate,
458 G4Material::GetMaterial(
"Aluminium"),
461 physiAlPlate =
new G4PVPlacement(0,
462 G4ThreeVector(0,0,-((*besEMCGeometry).rearBoxDz/2
463 -(*besEMCGeometry).rearCasingThickness
464 -(*besEMCGeometry).AlPlateDz/2)),
472 solidPD =
new G4Box(
"solidPD",
473 (*besEMCGeometry).PDLengthX,
474 (*besEMCGeometry).PDLengthY/2,
475 (*besEMCGeometry).PDLengthZ/2);
477 logicPD =
new G4LogicalVolume(solidPD,
478 G4Material::GetMaterial(
"M_Silicon"),
481 physiPD =
new G4PVPlacement(0,
482 G4ThreeVector(0,0,-((*besEMCGeometry).rearBoxDz/2
483 -(*besEMCGeometry).orgGlassLengthZ
484 -(*besEMCGeometry).PDLengthZ/2)),
492 solidPreAmpBox =
new G4Box(
"solidPreAmpBox",
493 (*besEMCGeometry).rearBoxLength/2,
494 (*besEMCGeometry).rearBoxLength/2,
495 (*besEMCGeometry).PABoxDz/2);
497 logicPreAmpBox =
new G4LogicalVolume(solidPreAmpBox,
498 G4Material::GetMaterial(
"Aluminium"),
501 physiPreAmpBox =
new G4PVPlacement(0,
502 G4ThreeVector(0,0,-((*besEMCGeometry).rearBoxDz/2
503 -(*besEMCGeometry).rearCasingThickness
504 -(*besEMCGeometry).AlPlateDz
505 -(*besEMCGeometry).PABoxDz/2)),
513 solidAirInPABox =
new G4Box(
"solidAirInPABox",
514 (*besEMCGeometry).rearBoxLength/2-(*besEMCGeometry).PABoxThickness,
515 (*besEMCGeometry).rearBoxLength/2-(*besEMCGeometry).PABoxThickness,
516 (*besEMCGeometry).PABoxDz/2-(*besEMCGeometry).PABoxThickness);
518 logicAirInPABox =
new G4LogicalVolume(solidAirInPABox,
519 G4Material::GetMaterial(
"Air"),
520 "logicalAirInPABox");
522 physiAirInPABox =
new G4PVPlacement(0,
525 "physicalAirInPABox",
531 solidHangingPlate =
new G4Box(
"solidHangingPlate",
532 (*besEMCGeometry).rearBoxLength/2,
533 (*besEMCGeometry).rearBoxLength/2,
534 (*besEMCGeometry).HangingPlateDz/2);
536 logicHangingPlate =
new G4LogicalVolume(solidHangingPlate,stainlessSteel,
"logicalHangingPlate");
538 physiHangingPlate =
new G4PVPlacement(0,
539 G4ThreeVector(0,0,-((*besEMCGeometry).rearBoxDz/2
540 -(*besEMCGeometry).rearCasingThickness
541 -(*besEMCGeometry).AlPlateDz
542 -(*besEMCGeometry).PABoxDz
543 -(*besEMCGeometry).HangingPlateDz/2)),
545 "physicalHangingPlate",
551 solidWaterPipe =
new G4Tubs(
"solidWaterPipe",
553 (*besEMCGeometry).waterPipeDr,
554 (*besEMCGeometry).BSCDz,
558 logicWaterPipe =
new G4LogicalVolume(solidWaterPipe,waterPipe,
"logicalWaterPipe");
560 physiWaterPipe =
new G4PVPlacement(0,
561 G4ThreeVector((*besEMCGeometry).cablePosX[0]-2*(*besEMCGeometry).cableDr,
562 (*besEMCGeometry).cablePosY[0]-(*besEMCGeometry).cableDr-(*besEMCGeometry).waterPipeDr,
575 G4String nameCrystalAndCasing=
"CrystalAndCasing";
578 for(i=startID;i<=thetaNbCrystals;i++)
580 ostringstream strSolidCasing;
581 strSolidCasing <<
"solidBSCCasing" << i-1;
582 ostringstream strVolumeCasing;
583 strVolumeCasing <<
"logicalBSCCasing" << i-1;
584 ostringstream strPhysiCasing;
585 strPhysiCasing <<
"physicalBSCCasing" << i-1;
587 if(i>(*besEMCGeometry).BSCNbTheta)
589 id=i-(*besEMCGeometry).BSCNbTheta-1;
590 solidBSCTheta =
new G4Trap(strSolidCasing.str(),
606 logicBSCTheta =
new G4LogicalVolume(solidBSCTheta,
608 strVolumeCasing.str());
610 rotateMatrix[(*besEMCGeometry).BSCNbPhi+i-1] =
new G4RotationMatrix();
611 rotateMatrix[(*besEMCGeometry).BSCNbPhi+i-1]->rotateZ(-90*deg);
612 rotateMatrix[(*besEMCGeometry).BSCNbPhi+i-1]
613 ->rotateX(-thetaPosition[
id]);
617 new G4PVPlacement(rotateMatrix[(*besEMCGeometry).BSCNbPhi+i-1],
618 G4ThreeVector(xPosition[
id],
621 strPhysiCasing.str(),
629 G4VisAttributes* rightVisAtt=
new G4VisAttributes(G4Colour(1.0,0.,0.));
630 rightVisAtt->SetVisibility(
true);
631 logicBSCTheta->SetVisAttributes(rightVisAtt);
632 logicBSCTheta->SetVisAttributes(G4VisAttributes::Invisible);
635 ostringstream strRear;
636 strRear <<
"physicalRearBox_1_" << i-1;
638 physiRear =
new G4PVPlacement(rotateMatrix[(*besEMCGeometry).BSCNbPhi+i-1],
639 G4ThreeVector((*besEMCGeometry).rearBoxPosX[
id],
640 (*besEMCGeometry).rearBoxPosY[
id],
641 (*besEMCGeometry).rearBoxPosZ[
id]),
648 ostringstream strGirder;
649 strGirder <<
"solidOpenningCutGirder_1_" << i-1;
650 solidOCGirder =
new G4Cons(strGirder.str(),
651 (*besEMCGeometry).OCGirderRmin1[
id],
652 (*besEMCGeometry).BSCPhiRmax,
653 (*besEMCGeometry).OCGirderRmin2[
id],
654 (*besEMCGeometry).BSCPhiRmax,
655 (*besEMCGeometry).OCGirderDz[
id]/2,
656 360.*deg-(*besEMCGeometry).OCGirderAngle/2,
657 (*besEMCGeometry).OCGirderAngle/2-da);
659 ostringstream strVGirder;
660 strVGirder <<
"logicalOpenningCutGirder_1_" << i-1;
661 logicOCGirder =
new G4LogicalVolume(solidOCGirder,stainlessSteel,strVGirder.str());
662 logicOCGirder->SetVisAttributes(G4VisAttributes::Invisible);
664 ostringstream strPGirder;
665 strPGirder <<
"physicalOpenningCutGirder_1_" << i-1;
666 physiOCGirder =
new G4PVPlacement(0,
667 G4ThreeVector(0,0,(*besEMCGeometry).OCGirderPosZ[
id]),
674 if(
id<(*besEMCGeometry).BSCNbTheta-1)
676 G4double zLength = (*besEMCGeometry).OCGirderPosZ[
id+1]
677 -(*besEMCGeometry).OCGirderPosZ[id]
678 -(*besEMCGeometry).OCGirderDz[
id+1]/2-(*besEMCGeometry).OCGirderDz[id]/2;
679 G4double zPositionOCGirder = (*besEMCGeometry).OCGirderPosZ[
id+1]
680 -(*besEMCGeometry).OCGirderDz[
id+1]/2-zLength/2;
682 ostringstream strGirder2;
683 strGirder2 <<
"solidOpenningCutGirder_2_" << i-1;
684 solidOCGirder =
new G4Cons(strGirder2.str(),
685 (*besEMCGeometry).OCGirderRmin2[
id],
686 (*besEMCGeometry).BSCPhiRmax,
687 (*besEMCGeometry).OCGirderRmin1[
id+1],
688 (*besEMCGeometry).BSCPhiRmax,
690 360.*deg-(*besEMCGeometry).OCGirderAngle/2,
691 (*besEMCGeometry).OCGirderAngle/2-da);
693 ostringstream strVGirder2;
694 strVGirder2 <<
"logicalOpenningCutGirder_2_" << i-1;
695 logicOCGirder =
new G4LogicalVolume(solidOCGirder,stainlessSteel,strVGirder2.str());
696 logicOCGirder->SetVisAttributes(G4VisAttributes::Invisible);
698 ostringstream strPGirder2;
699 strPGirder2 <<
"physicalOpenningCutGirder_2_" << i-1;
700 physiOCGirder =
new G4PVPlacement(0,
701 G4ThreeVector(0,0,zPositionOCGirder),
709 ostringstream strBSCCable;
710 strBSCCable <<
"solidBSCCable_1_" << i-1;
711 solidCable =
new G4Tubs(strBSCCable.str(),
713 (*besEMCGeometry).cableDr,
714 (*besEMCGeometry).cableLength[
id]/2,
718 ostringstream strVBSCCable;
719 strVBSCCable <<
"logicalBSCCable_1_" << i-1;
720 logicCable =
new G4LogicalVolume(solidCable,cable,strVBSCCable.str());
722 ostringstream strPBSCCable;
723 strPBSCCable <<
"physicalBSCCable_1_" << i-1;
724 physiCable =
new G4PVPlacement(0,
725 G4ThreeVector((*besEMCGeometry).cablePosX[
id],
726 (*besEMCGeometry).cablePosY[
id],
727 (*besEMCGeometry).cablePosZ[
id]),
733 logicCable->SetVisAttributes(G4VisAttributes::Invisible);
737 id=(*besEMCGeometry).BSCNbTheta-i;
738 solidBSCTheta =
new G4Trap(strSolidCasing.str(),
754 logicBSCTheta =
new G4LogicalVolume(solidBSCTheta,
756 strVolumeCasing.str());
758 rotateMatrix[(*besEMCGeometry).BSCNbPhi+i-1] =
new G4RotationMatrix();
759 rotateMatrix[(*besEMCGeometry).BSCNbPhi+i-1]->rotateZ(-90*deg);
760 rotateMatrix[(*besEMCGeometry).BSCNbPhi+i-1]
761 ->rotateX(-180*deg+thetaPosition[
id]);
763 new G4PVPlacement(rotateMatrix[(*besEMCGeometry).BSCNbPhi+i-1],
764 G4ThreeVector(xPosition[
id],
767 strPhysiCasing.str(),
774 G4VisAttributes* rightVisAtt=
new G4VisAttributes(G4Colour(1.0,0.,0.));
775 rightVisAtt->SetVisibility(
true);
776 logicBSCTheta->SetVisAttributes(rightVisAtt);
777 logicBSCTheta->SetVisAttributes(G4VisAttributes::Invisible);
780 ostringstream strRear;
781 strRear <<
"physicalRearBox_2_" << i-1;
783 physiRear =
new G4PVPlacement(rotateMatrix[(*besEMCGeometry).BSCNbPhi+i-1],
784 G4ThreeVector((*besEMCGeometry).rearBoxPosX[
id],
785 (*besEMCGeometry).rearBoxPosY[
id],
786 -(*besEMCGeometry).rearBoxPosZ[
id]),
793 ostringstream strGirder;
794 strGirder <<
"solidOpenningCutGirder_3_" << i-1;
795 solidOCGirder =
new G4Cons(strGirder.str(),
796 (*besEMCGeometry).OCGirderRmin2[
id],
797 (*besEMCGeometry).BSCPhiRmax,
798 (*besEMCGeometry).OCGirderRmin1[
id],
799 (*besEMCGeometry).BSCPhiRmax,
800 (*besEMCGeometry).OCGirderDz[
id]/2,
801 360.*deg-(*besEMCGeometry).OCGirderAngle/2,
802 (*besEMCGeometry).OCGirderAngle/2-da);
804 ostringstream strVGirder;
805 strVGirder <<
"logicalOpenningCutGirder_3_" << i-1;
806 logicOCGirder =
new G4LogicalVolume(solidOCGirder,stainlessSteel,strVGirder.str());
807 logicOCGirder->SetVisAttributes(G4VisAttributes::Invisible);
809 ostringstream strPGirder;
810 strPGirder <<
"physicalOpenningCutGirder_3_" << i-1;
811 physiOCGirder =
new G4PVPlacement(0,
812 G4ThreeVector(0,0,-(*besEMCGeometry).OCGirderPosZ[
id]),
819 if(
id<(*besEMCGeometry).BSCNbTheta-1)
821 G4double zLength = (*besEMCGeometry).OCGirderPosZ[
id+1]-(*besEMCGeometry).OCGirderPosZ[id]
822 -(*besEMCGeometry).OCGirderDz[
id+1]/2-(*besEMCGeometry).OCGirderDz[id]/2;
823 G4double zPositionOCGirder = (*besEMCGeometry).OCGirderPosZ[
id+1]-(*besEMCGeometry).OCGirderDz[
id+1]/2-zLength/2;
825 ostringstream strGirder2;
826 strGirder2 <<
"solidOpenningCutGirder_4_" << i-1;
827 solidOCGirder =
new G4Cons(strGirder2.str(),
828 (*besEMCGeometry).OCGirderRmin1[
id+1],
829 (*besEMCGeometry).BSCPhiRmax,
830 (*besEMCGeometry).OCGirderRmin2[
id],
831 (*besEMCGeometry).BSCPhiRmax,
833 360.*deg-(*besEMCGeometry).OCGirderAngle/2,
834 (*besEMCGeometry).OCGirderAngle/2-da);
836 ostringstream strVGirder2;
837 strVGirder2 <<
"logicalOpenningCutGirder_4_" << i-1;
839 =
new G4LogicalVolume(solidOCGirder,stainlessSteel,strVGirder2.str());
840 logicOCGirder->SetVisAttributes(G4VisAttributes::Invisible);
842 ostringstream strPGirder2;
843 strPGirder2 <<
"physicalOpenningCutGirder_4_" << i-1;
844 physiOCGirder =
new G4PVPlacement(0,
845 G4ThreeVector(0,0,-zPositionOCGirder),
853 ostringstream strBSCCable;
854 strBSCCable <<
"solidBSCCable_2_" << i-1;
855 solidCable =
new G4Tubs(strBSCCable.str(),
857 (*besEMCGeometry).cableDr,
858 (*besEMCGeometry).cableLength[
id]/2,
862 ostringstream strVBSCCable;
863 strVBSCCable <<
"logicalBSCCable_2_" << i-1;
864 logicCable =
new G4LogicalVolume(solidCable,cable,strVBSCCable.str());
866 ostringstream strPBSCCable;
867 strPBSCCable <<
"physicalBSCCable_2_" << i-1;
868 physiCable =
new G4PVPlacement(0,
869 G4ThreeVector((*besEMCGeometry).cablePosX[
id],
870 (*besEMCGeometry).cablePosY[
id],
871 -(*besEMCGeometry).cablePosZ[
id]),
877 logicCable->SetVisAttributes(G4VisAttributes::Invisible);
881 ostringstream strCrystal;
882 strCrystal <<
"physicalCrystal" << i-1;
883 physiBSCCrystal =
new G4PVParameterised(
890 (*besEMCGeometry).physiBSCCrystal[i]=physiBSCCrystal;
892 physiBSCCrystal->SetCopyNo(i);
893 if(
CHECKLV4) physiBSCCrystal->CheckOverlaps();
896 G4cout <<
"BesEmcConstruction*****************************"<< G4endl
897 <<
"point of crystal =" <<physiBSCCrystal << G4endl
899 <<
"point of excepted=" <<physiBSCTheta << G4endl;
916 if(logicEMC&&physiEMC&&verboseLevel>4){
917 G4cout<<
"logicEmc "<<logicEMC<<
" physiEmc "<<physiEMC<<G4endl;
918 G4cout<<
"list geo tree"<<G4endl;
920 int NdaughterofEMC = logicEMC->GetNoDaughters();
922 for(
int i = 0; i < NdaughterofEMC; i++)
924 G4LogicalVolume *daughterofEmc = logicEMC->GetDaughter(i)->GetLogicalVolume();
925 G4cout<<i<<
"/"<<NdaughterofEMC<<
" name: "<<daughterofEmc->GetName()<<
" "<<daughterofEmc<<
" shape: "<<daughterofEmc->GetSolid()->GetName()<<G4endl;
926 int NdaughterofEmc_2 = daughterofEmc->GetNoDaughters();
927 for(
int j = 0; j < NdaughterofEmc_2; j++)
929 G4LogicalVolume *daughterofEmc_2 = daughterofEmc->GetDaughter(j)->GetLogicalVolume();
930 G4cout<<
" --> "<<j<<
"/"<<NdaughterofEmc_2<<
" name: "<<daughterofEmc_2->GetName()<<
" "<<daughterofEmc_2<<
" shape: "<<daughterofEmc_2->GetSolid()->GetName()<<G4endl;
931 int NdaughterofEmc_3 = daughterofEmc_2->GetNoDaughters();
932 for(
int k = 0; k < NdaughterofEmc_3; k++)
934 G4LogicalVolume *daughterofEmc_3 = daughterofEmc_2->GetDaughter(k)->GetLogicalVolume();
935 G4cout<<
" --> "<<k<<
"/"<<NdaughterofEmc_3<<
" name: "<<daughterofEmc_3->GetName()<<
" "<<daughterofEmc_3<<
" shape: "<<daughterofEmc_3->GetSolid()->GetName()<<G4endl;
936 int NdaughterofEmc_4 = daughterofEmc_3->GetNoDaughters();
937 for(
int m = 0; m < NdaughterofEmc_4; m++)
939 G4LogicalVolume *daughterofEmc_4 = daughterofEmc_3->GetDaughter(m)->GetLogicalVolume();
940 G4cout<<
" --> "<<m<<
"/"<<NdaughterofEmc_4<<
" name: "<<daughterofEmc_4->GetName()<<
" "<<daughterofEmc_4<<
" shape: "<<daughterofEmc_4->GetSolid()->GetName()<<G4endl;
941 if(daughterofEmc_3->GetSolid()->GetName().contains(
"solidBSCCasing"))
943 G4Trap *Crystal = (G4Trap *)daughterofEmc_3->GetSolid();
944 double hz = Crystal->GetZHalfLength();
945 double hx1 = Crystal->GetXHalfLength1();
946 double hx2 = Crystal->GetXHalfLength2();
947 double hx3 = Crystal->GetXHalfLength3();
948 double hx4 = Crystal->GetXHalfLength4();
949 double hy1 = Crystal->GetYHalfLength1();
950 double hy2 = Crystal->GetYHalfLength2();
951 double tanalpha1 = Crystal->GetTanAlpha1();
952 double tanalpha2 = Crystal->GetTanAlpha2();
953 G4cout<<
" --> "<<hx1<<
" "<<hx2<<
" "<<hx3<<
" "<<hx4<<
" "<<hy1<<
" "<<hy2<<
" "<<hz<<
" "<<tanalpha1<<
" "<<tanalpha2<<G4endl;
966 if(logEMC!=logicEMC) G4cout <<
"BesEmcConstruction::ConstructEndGeometry parameter transmit error!" << G4endl;
969 G4VisAttributes* crystalVisAtt=
new G4VisAttributes(G4Colour(0.5,0,1.0));
970 crystalVisAtt->SetVisibility(
false);
971 G4VisAttributes* endPhiVisAtt=
new G4VisAttributes(G4Colour(0,1.0,0));
972 endPhiVisAtt->SetVisibility(
false);
973 const G4double zoomConst = 0.995;
974 const G4double da=0.001*deg;
978 solidEnd =
new G4Cons(
"solidEndWorld",(*emcEnd).WorldRmin1,(*emcEnd).WorldRmax1,
979 (*emcEnd).WorldRmin2,(*emcEnd).WorldRmax2,
980 (*emcEnd).WorldDz/2,0.*deg,360.*deg);
981 logicEnd =
new G4LogicalVolume(solidEnd, G4Material::GetMaterial(
"Aluminium"),
"logicalEndWorld", 0, 0, 0);
982 physiEnd =
new G4PVPlacement(0,
983 G4ThreeVector(0,0,(*emcEnd).WorldZPosition),
990 logicEnd->SetVisAttributes(G4VisAttributes::Invisible);
994 G4RotationMatrix *rotateEnd =
new G4RotationMatrix();
995 rotateEnd->rotateY(180.*deg);
996 physiEnd =
new G4PVPlacement(rotateEnd,
997 G4ThreeVector(0,0,-(*emcEnd).WorldZPosition),
1029 solidEndPhi =
new G4Cons(
"solidEndPhi0",
1030 (*emcEnd).SectorRmin1,(*emcEnd).SectorRmax1,(*emcEnd).SectorRmin2,(*emcEnd).SectorRmax2,
1031 (*emcEnd).SectorDz/2,0.*deg,22.5*deg-da);
1032 logicEndPhi =
new G4LogicalVolume(solidEndPhi, G4Material::GetMaterial(
"Air"),
"logicalEndPhi0", 0, 0, 0);
1033 for(G4int i=0;i<14;i++)
1037 G4RotationMatrix *rotatePhi =
new G4RotationMatrix();
1038 rotatePhi->rotateZ(-i*22.5*deg+67.5*deg);
1039 ostringstream strEndPhi;
1040 strEndPhi <<
"physicalEndPhi" << i;
1041 physiEndPhi =
new G4PVPlacement(rotatePhi,
1042 G4ThreeVector(0,0,(*emcEnd).SectorZPosition),logicEndPhi,strEndPhi.str(),logicEnd,
false,i,
CHECKLV2);
1046 logicEndPhi->SetVisAttributes(endPhiVisAtt);
1048 for(G4int i=0;i<35;i++)
1050 ostringstream strEndCasing;
1051 strEndCasing <<
"solidEndCasing_0_" << i;
1054 G4ThreeVector newfPnt[8];
1055 G4ThreeVector center(0.0, 0.0, 0.0);
1056 G4ThreeVector rotAngle(0.0, 0.0, 0.0);
1060 emcEnd->
Zoom(newfPnt,zoomConst);
1062 G4RotationMatrix *rotatePhiIrregBox =
new G4RotationMatrix();
1063 rotatePhiIrregBox->rotateX(rotAngle.x());
1064 rotatePhiIrregBox->rotateY(rotAngle.y());
1065 rotatePhiIrregBox->rotateZ(rotAngle.z());
1068 solidEndCasing =
new G4IrregBox(strEndCasing.str(),(*emcEnd).zoomPoint);
1070 ostringstream strVEndCasing;
1071 strVEndCasing <<
"logicalEndCasing_0_" << i;
1072 logicEndCasing =
new G4LogicalVolume(solidEndCasing,fCasingMaterial,strVEndCasing.str());
1074 ostringstream strPEndCasing;
1075 strPEndCasing <<
"physicalEndCasing_0_" << i;
1076 physiEndCasing =
new G4PVPlacement(rotatePhiIrregBox,center,
1077 logicEndCasing,strPEndCasing.str(),logicEndPhi,
false,i,
CHECKIrreg);
1079 ostringstream strEndCrystal;
1080 strEndCrystal <<
"solidEndCrystal_0_" << i;
1083 solidEndCrystal =
new G4IrregBox(strEndCrystal.str(),(*emcEnd).cryPoint);
1085 ostringstream strVEndCrystal;
1086 strVEndCrystal <<
"logicalEndCrystal_0_" << i;
1087 logicEndCrystal =
new G4LogicalVolume(solidEndCrystal,fCrystalMaterial,strVEndCrystal.str());
1089 ostringstream strPEndCrystal;
1090 strPEndCrystal <<
"physicalEndCrystal_0_" << i;
1091 physiEndCrystal =
new G4PVPlacement(0,G4ThreeVector(),logicEndCrystal,strPEndCrystal.str(),logicEndCasing,
false,i,
CHECKIrreg);
1093 logicEndCasing->SetVisAttributes(G4VisAttributes::Invisible);
1094 logicEndCrystal->SetVisAttributes(crystalVisAtt);
1095 logicEndCrystal->SetSensitiveDetector(besEMCSD);
1100 G4double rmin2 = (*emcEnd).WorldRmin1+((*emcEnd).WorldRmin2-(*emcEnd).WorldRmin1)*(*emcEnd).SectorDz/(*emcEnd).WorldDz;
1101 G4double rmax2 = (*emcEnd).WorldRmax1+((*emcEnd).WorldRmax2-(*emcEnd).WorldRmax1)*(*emcEnd).SectorDz/(*emcEnd).WorldDz;
1102 solidEndPhi =
new G4Cons(
"solidEndPhi1",
1103 (*emcEnd).WorldRmin1, (*emcEnd).WorldRmax1, rmin2, rmax2,
1104 (*emcEnd).SectorDz/2,67.5*deg,22.5*deg-da);
1105 logicEndPhi =
new G4LogicalVolume(solidEndPhi, G4Material::GetMaterial(
"Air"),
"logicalEndPhi1", 0, 0, 0);
1106 for(G4int i=0;i<2;i++)
1108 G4RotationMatrix *rotatePhi =
new G4RotationMatrix();
1109 rotatePhi->rotateZ(-i*180.*deg);
1110 ostringstream strEndPhi;
1111 strEndPhi <<
"physicalEndPhi" << i*8+6;
1112 physiEndPhi =
new G4PVPlacement(rotatePhi,G4ThreeVector(0,0,(*emcEnd).SectorZPosition),
1113 logicEndPhi,strEndPhi.str(),logicEnd,
false,i*8+6,
CHECKLV2);
1116 logicEndPhi->SetVisAttributes(endPhiVisAtt);
1118 for(G4int i=0;i<35;i++)
1120 ostringstream strEndCasing;
1121 strEndCasing <<
"solidEndCasing_1_" << i;
1124 G4ThreeVector newfPnt[8];
1125 G4ThreeVector center(0.0, 0.0, 0.0);
1126 G4ThreeVector rotAngle(0.0, 0.0, 0.0);
1130 emcEnd->
Zoom(newfPnt,zoomConst);
1132 G4RotationMatrix *rotatePhiIrregBox =
new G4RotationMatrix();
1133 rotatePhiIrregBox->rotateX(rotAngle.x());
1134 rotatePhiIrregBox->rotateY(rotAngle.y());
1135 rotatePhiIrregBox->rotateZ(rotAngle.z());
1138 solidEndCasing =
new G4IrregBox(strEndCasing.str(),(*emcEnd).zoomPoint);
1140 ostringstream strVEndCasing;
1141 strVEndCasing <<
"logicalEndCasing_1_" << i;
1142 logicEndCasing =
new G4LogicalVolume(solidEndCasing,fCasingMaterial,strVEndCasing.str());
1144 ostringstream strPEndCasing;
1145 strPEndCasing <<
"physicalEndCasing_1_" << i;
1146 physiEndCasing =
new G4PVPlacement(rotatePhiIrregBox,center,
1147 logicEndCasing,strPEndCasing.str(),logicEndPhi,
false,i,
CHECKIrreg);
1149 ostringstream strEndCrystal;
1150 strEndCrystal <<
"solidEndCrystal_1_" << i;
1153 solidEndCrystal =
new G4IrregBox(strEndCrystal.str(),(*emcEnd).cryPoint);
1155 ostringstream strVEndCrystal;
1156 strVEndCrystal <<
"logicalEndCrystal_1_" << i;
1157 logicEndCrystal =
new G4LogicalVolume(solidEndCrystal,fCrystalMaterial,strVEndCrystal.str());
1159 ostringstream strPEndCrystal;
1160 strPEndCrystal <<
"physicalEndCrystal_1_" << i;
1161 physiEndCrystal =
new G4PVPlacement(0,G4ThreeVector(),logicEndCrystal,strPEndCrystal.str(),logicEndCasing,
false,i,
CHECKIrreg);
1163 logicEndCasing->SetVisAttributes(G4VisAttributes::Invisible);
1164 logicEndCrystal->SetVisAttributes(crystalVisAtt);
1165 logicEndCrystal->SetSensitiveDetector(besEMCSD);
1168 (*emcEnd).ReflectX();
1171 for(G4int i=0;i<35;i++)
1172 for (G4int j=0;j<8;j++)
1173 (*emcEnd).fPnt1[i][j].rotateZ(-90.*deg);
1175 solidEndPhi =
new G4Cons(
"solidEndPhi2",
1176 (*emcEnd).WorldRmin1, (*emcEnd).WorldRmax1, rmin2, rmax2,
1177 (*emcEnd).SectorDz/2,0*deg,22.5*deg-da);
1178 logicEndPhi =
new G4LogicalVolume(solidEndPhi, G4Material::GetMaterial(
"Air"),
"logicalEndPhi2", 0, 0, 0);
1179 for(G4int i=0;i<2;i++)
1181 G4RotationMatrix *rotatePhi =
new G4RotationMatrix();
1182 rotatePhi->rotateZ(-i*180.*deg-90.*deg);
1183 ostringstream strEndPhi;
1184 strEndPhi <<
"physicalEndPhi" << i*8+7;
1185 physiEndPhi =
new G4PVPlacement(rotatePhi,G4ThreeVector(0,0,(*emcEnd).SectorZPosition),
1186 logicEndPhi,strEndPhi.str(),logicEnd,
false,i*8+7,
CHECKLV2);
1189 logicEndPhi->SetVisAttributes(endPhiVisAtt);
1191 for(G4int i=0;i<35;i++)
1193 ostringstream strEndCasing;
1194 strEndCasing <<
"solidEndCasing_2_" << i;
1197 G4ThreeVector newfPnt[8];
1198 G4ThreeVector center(0.0, 0.0, 0.0);
1199 G4ThreeVector rotAngle(0.0, 0.0, 0.0);
1203 emcEnd->
Zoom(newfPnt,zoomConst);
1205 G4RotationMatrix *rotatePhiIrregBox =
new G4RotationMatrix();
1206 rotatePhiIrregBox->rotateX(rotAngle.x());
1207 rotatePhiIrregBox->rotateY(rotAngle.y());
1208 rotatePhiIrregBox->rotateZ(rotAngle.z());
1211 solidEndCasing =
new G4IrregBox(strEndCasing.str(),(*emcEnd).zoomPoint);
1213 ostringstream strVEndCasing;
1214 strVEndCasing <<
"logicalEndCasing_2_" << i;
1215 logicEndCasing =
new G4LogicalVolume(solidEndCasing,fCasingMaterial,strVEndCasing.str());
1217 ostringstream strPEndCasing;
1218 strPEndCasing <<
"physicalEndCasing_2_" << i;
1219 physiEndCasing =
new G4PVPlacement(rotatePhiIrregBox,center,
1220 logicEndCasing,strPEndCasing.str(),logicEndPhi,
false,i,
CHECKIrreg);
1222 ostringstream strEndCrystal;
1223 strEndCrystal <<
"solidEndCrystal_2_" << i;
1226 solidEndCrystal =
new G4IrregBox(strEndCrystal.str(),(*emcEnd).cryPoint);
1228 ostringstream strVEndCrystal;
1229 strVEndCrystal <<
"logicalEndCrystal_2_" << i;
1230 logicEndCrystal =
new G4LogicalVolume(solidEndCrystal,fCrystalMaterial,strVEndCrystal.str());
1232 ostringstream strPEndCrystal;
1233 strPEndCrystal <<
"physicalEndCrystal_2_" << i;
1234 physiEndCrystal =
new G4PVPlacement(0, G4ThreeVector(),logicEndCrystal,strPEndCrystal.str(),logicEndCasing,
false,i,
CHECKIrreg);
1236 logicEndCasing->SetVisAttributes(G4VisAttributes::Invisible);
1237 logicEndCrystal->SetVisAttributes(crystalVisAtt);
1238 logicEndCrystal->SetSensitiveDetector(besEMCSD);
1270 G4double rmax=(*besEMCGeometry).BSCRmax+2.*mm;
1271 solidSupportBar =
new G4Tubs(
"solidSupportBar0",
1272 rmax+(*besEMCGeometry).SPBarThickness1,
1273 rmax+(*besEMCGeometry).SPBarThickness+(*besEMCGeometry).SPBarThickness1,
1274 (*besEMCGeometry).BSCDz
1275 +(*besEMCGeometry).TaperRingThickness3+(*besEMCGeometry).EndRingDz,
1279 logicSupportBar =
new G4LogicalVolume(solidSupportBar,stainlessSteel,
"logicalSupportBar0");
1281 physiSupportBar =
new G4PVPlacement(0,G4ThreeVector(),logicSupportBar,
"physicalSupportBar0",logMother,
false,0,
CHECKLV2);
1283 solidSupportBar1 =
new G4Tubs(
"solidSupportBar1",
1285 rmax+(*besEMCGeometry).SPBarThickness1,
1286 (*besEMCGeometry).BSCDz+(*besEMCGeometry).TaperRingThickness3,
1287 (*besEMCGeometry).BSCPhiDphi-(*besEMCGeometry).SPBarDphi/2,
1288 (*besEMCGeometry).SPBarDphi);
1290 logicSupportBar1 =
new G4LogicalVolume(solidSupportBar1,stainlessSteel,
"logicalSupportBar1");
1292 for(G4int i=0;i<(*besEMCGeometry).BSCNbPhi/2;i++)
1294 G4RotationMatrix *rotateSPBar =
new G4RotationMatrix();
1295 rotateSPBar->rotateZ((*besEMCGeometry).BSCPhiDphi-i*2*(*besEMCGeometry).BSCPhiDphi);
1296 ostringstream strSupportBar1;
1297 strSupportBar1 <<
"physicalSupportBar1_" << i;
1298 physiSupportBar1 =
new G4PVPlacement(rotateSPBar,G4ThreeVector(),
1299 logicSupportBar1,strSupportBar1.str(),logMother,
false,0,
CHECKLV2);
1303 solidEndRing =
new G4Tubs(
"solidEndRing",
1304 (*besEMCGeometry).EndRingRmin,
1305 (*besEMCGeometry).EndRingRmin+(*besEMCGeometry).EndRingDr/2,
1306 (*besEMCGeometry).EndRingDz/2,
1310 solidGear =
new G4Tubs(
"solidGear",
1311 (*besEMCGeometry).EndRingRmin+(*besEMCGeometry).EndRingDr/2,
1312 (*besEMCGeometry).EndRingRmin+(*besEMCGeometry).EndRingDr,
1313 (*besEMCGeometry).EndRingDz/2,
1315 (*besEMCGeometry).BSCPhiDphi);
1318 solidTaperRing1 =
new G4Tubs(
"solidTaperRing1",
1319 (*besEMCGeometry).TaperRingRmin1,
1320 (*besEMCGeometry).TaperRingRmin1+(*besEMCGeometry).TaperRingThickness1,
1321 (*besEMCGeometry).TaperRingInnerLength/2,
1325 solidTaperRing2 =
new G4Cons(
"solidTaperRing2",
1326 (*besEMCGeometry).TaperRingRmin1,
1327 (*besEMCGeometry).TaperRingRmin1+(*besEMCGeometry).TaperRingThickness1,
1328 (*besEMCGeometry).TaperRingRmin2,
1329 (*besEMCGeometry).TaperRingRmin2+(*besEMCGeometry).TaperRingDr,
1330 (*besEMCGeometry).TaperRingDz/2,
1334 solidTaperRing3 =
new G4Cons(
"solidTaperRing3",
1335 (*besEMCGeometry).BSCRmax2,
1336 (*besEMCGeometry).BSCRmax2+(*besEMCGeometry).TaperRingOuterLength1,
1337 (*besEMCGeometry).TaperRingRmin2+(*besEMCGeometry).TaperRingDr,
1338 (*besEMCGeometry).TaperRingRmin2+(*besEMCGeometry).TaperRingDr+(*besEMCGeometry).TaperRingOuterLength,
1339 (*besEMCGeometry).TaperRingThickness3/2,
1343 logicEndRing =
new G4LogicalVolume(solidEndRing,stainlessSteel,
"logicalEndRing");
1344 logicGear =
new G4LogicalVolume(solidGear,stainlessSteel,
"logicalGear");
1345 logicTaperRing1 =
new G4LogicalVolume(solidTaperRing1,stainlessSteel,
"logicalTaperRing1");
1346 logicTaperRing2 =
new G4LogicalVolume(solidTaperRing2,stainlessSteel,
"logicalTaperRing2");
1347 logicTaperRing3 =
new G4LogicalVolume(solidTaperRing3,stainlessSteel,
"logicalTaperRing3");
1349 for(G4int i=0;i<2;i++)
1351 G4RotationMatrix *rotateSPRing =
new G4RotationMatrix();
1352 G4double zEndRing,z1,z2,z3;
1355 zEndRing = (*besEMCGeometry).BSCDz+(*besEMCGeometry).TaperRingThickness3+(*besEMCGeometry).EndRingDz/2;
1356 z1 = (*besEMCGeometry).BSCDz+(*besEMCGeometry).TaperRingThickness3
1357 -(*besEMCGeometry).TaperRingDz-(*besEMCGeometry).TaperRingInnerLength/2;
1358 z2 = (*besEMCGeometry).BSCDz+(*besEMCGeometry).TaperRingThickness3-(*besEMCGeometry).TaperRingDz/2;
1359 z3 = (*besEMCGeometry).BSCDz+(*besEMCGeometry).TaperRingThickness3/2;
1363 rotateSPRing->rotateY(180.*deg);
1364 zEndRing = -((*besEMCGeometry).BSCDz+(*besEMCGeometry).TaperRingThickness3+(*besEMCGeometry).EndRingDz/2);
1365 z1 = -((*besEMCGeometry).BSCDz+(*besEMCGeometry).TaperRingThickness3
1366 -(*besEMCGeometry).TaperRingDz-(*besEMCGeometry).TaperRingInnerLength/2);
1367 z2 = -((*besEMCGeometry).BSCDz+(*besEMCGeometry).TaperRingThickness3-(*besEMCGeometry).TaperRingDz/2);
1368 z3 = -((*besEMCGeometry).BSCDz+(*besEMCGeometry).TaperRingThickness3/2);
1371 ostringstream strEndRing;
1372 strEndRing <<
"physicalEndRing_" << i;
1373 physiEndRing =
new G4PVPlacement(rotateSPRing,G4ThreeVector(0,0,zEndRing),
1374 logicEndRing,strEndRing.str(),logMother,
false,0,
CHECKLV2);
1376 for(G4int j=0;j<(*besEMCGeometry).BSCNbPhi/2;j++)
1378 G4RotationMatrix *rotateGear =
new G4RotationMatrix();
1379 rotateGear->rotateZ((*besEMCGeometry).BSCPhiDphi/2-j*2*(*besEMCGeometry).BSCPhiDphi);
1381 ostringstream strGear;
1382 strGear <<
"physicalGear_" << i <<
"_" <<j;
1383 physiGear =
new G4PVPlacement(rotateGear,G4ThreeVector(0,0,zEndRing),
1384 logicGear,strGear.str(),logMother,
false,0,
CHECKLV2);
1387 ostringstream strTaperRing1;
1388 strTaperRing1 <<
"physicalTaperRing1_" << i;
1389 physiTaperRing1 =
new G4PVPlacement(rotateSPRing,G4ThreeVector(0,0,z1),
1390 logicTaperRing1,strTaperRing1.str(),logMother,
false,0,
CHECKLV2);
1392 ostringstream strTaperRing2;
1393 strTaperRing2 <<
"physicalTaperRing2_" << i;
1394 physiTaperRing2 =
new G4PVPlacement(rotateSPRing,G4ThreeVector(0,0,z2),
1395 logicTaperRing2,strTaperRing2.str(),logMother,
false,0,
CHECKLV2);
1397 ostringstream strTaperRing3;
1398 strTaperRing3 <<
"physicalTaperRing3_" << i;
1399 physiTaperRing3 =
new G4PVPlacement(rotateSPRing,G4ThreeVector(0,0,z3),
1400 logicTaperRing3,strTaperRing3.str(),logMother,
false,0,
CHECKLV2);
1409 G4VisAttributes* bscVisAtt=
new G4VisAttributes(G4Colour(0.5,0.5,0.5));
1410 bscVisAtt->SetVisibility(
false);
1411 logicEMC->SetVisAttributes(bscVisAtt);
1413 logicBSCWorld->SetVisAttributes(G4VisAttributes::Invisible);
1415 if (logicBSCCrystal) {
1417 G4VisAttributes* crystalVisAtt=
new G4VisAttributes(G4Colour(0,0,1.0));
1418 crystalVisAtt->SetVisibility(
true);
1419 logicBSCCrystal->SetVisAttributes(crystalVisAtt);
1420 logicBSCCrystal->SetSensitiveDetector(besEMCSD);
1424 G4VisAttributes* rightVisAtt=
new G4VisAttributes(G4Colour(1.0,0.,1.0));
1425 rightVisAtt->SetVisibility(
false);
1426 logicBSCPhi->SetVisAttributes(rightVisAtt);
1430 logicRear->SetVisAttributes(G4VisAttributes::Invisible);
1432 logicOrgGlass->SetVisAttributes(G4VisAttributes::Invisible);
1434 logicRearCasing->SetVisAttributes(G4VisAttributes::Invisible);
1436 logicAlPlate->SetVisAttributes(G4VisAttributes::Invisible);
1438 logicPD->SetVisAttributes(G4VisAttributes::Invisible);
1439 logicPD->SetSensitiveDetector(besEMCSD);
1442 logicPreAmpBox->SetVisAttributes(G4VisAttributes::Invisible);
1444 logicAirInPABox->SetVisAttributes(G4VisAttributes::Invisible);
1445 if(logicHangingPlate)
1446 logicHangingPlate->SetVisAttributes(G4VisAttributes::Invisible);
1448 logicWaterPipe->SetVisAttributes(G4VisAttributes::Invisible);
1452 G4VisAttributes* ringVisAtt=
new G4VisAttributes(G4Colour(0.5,0.25,0.));
1453 ringVisAtt->SetVisibility(
false);
1455 logicSupportBar->SetVisAttributes(ringVisAtt);
1456 if(logicSupportBar1)
1457 logicSupportBar1->SetVisAttributes(ringVisAtt);
1459 logicEndRing->SetVisAttributes(ringVisAtt);
1461 logicGear->SetVisAttributes(ringVisAtt);
1463 logicTaperRing1->SetVisAttributes(ringVisAtt);
1465 logicTaperRing2->SetVisAttributes(ringVisAtt);
1467 logicTaperRing3->SetVisAttributes(ringVisAtt);
1471 G4VisAttributes* endPhiVisAtt=
new G4VisAttributes(G4Colour(0,1.0,0));
1472 endPhiVisAtt->SetVisibility(
false);
1474 logicEnd->SetVisAttributes(endPhiVisAtt);
1495 for(
int i = 0; i < 44; i++){
1496 std::ostringstream osnameBSCCasing;
1497 osnameBSCCasing <<
"logicalBSCCasing"<<i;
1501 G4VisAttributes* rightVisAtt=
new G4VisAttributes(G4Colour(1.0, 0.0,0.0));
1502 rightVisAtt->SetVisibility(
false);
1503 logicBSCTheta->SetVisAttributes(rightVisAtt);
1506 std::ostringstream osnameBSCCable1;
1507 osnameBSCCable1 <<
"logicalBSCCable_1_"<<i;
1510 logicCable->SetVisAttributes(G4VisAttributes::Invisible);
1512 std::ostringstream osnameBSCCable2;
1513 osnameBSCCable2 <<
"logicalBSCCable_2_"<<i;
1516 logicCable->SetVisAttributes(G4VisAttributes::Invisible);
1518 std::ostringstream osnameOCGirder1;
1519 osnameOCGirder1 <<
"logicalOpenningCutGirder_1_"<<i;
1522 logicOCGirder->SetVisAttributes(G4VisAttributes::Invisible);
1524 std::ostringstream osnameOCGirder2;
1525 osnameOCGirder2 <<
"logicalOpenningCutGirder_2_"<<i;
1528 logicOCGirder->SetVisAttributes(G4VisAttributes::Invisible);
1530 std::ostringstream osnameOCGirder3;
1531 osnameOCGirder3 <<
"logicalOpenningCutGirder_3_"<<i;
1534 logicOCGirder->SetVisAttributes(G4VisAttributes::Invisible);
1536 std::ostringstream osnameOCGirder4;
1537 osnameOCGirder4 <<
"logicalOpenningCutGirder_4_"<<i;
1540 logicOCGirder->SetVisAttributes(G4VisAttributes::Invisible);
1557 for(G4int sector=0;sector<3;sector++) {
1558 std::ostringstream osnameEndPhi;
1559 osnameEndPhi<<
"logicalEndPhi"<<sector;
1562 logicEndPhi->SetVisAttributes(G4VisAttributes::Invisible);
1564 G4cout<<
"Can't find logicEndPhi!"<<G4endl;
1567 for(G4int cryNb=0;cryNb<35;cryNb++) {
1569 std::ostringstream osnameEndCrystal;
1570 osnameEndCrystal<<
"logicalEndCrystal_"<<sector<<
"_"<<cryNb;
1572 if(logicEndCrystal) {
1573 logicEndCrystal->SetSensitiveDetector(besEMCSD);
1574 G4VisAttributes* crystalVisAtt
1575 =
new G4VisAttributes(G4Colour(0.5,0,1.0));
1576 crystalVisAtt->SetVisibility(
false);
1577 logicEndCrystal->SetVisAttributes(crystalVisAtt);
1579 G4cout<<
"Can't find: "<<osnameEndCrystal.str()<<G4endl;
1582 std::ostringstream osnameEndCasing;
1583 osnameEndCasing<<
"logicalEndCasing_"<<sector<<
"_"<<cryNb;
1585 if(logicEndCasing) {
1586 logicEndCasing->SetVisAttributes(G4VisAttributes::Invisible);
1588 G4cout<<
"Can't find: "<<osnameEndCasing.str()<<G4endl;
1594void BesEmcConstruction::DefineMaterials()
1596 G4String name, symbol;
1597 G4double a, z, density;
1601 G4int ncomponents, natoms;
1602 G4double fractionmass;
1611 G4Element*
H=G4Element::GetElement(
"Hydrogen");
1615 H =
new G4Element(name=
"Hydrogen",symbol=
"H" , z= 1., a);
1617 G4Element*
C=G4Element::GetElement(
"Carbon");
1621 C =
new G4Element(name=
"Carbon" ,symbol=
"C" , z= 6., a);
1623 G4Element* O=G4Element::GetElement(
"Oxygen");
1627 O =
new G4Element(name=
"Oxygen" ,symbol=
"O" , z= 8., a);
1630 density = 0.344*g/cm3;
1631 G4Material* Tyvek =
new G4Material(name=
"M_Polyethylene", density, ncomponents=2);
1632 Tyvek->AddElement(
C, natoms=1);
1633 Tyvek->AddElement(
H, natoms=2);
1635 density = 1.39*g/cm3;
1636 G4Material* Mylar =
new G4Material(name=
"M_PolyethyleneTerephthlate", density, ncomponents=3);
1637 Mylar->AddElement(
C, natoms=5);
1638 Mylar->AddElement(
H, natoms=4);
1639 Mylar->AddElement(O, natoms=2);
1641 density = 1.18*g/cm3;
1642 organicGlass =
new G4Material(name=
"M_OrganicGlass", density, ncomponents=3);
1643 organicGlass->AddElement(
C, natoms=5);
1644 organicGlass->AddElement(
H, natoms=7);
1645 organicGlass->AddElement(O, natoms=2);
1647 G4Material *Fe =
new G4Material(name=
"M_Iron", z=26., a=55.85*g/mole, density=7.87*g/cm3);
1648 G4Material *Cr =
new G4Material(name=
"M_Chromium", z=24., a=52.00*g/mole, density=8.72*g/cm3);
1649 G4Material *Ni =
new G4Material(name=
"M_Nickel", z=28., a=58.69*g/mole, density=8.72*g/cm3);
1651 stainlessSteel =
new G4Material(name=
"M_Cr18Ni9", density=7.85*g/cm3, ncomponents=3);
1652 stainlessSteel->AddMaterial(Fe, fractionmass=73.*perCent);
1653 stainlessSteel->AddMaterial(Cr, fractionmass=18.*perCent);
1654 stainlessSteel->AddMaterial(Ni, fractionmass=9.*perCent);
1656 G4Material *H2O = G4Material::GetMaterial(
"Water");
1657 G4Material *Cu = G4Material::GetMaterial(
"Copper");
1658 G4double dWater = 1.*g/cm3;
1659 G4double dCopper = 8.96*g/cm3;
1660 G4double aWater = ((*besEMCGeometry).waterPipeDr-(*besEMCGeometry).waterPipeThickness)
1661 *((*besEMCGeometry).waterPipeDr-(*besEMCGeometry).waterPipeThickness);
1662 G4double aCopper = (*besEMCGeometry).waterPipeDr*(*besEMCGeometry).waterPipeDr-aWater;
1663 density = (dWater*aWater+dCopper*aCopper)/(aWater+aCopper);
1665 waterPipe =
new G4Material(name=
"M_WaterPipe", density, ncomponents=2);
1666 fractionmass = dWater*aWater/(dWater*aWater+dCopper*aCopper);
1667 waterPipe->AddMaterial(H2O, fractionmass);
1668 fractionmass = dCopper*aCopper/(dWater*aWater+dCopper*aCopper);
1669 waterPipe->AddMaterial(Cu, fractionmass);
1671 cable =
new G4Material(name=
"M_Cable", density=4.*g/cm3, ncomponents=1);
1672 cable->AddMaterial(Cu,1);
1680 G4Material* Al=G4Material::GetMaterial(
"Aluminium");
1683 Al =
new G4Material(name=
"Aluminium", z=13., a=26.98*g/mole, density=2.700*g/cm3);
1686 G4Material *Si=G4Material::GetMaterial(
"M_Silicon");
1689 Si =
new G4Material(name=
"M_Silicon", z=14., a=28.0855*g/mole, density=2.33*g/cm3);
1694 G4double totalThickness=(*besEMCGeometry).fTyvekThickness
1695 +(*besEMCGeometry).fAlThickness+(*besEMCGeometry).fMylarThickness;
1696 density = (Tyvek->GetDensity()*(*besEMCGeometry).fTyvekThickness+
1697 Al->GetDensity()*(*besEMCGeometry).fAlThickness+
1698 Mylar->GetDensity()*(*besEMCGeometry).fMylarThickness)
1700 G4Material* Casing =
new G4Material(name=
"M_Casing", density, ncomponents=3);
1701 Casing->AddMaterial(
1703 fractionmass=Tyvek->GetDensity()/density
1704 *(*besEMCGeometry).fTyvekThickness
1706 Casing->AddMaterial(
1708 fractionmass=Al->GetDensity()/density
1709 *(*besEMCGeometry).fAlThickness
1711 Casing->AddMaterial(
1713 fractionmass=Mylar->GetDensity()/density
1714 *(*besEMCGeometry).fMylarThickness
1716 fCasingMaterial = Casing;
1717 rearCasingMaterial = Tyvek;
1720 fCrystalMaterial = G4Material::GetMaterial(
"Cesiumiodide");
1727 G4cout <<
"-------------------------------------------------------"<< G4endl
1728 <<
"---> There are "
1729 << phiNbCrystals <<
"(max=" << (*besEMCGeometry).BSCNbPhi
1730 <<
") crystals along phi direction and "
1731 << thetaNbCrystals <<
"(max=" << (*besEMCGeometry).BSCNbTheta
1732 <<
") crystals along theta direction."<< G4endl
1733 <<
"The crystals have sizes of "
1734 << (*besEMCGeometry).BSCCryLength/cm <<
"cm(L) and "
1735 << (*besEMCGeometry).BSCYFront/cm <<
"cm(Y) with "
1736 << fCrystalMaterial->GetName() <<
"."<< G4endl
1737 <<
"The casing is layer of "
1738 << (*besEMCGeometry).fTyvekThickness/mm <<
"mm tyvek,"
1739 << (*besEMCGeometry).fAlThickness/mm <<
"mm aluminum and"
1740 << (*besEMCGeometry).fMylarThickness/mm <<
"mm mylar."<< G4endl
1741 <<
"-------------------------------------------------------"<< G4endl;
1742 G4cout << G4Material::GetMaterial(
"PolyethyleneTerephthlate") << G4endl
1743 << G4Material::GetMaterial(
"Casing") << G4endl
1744 << G4Material::GetMaterial(
"Polyethylene") << G4endl
1745 <<
"-------------------------------------------------------"<< G4endl;
1753 G4Material* pttoMaterial = G4Material::GetMaterial(materialChoice);
1755 {fCrystalMaterial = pttoMaterial;
1756 logicBSCCrystal->SetMaterial(pttoMaterial);
1766 G4Material* pttoMaterial = G4Material::GetMaterial(materialChoice);
1768 {fCasingMaterial = pttoMaterial;
1769 logicBSCTheta->SetMaterial(pttoMaterial);
1779 (*besEMCGeometry).fTyvekThickness = val(
'X');
1780 (*besEMCGeometry).fAlThickness = val(
'Y');
1781 (*besEMCGeometry).fMylarThickness = val(
'Z');
1788 (*besEMCGeometry).BSCRmin = val;
1795 (*besEMCGeometry).BSCNbPhi = val;
1802 (*besEMCGeometry).BSCNbTheta = val;
1815 (*besEMCGeometry).BSCCryLength = val;
1822 (*besEMCGeometry).BSCYFront0 = val;
1829 (*besEMCGeometry).BSCYFront = val;
1836 (*besEMCGeometry).BSCPosition0 = val;
1843 (*besEMCGeometry).BSCPosition1 = val;
1852 G4FieldManager* fieldMgr
1853 = G4TransportationManager::GetTransportationManager()->GetFieldManager();
1855 if(magField)
delete magField;
1858 { magField =
new G4UniformMagField(G4ThreeVector(0.,0.,fieldValue));
1859 fieldMgr->SetDetectorField(magField);
1860 fieldMgr->CreateChordFinder(magField);
1861 fmagField=fieldValue;
1864 fieldMgr->SetDetectorField(magField);
1882 center = G4ThreeVector(0.0, 0.0, 0.0);
1883 for (
int i = 0; i < 8; i++) {
1884 point[i] =
HepPoint3D( fPnt[i].
x(), fPnt[i].
y(), fPnt[i].z() );
1889 HepPlane3D bottomPlane( point[4], point[5], point[6] );
1890 HepPoint3D centerProject = bottomPlane.point( center );
1891 Hep3Vector newZ = center - centerProject;
1894 G4RotationMatrix *g4Rot =
new G4RotationMatrix();
1895 g4Rot->rotateX( rotAngle.x() );
1896 g4Rot->rotateY( rotAngle.y() );
1898 G4AffineTransform *transform =
new G4AffineTransform( g4Rot, center );
1899 transform->Invert();
1900 for (
int i = 0; i < 8; i++) {
1901 newfPnt[i] = transform->TransformPoint(fPnt[i]);
1911 for (
int i = 0; i < 8; i++) {
1923 Hep3Vector x0(1, 0, 0), y0(0, 1, 0), z0(0, 0, 1);
1924 double dx, dy, dz = 0.0;
1926 Hep3Vector a(0.0, newZ.y(), newZ.z());
1932 if(a.mag() != 0.0) a.setMag(1.0);
1933 else cout <<
"newZ on X axis, a=(0,0,0)" << endl;
1934 dx = acos(a.dot(z0));
1935 if(a.dot(z0) == -1.0) dx = 0.0;
1938 Hep3Vector
b(0,
sin(dx),
cos(dx));
1939 dy = acos(
b.dot(newZ));
1940 if(newZ.x() > 0.0) dy = -dy;
1942 Hep3Vector
v(dx, dy, dz);
double tan(const BesAngle a)
double sin(const BesAngle a)
double cos(const BesAngle a)
HepGeom::Point3D< double > HepPoint3D
HepGeom::Plane3D< double > HepPlane3D
double P(RecMdcKalTrack *trk)
**********Class see also m_nmax DOUBLE PRECISION m_amel DOUBLE PRECISION m_x2 DOUBLE PRECISION m_alfinv DOUBLE PRECISION m_Xenph INTEGER m_KeyWtm INTEGER m_idyfs DOUBLE PRECISION m_zini DOUBLE PRECISION m_q2 DOUBLE PRECISION m_Wt_KF DOUBLE PRECISION m_WtCut INTEGER m_KFfin *COMMON c_KarLud $ !Input CMS energy[GeV] $ !CMS energy after beam spread beam strahlung[GeV] $ !Beam energy spread[GeV] $ !z boost due to beam spread $ !electron beam mass *ff pair spectrum $ !minimum v
***************************************************************************************Pseudo Class RRes *****************************************************************************************Parameters and physical constants **Maarten sept ************************************************************************DOUBLE PRECISION xsmu **************************************************************************PARTICLE DATA all others are from PDG *Only resonances with known widths into electron pairs are sept ************************************************************************C Declarations C
void SetBSCRmin(G4double)
static BesEmcConstruction * GetBesEmcConstruction()
void SetBSCYFront(G4double)
void ThreeVectorTrans(G4ThreeVector fPnt[8], double x[8], double y[8], double z[8])
void ConstructSPFrame(G4LogicalVolume *, BesEmcGeometry *)
void Construct(G4LogicalVolume *)
void TransformToArb8(const G4ThreeVector fPnt[8], G4ThreeVector newfPnt[8], G4ThreeVector ¢er, G4ThreeVector &rotAngle)
void SetMagField(G4double)
void ConstructEndGeometry(G4LogicalVolume *)
void SetBSCPosition1(G4double)
void SetCasingThickness(G4ThreeVector)
void SetBSCYFront0(G4double)
void SetBSCCrystalLength(G4double)
void PrintEMCParameters()
void SetCrystalMaterial(G4String)
void SetBSCPosition0(G4double)
Hep3Vector RotAngleFromNewZ(Hep3Vector newZ)
void SetCasingMaterial(G4String)
void SetStartIDTheta(G4int)
G4int ComputeEndCopyNb(G4int)
void SetBSCNbTheta(G4int)
void ModifyForCasing(G4ThreeVector pos[8], G4int CryNb)
void Zoom(const G4ThreeVector pos[8], const G4double factor)
void ComputeEMCParameters()
G4LogicalVolume * FindLogicalVolume(const G4String &vn)
static EmcG4Geo * Instance()
Get a pointer to the single instance of EmcG4Geo.
G4LogicalVolume * GetTopVolume()
Get the top(world) volume;.