BOSS 8.0.0
BESIII Offline Software System
Loading...
Searching...
No Matches
ExtBesEmcConstruction Class Reference

#include <ExtBesEmcConstruction.h>

Inheritance diagram for ExtBesEmcConstruction:

Public Member Functions

 ExtBesEmcConstruction ()
 ~ExtBesEmcConstruction ()
void Construct (G4LogicalVolume *)
void ConstructSPFrame (G4LogicalVolume *, ExtBesEmcGeometry *)
void ConstructEndGeometry (G4LogicalVolume *)
G4int ComputeEndCopyNb (G4int)
void SetVerboseLevel (G4int val)
void SetCrystalMaterial (G4String)
void SetCasingMaterial (G4String)
void SetCasingThickness (G4ThreeVector)
void SetBSCRmin (G4double)
void SetBSCNbPhi (G4int)
void SetBSCNbTheta (G4int)
void SetStartIDTheta (G4int)
void SetBSCCrystalLength (G4double)
void SetBSCYFront0 (G4double)
void SetBSCYFront (G4double)
void SetBSCPosition0 (G4double)
void SetBSCPosition1 (G4double)
void SetMagField (G4double)
void UpdateGeometry ()
void PrintEMCParameters ()
G4int GetVerboseLevel ()
G4double GetMagField ()
G4int GetStartIDTheta ()
G4Material * GetCrystalMaterial ()
G4Material * GetCasingMaterial ()
const G4VPhysicalVolume * GetEMC ()
const G4VPhysicalVolume * GetBSCPhi ()
const G4VPhysicalVolume * GetBSCTheta ()
const G4VPhysicalVolume * GetBSCCrystal ()
const G4VPVParameterisation * GetCrystalParam ()
Public Member Functions inherited from ExtBesSubdetector
 ExtBesSubdetector ()
virtual ~ExtBesSubdetector ()
G4LogicalVolume * FindLogicalVolume (const G4String &vn)

Static Public Member Functions

static ExtBesEmcConstructionGetBesEmcConstruction ()

Detailed Description

Definition at line 28 of file ExtBesEmcConstruction.h.

Constructor & Destructor Documentation

◆ ExtBesEmcConstruction()

ExtBesEmcConstruction::ExtBesEmcConstruction ( )

Definition at line 50 of file ExtBesEmcConstruction.cxx.

51 : verboseLevel( 0 )
52 , solidEMC( 0 )
53 , logicEMC( 0 )
54 , physiEMC( 0 )
55 , solidBSCPhi( 0 )
56 , logicBSCPhi( 0 )
57 , physiBSCPhi( 0 )
58 , solidBSCTheta( 0 )
59 , logicBSCTheta( 0 )
60 , physiBSCTheta( 0 )
61 , solidBSCCrystal( 0 )
62 , logicBSCCrystal( 0 )
63 , physiBSCCrystal( 0 )
64 , magField( 0 )
65 , detectorMessenger( 0 )
66 , besEMCSD( 0 )
67 , crystalParam( 0 ) {
68 if ( !fBesEmcConstruction ) fBesEmcConstruction = this;
69
70 startID = 1;
71 phiNbCrystals = 0;
72 thetaNbCrystals = 0;
73 besEMCGeometry = new ExtBesEmcGeometry();
74 emcEnd = new ExtBesEmcEndGeometry();
75}

Referenced by GetBesEmcConstruction().

◆ ~ExtBesEmcConstruction()

ExtBesEmcConstruction::~ExtBesEmcConstruction ( )

Definition at line 77 of file ExtBesEmcConstruction.cxx.

77 {
78 if ( crystalParam ) delete crystalParam;
79 if ( besEMCGeometry ) delete besEMCGeometry;
80 if ( emcEnd ) delete emcEnd;
81}

Member Function Documentation

◆ ComputeEndCopyNb()

G4int ExtBesEmcConstruction::ComputeEndCopyNb ( G4int num)

Definition at line 1299 of file ExtBesEmcConstruction.cxx.

1299 {
1300 G4int copyNb;
1301 switch ( num )
1302 {
1303 case 30: copyNb = 5; break;
1304 case 31: copyNb = 6; break;
1305 case 32: copyNb = 14; break;
1306 case 33: copyNb = 15; break;
1307 case 34: copyNb = 16; break;
1308 default: copyNb = num; break;
1309 }
1310 return copyNb;
1311}

Referenced by ConstructEndGeometry().

◆ Construct()

void ExtBesEmcConstruction::Construct ( G4LogicalVolume * logicBes)
virtual

Implements ExtBesSubdetector.

Definition at line 83 of file ExtBesEmcConstruction.cxx.

