Loading...
Searching...
No Matches
WLSDetectorConstruction.cc
Go to the documentation of this file.
1//
2// ********************************************************************
3// * License and Disclaimer *
4// * *
5// * The Geant4 software is copyright of the Copyright Holders of *
6// * the Geant4 Collaboration. It is provided under the terms and *
7// * conditions of the Geant4 Software License, included in the file *
8// * LICENSE and available at http://cern.ch/geant4/license . These *
9// * include a list of copyright holders. *
10// * *
11// * Neither the authors of this software system, nor their employing *
12// * institutes,nor the agencies providing financial support for this *
13// * work make any representation or warranty, express or implied, *
14// * regarding this software system or assume any liability for its *
15// * use. Please see the license in the file LICENSE and URL above *
16// * for the full disclaimer and the limitation of liability. *
17// * *
18// * This code implementation is the result of the scientific and *
19// * technical work of the GEANT4 collaboration. *
20// * By using, copying, modifying or distributing the software (or *
21// * any work based on the software) you agree to acknowledge its *
22// * use in resulting scientific publications, and indicate your *
23// * acceptance of all terms of the Geant4 Software license. *
24// ********************************************************************
25//
26//
27/// \file optical/wls/src/WLSDetectorConstruction.cc
28/// \brief Implementation of the WLSDetectorConstruction class
29//
30//
31
33
35#include "WLSMaterials.hh"
36#include "WLSPhotonDetSD.hh"
37
38#include "globals.hh"
39#include "G4Box.hh"
40#include "G4EllipticalTube.hh"
41#include "G4ios.hh"
42#include "G4GeometryManager.hh"
43#include "G4LogicalBorderSurface.hh"
44#include "G4LogicalSkinSurface.hh"
45#include "G4LogicalVolume.hh"
46#include "G4LogicalVolumeStore.hh"
47#include "G4Material.hh"
48#include "G4NistManager.hh"
49#include "G4OpticalSurface.hh"
50#include "G4PhysicalConstants.hh"
51#include "G4PhysicalVolumeStore.hh"
52#include "G4PVPlacement.hh"
53#include "G4RunManager.hh"
54#include "G4SDManager.hh"
55#include "G4SolidStore.hh"
56#include "G4SystemOfUnits.hh"
57#include "G4Tubs.hh"
58#include "G4UserLimits.hh"
59
60#include "G4VisAttributes.hh"
61#include "G4Colour.hh"
62
63//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
64
74
75//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
76
78{
79 delete fDetectorMessenger;
80 delete fMaterials;
81 for (auto visAttributes: fVisAttributes)
82 {
83 delete visAttributes;
84 }
85}
86
87//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
88
90{
91 if(fPhysiWorld)
92 {
93 G4GeometryManager::GetInstance()->OpenGeometry();
94 G4PhysicalVolumeStore::GetInstance()->Clean();
95 G4LogicalVolumeStore::GetInstance()->Clean();
96 G4SolidStore::GetInstance()->Clean();
97 G4LogicalSkinSurface::CleanSurfaceTable();
98 G4LogicalBorderSurface::CleanSurfaceTable();
99 }
100
103
104 return ConstructDetector();
105}
106
107//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
108
110{
111
112 auto air = FindMaterial("G4_AIR");
113 //G4cout << "\nMaterial Properties Table for G4_AIR:" << G4endl;
114 //air->GetMaterialPropertiesTable()->DumpTable();
115
116 //--------------------------------------------------
117 // World
118 //--------------------------------------------------
119
120 G4VSolid* solidWorld =
122
124 new G4LogicalVolume(solidWorld, air, "World");
125
127 new G4PVPlacement(nullptr, G4ThreeVector(), fLogicWorld, "World", nullptr,
128 false, 0);
129
130 //--------------------------------------------------
131 // Extrusion
132 //--------------------------------------------------
133
134 auto coating = FindMaterial("Coating");
135
136 G4VSolid* solidExtrusion = new G4Box("Extrusion", GetBarBase() / 2.,
137 GetBarBase() / 2., GetBarLength() / 2.);
138
139 auto logicExtrusion =
140 new G4LogicalVolume(solidExtrusion, coating, "Extrusion");
141
142 auto TiO2Surface = new G4OpticalSurface(
143 "TiO2Surface", glisur, ground, dielectric_metal, fExtrusionPolish);
144
145 auto TiO2SurfaceProperty = new G4MaterialPropertiesTable();
146
147 std::vector<G4double> p_TiO2 = { 2.00 * eV, 3.47 * eV };
148
149 std::vector<G4double> refl_TiO2 = { fExtrusionReflectivity,
151 std::vector<G4double> effi_TiO2 = { 0., 0. };
152
153 TiO2SurfaceProperty->AddProperty("REFLECTIVITY", p_TiO2, refl_TiO2);
154 TiO2SurfaceProperty->AddProperty("EFFICIENCY", p_TiO2, effi_TiO2);
155
156 TiO2Surface->SetMaterialPropertiesTable(TiO2SurfaceProperty);
157
158 new G4PVPlacement(nullptr, G4ThreeVector(), logicExtrusion, "Extrusion",
159 fLogicWorld, false, 0);
160
161 new G4LogicalSkinSurface("TiO2Surface", logicExtrusion, TiO2Surface);
162
163 //--------------------------------------------------
164 // Scintillator
165 //--------------------------------------------------
166
167 auto polystyrene = FindMaterial("Polystyrene");
168 //G4cout << "\nMaterial Properties Table for Polystyrene:" << G4endl;
169 //polystyrene->GetMaterialPropertiesTable()->DumpTable();
170
171 G4VSolid* solidScintillator =
172 new G4Box("Scintillator",
175 GetBarLength() / 2.);
176
177 auto logicScintillator = new G4LogicalVolume(
178 solidScintillator, polystyrene, "Scintillator");
179
180 new G4PVPlacement(nullptr, G4ThreeVector(), logicScintillator, "Scintillator",
181 logicExtrusion, false, 0);
182
183 G4LogicalVolume* logicScintSide = nullptr;
184 G4LogicalVolume* logicScintCrnr = nullptr;
185 if(GetCoatingRadius() > 0.)
186 {
187 G4VSolid* solidScintside =
188 new G4Box("SideOfBar",
190 GetCoatingRadius() / 2., GetBarLength() / 2.);
191
192 G4VSolid* solidScintcrnr =
193 new G4Tubs("CrnrOfBar", 0.0 * cm, GetCoatingRadius(), GetBarLength() / 2.,
194 0. * deg, 90. * deg);
195
196 logicScintSide = new G4LogicalVolume(
197 solidScintside, polystyrene, "SideOfBar");
198
199 logicScintCrnr = new G4LogicalVolume(
200 solidScintcrnr, polystyrene, "CrnrOfBar");
201
202 G4double pos =
204
205 new G4PVPlacement(nullptr, G4ThreeVector(0., -pos, 0.), logicScintSide,
206 "SideOfBar", logicExtrusion, false, 0);
207
208 new G4PVPlacement(nullptr, G4ThreeVector(0., pos, 0.), logicScintSide,
209 "SideOfBar", logicExtrusion, false, 1);
210
211 auto rot1 = new G4RotationMatrix();
212 rot1->rotateZ(-90.*deg);
213
214 new G4PVPlacement(rot1, G4ThreeVector(pos, 0., 0.), logicScintSide,
215 "SideOfBar", logicExtrusion, false, 2);
216
217 new G4PVPlacement(rot1, G4ThreeVector(-pos, 0., 0.), logicScintSide,
218 "SideOfBar", logicExtrusion, false, 3);
219
221
222 new G4PVPlacement(nullptr, G4ThreeVector(pos, pos, 0.), logicScintCrnr,
223 "CrnrOfBar", logicExtrusion, false, 0);
224
225 new G4PVPlacement(rot1, G4ThreeVector(-pos, pos, 0.), logicScintCrnr,
226 "CrnrOfBar", logicExtrusion, false, 1);
227
228 auto rot2 = new G4RotationMatrix();
229 rot2->rotateZ(-180.*deg);
230
231 new G4PVPlacement(rot2, G4ThreeVector(-pos, -pos, 0.), logicScintCrnr,
232 "CrnrOfBar", logicExtrusion, false, 2);
233
234 auto rot3 = new G4RotationMatrix();
235 rot3->rotateZ(-270.*deg);
236
237 new G4PVPlacement(rot3, G4ThreeVector(pos, -pos, 0.), logicScintCrnr,
238 "CrnrOfBar", logicExtrusion, false, 3);
239 }
240
242 {
243 G4VSolid* solidHole = new G4Tubs(
244 "Hole", 0., GetHoleRadius(), GetHoleLength() / 2., 0. * deg, 360. * deg);
245
246 fLogicHole = new G4LogicalVolume(solidHole, air, "Hole");
247
248 fPhysiHole = new G4PVPlacement(nullptr, G4ThreeVector(), fLogicHole, "Hole",
249 logicScintillator, false, 0);
250 }
251
252 //--------------------------------------------------
253 // Fiber
254 //--------------------------------------------------
255
256 if(!(fLogicHole) || !(fPhysiHole))
257 {
258 G4ExceptionDescription ed;
259 ed << "The Fiber Hole has not been constructed";
260 G4Exception("WLSDetectorConstruction", "wls001", FatalException, ed);
261 }
262
263 // Pointers to the most recently constructed volume
264 G4LogicalVolume* logicPlacement = fLogicHole;
265 G4VPhysicalVolume* physiPlacement = fPhysiHole;
266
267 //--------------------------------------------------
268 // Fiber Construction
269 //--------------------------------------------------
270
271 // Boundary Surface Properties
272 G4OpticalSurface* opSurface = nullptr;
273
274 if(fSurfaceRoughness < 1.)
275 opSurface = new G4OpticalSurface("RoughSurface", glisur, ground,
276 dielectric_dielectric, fSurfaceRoughness);
277
278 G4LogicalVolume* logicWLSfiber = nullptr;
279 G4LogicalVolume* logicClad1 = nullptr;
280 G4LogicalVolume* logicClad2 = nullptr;
281 G4VPhysicalVolume* physiClad1 = nullptr;
282 G4VPhysicalVolume* physiClad2 = nullptr;
283
284 auto fpethylene = FindMaterial("FPethylene");
285 auto pethylene = FindMaterial("Pethylene");
286 auto pmma = FindMaterial("PMMA");
287
288 // Determine the number of cladding layers to be built
289 switch(fNumOfCladLayers)
290 {
291 case 2:
292
293 //--------------------------------------------------
294 // Cladding 2
295 //--------------------------------------------------
296
297 //G4cout << "\nMaterial Properties Table for fPethylene:" << G4endl;
298 //fpethylene->GetMaterialPropertiesTable()->DumpTable();
299
300 G4VSolid* solidClad2;
301
302 if(fXYRatio == 1.)
303 solidClad2 = new G4Tubs("Clad2", 0., fClad2RX, fClad2Z, 0., twopi);
304 else
305 solidClad2 = new G4EllipticalTube("Clad2", fClad2RX, fClad2RY, fClad2Z);
306
307 logicClad2 =
308 new G4LogicalVolume(solidClad2, fpethylene, "Clad2");
309
310 physiClad2 =
311 new G4PVPlacement(nullptr, G4ThreeVector(0.0, 0.0, fWLSfiberOrigin),
312 logicClad2, "Clad2", logicPlacement, false, 0);
313
314 // Place the rough surface only if needed
315 if(opSurface)
316 {
317 new G4LogicalBorderSurface("surfaceClad2Out", physiClad2,
318 physiPlacement, opSurface);
319 new G4LogicalBorderSurface("surfaceClad2In", physiPlacement, physiClad2,
320 opSurface);
321 }
322
323 logicPlacement = logicClad2;
324 physiPlacement = physiClad2;
325 [[fallthrough]];
326
327 case 1:
328
329 //--------------------------------------------------
330 // Cladding 1
331 //--------------------------------------------------
332
333 //G4cout << "\nMaterial Properties Table for Pethylene:" << G4endl;
334 //pethylene->GetMaterialPropertiesTable()->DumpTable();
335
336 G4VSolid* solidClad1;
337
338 if(fXYRatio == 1.)
339 solidClad1 = new G4Tubs("Clad1", 0., fClad1RX, fClad1Z, 0., twopi);
340 else
341 solidClad1 = new G4EllipticalTube("Clad1", fClad1RX, fClad1RY, fClad1Z);
342
343 logicClad1 =
344 new G4LogicalVolume(solidClad1, pethylene, "Clad1");
345
346 physiClad1 =
347 new G4PVPlacement(nullptr, G4ThreeVector(0., 0., fWLSfiberOrigin),
348 logicClad1, "Clad1", logicPlacement, false, 0);
349
350 // Place the rough surface only if needed
351 if(opSurface)
352 {
353 new G4LogicalBorderSurface("surfaceClad1Out", physiClad1,
354 physiPlacement, opSurface);
355
356 new G4LogicalBorderSurface("surfaceClad1In", physiPlacement, physiClad1,
357 opSurface);
358 }
359
360 logicPlacement = logicClad1;
361 physiPlacement = physiClad1;
362 [[fallthrough]];
363
364 default:
365
366 //--------------------------------------------------
367 // WLS Fiber
368 //--------------------------------------------------
369
370 //G4cout << "\nMaterial Properties Table for PMMA:" << G4endl;
371 //pmma->GetMaterialPropertiesTable()->DumpTable();
372
373 G4VSolid* solidWLSfiber;
374
375 if(fXYRatio == 1.)
376 {
377 solidWLSfiber =
378 new G4Tubs("WLSFiber", 0., fWLSfiberRX, fWLSfiberZ, 0., twopi);
379 }
380 else
381 {
382 solidWLSfiber = new G4EllipticalTube("WLSFiber", fWLSfiberRX,
384 }
385
386 logicWLSfiber =
387 new G4LogicalVolume(solidWLSfiber, pmma, "WLSFiber");
388
389 logicWLSfiber->SetUserLimits(
390 new G4UserLimits(DBL_MAX, DBL_MAX, 10. * ms));
391
392 G4VPhysicalVolume* physiWLSfiber =
393 new G4PVPlacement(nullptr, G4ThreeVector(0., 0., fWLSfiberOrigin),
394 logicWLSfiber, "WLSFiber", logicPlacement, false, 0);
395
396 // Place the rough surface only if needed
397 if(opSurface)
398 {
399 new G4LogicalBorderSurface("surfaceWLSOut", physiWLSfiber,
400 physiPlacement, opSurface);
401
402 new G4LogicalBorderSurface("surfaceWLSIn", physiPlacement,
403 physiWLSfiber, opSurface);
404 }
405 }
406
407 //--------------------------------------------------
408 // Mirror for reflection at one of the end
409 //--------------------------------------------------
410
411 // Place the mirror only if the user wants the mirror
412 G4LogicalVolume* logicMirror = nullptr;
413
414 auto aluminum = FindMaterial("G4_Al");
415
416 if(fMirrorToggle)
417 {
418 G4VSolid* solidMirror =
419 new G4Box("Mirror", fMirrorRmax, fMirrorRmax, fMirrorZ);
420
421 logicMirror =
422 new G4LogicalVolume(solidMirror, aluminum, "Mirror");
423
424 auto mirrorSurface = new G4OpticalSurface(
425 "MirrorSurface", glisur, ground, dielectric_metal, fMirrorPolish);
426
427 auto mirrorSurfaceProperty = new G4MaterialPropertiesTable();
428
429 std::vector<G4double> p_mirror = { 2.00 * eV, 3.47 * eV };
430 std::vector<G4double> refl_mirror = { fMirrorReflectivity,
432 std::vector<G4double> effi_mirror = { 0., 0. };
433
434 mirrorSurfaceProperty->AddProperty("REFLECTIVITY", p_mirror, refl_mirror);
435 mirrorSurfaceProperty->AddProperty("EFFICIENCY", p_mirror, effi_mirror);
436
437 mirrorSurface->SetMaterialPropertiesTable(mirrorSurfaceProperty);
438
439 new G4PVPlacement(nullptr, G4ThreeVector(0., 0., fMirrorOrigin),
440 logicMirror, "Mirror", fLogicWorld, false, 0);
441
442 new G4LogicalSkinSurface("MirrorSurface", logicMirror, mirrorSurface);
443 }
444
445 //--------------------------------------------------
446 // Coupling at the read-out end
447 //--------------------------------------------------
448
449 // Clear Fiber (Coupling Layer)
450 G4VSolid* solidCouple = new G4Box("Couple", fCoupleRX, fCoupleRY, fCoupleZ);
451
452 auto logicCouple = new G4LogicalVolume(solidCouple, air, "Couple");
453
454 new G4PVPlacement(nullptr, G4ThreeVector(0., 0., fCoupleOrigin), logicCouple,
455 "Couple", fLogicWorld, false, 0);
456
457 //--------------------------------------------------
458 // A logical layer in front of PhotonDet
459 //--------------------------------------------------
460
461 // Purpose: Preventing direct dielectric to metal contact
462
463 // Check for valid placement of PhotonDet
464 if(fMPPCTheta > std::atan(fMPPCDist / fMPPCHalfL))
465 {
466 fMPPCTheta = 0.;
469 G4ExceptionDescription ed;
470 ed << "Invalid alignment. Alignment reset to 0.";
471 G4Exception("WLSDetectorConstruction", "wls002", JustWarning, ed);
472 }
473
474 // Clear Fiber (Coupling Layer)
475 G4VSolid* solidClrfiber;
476
477 if(fMPPCShape == "Square")
478 {
479 solidClrfiber =
480 new G4Box("ClearFiber", fClrfiberHalfL, fClrfiberHalfL, fClrfiberZ);
481 }
482 else
483 {
484 solidClrfiber =
485 new G4Tubs("ClearFiber", 0., fClrfiberHalfL, fClrfiberZ, 0., twopi);
486 }
487
488 auto logicClrfiber = new G4LogicalVolume(solidClrfiber, air, "ClearFiber");
489
490 new G4PVPlacement(new G4RotationMatrix(CLHEP::HepRotationY(-fMPPCTheta)),
491 G4ThreeVector(fMPPCOriginX, 0.0, fMPPCOriginZ),
492 logicClrfiber, "ClearFiber", logicCouple, false, 0);
493
494 //--------------------------------------------------
495 // PhotonDet (Sensitive Detector)
496 //--------------------------------------------------
497
498 // Physical Construction
499 G4VSolid* solidPhotonDet = nullptr;
500
501 if(fMPPCShape == "Square")
502 solidPhotonDet = new G4Box("PhotonDet", fMPPCHalfL, fMPPCHalfL, fMPPCZ);
503 else
504 solidPhotonDet = new G4Tubs("PhotonDet", 0., fMPPCHalfL, fMPPCZ, 0., twopi);
505
506 auto logicPhotonDet =
507 new G4LogicalVolume(solidPhotonDet, aluminum, "PhotonDet_LV");
508
509 new G4PVPlacement(nullptr, G4ThreeVector(0., 0., 0.), logicPhotonDet,
510 "PhotonDet", logicClrfiber, false, 0);
511
512 // PhotonDet Surface Properties
513 auto photonDetSurface = new G4OpticalSurface(
514 "PhotonDetSurface", glisur, ground, dielectric_metal, fMPPCPolish);
515
516 auto photonDetSurfaceProperty = new G4MaterialPropertiesTable();
517
518 std::vector<G4double> p_mppc = { 2.00 * eV, 3.47 * eV };
519 std::vector<G4double> refl_mppc = { fMPPCReflectivity, fMPPCReflectivity };
520 std::vector<G4double> effi_mppc = { 1., 1. };
521
522 photonDetSurfaceProperty->AddProperty("REFLECTIVITY", p_mppc, refl_mppc);
523 photonDetSurfaceProperty->AddProperty("EFFICIENCY", p_mppc, effi_mppc);
524
525 photonDetSurface->SetMaterialPropertiesTable(photonDetSurfaceProperty);
526
527 new G4LogicalSkinSurface("PhotonDetSurface", logicPhotonDet,
528 photonDetSurface);
529
530 // visualization attributes -------------------------------------------------
531
532 auto visAttributes = new G4VisAttributes(G4Colour(1.0,1.0,1.0));
533 visAttributes->SetVisibility(false);
534 fLogicWorld->SetVisAttributes(visAttributes);
535 fVisAttributes.push_back(visAttributes);
536
537 visAttributes = new G4VisAttributes(G4Colour(0.2,0.2,0.2,0.5));
538 visAttributes->SetVisibility(true);
539 logicExtrusion->SetVisAttributes(visAttributes);
540 fVisAttributes.push_back(visAttributes);
541
542 visAttributes = new G4VisAttributes(G4Colour(0.0,0.0,1.0,0.9));
543 visAttributes->SetVisibility(true);
544 logicScintillator->SetVisAttributes(visAttributes);
545 fVisAttributes.push_back(visAttributes);
546
547 visAttributes = new G4VisAttributes(G4Colour(0.0,0.8,0.2,0.2));
548 visAttributes->SetVisibility(true);
549 logicScintSide->SetVisAttributes(visAttributes);
550 fVisAttributes.push_back(visAttributes);
551
552 visAttributes = new G4VisAttributes(G4Colour(0.0,0.8,0.2,0.2));
553 visAttributes->SetVisibility(true);
554 logicScintCrnr->SetVisAttributes(visAttributes);
555 fVisAttributes.push_back(visAttributes);
556
557 visAttributes = new G4VisAttributes(G4Colour(0.4,0.0,0.0,0.5));
558 visAttributes->SetVisibility(true);
559 fLogicHole->SetVisAttributes(visAttributes);
560 fVisAttributes.push_back(visAttributes);
561
562 if(logicClad1 != nullptr)
563 {
564 visAttributes = new G4VisAttributes(G4Colour(0.0,0.8,0.5,0.5));
565 visAttributes->SetVisibility(true);
566 logicClad1->SetVisAttributes(visAttributes);
567 fVisAttributes.push_back(visAttributes);
568 }
569
570 if(logicClad2 != nullptr)
571 {
572 visAttributes = new G4VisAttributes(G4Colour(0.0,0.5,0.8,0.5));
573 visAttributes->SetVisibility(true);
574 logicClad2->SetVisAttributes(visAttributes);
575 fVisAttributes.push_back(visAttributes);
576 }
577
578 visAttributes = new G4VisAttributes(G4Colour(0.8,0.8,1.0));
579 visAttributes->SetVisibility(true);
580 logicWLSfiber->SetVisAttributes(visAttributes);
581 fVisAttributes.push_back(visAttributes);
582
583 if(fMirrorToggle == true)
584 {
585 visAttributes = new G4VisAttributes(G4Colour(0.3,0.3,1.0,0.3));
586 visAttributes->SetVisibility(true);
587 logicMirror->SetVisAttributes(visAttributes);
588 fVisAttributes.push_back(visAttributes);
589 }
590
591 visAttributes = new G4VisAttributes(G4Colour(0.0,0.0,0.5,0.5));
592 visAttributes->SetVisibility(true);
593 logicCouple->SetVisAttributes(visAttributes);
594 fVisAttributes.push_back(visAttributes);
595
596 visAttributes = new G4VisAttributes(G4Colour(0.3,0.3,0.3,0.5));
597 visAttributes->SetVisibility(true);
598 logicClrfiber->SetVisAttributes(visAttributes);
599 fVisAttributes.push_back(visAttributes);
600
601 visAttributes = new G4VisAttributes(G4Colour(1.0,1.0,1.0,0.8));
602 visAttributes->SetVisibility(true);
603 logicPhotonDet->SetVisAttributes(visAttributes);
604 fVisAttributes.push_back(visAttributes);
605
606 return fPhysiWorld;
607}
608
609
610
611//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
612
614{
615 if(!fmppcSD.Get())
616 {
617 G4String mppcSDName = "WLS/PhotonDet";
618 auto mppcSD = new WLSPhotonDetSD(mppcSDName);
619 G4SDManager::GetSDMpointer()->AddNewDetector(mppcSD);
620 fmppcSD.Put(mppcSD);
621 }
622 SetSensitiveDetector("PhotonDet_LV", fmppcSD.Get(), true);
623}
624
625//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
626
656
657//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
658
660// Set the Geometry of the PhotonDet detector
661// Pre: shape must be either "Circle" and "Square"
662{
663 if(shape == "Circle" || shape == "Square")
664 fMPPCShape = shape;
665 G4RunManager::GetRunManager()->GeometryHasBeenModified();
666}
667
668//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
669
671// Set the number of claddings
672// Pre: 0 <= num <= 2
673{
674 fNumOfCladLayers = num;
675 G4RunManager::GetRunManager()->GeometryHasBeenModified();
676}
677
678//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
679
681// Set the TOTAL length of the WLS fiber
682{
683 fWLSfiberZ = length;
684 G4RunManager::GetRunManager()->GeometryHasBeenModified();
685}
686
687//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
688
690// Set the Y radius of WLS fiber
691{
692 fWLSfiberRY = radius;
693 G4RunManager::GetRunManager()->GeometryHasBeenModified();
694}
695
696//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
697
699// Set the Y radius of Cladding 1
700{
701 fClad1RY = radius;
702 G4RunManager::GetRunManager()->GeometryHasBeenModified();
703}
704
705//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
706
708// Set the Y radius of Cladding 2
709{
710 fClad2RY = radius;
711 G4RunManager::GetRunManager()->GeometryHasBeenModified();
712}
713
714//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
715
717// Set the half length of the PhotonDet detector
718// The half length will be the radius if PhotonDet is circular
719{
720 fMPPCHalfL = halfL;
721 G4RunManager::GetRunManager()->GeometryHasBeenModified();
722}
723
724//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
725
727// Set the distance between fiber end and PhotonDet
728{
729 fMPPCDist = gap;
730 G4RunManager::GetRunManager()->GeometryHasBeenModified();
731}
732
733//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
734
736// Set the Aligment of PhotonDet with respect to the z axis
737// If theta is 0 deg, then the detector is perfectly aligned
738// PhotonDet will be deviated by theta from z axis
739// facing towards the center of the fiber
740{
741 fMPPCTheta = theta;
742 G4RunManager::GetRunManager()->GeometryHasBeenModified();
743}
744
745//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
746
748// Set the Surface Roughness between Cladding 1 and WLS fiber
749// Pre: 0 < roughness <= 1
750{
751 fSurfaceRoughness = roughness;
752 G4RunManager::GetRunManager()->GeometryHasBeenModified();
753}
754
755//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
756
758// Set the Polish of the mirror, polish of 1 is a perfect mirror surface
759// Pre: 0 < polish <= 1
760{
761 fMirrorPolish = polish;
762 G4RunManager::GetRunManager()->GeometryHasBeenModified();
763}
764
765//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
766
768// Set the Reflectivity of the mirror, reflectivity of 1 is a perfect mirror
769// Pre: 0 < reflectivity <= 1
770{
771 fMirrorReflectivity = reflectivity;
772 G4RunManager::GetRunManager()->GeometryHasBeenModified();
773}
774
775//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
776
778// Set the Polish of the PhotonDet, polish of 1 is a perfect mirror surface
779// Pre: 0 < polish <= 1
780{
781 fMPPCPolish = polish;
782 G4RunManager::GetRunManager()->GeometryHasBeenModified();
783}
784
785//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
786
788// Set the Reflectivity of the PhotonDet, reflectivity of 1 is a perfect mirror
789// Pre: 0 < reflectivity <= 1
790{
791 fMPPCReflectivity = reflectivity;
792 G4RunManager::GetRunManager()->GeometryHasBeenModified();
793}
794
795//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
796
798// Toggle to place the mirror or not at one end (-z end) of the fiber
799// True means place the mirror, false means otherwise
800{
801 fMirrorToggle = flag;
802 G4RunManager::GetRunManager()->GeometryHasBeenModified();
803}
804
805//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
806
808// Set the ratio of the x and y radius of the ellipse (x/y)
809// a ratio of 1 would produce a circle
810{
811 fXYRatio = r;
812 G4RunManager::GetRunManager()->GeometryHasBeenModified();
813}
814
815//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
816
818// Set the length of the scintillator bar
819{
820 fBarLength = length;
821 G4RunManager::GetRunManager()->GeometryHasBeenModified();
822}
823
824//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
825
827// Set the side of the scintillator bar
828{
829 fBarBase = side;
830 G4RunManager::GetRunManager()->GeometryHasBeenModified();
831}
832
833//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
834
836// Set the radius of the fiber hole
837{
838 fHoleRadius = radius;
839 G4RunManager::GetRunManager()->GeometryHasBeenModified();
840}
841
842//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
843
845// Set thickness of the coating on the bars
846{
847 fCoatingThickness = thick;
848 G4RunManager::GetRunManager()->GeometryHasBeenModified();
849}
850
851//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
852
854// Set inner radius of the corner bar coating
855{
856 fCoatingRadius = radius;
857 G4RunManager::GetRunManager()->GeometryHasBeenModified();
858}
859
860//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
861
863
864//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
865
867
868//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
869
871
872//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
873
875
876//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
877
879
880//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
881
883
884//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
885
890
891//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
892
894
895//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
896
901
902//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
903
905{
906 if(fNumOfCladLayers == 2)
907 return fClad2RY;
908 if(fNumOfCladLayers == 1)
909 return fClad1RY;
910 return fWLSfiberRY;
911}
912
913//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
914
919
920//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
921
922// Return True if the fiber construction is ideal
924{
925 return fSurfaceRoughness == 1. && fXYRatio == 1. &&
926 (!fMirrorToggle || (fMirrorPolish == 1. && fMirrorReflectivity == 1.));
927}
928
929//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
930
932{
933 G4Material* material = G4Material::GetMaterial(name, true);
934 return material;
935}
Definition of the WLSDetectorConstruction class.
Definition of the WLSDetectorMessenger class.
Definition of the WLSMaterials class.
Definition of the WLSPhotonDetSD class.
G4Material * FindMaterial(G4String)
G4VPhysicalVolume * ConstructDetector()
std::vector< G4VisAttributes * > fVisAttributes
G4Cache< WLSPhotonDetSD * > fmppcSD
WLSDetectorMessenger * fDetectorMessenger
G4VPhysicalVolume * Construct() override
static WLSMaterials * GetInstance()

Applications | User Support | Publications | Collaboration