83 {
84 /*
85 G4String GeometryPath = getenv("SIMUTILDATAROOT");
86 GeometryPath+="/dat/Emc.gdml";
87
88 m_config.SetURI(GeometryPath);
89 m_config.SetSetupName( "Emc" );
90 m_config.SetSetupVersion( "1.0" );
91 m_config.SetType( "G4" );
92 m_sxp.Configure(&m_config);
93 m_sxp.Initialize();
94
95 //construct Emc
96 m_sxp.Run();
97
98 logicalEmc = FindLogicalVolume("logicalEmc");
99 physicalEmc = new G4PVPlacement(0,G4ThreeVector(0.0 ,0.0 ,0.0),logicalEmc,
100 "BSC",logicBes, false, 0);
101
102 m_sxp.Finalize();
103 */
104
105 // new version of geometry construction from gdml
106 logicEMC = EmcG4Geo::Instance()->GetTopVolume();
107 if ( logicEMC )
108 physiEMC = new G4PVPlacement( 0, G4ThreeVector( 0.0, 0.0, 0.0 ), logicEMC, "physicalEMC",
109 logicBes, false, 0 );
110
111 // geometry construction by code
112 /*
113 besEMCGeometry->ComputeEMCParameters();
114 emcEnd->ComputeParameters();
115 DefineMaterials();
116 phiNbCrystals = (*besEMCGeometry).BSCNbPhi;
117 thetaNbCrystals = (*besEMCGeometry).BSCNbTheta*2;
118 //
119 //BSC
120 //
121 //G4cout << "Acquired " << G4Material::GetMaterial("Air") << G4endl;
122
123 solidBSC = new G4Tubs("BSC",
124 (*besEMCGeometry).TaperRingRmin1,
125 (*besEMCGeometry).BSCRmax+(*besEMCGeometry).SPBarThickness+(*besEMCGeometry).SPBarThickness1,
126 (*besEMCGeometry).BSCDz+(*besEMCGeometry).TaperRingThickness3+(*besEMCGeometry).EndRingDz,
127 0.*deg,
128 360.*deg);
129
130 solidESC = new
131 G4Tubs("ESC",(*emcEnd).WorldRmin2,(*emcEnd).WorldRmax2,(*emcEnd).WorldDz/2,0.*deg,360.*deg);
132
133 solidEMC = new G4UnionSolid("EMC",
134 solidBSC,
135 solidESC,
136 0,
137 G4ThreeVector(0,0,(*emcEnd).WorldZPosition));
138
139 solidEMC = new G4UnionSolid("EMC",
140 solidEMC,
141 solidESC,
142 0,
143 G4ThreeVector(0,0,-(*emcEnd).WorldZPosition));
144
145 logicEMC = new G4LogicalVolume(solidEMC,
146 G4Material::GetMaterial("Air"),
147 "EMC");
148
149 physiEMC = new G4PVPlacement(0,
150 0,
151 logicEMC,
152 "EMC",
153 logicBes,
154 false,
155 0);
156
157 // G4RotationMatrix *rotateMatrixBSC;
158 // rotateMatrixBSC = new G4RotationMatrix();
159 // G4ThreeVector newAxisX=G4ThreeVector(1.,0,0);
160 // G4ThreeVector newAxisY=G4ThreeVector(0,-1.,0);
161 // G4ThreeVector newAxisZ=G4ThreeVector(0,0,-1.);
162 // rotateMatrixBSC->rotateAxes(newAxisX,newAxisY,newAxisZ);
163 // rotateMatrixBSC->rotateX(180.*deg);
164 // physiBSC = new G4PVPlacement(rotateMatrixBSC,
165 // G4ThreeVector(0,0,-BSCDz/2.),
166 // "BSC",
167 // logicBSC,
168 // logicEMC,
169 // false,
170 // 1);
171 //
172 // Phi Cell
173 solidBSCPhiTub = new G4Tubs(
174 "BSCPhiTub",
175 (*besEMCGeometry).BSCRmin,
176 (*besEMCGeometry).BSCPhiRmax,
177 (*besEMCGeometry).BSCDz,
178 360.*deg-(*besEMCGeometry).BSCPhiDphi,
179 (*besEMCGeometry).BSCPhiDphi);
180 solidConsPhi = new G4Cons("consPhi",
181 (*besEMCGeometry).BSCRmin1,
182 (*besEMCGeometry).BSCRmax1,
183 (*besEMCGeometry).BSCRmin2,
184 (*besEMCGeometry).BSCRmax2,
185 (*besEMCGeometry).BSCDz1/2,
186 0.*deg,
187 360.*deg);
188 solidBSCPhi1 = new G4SubtractionSolid("BSCPhi1",
189 solidBSCPhiTub,
190 solidConsPhi,
191 0,
192 G4ThreeVector(0,0,(*besEMCGeometry).BSCDz-(*besEMCGeometry).BSCDz1/2));
193 solidConsPhi = new G4Cons("consPhi",
194 (*besEMCGeometry).BSCRmin2,
195 (*besEMCGeometry).BSCRmax2,
196 (*besEMCGeometry).BSCRmin1,
197 (*besEMCGeometry).BSCRmax1,
198 (*besEMCGeometry).BSCDz1/2,
199 0.*deg,
200 360.*deg);
201 solidBSCPhi = new G4SubtractionSolid("BSCPhi",
202 solidBSCPhi1,
203 solidConsPhi,
204 0,
205 G4ThreeVector(0,0,(*besEMCGeometry).BSCDz1/2-(*besEMCGeometry).BSCDz));
206
207 logicBSCPhi = new G4LogicalVolume(solidBSCPhi,
208 G4Material::GetMaterial("Air"),
209 "BSCPhi");
210
211 //new geometry by Fu Chengdong
212 G4RotationMatrix *rotateMatrix[200];
213 G4double oOp,ox,oy,oz;
214 G4int i;
215 G4double delta = 0*deg;
216 G4ThreeVector axis = G4ThreeVector(0,0,0);
217 oOp=(*besEMCGeometry).BSCRmin/sin(0.5*(*besEMCGeometry).BSCPhiDphi+90*deg)
218 *sin((*besEMCGeometry).BSCAngleRotat);
219 G4double ll=(*besEMCGeometry).BSCCryLength;
220 G4double rr=(*besEMCGeometry).BSCRmin;
221 G4double oj=sqrt(ll*ll+rr*rr-2*ll*rr*cos(180.*deg-(*besEMCGeometry).BSCAngleRotat));
222 G4double oij=90.*deg-(*besEMCGeometry).BSCPhiDphi/2.-(*besEMCGeometry).BSCAngleRotat;
223 G4double doj=asin(sin(180.*deg-(*besEMCGeometry).BSCAngleRotat)/oj*ll);
224 G4double ioj=(*besEMCGeometry).BSCPhiDphi/2.+doj;
225 G4double ij=oj/sin(oij)*sin(ioj);
226 G4double dOp=rr/sin(90.*deg-(*besEMCGeometry).BSCPhiDphi/2.)
227 *sin(90.*deg+(*besEMCGeometry).BSCPhiDphi/2.-(*besEMCGeometry).BSCAngleRotat);
228 G4double cOp=rr/sin(90.*deg+(*besEMCGeometry).BSCPhiDphi/2.)
229 *sin(90.*deg-(*besEMCGeometry).BSCPhiDphi/2.-(*besEMCGeometry).BSCAngleRotat);
230 G4double ch=(dOp+ll)/cos((*besEMCGeometry).BSCPhiDphi)-cOp;
231 G4double hi=(dOp+ll)*tan((*besEMCGeometry).BSCPhiDphi)-ij;
232 G4double oh=sqrt(ch*ch+rr*rr-2*ch*rr*cos(180*deg-(*besEMCGeometry).BSCAngleRotat));
233 G4double hoi=asin(sin(180*deg-oij)/oh*hi);
234 G4double dok=asin(sin(180*deg-(*besEMCGeometry).BSCAngleRotat)/oh*ch);
235
236 i=1;
237 for(i=1;i<=(*besEMCGeometry).BSCNbPhi;i++)
238 {
239 rotateMatrix[i-1] = new G4RotationMatrix();
240 rotateMatrix[i-1]->rotateZ(-(i-1)*(*besEMCGeometry).BSCPhiDphi
241 -(*besEMCGeometry).BSCAngleRotat
242 -(*besEMCGeometry).BSCPhiDphi/2.
243 -hoi);
244 rotateMatrix[i-1]->getAngleAxis(delta, axis);
245 //G4cout << "The axis of crystals in the world system is: "
246 // << delta/deg << "(deg)(delta) "
247 //<< axis << "(Z axis)"<< G4endl;
248 ox=oOp*cos(-90.*deg+(*besEMCGeometry).BSCAngleRotat
249 +(i-1)*(*besEMCGeometry).BSCPhiDphi);
250 oy=oOp*sin(-90.*deg+(*besEMCGeometry).BSCAngleRotat
251 +(i-1)*(*besEMCGeometry).BSCPhiDphi);
252 oz=0*cm;
253 physiBSCPhi = new G4PVPlacement(rotateMatrix[i-1],
254 G4ThreeVector(ox,oy,oz),
255 logicBSCPhi,
256 "BSCPhi",
257 logicEMC,
258 false,
259 i-1);
260 }
261 */
262 /*
263G4RotationMatrix *rotateMatrix[200];
264// rotateMatrix = new G4RotationMatrix();
265// rotateMatrix->rotateZ(BSCAngleRotat-BSCPhiDphi);
266G4double oOp,ox,oy,oz;
267G4int i;
268G4double delta = 0*deg;
269G4ThreeVector axis = G4ThreeVector(0,0,0);
270oOp=(*besEMCGeometry).BSCRmin/sin(0.5*(*besEMCGeometry).BSCPhiDphi+90*deg)
271*sin((*besEMCGeometry).BSCAngleRotat);
272i=1;
273for(i=1;i<=(*besEMCGeometry).BSCNbPhi;i++)
274{
275 rotateMatrix[i-1] = new G4RotationMatrix();
276 rotateMatrix[i-1]->rotateZ(-(i-1)*(*besEMCGeometry).BSCPhiDphi
277 +(*besEMCGeometry).BSCAngleRotat
278 +(*besEMCGeometry).BSCPhiDphi/2.);
279 rotateMatrix[i-1]->getAngleAxis(delta, axis);
280 //G4cout << "The axis of crystals in the world system is: "
281 // << delta/deg << "(deg)(delta) "
282 //<< axis << "(Z axis)"<< G4endl;
283 ox=oOp*cos(90.*deg-(*besEMCGeometry).BSCAngleRotat
284 +(i-1)*(*besEMCGeometry).BSCPhiDphi);
285 oy=oOp*sin(90.*deg-(*besEMCGeometry).BSCAngleRotat
286 +(i-1)*(*besEMCGeometry).BSCPhiDphi);
287 oz=0*cm;
288 physiBSCPhi = new G4PVPlacement(rotateMatrix[i-1],
289 G4ThreeVector(ox,oy,oz),
290 logicBSCPhi,
291 "BSCPhi",
292 logicEMC,
293 false,
294 i);
295 //G4cout << G4ThreeVector(ox/cm,oy/cm,oz/cm) <<"(cm)" << G4endl
296 // << (-(*besEMCGeometry).BSCAngleRotat+(i-1)*(*besEMCGeometry).BSCPhiDphi)/deg
297<<"(degree)" << G4endl;
298 }*/
299 //
300 // Crystals
301 //
302 /* G4double zHalfLength[50];
303 G4double thetaAxis[50];
304 G4double phiAxis[50];
305 G4double yHalfLength1[50];
306 G4double xHalfLength2[50];
307 G4double xHalfLength1[50];
308 G4double tanAlpha1[50];
309 G4double yHalfLength2[50];
310 G4double xHalfLength4[50];
311 G4double xHalfLength3[50];
312 G4double tanAlpha2[50];
313 G4double xPosition[50];
314 G4double yPosition[50];
315 G4double zPosition[50];
316 G4double thetaPosition[50];
317 for(i=0;i<(*besEMCGeometry).BSCNbTheta;i++)
318 {
319 zHalfLength[i] = (*besEMCGeometry).zHalfLength[i];
320 thetaAxis[i] = (*besEMCGeometry).thetaAxis[i];
321 phiAxis[i] = (*besEMCGeometry).phiAxis[i];
322 yHalfLength1[i] = (*besEMCGeometry).yHalfLength1[i];
323 xHalfLength2[i] = (*besEMCGeometry).xHalfLength2[i];
324 xHalfLength1[i] = (*besEMCGeometry).xHalfLength1[i];
325 tanAlpha1[i] = (*besEMCGeometry).tanAlpha1[i];
326 yHalfLength2[i] = (*besEMCGeometry).yHalfLength2[i];
327 xHalfLength4[i] = (*besEMCGeometry).xHalfLength4[i];
328 xHalfLength3[i] = (*besEMCGeometry).xHalfLength3[i];
329 tanAlpha2[i] = (*besEMCGeometry).tanAlpha2[i];
330 xPosition[i] = (*besEMCGeometry).xPosition[i];
331 yPosition[i] = (*besEMCGeometry).yPosition[i];
332 zPosition[i] = (*besEMCGeometry).zPosition[i];
333 thetaPosition[i]= (*besEMCGeometry).thetaPosition[i];
334 }
335
336 besEMCGeometry->ModifyForCasing();
337
338 solidBSCCrystal = new G4Trap("Crystal",
339 100*cm, 100*deg, 100*deg,
340 100*cm, 100*cm, 100*cm, 100*deg,
341 100*cm, 100*cm, 100*cm, 100*deg);
342
343 logicBSCCrystal = new G4LogicalVolume(solidBSCCrystal,
344 fCrystalMaterial,
345 "Crystal");
346
347 crystalParam = new ExtBesCrystalParameterisation
348 (startID,
349 thetaNbCrystals,
350 (*besEMCGeometry).BSCNbTheta*2,
351 besEMCGeometry,
352 verboseLevel);
353
354 //---------------------------------------------------------------------------------
355 //rear substance
356 solidRear = new G4Box("RearBox",
357 (*besEMCGeometry).rearBoxLength/2,
358 (*besEMCGeometry).rearBoxLength/2,
359 (*besEMCGeometry).rearBoxDz/2);
360
361 logicRear = new G4LogicalVolume(solidRear,
362 G4Material::GetMaterial("Air"),
363 "RearBox");
364
365 //organic glass
366 solidOrgGlass = new G4Box("OrganicGlass",
367 (*besEMCGeometry).orgGlassLengthX/2,
368 (*besEMCGeometry).orgGlassLengthY/2,
369 (*besEMCGeometry).orgGlassLengthZ/2);
370
371 logicOrgGlass = new G4LogicalVolume(solidOrgGlass,
372 organicGlass,
373 "OrganicGlass");
374
375 physiOrgGlass = new G4PVPlacement(0,
376 G4ThreeVector(0,0,-((*besEMCGeometry).rearBoxDz-(*besEMCGeometry).orgGlassLengthZ)/2),
377 logicOrgGlass,
378 "OrganicGlass",
379 logicRear,
380 false,
381 0);
382
383 //casing
384 solidCasingBox = new G4Box("CasingBox",
385 (*besEMCGeometry).rearBoxLength/2,
386 (*besEMCGeometry).rearBoxLength/2,
387 (*besEMCGeometry).rearCasingThickness/2);
388
389 solidAirHole = new G4Box("AirHole",
390 (*besEMCGeometry).orgGlassLengthX/2,
391 (*besEMCGeometry).orgGlassLengthY/2,
392 (*besEMCGeometry).rearBoxDz/2); //any value more than casing thickness
393
394 solidRearCasing = new G4SubtractionSolid("RearCasing",
395 solidCasingBox,
396 solidAirHole,
397 0,
398 0);
399
400 logicRearCasing = new G4LogicalVolume(solidRearCasing,
401 rearCasingMaterial,
402 "RearCasing");
403
404 physiRearCasing = new G4PVPlacement(0,
405 G4ThreeVector(0,0,-((*besEMCGeometry).rearBoxDz-(*besEMCGeometry).rearCasingThickness)/2),
406 logicRearCasing,
407 "RearCasing",
408 logicRear,
409 false,
410 0);
411
412 //Al Plate
413 solidAlBox = new G4Box("AlBox",
414 (*besEMCGeometry).rearBoxLength/2,
415 (*besEMCGeometry).rearBoxLength/2,
416 (*besEMCGeometry).AlPlateDz/2);
417
418 solidAlPlate = new G4SubtractionSolid("AlPlate",
419 solidAlBox,
420 solidAirHole,
421 0,
422 0);
423
424 logicAlPlate = new G4LogicalVolume(solidAlPlate,
425 G4Material::GetMaterial("Aluminium"),
426 "AlPlate");
427
428 physiAlPlate = new G4PVPlacement(0,
429 G4ThreeVector(0,0,-((*besEMCGeometry).rearBoxDz/2
430 -(*besEMCGeometry).rearCasingThickness
431 -(*besEMCGeometry).AlPlateDz/2)),
432 logicAlPlate,
433 "AlPlate",
434 logicRear,
435 false,
436 0);
437
438 //photodiode
439 solidPD = new G4Box("PD",
440 (*besEMCGeometry).PDLengthX, //two PD
441 (*besEMCGeometry).PDLengthY/2,
442 (*besEMCGeometry).PDLengthZ/2);
443
444 logicPD = new G4LogicalVolume(solidPD,
445 G4Material::GetMaterial("Silicon"),
446 "PD");
447
448 physiPD = new G4PVPlacement(0,
449 G4ThreeVector(0,0,-((*besEMCGeometry).rearBoxDz/2
450 -(*besEMCGeometry).orgGlassLengthZ
451 -(*besEMCGeometry).PDLengthZ/2)),
452 logicPD,
453 "PD",
454 logicRear,
455 false,
456 0);
457
458 //preamplifier box
459 solidPreAmpBox = new G4Box("PreAmpBox",
460 (*besEMCGeometry).rearBoxLength/2,
461 (*besEMCGeometry).rearBoxLength/2,
462 (*besEMCGeometry).PABoxDz/2);
463
464 logicPreAmpBox = new G4LogicalVolume(solidPreAmpBox,
465 G4Material::GetMaterial("Aluminium"),
466 "PreAmpBox");
467
468 physiPreAmpBox = new G4PVPlacement(0,
469 G4ThreeVector(0,0,-((*besEMCGeometry).rearBoxDz/2
470 -(*besEMCGeometry).rearCasingThickness
471 -(*besEMCGeometry).AlPlateDz
472 -(*besEMCGeometry).PABoxDz/2)),
473 logicPreAmpBox,
474 "PreAmpBox",
475 logicRear,
476 false,
477 0);
478
479 //air in preamplifier box
480 solidAirInPABox = new G4Box("AirInPABox",
481 (*besEMCGeometry).rearBoxLength/2-(*besEMCGeometry).PABoxThickness,
482 (*besEMCGeometry).rearBoxLength/2-(*besEMCGeometry).PABoxThickness,
483 (*besEMCGeometry).PABoxDz/2-(*besEMCGeometry).PABoxThickness);
484
485 logicAirInPABox = new G4LogicalVolume(solidAirInPABox,
486 G4Material::GetMaterial("Air"),
487 "AirInPABox");
488
489 physiAirInPABox = new G4PVPlacement(0,
490 0,
491 logicAirInPABox,
492 "AirInPABox",
493 logicPreAmpBox,
494 false,
495 0);
496
497 //stainless steel for hanging the crystal
498 solidHangingPlate = new G4Box("HangingPlate",
499 (*besEMCGeometry).rearBoxLength/2,
500 (*besEMCGeometry).rearBoxLength/2,
501 (*besEMCGeometry).HangingPlateDz/2);
502
503 logicHangingPlate = new G4LogicalVolume(solidHangingPlate,stainlessSteel,"HangingPlate");
504
505 physiHangingPlate = new G4PVPlacement(0,
506 G4ThreeVector(0,0,-((*besEMCGeometry).rearBoxDz/2
507 -(*besEMCGeometry).rearCasingThickness
508 -(*besEMCGeometry).AlPlateDz
509 -(*besEMCGeometry).PABoxDz
510 -(*besEMCGeometry).HangingPlateDz/2)),
511 logicHangingPlate,
512 "HangingPlate",
513 logicRear,
514 false,
515 0);
516
517 //water pipe
518 solidWaterPipe = new G4Tubs("WaterPipe",
519 0,
520 (*besEMCGeometry).waterPipeDr,
521 (*besEMCGeometry).BSCDz,
522 0.*deg,
523 360.*deg);
524
525 logicWaterPipe = new G4LogicalVolume(solidWaterPipe,stainlessSteel,"WaterPipe");
526
527 physiWaterPipe = new G4PVPlacement(0,
528 G4ThreeVector((*besEMCGeometry).cablePosX[0]-2*(*besEMCGeometry).cableDr,
529 (*besEMCGeometry).cablePosY[0]-(*besEMCGeometry).cableDr-(*besEMCGeometry).waterPipeDr,
530 0),
531 logicWaterPipe,
532 "WaterPipe",
533 logicBSCPhi,
534 false,
535 0);
536 //---------------------------------------------------------------------------------
537
538 //
539 //Theta Cell
540 //
541 G4String nameCrystalAndCasing="CrystalAndCasing";
542 G4int id=0; //ID of crystals after distinguishing left and right
543 for(i=startID;i<=thetaNbCrystals;i++)
544 {
545 if(i>(*besEMCGeometry).BSCNbTheta)
546 {
547 id=i-(*besEMCGeometry).BSCNbTheta-1;
548 solidBSCTheta = new G4Trap(nameCrystalAndCasing,
549 zHalfLength[id],
550 thetaAxis[id],
551 -phiAxis[id],
552 yHalfLength1[id],
553 xHalfLength2[id],
554 xHalfLength1[id],
555 -tanAlpha1[id],
556 yHalfLength2[id],
557 xHalfLength4[id],
558 xHalfLength3[id],
559 -tanAlpha2[id]);
560
561 logicBSCTheta = new G4LogicalVolume(solidBSCTheta,
562 fCasingMaterial,
563 nameCrystalAndCasing);
564
565 rotateMatrix[(*besEMCGeometry).BSCNbPhi+i-1] = new G4RotationMatrix();
566 rotateMatrix[(*besEMCGeometry).BSCNbPhi+i-1]->rotateZ(-90*deg);
567 rotateMatrix[(*besEMCGeometry).BSCNbPhi+i-1]
568 ->rotateX(-thetaPosition[id]);
569 physiBSCTheta =
570 new G4PVPlacement(rotateMatrix[(*besEMCGeometry).BSCNbPhi+i-1],
571 G4ThreeVector(xPosition[id],
572 yPosition[id],
573 zPosition[id]),
574 nameCrystalAndCasing,
575 logicBSCTheta,
576 physiBSCPhi,
577 false,
578 thetaNbCrystals-i);
579 if(logicBSCTheta)
580 logicBSCTheta->SetVisAttributes(G4VisAttributes::Invisible);
581
582 if(id<(*besEMCGeometry).BSCNbTheta-1)
583 {
584 physiRear = new G4PVPlacement(rotateMatrix[(*besEMCGeometry).BSCNbPhi+i-1],
585 G4ThreeVector((*besEMCGeometry).rearBoxPosX[id],
586 (*besEMCGeometry).rearBoxPosY[id],
587 (*besEMCGeometry).rearBoxPosZ[id]),
588 "RearBox",
589 logicRear,
590 physiBSCPhi,
591 false,
592 thetaNbCrystals-i);
593
594 solidOCGirder = new G4Cons("OpenningCutGirder",
595 (*besEMCGeometry).OCGirderRmin1[id],
596 (*besEMCGeometry).BSCPhiRmax,
597 (*besEMCGeometry).OCGirderRmin2[id],
598 (*besEMCGeometry).BSCPhiRmax,
599 (*besEMCGeometry).OCGirderDz[id]/2,
600 360.*deg-(*besEMCGeometry).OCGirderAngle/2,
601 (*besEMCGeometry).OCGirderAngle/2);
602
603 logicOCGirder = new G4LogicalVolume(solidOCGirder,stainlessSteel,"OpenningCutGirder");
604 //logicOCGirder->SetVisAttributes(G4VisAttributes::Invisible);
605
606 physiOCGirder = new G4PVPlacement(0,
607 G4ThreeVector(0,0,(*besEMCGeometry).OCGirderPosZ[id]),
608 logicOCGirder,
609 "OpenningCutGirder",
610 logicBSCPhi,
611 false,
612 0);
613
614 G4double zLength =
615 (*besEMCGeometry).OCGirderPosZ[id+1]-(*besEMCGeometry).OCGirderPosZ[id]
616 -(*besEMCGeometry).OCGirderDz[id+1]/2-(*besEMCGeometry).OCGirderDz[id]/2;
617 G4double zPosition =
618 (*besEMCGeometry).OCGirderPosZ[id+1]-(*besEMCGeometry).OCGirderDz[id+1]/2-zLength/2;
619
620 solidOCGirder = new G4Cons("OpenningCutGirder",
621 (*besEMCGeometry).OCGirderRmin2[id],
622 (*besEMCGeometry).BSCPhiRmax,
623 (*besEMCGeometry).OCGirderRmin1[id+1],
624 (*besEMCGeometry).BSCPhiRmax,
625 zLength/2,
626 360.*deg-(*besEMCGeometry).OCGirderAngle/2,
627 (*besEMCGeometry).OCGirderAngle/2);
628
629 logicOCGirder = new G4LogicalVolume(solidOCGirder,stainlessSteel,"OpenningCutGirder");
630 //logicOCGirder->SetVisAttributes(G4VisAttributes::Invisible);
631
632 physiOCGirder = new G4PVPlacement(0,
633 G4ThreeVector(0,0,zPosition),
634 logicOCGirder,
635 "OpenningCutGirder",
636 logicBSCPhi,
637 false,
638 0);
639 }
640
641 solidCable = new G4Tubs("BSCCable",
642 0,
643 (*besEMCGeometry).cableDr,
644 (*besEMCGeometry).cableLength[id]/2,
645 0.*deg,
646 360.*deg);
647
648 logicCable = new G4LogicalVolume(solidCable,cable,"BSCCable");
649
650 physiCable = new G4PVPlacement(0,
651 G4ThreeVector((*besEMCGeometry).cablePosX[id],
652 (*besEMCGeometry).cablePosY[id],
653 (*besEMCGeometry).cablePosZ[id]),
654 logicCable,
655 "BSCCable",
656 logicBSCPhi,
657 false,
658 0);
659 //logicCable->SetVisAttributes(G4VisAttributes::Invisible);
660
661 }
662 else
663 {
664 id=(*besEMCGeometry).BSCNbTheta-i;
665 solidBSCTheta = new G4Trap(nameCrystalAndCasing,
666 zHalfLength[id],
667 thetaAxis[id],
668 phiAxis[id],
669 yHalfLength1[id],
670 xHalfLength1[id],
671 xHalfLength2[id],
672 tanAlpha1[id],
673 yHalfLength2[id],
674 xHalfLength3[id],
675 xHalfLength4[id],
676 tanAlpha2[id]);
677
678 logicBSCTheta = new G4LogicalVolume(solidBSCTheta,
679 fCasingMaterial,
680 nameCrystalAndCasing);
681
682 rotateMatrix[(*besEMCGeometry).BSCNbPhi+i-1] = new G4RotationMatrix();
683 rotateMatrix[(*besEMCGeometry).BSCNbPhi+i-1]->rotateZ(-90*deg);
684 rotateMatrix[(*besEMCGeometry).BSCNbPhi+i-1]
685 ->rotateX(-180*deg+thetaPosition[id]);
686 physiBSCTheta =
687 new G4PVPlacement(rotateMatrix[(*besEMCGeometry).BSCNbPhi+i-1],
688 G4ThreeVector(xPosition[id],
689 yPosition[id],
690 -zPosition[id]),
691 nameCrystalAndCasing,
692 logicBSCTheta,
693 physiBSCPhi,
694 false,
695 thetaNbCrystals-i);
696 if(logicBSCTheta)
697 {
698 //G4VisAttributes* rightVisAtt= new G4VisAttributes(G4Colour(1.0,0.,0.));
699 //rightVisAtt->SetVisibility(true);
700 //logicBSCTheta->SetVisAttributes(rightVisAtt);
701 //logicBSCTheta->SetVisAttributes(G4VisAttributes::Invisible);
702 }
703
704 if(id<(*besEMCGeometry).BSCNbTheta-1)
705 {
706 physiRear = new G4PVPlacement(rotateMatrix[(*besEMCGeometry).BSCNbPhi+i-1],
707 G4ThreeVector((*besEMCGeometry).rearBoxPosX[id],
708 (*besEMCGeometry).rearBoxPosY[id],
709 -(*besEMCGeometry).rearBoxPosZ[id]),
710 "RearBox",
711 logicRear,
712 physiBSCPhi,
713 false,
714 thetaNbCrystals-i);
715
716 solidOCGirder = new G4Cons("OpenningCutGirder",
717 (*besEMCGeometry).OCGirderRmin2[id],
718 (*besEMCGeometry).BSCPhiRmax,
719 (*besEMCGeometry).OCGirderRmin1[id],
720 (*besEMCGeometry).BSCPhiRmax,
721 (*besEMCGeometry).OCGirderDz[id]/2,
722 360.*deg-(*besEMCGeometry).OCGirderAngle/2,
723 (*besEMCGeometry).OCGirderAngle/2);
724
725 logicOCGirder = new G4LogicalVolume(solidOCGirder,stainlessSteel,"OpenningCutGirder");
726 //logicOCGirder->SetVisAttributes(G4VisAttributes::Invisible);
727
728 physiOCGirder = new G4PVPlacement(0,
729 G4ThreeVector(0,0,-(*besEMCGeometry).OCGirderPosZ[id]),
730 logicOCGirder,
731 "OpenningCutGirder",
732 logicBSCPhi,
733 false,
734 0);
735
736 G4double zLength =
737 (*besEMCGeometry).OCGirderPosZ[id+1]-(*besEMCGeometry).OCGirderPosZ[id]
738 -(*besEMCGeometry).OCGirderDz[id+1]/2-(*besEMCGeometry).OCGirderDz[id]/2;
739 G4double zPosition =
740 (*besEMCGeometry).OCGirderPosZ[id+1]-(*besEMCGeometry).OCGirderDz[id+1]/2-zLength/2;
741
742 solidOCGirder = new G4Cons("OpenningCutGirder",
743 (*besEMCGeometry).OCGirderRmin1[id+1],
744 (*besEMCGeometry).BSCPhiRmax,
745 (*besEMCGeometry).OCGirderRmin2[id],
746 (*besEMCGeometry).BSCPhiRmax,
747 zLength/2,
748 360.*deg-(*besEMCGeometry).OCGirderAngle/2,
749 (*besEMCGeometry).OCGirderAngle/2);
750
751 logicOCGirder = new G4LogicalVolume(solidOCGirder,stainlessSteel,"OpenningCutGirder");
752 //logicOCGirder->SetVisAttributes(G4VisAttributes::Invisible);
753
754 physiOCGirder = new G4PVPlacement(0,
755 G4ThreeVector(0,0,-zPosition),
756 logicOCGirder,
757 "OpenningCutGirder",
758 logicBSCPhi,
759 false,
760 0);
761 }
762
763 solidCable = new G4Tubs("BSCCable",
764 0,
765 (*besEMCGeometry).cableDr,
766 (*besEMCGeometry).cableLength[id]/2,
767 0.*deg,
768 360.*deg);
769
770 logicCable = new G4LogicalVolume(solidCable,cable,"BSCCable");
771
772 physiCable = new G4PVPlacement(0,
773 G4ThreeVector((*besEMCGeometry).cablePosX[id],
774 (*besEMCGeometry).cablePosY[id],
775 -(*besEMCGeometry).cablePosZ[id]),
776 logicCable,
777 "BSCCable",
778 logicBSCPhi,
779 false,
780 0);
781 //logicCable->SetVisAttributes(G4VisAttributes::Invisible);
782 }
783
784 physiBSCCrystal = new G4PVParameterised(
785 "Crystal",
786 logicBSCCrystal,
787 physiBSCTheta,
788 kZAxis,
789 1,//for this method,it must be 1.
790 crystalParam);
791 (*besEMCGeometry).physiBSCCrystal[i]=physiBSCCrystal;
792 //G4cout << (*besEMCGeometry).physiBSCCrystal[i] << G4endl;
793 physiBSCCrystal->SetCopyNo(thetaNbCrystals-i);
794 if(verboseLevel>4)
795 G4cout << "BesEmcConstruction*****************************"<< G4endl
796 << "point of crystal =" <<physiBSCCrystal << G4endl
797 // << "point of mother =" <<physiBSCCrystal->GetMotherPhysical() << G4endl
798 << "point of excepted=" <<physiBSCTheta << G4endl;
799 //G4Exception("BesEMCConstruction::Construct() starting............");
800 }
801 */
802 //
803 // Sensitive Detectors: Absorber and Gap
804 //
805 // if (logicBSCCrystal)
806 // logicBSCCrystal->SetSensitiveDetector(besEMCSD);
807
808 //
809 // Visualization attributes
810 //
811 /* if(logicEMC)
812 {
813 G4VisAttributes* bscVisAtt= new G4VisAttributes(G4Colour(0.5,0.5,0.5));
814 bscVisAtt->SetVisibility(false);
815 logicEMC->SetVisAttributes(bscVisAtt);
816 //logicBSC->SetVisAttributes(G4VisAttributes::Invisible);
817 }
818 if(logicBSCPhi)
819 {
820 G4VisAttributes* rightVisAtt= new G4VisAttributes(G4Colour(1.0,0.,1.0));
821 rightVisAtt->SetVisibility(false);
822 logicBSCPhi->SetVisAttributes(rightVisAtt);
823 //logicBSCPhi->SetVisAttributes(G4VisAttributes::Invisible);
824 }
825 if(logicBSCCrystal)
826 {
827 G4VisAttributes* crystalVisAtt= new G4VisAttributes(G4Colour(0,0,1.0));
828 crystalVisAtt->SetVisibility(true);
829 logicBSCCrystal->SetVisAttributes(crystalVisAtt);
830 //logicBSCCrystal->SetVisAttributes(G4VisAttributes::Invisible);
831 }
832 if(logicOrgGlass)
833 {
834 G4VisAttributes* glassVisAtt = new G4VisAttributes(G4Colour(0.5,1.0,1.0));
835 glassVisAtt->SetVisibility(false);
836 logicOrgGlass->SetVisAttributes(glassVisAtt);
837 }
838 if(logicRearCasing)
839 {
840 logicRearCasing->SetVisAttributes(G4VisAttributes::Invisible);
841 }
842 if(logicAlPlate)
843 {
844 G4VisAttributes* AlPlateVisAtt = new G4VisAttributes(G4Colour(0.9,0.9,1.0));
845 AlPlateVisAtt->SetVisibility(true);
846 logicAlPlate->SetVisAttributes(AlPlateVisAtt);
847 logicAlPlate->SetVisAttributes(G4VisAttributes::Invisible);
848 }
849 logicRear->SetVisAttributes(G4VisAttributes::Invisible);
850 logicPreAmpBox->SetVisAttributes(G4VisAttributes::Invisible);
851 logicHangingPlate->SetVisAttributes(G4VisAttributes::Invisible);
852 logicAirInPABox->SetVisAttributes(G4VisAttributes::Invisible);
853 logicPD->SetVisAttributes(G4VisAttributes::Invisible);
854 logicWaterPipe->SetVisAttributes(G4VisAttributes::Invisible);
855 //
856 //always return the physical World
857 //
858 if(verboseLevel>0)PrintEMCParameters();
859 // return physiBSC;
860 */
861 // ConstructEndGeometry(logicEMC);
862 // ConstructSPFrame(logicEMC,besEMCGeometry);
863}
static EmcG4Geo * Instance()
Get a pointer to the single instance of EmcG4Geo.
Definition EmcG4Geo.cxx:43
G4LogicalVolume * GetTopVolume()
Get the top(world) volume;.

◆ ConstructEndGeometry()

void ExtBesEmcConstruction::ConstructEndGeometry ( G4LogicalVolume * logicEM)

Definition at line 995 of file ExtBesEmcConstruction.cxx.

995 {
996 G4Material* fCrystalMaterial = G4Material::GetMaterial( "Cesiumiodide" );
997 // G4VisAttributes* crystalVisAtt= new G4VisAttributes(G4Colour(0.5,0,1.0));
998 // crystalVisAtt->SetVisibility(true);
999 // G4VisAttributes* endPhiVisAtt= new G4VisAttributes(G4Colour(0,1.0,0));
1000 // endPhiVisAtt->SetVisibility(false);
1001
1002 // world volume of endcap
1003 // east end
1004 solidEnd = new G4Cons( "EndWorld", ( *emcEnd ).WorldRmin1, ( *emcEnd ).WorldRmax1,
1005 ( *emcEnd ).WorldRmin2, ( *emcEnd ).WorldRmax2,
1006 ( *emcEnd ).WorldDz / 2, 0. * deg, 360. * deg );
1007 logicEnd =
1008 new G4LogicalVolume( solidEnd, G4Material::GetMaterial( "Air" ), "EndWorld", 0, 0, 0 );
1009 physiEnd = new G4PVPlacement( 0, // no rotation
1010 G4ThreeVector( 0, 0, ( *emcEnd ).WorldZPosition ),
1011 logicEnd, // its logical volume
1012 "EndWorld", // its name
1013 logicEMC, // its mother volume
1014 false, // no boolean operations
1015 0 ); // no field specific to volume
1016 // if(logicEnd)
1017 // logicEnd->SetVisAttributes(G4VisAttributes::Invisible);
1018
1019 // west end
1020 G4RotationMatrix* rotateEnd = new G4RotationMatrix();
1021 rotateEnd->rotateY( 180. * deg );
1022 physiEnd = new G4PVPlacement( rotateEnd, G4ThreeVector( 0, 0, -( *emcEnd ).WorldZPosition ),
1023 logicEnd, "EndWorld", logicEMC, false, 2 );
1024
1025 ////////////////////////////////////////////////////////////////////////
1026 // emc endcap sectors (east) //
1027 //////////////////////////////////////////////////////////////////////////
1028 // 20mm gap //
1029 // || //
1030 // \ 7 || 6 / //
1031 // - 8 \ || / 5 - //
1032 // - \ || / - //
1033 // _ 9 - \ || / - 4 _ //
1034 // - _ - \ || / - _ - //
1035 // - _ - \||/ - _ - //
1036 // 10 - -||- - 3 //
1037 // ----------------||---------------- //
1038 // 11 - -||- - 2 //
1039 // _ - - /||\ - - _ //
1040 // _ - - / || \ - - _ //
1041 // - 12 - / || \ - 1 - //
1042 // - / || \ - //
1043 // - 13 / || \ 0 - //
1044 // / 14 || 15 \ //
1045 // || //
1046 ////////////////////////////////////////////////////////////////////////
1047
1048 // 1/16 of endcap world,which has some symmetry
1049 // sector 0-6,8-14
1050 solidEndPhi = new G4Cons( "EndPhi", ( *emcEnd ).WorldRmin1, ( *emcEnd ).WorldRmax1,
1051 ( *emcEnd ).WorldRmin2, ( *emcEnd ).WorldRmax2,
1052 ( *emcEnd ).WorldDz / 2, 0 * deg, 22.5 * deg );
1053 logicEndPhi =
1054 new G4LogicalVolume( solidEndPhi, G4Material::GetMaterial( "Air" ), "EndPhi", 0, 0, 0 );
1055 for ( G4int i = 0; i < 14; i++ )
1056 {
1057 if ( ( i != 6 ) && ( i != 7 ) )
1058 {
1059 G4RotationMatrix* rotatePhi = new G4RotationMatrix();
1060 rotatePhi->rotateZ( -i * 22.5 * deg + 67.5 * deg );
1061 physiEndPhi = new G4PVPlacement( rotatePhi, G4ThreeVector( 0, 0, 0 ), logicEndPhi,
1062 "EndPhi", logicEnd, false, i, false );
1063 }
1064 }
1065 // if(logicEndPhi)
1066 // logicEndPhi->SetVisAttributes(endPhiVisAtt);
1067
1068 for ( G4int i = 0; i < 35; i++ )
1069 {
1070 G4int copyNb = ComputeEndCopyNb( i );
1071
1072 solidEndCasing = new G4IrregBox( "EndCasing", ( *emcEnd ).fPnt[i] );
1073 logicEndCasing = new G4LogicalVolume( solidEndCasing, fCasingMaterial, "EndCasing" );
1074 physiEndCasing = new G4PVPlacement( 0, G4ThreeVector( 0, 0, 0 ), logicEndCasing,
1075 "EndCasing", logicEndPhi, false, copyNb, false );
1076
1077 emcEnd->ModifyForCasing( ( *emcEnd ).fPnt[i], i );
1078 solidEndCrystal = new G4IrregBox( "EndCrystal", ( *emcEnd ).cryPoint );
1079 logicEndCrystal = new G4LogicalVolume( solidEndCrystal, fCrystalMaterial, "EndCrystal" );
1080 physiEndCrystal = new G4PVPlacement( 0, G4ThreeVector( 0, 0, 0 ), logicEndCrystal,
1081 "EndCrystal", logicEndCasing, false, copyNb, false );
1082
1083 // logicEndCasing->SetVisAttributes(G4VisAttributes::Invisible);
1084 // logicEndCrystal->SetVisAttributes(crystalVisAtt);
1085 // logicEndCrystal->SetSensitiveDetector(besEMCSD);
1086 }
1087
1088 // the top area which has 20 mm gap
1089 // sector 6,14
1090 solidEndPhi = new G4Cons( "EndPhi", ( *emcEnd ).WorldRmin1, ( *emcEnd ).WorldRmax1,
1091 ( *emcEnd ).WorldRmin2, ( *emcEnd ).WorldRmax2,
1092 ( *emcEnd ).WorldDz / 2, 67.5 * deg, 22.5 * deg );
1093 logicEndPhi =
1094 new G4LogicalVolume( solidEndPhi, G4Material::GetMaterial( "Air" ), "EndPhi", 0, 0, 0 );
1095 for ( G4int i = 0; i < 2; i++ )
1096 {
1097 G4RotationMatrix* rotatePhi = new G4RotationMatrix();
1098 rotatePhi->rotateZ( -i * 180. * deg );
1099 physiEndPhi = new G4PVPlacement( rotatePhi, G4ThreeVector( 0, 0, 0 ), logicEndPhi,
1100 "EndPhi", logicEnd, false, i * 8 + 6, false );
1101 }
1102 // if(logicEndPhi)
1103 // logicEndPhi->SetVisAttributes(endPhiVisAtt);
1104
1105 for ( G4int i = 0; i < 35; i++ )
1106 {
1107 G4int copyNb = ComputeEndCopyNb( i );
1108 solidEndCasing = new G4IrregBox( "EndCasing", ( *emcEnd ).fPnt1[i] );
1109 logicEndCasing = new G4LogicalVolume( solidEndCasing, fCasingMaterial, "EndCasing" );
1110 physiEndCasing = new G4PVPlacement( 0, G4ThreeVector( 0, 0, 0 ), logicEndCasing,
1111 "EndCasing", logicEndPhi, false, copyNb, false );
1112
1113 emcEnd->ModifyForCasing( ( *emcEnd ).fPnt1[i], i );
1114 solidEndCrystal = new G4IrregBox( "EndCrystal", ( *emcEnd ).cryPoint );
1115 logicEndCrystal = new G4LogicalVolume( solidEndCrystal, fCrystalMaterial, "EndCrystal" );
1116 physiEndCrystal = new G4PVPlacement( 0, G4ThreeVector( 0, 0, 0 ), logicEndCrystal,
1117 "EndCrystal", logicEndCasing, false, copyNb, false );
1118
1119 // logicEndCasing->SetVisAttributes(G4VisAttributes::Invisible);
1120 // logicEndCrystal->SetVisAttributes(crystalVisAtt);
1121 // logicEndCrystal->SetSensitiveDetector(besEMCSD);
1122 }
1123
1124 ( *emcEnd ).ReflectX();
1125
1126 // sector 7,15
1127 for ( G4int i = 0; i < 35; i++ )
1128 for ( G4int j = 0; j < 8; j++ ) ( *emcEnd ).fPnt1[i][j].rotateZ( -90. * deg );
1129
1130 solidEndPhi = new G4Cons( "EndPhi", ( *emcEnd ).WorldRmin1, ( *emcEnd ).WorldRmax1,
1131 ( *emcEnd ).WorldRmin2, ( *emcEnd ).WorldRmax2,
1132 ( *emcEnd ).WorldDz / 2, 0 * deg, 22.5 * deg );
1133 logicEndPhi =
1134 new G4LogicalVolume( solidEndPhi, G4Material::GetMaterial( "Air" ), "EndPhi", 0, 0, 0 );
1135 for ( G4int i = 0; i < 2; i++ )
1136 {
1137 G4RotationMatrix* rotatePhi = new G4RotationMatrix();
1138 rotatePhi->rotateZ( -i * 180. * deg - 90. * deg );
1139 physiEndPhi = new G4PVPlacement( rotatePhi, G4ThreeVector( 0, 0, 0 ), logicEndPhi,
1140 "EndPhi", logicEnd, false, i * 8 + 7, false );
1141 }
1142 // if(logicEndPhi)
1143 // logicEndPhi->SetVisAttributes(endPhiVisAtt);
1144
1145 for ( G4int i = 0; i < 35; i++ )
1146 {
1147 G4int copyNb = ComputeEndCopyNb( i );
1148 solidEndCasing = new G4IrregBox( "EndCasing", ( *emcEnd ).fPnt1[i] );
1149 logicEndCasing = new G4LogicalVolume( solidEndCasing, fCrystalMaterial, "EndCasing" );
1150 physiEndCasing = new G4PVPlacement( 0, G4ThreeVector( 0, 0, 0 ), logicEndCasing,
1151 "EndCasing", logicEndPhi, false, copyNb, false );
1152
1153 emcEnd->ModifyForCasing( ( *emcEnd ).fPnt1[i], i );
1154 solidEndCrystal = new G4IrregBox( "EndCrystal", ( *emcEnd ).cryPoint );
1155 logicEndCrystal = new G4LogicalVolume( solidEndCrystal, fCrystalMaterial, "EndCrystal" );
1156 physiEndCrystal = new G4PVPlacement( 0, G4ThreeVector( 0, 0, 0 ), logicEndCrystal,
1157 "EndCrystal", logicEndCasing, false, copyNb, false );
1158
1159 // logicEndCasing->SetVisAttributes(G4VisAttributes::Invisible);
1160 // logicEndCrystal->SetVisAttributes(crystalVisAtt);
1161 // logicEndCrystal->SetSensitiveDetector(besEMCSD);
1162 }
1163}

◆ ConstructSPFrame()

void ExtBesEmcConstruction::ConstructSPFrame ( G4LogicalVolume * logicEMC,
ExtBesEmcGeometry * besEMCGeometry )

Definition at line 1166 of file ExtBesEmcConstruction.cxx.

1167 {
1168 // G4VisAttributes* ringVisAtt= new G4VisAttributes(G4Colour(0.5,0.25,0.));
1169 // ringVisAtt->SetVisibility(false);
1170
1171 solidSupportBar = new G4Tubs(
1172 "SupportBar", ( *besEMCGeometry ).BSCRmax + ( *besEMCGeometry ).SPBarThickness1,
1173 ( *besEMCGeometry ).BSCRmax + ( *besEMCGeometry ).SPBarThickness +
1174 ( *besEMCGeometry ).SPBarThickness1,
1175 ( *besEMCGeometry ).BSCDz + ( *besEMCGeometry ).TaperRingThickness3 +
1176 ( *besEMCGeometry ).EndRingDz,
1177 0. * deg, 360. * deg );
1178
1179 logicSupportBar = new G4LogicalVolume( solidSupportBar, stainlessSteel, "SupportBar" );
1180
1181 physiSupportBar = new G4PVPlacement( 0, G4ThreeVector( 0, 0, 0 ), logicSupportBar,
1182 "SupportBar", logicEMC, false, 0, false );
1183
1184 solidSupportBar1 =
1185 new G4Tubs( "SupportBar1", ( *besEMCGeometry ).BSCRmax,
1186 ( *besEMCGeometry ).BSCRmax + ( *besEMCGeometry ).SPBarThickness1,
1187 ( *besEMCGeometry ).BSCDz + ( *besEMCGeometry ).TaperRingThickness3,
1188 ( *besEMCGeometry ).BSCPhiDphi - ( *besEMCGeometry ).SPBarDphi / 2,
1189 ( *besEMCGeometry ).SPBarDphi );
1190
1191 logicSupportBar1 = new G4LogicalVolume( solidSupportBar1, stainlessSteel, "SupportBar1" );
1192
1193 for ( G4int i = 0; i < ( *besEMCGeometry ).BSCNbPhi / 2; i++ )
1194 {
1195 G4RotationMatrix* rotateSPBar = new G4RotationMatrix();
1196 rotateSPBar->rotateZ( ( *besEMCGeometry ).BSCPhiDphi -
1197 i * 2 * ( *besEMCGeometry ).BSCPhiDphi );
1198 physiSupportBar1 =
1199 new G4PVPlacement( rotateSPBar, G4ThreeVector( 0, 0, 0 ), logicSupportBar1,
1200 "SupportBar1", logicEMC, false, 0, false );
1201 }
1202
1203 // end ring
1204 solidEndRing =
1205 new G4Tubs( "EndRing", ( *besEMCGeometry ).EndRingRmin,
1206 ( *besEMCGeometry ).EndRingRmin + ( *besEMCGeometry ).EndRingDr / 2,
1207 ( *besEMCGeometry ).EndRingDz / 2, 0. * deg, 360. * deg );
1208
1209 solidGear = new G4Tubs(
1210 "Gear", ( *besEMCGeometry ).EndRingRmin + ( *besEMCGeometry ).EndRingDr / 2,
1211 ( *besEMCGeometry ).EndRingRmin + ( *besEMCGeometry ).EndRingDr,
1212 ( *besEMCGeometry ).EndRingDz / 2, 0. * deg, ( *besEMCGeometry ).BSCPhiDphi );
1213
1214 // taper ring
1215 solidTaperRing1 =
1216 new G4Tubs( "TaperRing1", ( *besEMCGeometry ).TaperRingRmin1,
1217 ( *besEMCGeometry ).TaperRingRmin1 + ( *besEMCGeometry ).TaperRingThickness1,
1218 ( *besEMCGeometry ).TaperRingInnerLength / 2, 0. * deg, 360. * deg );
1219
1220 solidTaperRing2 =
1221 new G4Cons( "TaperRing2", ( *besEMCGeometry ).TaperRingRmin1,
1222 ( *besEMCGeometry ).TaperRingRmin1 + ( *besEMCGeometry ).TaperRingDr,
1223 ( *besEMCGeometry ).TaperRingRmin2,
1224 ( *besEMCGeometry ).TaperRingRmin2 + ( *besEMCGeometry ).TaperRingDr,
1225 ( *besEMCGeometry ).TaperRingDz / 2, 0. * deg, 360. * deg );
1226
1227 solidTaperRing3 =
1228 new G4Cons( "TaperRing3", ( *besEMCGeometry ).BSCRmax2,
1229 ( *besEMCGeometry ).BSCRmax2 + ( *besEMCGeometry ).TaperRingOuterLength1,
1230 ( *besEMCGeometry ).TaperRingRmin2 + ( *besEMCGeometry ).TaperRingDr,
1231 ( *besEMCGeometry ).TaperRingRmin2 + ( *besEMCGeometry ).TaperRingDr +
1232 ( *besEMCGeometry ).TaperRingOuterLength,
1233 ( *besEMCGeometry ).TaperRingThickness3 / 2, 0. * deg, 360. * deg );
1234
1235 logicEndRing = new G4LogicalVolume( solidEndRing, stainlessSteel, "EmcEndRing" );
1236 logicGear = new G4LogicalVolume( solidGear, stainlessSteel, "Gear" );
1237 logicTaperRing1 = new G4LogicalVolume( solidTaperRing1, stainlessSteel, "TaperRing1" );
1238 logicTaperRing2 = new G4LogicalVolume( solidTaperRing2, stainlessSteel, "TaperRing2" );
1239 logicTaperRing3 = new G4LogicalVolume( solidTaperRing3, stainlessSteel, "TaperRing3" );
1240
1241 for ( G4int i = 0; i < 2; i++ )
1242 {
1243 G4RotationMatrix* rotateSPRing = new G4RotationMatrix();
1244 G4double zEndRing, z1, z2, z3;
1245 if ( i == 0 )
1246 {
1247 zEndRing = ( *besEMCGeometry ).BSCDz + ( *besEMCGeometry ).TaperRingThickness3 +
1248 ( *besEMCGeometry ).EndRingDz / 2;
1249 z1 = ( *besEMCGeometry ).BSCDz + ( *besEMCGeometry ).TaperRingThickness3 -
1250 ( *besEMCGeometry ).TaperRingDz - ( *besEMCGeometry ).TaperRingInnerLength / 2;
1251 z2 = ( *besEMCGeometry ).BSCDz + ( *besEMCGeometry ).TaperRingThickness3 -
1252 ( *besEMCGeometry ).TaperRingDz / 2;
1253 z3 = ( *besEMCGeometry ).BSCDz + ( *besEMCGeometry ).TaperRingThickness3 / 2;
1254 }
1255 else
1256 {
1257 rotateSPRing->rotateY( 180. * deg );
1258 zEndRing = -( ( *besEMCGeometry ).BSCDz + ( *besEMCGeometry ).TaperRingThickness3 +
1259 ( *besEMCGeometry ).EndRingDz / 2 );
1260 z1 = -( ( *besEMCGeometry ).BSCDz + ( *besEMCGeometry ).TaperRingThickness3 -
1261 ( *besEMCGeometry ).TaperRingDz - ( *besEMCGeometry ).TaperRingInnerLength / 2 );
1262 z2 = -( ( *besEMCGeometry ).BSCDz + ( *besEMCGeometry ).TaperRingThickness3 -
1263 ( *besEMCGeometry ).TaperRingDz / 2 );
1264 z3 = -( ( *besEMCGeometry ).BSCDz + ( *besEMCGeometry ).TaperRingThickness3 / 2 );
1265 }
1266
1267 physiEndRing = new G4PVPlacement( rotateSPRing, G4ThreeVector( 0, 0, zEndRing ),
1268 logicEndRing, "EndRing", logicEMC, false, 0 );
1269
1270 for ( G4int j = 0; j < ( *besEMCGeometry ).BSCNbPhi / 2; j++ )
1271 {
1272 G4RotationMatrix* rotateGear = new G4RotationMatrix();
1273 rotateGear->rotateZ( ( *besEMCGeometry ).BSCPhiDphi / 2 -
1274 j * 2 * ( *besEMCGeometry ).BSCPhiDphi );
1275 physiGear = new G4PVPlacement( rotateGear, G4ThreeVector( 0, 0, zEndRing ), logicGear,
1276 "Gear", logicEMC, false, 0 );
1277 }
1278
1279 physiTaperRing1 = new G4PVPlacement( rotateSPRing, G4ThreeVector( 0, 0, z1 ),
1280 logicTaperRing1, "TaperRing1", logicEMC, false, 0 );
1281
1282 physiTaperRing2 = new G4PVPlacement( rotateSPRing, G4ThreeVector( 0, 0, z2 ),
1283 logicTaperRing2, "TaperRing2", logicEMC, false, 0 );
1284
1285 physiTaperRing3 = new G4PVPlacement( rotateSPRing, G4ThreeVector( 0, 0, z3 ),
1286 logicTaperRing3, "TaperRing3", logicEMC, false, 0 );
1287 }
1288 /*
1289 logicSupportBar->SetVisAttributes(ringVisAtt);
1290 logicSupportBar1->SetVisAttributes(ringVisAtt);
1291 logicEndRing->SetVisAttributes(ringVisAtt);
1292 logicGear->SetVisAttributes(ringVisAtt);
1293 logicTaperRing1->SetVisAttributes(ringVisAtt);
1294 logicTaperRing2->SetVisAttributes(ringVisAtt);
1295 logicTaperRing3->SetVisAttributes(ringVisAtt);
1296 */
1297}

◆ GetBesEmcConstruction()

ExtBesEmcConstruction * ExtBesEmcConstruction::GetBesEmcConstruction ( )
inlinestatic

Definition at line 33 of file ExtBesEmcConstruction.h.

33{ return fBesEmcConstruction; };

Referenced by ExtBesCrystalParameterisation::ComputeIDAndSide(), and ExtBesCrystalParameterisation::ComputeMaterial().

◆ GetBSCCrystal()

const G4VPhysicalVolume * ExtBesEmcConstruction::GetBSCCrystal ( )
inline

Definition at line 77 of file ExtBesEmcConstruction.h.

77{ return physiBSCCrystal; };

◆ GetBSCPhi()

const G4VPhysicalVolume * ExtBesEmcConstruction::GetBSCPhi ( )
inline

Definition at line 75 of file ExtBesEmcConstruction.h.

75{ return physiBSCPhi; };

◆ GetBSCTheta()

const G4VPhysicalVolume * ExtBesEmcConstruction::GetBSCTheta ( )
inline

Definition at line 76 of file ExtBesEmcConstruction.h.

76{ return physiBSCTheta; };

◆ GetCasingMaterial()

G4Material * ExtBesEmcConstruction::GetCasingMaterial ( )
inline

Definition at line 70 of file ExtBesEmcConstruction.h.

70{ return fCasingMaterial; };

Referenced by ExtBesCrystalParameterisation::ComputeMaterial().

◆ GetCrystalMaterial()

G4Material * ExtBesEmcConstruction::GetCrystalMaterial ( )
inline

Definition at line 69 of file ExtBesEmcConstruction.h.

69{ return fCrystalMaterial; };

Referenced by ExtBesCrystalParameterisation::ComputeMaterial().

◆ GetCrystalParam()

const G4VPVParameterisation * ExtBesEmcConstruction::GetCrystalParam ( )
inline

Definition at line 78 of file ExtBesEmcConstruction.h.

78{ return crystalParam; };

◆ GetEMC()

const G4VPhysicalVolume * ExtBesEmcConstruction::GetEMC ( )
inline

Definition at line 74 of file ExtBesEmcConstruction.h.

74{ return physiEMC; }

◆ GetMagField()

G4double ExtBesEmcConstruction::GetMagField ( )
inline

Definition at line 65 of file ExtBesEmcConstruction.h.

65{ return fmagField; };

◆ GetStartIDTheta()

G4int ExtBesEmcConstruction::GetStartIDTheta ( )
inline

Definition at line 67 of file ExtBesEmcConstruction.h.

67{ return startID; };

◆ GetVerboseLevel()

G4int ExtBesEmcConstruction::GetVerboseLevel ( )
inline

Definition at line 64 of file ExtBesEmcConstruction.h.

64{ return verboseLevel; };

Referenced by ExtBesCrystalParameterisation::ComputeIDAndSide().

◆ PrintEMCParameters()

void ExtBesEmcConstruction::PrintEMCParameters ( )

Definition at line 1313 of file ExtBesEmcConstruction.cxx.

1313 {
1314 G4cout << "-------------------------------------------------------" << G4endl
1315 << "---> There are " << phiNbCrystals << "(max=" << ( *besEMCGeometry ).BSCNbPhi
1316 << ") crystals along phi direction and " << thetaNbCrystals
1317 << "(max=" << ( *besEMCGeometry ).BSCNbTheta << ") crystals along theta direction."
1318 << G4endl << "The crystals have sizes of " << ( *besEMCGeometry ).BSCCryLength / cm
1319 << "cm(L) and " << ( *besEMCGeometry ).BSCYFront / cm << "cm(Y) with "
1320 << fCrystalMaterial->GetName() << "." << G4endl << "The casing is layer of "
1321 << ( *besEMCGeometry ).fTyvekThickness / mm << "mm tyvek,"
1322 << ( *besEMCGeometry ).fAlThickness / mm << "mm aluminum and"
1323 << ( *besEMCGeometry ).fMylarThickness / mm << "mm mylar." << G4endl
1324 << "-------------------------------------------------------" << G4endl;
1325 G4cout << G4Material::GetMaterial( "PolyethyleneTerephthlate" ) << G4endl
1326 << G4Material::GetMaterial( "Casing" ) << G4endl
1327 << G4Material::GetMaterial( "Polyethylene" ) << G4endl
1328 << "-------------------------------------------------------" << G4endl;
1329}

Referenced by SetCasingMaterial(), and SetCrystalMaterial().

◆ SetBSCCrystalLength()

void ExtBesEmcConstruction::SetBSCCrystalLength ( G4double val)

Definition at line 1382 of file ExtBesEmcConstruction.cxx.

1382 {
1383 ( *besEMCGeometry ).BSCCryLength = val;
1384}

◆ SetBSCNbPhi()

void ExtBesEmcConstruction::SetBSCNbPhi ( G4int val)

Definition at line 1370 of file ExtBesEmcConstruction.cxx.

1370{ ( *besEMCGeometry ).BSCNbPhi = val; }

◆ SetBSCNbTheta()

void ExtBesEmcConstruction::SetBSCNbTheta ( G4int val)

Definition at line 1374 of file ExtBesEmcConstruction.cxx.

1374 {
1375 ( *besEMCGeometry ).BSCNbTheta = val;
1376}

◆ SetBSCPosition0()

void ExtBesEmcConstruction::SetBSCPosition0 ( G4double val)

Definition at line 1400 of file ExtBesEmcConstruction.cxx.

1400 {
1401 ( *besEMCGeometry ).BSCPosition0 = val;
1402}

◆ SetBSCPosition1()

void ExtBesEmcConstruction::SetBSCPosition1 ( G4double val)

Definition at line 1406 of file ExtBesEmcConstruction.cxx.

1406 {
1407 ( *besEMCGeometry ).BSCPosition1 = val;
1408}

◆ SetBSCRmin()

void ExtBesEmcConstruction::SetBSCRmin ( G4double val)

Definition at line 1366 of file ExtBesEmcConstruction.cxx.

1366{ ( *besEMCGeometry ).BSCRmin = val; }

◆ SetBSCYFront()

void ExtBesEmcConstruction::SetBSCYFront ( G4double val)

Definition at line 1394 of file ExtBesEmcConstruction.cxx.

1394 {
1395 ( *besEMCGeometry ).BSCYFront = val;
1396}

◆ SetBSCYFront0()

void ExtBesEmcConstruction::SetBSCYFront0 ( G4double val)

Definition at line 1388 of file ExtBesEmcConstruction.cxx.

1388 {
1389 ( *besEMCGeometry ).BSCYFront0 = val;
1390}

◆ SetCasingMaterial()

void ExtBesEmcConstruction::SetCasingMaterial ( G4String materialChoice)

Definition at line 1344 of file ExtBesEmcConstruction.cxx.

1344 {
1345 // search the material by its name
1346 G4Material* pttoMaterial = G4Material::GetMaterial( materialChoice );
1347 if ( pttoMaterial )
1348 {
1349 fCasingMaterial = pttoMaterial;
1350 logicBSCTheta->SetMaterial( pttoMaterial );
1352 }
1353}

◆ SetCasingThickness()

void ExtBesEmcConstruction::SetCasingThickness ( G4ThreeVector val)

Definition at line 1357 of file ExtBesEmcConstruction.cxx.

1357 {
1358 // change Gap thickness and recompute the calorimeter parameters
1359 ( *besEMCGeometry ).fTyvekThickness = val( 'X' );
1360 ( *besEMCGeometry ).fAlThickness = val( 'Y' );
1361 ( *besEMCGeometry ).fMylarThickness = val( 'Z' );
1362}

◆ SetCrystalMaterial()

void ExtBesEmcConstruction::SetCrystalMaterial ( G4String materialChoice)

Definition at line 1333 of file ExtBesEmcConstruction.cxx.

1333 {
1334 // search the material by its name
1335 G4Material* pttoMaterial = G4Material::GetMaterial( materialChoice );
1336 if ( pttoMaterial )
1337 {
1338 fCrystalMaterial = pttoMaterial;
1339 logicBSCCrystal->SetMaterial( pttoMaterial );
1341 }
1342}

◆ SetMagField()

void ExtBesEmcConstruction::SetMagField ( G4double fieldValue)

Definition at line 1412 of file ExtBesEmcConstruction.cxx.

1412 {
1413 // apply a global uniform magnetic field along Z axis
1414 G4FieldManager* fieldMgr =
1415 G4TransportationManager::GetTransportationManager()->GetFieldManager();
1416
1417 if ( magField ) delete magField; // delete the existing magn field
1418
1419 if ( fieldValue != 0. ) // create a new one if non nul
1420 {
1421 magField = new G4UniformMagField( G4ThreeVector( 0., 0., fieldValue ) );
1422 fieldMgr->SetDetectorField( magField );
1423 fieldMgr->CreateChordFinder( magField );
1424 fmagField = fieldValue;
1425 }
1426 else
1427 {
1428 magField = 0;
1429 fieldMgr->SetDetectorField( magField );
1430 fmagField = 0.;
1431 }
1432}

◆ SetStartIDTheta()

void ExtBesEmcConstruction::SetStartIDTheta ( G4int val)

Definition at line 1378 of file ExtBesEmcConstruction.cxx.

1378{ startID = val; }

◆ SetVerboseLevel()

void ExtBesEmcConstruction::SetVerboseLevel ( G4int val)
inline

Definition at line 41 of file ExtBesEmcConstruction.h.

41{ verboseLevel = val; }

◆ UpdateGeometry()

void ExtBesEmcConstruction::UpdateGeometry ( )

Definition at line 1436 of file ExtBesEmcConstruction.cxx.

1436 {
1437 ; // G4RunManager::GetRunManager()->DefineWorldVolume(BesDetectorConstruction::Construct());
1438}

The documentation for this class was generated from the following files: