Geant4  10.02.p01
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 // $Id: WLSDetectorConstruction.cc 84718 2014-10-20 07:40:45Z gcosmo $
27 //
30 //
31 //
32 #include "G4ios.hh"
33 #include "globals.hh"
34 
35 #include "G4Box.hh"
36 #include "G4Tubs.hh"
37 #include "G4EllipticalTube.hh"
38 
39 #include "G4LogicalVolume.hh"
40 #include "G4PVPlacement.hh"
41 
42 #include "G4OpBoundaryProcess.hh"
43 #include "G4LogicalSkinSurface.hh"
45 
46 #include "G4Material.hh"
47 #include "G4NistManager.hh"
48 
49 #include "G4GeometryManager.hh"
50 #include "G4SolidStore.hh"
51 #include "G4LogicalVolumeStore.hh"
52 #include "G4PhysicalVolumeStore.hh"
53 
54 #include "G4RunManager.hh"
55 
57 #include "WLSDetectorMessenger.hh"
58 #include "WLSMaterials.hh"
59 #include "WLSPhotonDetSD.hh"
60 
61 #include "G4UserLimits.hh"
62 #include "G4PhysicalConstants.hh"
63 #include "G4SystemOfUnits.hh"
64 
65 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
66 
68  : fMaterials(NULL), fLogicHole(NULL), fLogicWorld(NULL),
69  fPhysiWorld(NULL), fPhysiHole(NULL)
70 {
72 
73  fNumOfCladLayers = 0;
74 
76 
77  fMirrorToggle = true;
78  fMirrorPolish = 1.;
80 
81  fMPPCPolish = 1.;
82  fMPPCReflectivity = 0.;
83 
84  fExtrusionPolish = 1.;
86 
87  fXYRatio = 1.0;
88 
89  fWLSfiberZ = 1.*m;
90  fWLSfiberRY = 0.5*mm;
91  fWLSfiberOrigin = 0.0;
92 
93  fMPPCShape = "Circle";
95  fMPPCDist = 0.00*mm;
96  fMPPCTheta = 0.0*deg;
97  fMPPCZ = 0.05*mm;
98 
99  fClrfiberZ = fMPPCZ + 10.*nm;
100  fMirrorZ = 0.1*mm;
101 
102  fBarLength = 1.*m;
103  fBarBase = 9.6*mm;
104  fHoleRadius = 0.9*mm;
106  fCoatingThickness = 0.25*mm;
107  fCoatingRadius = 1.875*mm;
108 }
109 
110 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
111 
113 {
115  if (fMaterials) delete fMaterials;
116 }
117 
118 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
119 
121 {
122  if (fPhysiWorld) {
129  }
130 
132 
134 
135  return ConstructDetector();
136 }
137 
138 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
139 
141 {
142  //--------------------------------------------------
143  // World
144  //--------------------------------------------------
145 
146  G4VSolid* solidWorld =
147  new G4Box("World", fWorldSizeX, fWorldSizeY, fWorldSizeZ);
148 
149  fLogicWorld = new G4LogicalVolume(solidWorld,
150  FindMaterial("G4_AIR"),
151  "World");
152 
153  fPhysiWorld = new G4PVPlacement(0,
154  G4ThreeVector(),
155  fLogicWorld,
156  "World",
157  0,
158  false,
159  0);
160 
161  //--------------------------------------------------
162  // Extrusion
163  //--------------------------------------------------
164 
165  G4VSolid* solidExtrusion =
166  new G4Box("Extrusion",GetBarBase()/2,GetBarBase()/2,GetBarLength()/2);
167 
168  G4LogicalVolume* logicExtrusion =
169  new G4LogicalVolume(solidExtrusion,
170  FindMaterial("Coating"),
171  "Extrusion");
172 
173  G4OpticalSurface* TiO2Surface = new G4OpticalSurface("TiO2Surface",
174  glisur,
175  ground,
178 
179  G4MaterialPropertiesTable* TiO2SurfaceProperty =
181 
182  G4double p_TiO2[] = {2.00*eV, 3.47*eV};
183  const G4int nbins = sizeof(p_TiO2)/sizeof(G4double);
184 
186  assert(sizeof(refl_TiO2) == sizeof(p_TiO2));
187  G4double effi_TiO2[] = {0, 0};
188  assert(sizeof(effi_TiO2) == sizeof(p_TiO2));
189 
190  TiO2SurfaceProperty -> AddProperty("REFLECTIVITY",p_TiO2,refl_TiO2,nbins);
191  TiO2SurfaceProperty -> AddProperty("EFFICIENCY",p_TiO2,effi_TiO2,nbins);
192 
193  TiO2Surface -> SetMaterialPropertiesTable(TiO2SurfaceProperty);
194 
195  new G4PVPlacement(0,
196  G4ThreeVector(),
197  logicExtrusion,
198  "Extrusion",
199  fLogicWorld,
200  false,
201  0);
202 
203  new G4LogicalSkinSurface("TiO2Surface",logicExtrusion,TiO2Surface);
204 
205  //--------------------------------------------------
206  // Scintillator
207  //--------------------------------------------------
208 
209  G4VSolid* solidScintillator = new G4Box("Scintillator",
211  -GetCoatingRadius(),
213  -GetCoatingRadius(),
214  GetBarLength()/2);
215 
216  G4LogicalVolume* logicScintillator =
217  new G4LogicalVolume(solidScintillator,
218  FindMaterial("Polystyrene"),
219  "Scintillator");
220 
221  new G4PVPlacement(0,
222  G4ThreeVector(),
223  logicScintillator,
224  "Scintillator",
225  logicExtrusion,
226  false,
227  0);
228 
229  if (GetCoatingRadius() > 0.*mm) {
230  G4VSolid* solidScintside = new G4Box("SideOfBar",
232  -GetCoatingRadius(),
233  GetCoatingRadius()/2,
234  GetBarLength()/2);
235  G4VSolid* solidScintcrnr = new G4Tubs("CrnrOfBar",
236  0.0*cm,
238  GetBarLength()/2,
239  0.*deg,
240  90.*deg);
241  G4LogicalVolume* logicScintSide =
242  new G4LogicalVolume(solidScintside,
243  FindMaterial("Polystyrene"),
244  "SideOfBar");
245 
246  G4LogicalVolume* logicScintCrnr =
247  new G4LogicalVolume(solidScintcrnr,
248  FindMaterial("Polystyrene"),
249  "CrnrOfBar");
250 
253 
254  new G4PVPlacement(0,
255  G4ThreeVector(0,-y,0),
256  logicScintSide,
257  "SideOfBar",
258  logicExtrusion,
259  false,
260  0);
261  new G4PVPlacement(0,
262  G4ThreeVector(0, y,0),
263  logicScintSide,
264  "SideOfBar",
265  logicExtrusion,
266  false,
267  1);
268 
269  G4RotationMatrix* g4rot = new G4RotationMatrix();
270  *g4rot = StringToRotationMatrix("Z90");
271  *g4rot = g4rot->inverse();
272  if (*g4rot == G4RotationMatrix()) g4rot = NULL;
273 
274  new G4PVPlacement(g4rot,
275  G4ThreeVector(x,0,0),
276  logicScintSide,
277  "SideOfBar",
278  logicExtrusion,
279  false,
280  2);
281  new G4PVPlacement(g4rot,
282  G4ThreeVector(-x,0,0),
283  logicScintSide,
284  "SideOfBar",
285  logicExtrusion,
286  false,
287  3);
288 
291 
292  new G4PVPlacement(0,
293  G4ThreeVector(x,y,0),
294  logicScintCrnr,
295  "CrnrOfBar",
296  logicExtrusion,
297  false,
298  0);
299 
300  new G4PVPlacement(g4rot,
301  G4ThreeVector(-x,y,0),
302  logicScintCrnr,
303  "CrnrOfBar",
304  logicExtrusion,
305  false,
306  1);
307 
308  g4rot = new G4RotationMatrix();
309  *g4rot = StringToRotationMatrix("Z180");
310  *g4rot = g4rot->inverse();
311  if (*g4rot == G4RotationMatrix()) g4rot = NULL;
312 
313  new G4PVPlacement(g4rot,
314  G4ThreeVector(-x,-y,0),
315  logicScintCrnr,
316  "CrnrOfBar",
317  logicExtrusion,
318  false,
319  2);
320 
321  g4rot = new G4RotationMatrix();
322  *g4rot = StringToRotationMatrix("Z270");
323  *g4rot = g4rot->inverse();
324  if (*g4rot == G4RotationMatrix()) g4rot = NULL;
325 
326  new G4PVPlacement(g4rot,
327  G4ThreeVector(x,-y,0),
328  logicScintCrnr,
329  "CrnrOfBar",
330  logicExtrusion,
331  false,
332  3);
333 
334  }
335 
336  if (GetFiberRadius()<GetHoleRadius()) {
337 
338  G4VSolid* solidHole = new G4Tubs("Hole",
339  0.0*cm,
340  GetHoleRadius(),
341  GetHoleLength()/2,
342  0.*deg,
343  360.*deg);
344  fLogicHole = new G4LogicalVolume(solidHole,
345  FindMaterial("G4_AIR"),
346  "Hole");
347 
348  fPhysiHole = new G4PVPlacement(0,
349  G4ThreeVector(),
350  fLogicHole,
351  "Hole",
352  logicScintillator,
353  false,
354  0);
355  }
356 
357  //--------------------------------------------------
358  // Fiber
359  //--------------------------------------------------
360 
361  ConstructFiber();
362 
363  //--------------------------------------------------
364  // End of Construction
365  //--------------------------------------------------
366 
367  return fPhysiWorld;
368 }
369 
370 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
371 
373 {
374  if (!(fLogicHole) || !(fPhysiHole) ) {
375  std::ostringstream o;
376  o << "The Fiber Hole has not been constructed";
377  G4Exception("WLSDetectorConstruction::ConstructFiber","",
378  FatalException,o.str().c_str());
379  }
380 
381  // Pointers to the most recently constructed volume
382  G4LogicalVolume* logicPlacement = fLogicHole;
383  G4VPhysicalVolume* physiPlacement = fPhysiHole;
384 
385  //--------------------------------------------------
386  // Fiber Construction
387  //--------------------------------------------------
388 
389  // Boundary Surface Properties
390  G4OpticalSurface* opSurface = NULL;
391 
392  if (fSurfaceRoughness < 1.)
393  opSurface = new G4OpticalSurface("RoughSurface", // Surface Name
394  glisur, // SetModel
395  ground, // SetFinish
396  dielectric_dielectric, // SetType
397  fSurfaceRoughness); // SetPolish
398 
399  G4LogicalVolume *logicClad1, *logicClad2;
400  G4VPhysicalVolume *physiClad1, *physiClad2;
401 
402  // Determine the number of cladding layers to be built
403  switch ( fNumOfCladLayers ) {
404 
405  case 2:
406 
407  //--------------------------------------------------
408  // Cladding 2
409  //--------------------------------------------------
410 
411  G4VSolid* solidClad2;
412 
413  if (fXYRatio == 1.)
414  solidClad2 = new G4Tubs("Clad2",0.,fClad2RX,fClad2Z,0.0*rad,twopi*rad);
415  else
416  solidClad2 = new G4EllipticalTube("Clad2",fClad2RX,fClad2RY,fClad2Z);
417 
418  logicClad2 = new G4LogicalVolume(solidClad2,
419  FindMaterial("FPethylene"),
420  "Clad2");
421 
422  physiClad2 = new G4PVPlacement(0,
424  logicClad2,
425  "Clad2",
426  logicPlacement,
427  false,
428  0);
429 
430  // Place the rough surface only if needed
431  if (opSurface) {
432  new G4LogicalBorderSurface("surfaceClad2Out",
433  physiClad2,
434  physiPlacement,
435  opSurface);
436  new G4LogicalBorderSurface("surfaceClad2In",
437  physiPlacement,
438  physiClad2,
439  opSurface);
440  }
441 
442  logicPlacement = logicClad2;
443  physiPlacement = physiClad2;
444 
445  case 1:
446 
447  //--------------------------------------------------
448  // Cladding 1
449  //--------------------------------------------------
450 
451  G4VSolid* solidClad1;
452 
453  if (fXYRatio == 1.)
454  solidClad1 = new G4Tubs("Clad1",0.,fClad1RX,fClad1Z,0.0*rad,twopi*rad);
455  else
456  solidClad1 = new G4EllipticalTube("Clad1",fClad1RX,fClad1RY,fClad1Z);
457 
458  logicClad1 = new G4LogicalVolume(solidClad1,
459  FindMaterial("Pethylene"),
460  "Clad1");
461 
462  physiClad1 = new G4PVPlacement(0,
464  logicClad1,
465  "Clad1",
466  logicPlacement,
467  false,
468  0);
469 
470  // Place the rough surface only if needed
471  if (opSurface) {
472  new G4LogicalBorderSurface("surfaceClad1Out",
473  physiClad1,
474  physiPlacement,
475  opSurface);
476  new G4LogicalBorderSurface("surfaceClad1In",
477  physiPlacement,
478  physiClad1,
479  opSurface);
480  }
481 
482  logicPlacement = logicClad1;
483  physiPlacement = physiClad1;
484 
485  default:
486 
487  //--------------------------------------------------
488  // WLS Fiber
489  //--------------------------------------------------
490 
491  G4VSolid* solidWLSfiber;
492 
493  if (fXYRatio == 1.)
494  solidWLSfiber =
495  new G4Tubs("WLSFiber",0.,fWLSfiberRX,fWLSfiberZ,0.0*rad,twopi*rad);
496  else
497  solidWLSfiber =
499 
500  G4LogicalVolume* logicWLSfiber =
501  new G4LogicalVolume(solidWLSfiber,
502  FindMaterial("PMMA"),
503  "WLSFiber");
504 
505  logicWLSfiber->SetUserLimits(new G4UserLimits(DBL_MAX,DBL_MAX,10*ms));
506 
507  G4VPhysicalVolume* physiWLSfiber = new G4PVPlacement(0,
509  logicWLSfiber,
510  "WLSFiber",
511  logicPlacement,
512  false,
513  0);
514 
515  // Place the rough surface only if needed
516  if (opSurface) {
517  new G4LogicalBorderSurface("surfaceWLSOut",
518  physiWLSfiber,
519  physiPlacement,
520  opSurface);
521  new G4LogicalBorderSurface("surfaceWLSIn",
522  physiPlacement,
523  physiWLSfiber,
524  opSurface);
525  }
526  }
527 
528  //--------------------------------------------------
529  // Mirror for reflection at one of the end
530  //--------------------------------------------------
531 
532  // Place the mirror only if the user wants the mirror
533  if (fMirrorToggle) {
534 
535  G4VSolid* solidMirror = new G4Box("Mirror",
536  fMirrorRmax,
537  fMirrorRmax,
538  fMirrorZ);
539 
540  G4LogicalVolume* logicMirror = new G4LogicalVolume(solidMirror,
541  FindMaterial("G4_Al"),
542  "Mirror");
543 
544  G4OpticalSurface* mirrorSurface = new G4OpticalSurface("MirrorSurface",
545  glisur,
546  ground,
548  fMirrorPolish);
549 
550  G4MaterialPropertiesTable* mirrorSurfaceProperty =
552 
553  G4double p_mirror[] = {2.00*eV, 3.47*eV};
554  const G4int nbins = sizeof(p_mirror)/sizeof(G4double);
556  assert(sizeof(refl_mirror) == sizeof(p_mirror));
557  G4double effi_mirror[] = {0, 0};
558  assert(sizeof(effi_mirror) == sizeof(effi_mirror));
559 
560  mirrorSurfaceProperty->
561  AddProperty("REFLECTIVITY",p_mirror,refl_mirror,nbins);
562  mirrorSurfaceProperty->
563  AddProperty("EFFICIENCY",p_mirror,effi_mirror,nbins);
564 
565  mirrorSurface -> SetMaterialPropertiesTable(mirrorSurfaceProperty);
566 
567  new G4PVPlacement(0,
568  G4ThreeVector(0.0,0.0,fMirrorOrigin),
569  logicMirror,
570  "Mirror",
571  fLogicWorld,
572  false,
573  0);
574 
575  new G4LogicalSkinSurface("MirrorSurface",logicMirror,mirrorSurface);
576  }
577 
578  //--------------------------------------------------
579  // Coupling at the read-out end
580  //--------------------------------------------------
581 
582  // Clear Fiber (Coupling Layer)
583  G4VSolid* solidCouple = new G4Box("Couple",fCoupleRX,fCoupleRY,fCoupleZ);
584 
585  G4LogicalVolume* logicCouple = new G4LogicalVolume(solidCouple,
586  FindMaterial("G4_AIR"),
587  "Couple");
588 
589  new G4PVPlacement(0,
590  G4ThreeVector(0.0,0.0,fCoupleOrigin),
591  logicCouple,
592  "Couple",
593  fLogicWorld,
594  false,
595  0);
596 
597  //--------------------------------------------------
598  // A logical layer in front of PhotonDet
599  //--------------------------------------------------
600 
601  // Purpose: Preventing direct dielectric to metal contact
602 
603  // Check for valid placement of PhotonDet
604  if (fMPPCTheta > std::atan(fMPPCDist / fMPPCHalfL)) {
605 
606  fMPPCTheta = 0;
607  fMPPCOriginX = std::sin(fMPPCTheta) * (fMPPCDist + fClrfiberZ);
609  G4cerr << "Invalid alignment. Alignment Reset to 0" << G4endl;
610  }
611 
612  // Clear Fiber (Coupling Layer)
613  G4VSolid* solidClrfiber;
614 
615  if ( fMPPCShape == "Square" )
616  solidClrfiber =
617  new G4Box("ClearFiber",fClrfiberHalfL,fClrfiberHalfL,fClrfiberZ);
618  else
619  solidClrfiber =
620  new G4Tubs("ClearFiber",0.,fClrfiberHalfL,fClrfiberZ,0.0*rad,twopi*rad);
621 
622  G4LogicalVolume* logicClrfiber =
623  new G4LogicalVolume(solidClrfiber,
624  FindMaterial("G4_AIR"),
625  "ClearFiber");
626 
627  new G4PVPlacement(new G4RotationMatrix(CLHEP::HepRotationY(-fMPPCTheta)),
629  logicClrfiber,
630  "ClearFiber",
631  logicCouple,
632  false,
633  0);
634 
635  //--------------------------------------------------
636  // PhotonDet (Sensitive Detector)
637  //--------------------------------------------------
638 
639  // Physical Construction
640  G4VSolid* solidPhotonDet;
641 
642  if ( fMPPCShape == "Square" )
643  solidPhotonDet = new G4Box("PhotonDet",fMPPCHalfL,fMPPCHalfL,fMPPCZ);
644  else
645  solidPhotonDet =
646  new G4Tubs("PhotonDet",0.,fMPPCHalfL,fMPPCZ,0.0*rad,twopi*rad);
647 
648  G4LogicalVolume* logicPhotonDet =
649  new G4LogicalVolume(solidPhotonDet,
650  FindMaterial("G4_Al"),
651  "PhotonDet_LV");
652 
653  new G4PVPlacement(0,
654  G4ThreeVector(0.0,0.0,0.0),
655  logicPhotonDet,
656  "PhotonDet",
657  logicClrfiber,
658  false,
659  0);
660 
661  // PhotonDet Surface Properties
662  G4OpticalSurface* photonDetSurface = new G4OpticalSurface("PhotonDetSurface",
663  glisur,
664  ground,
666  fMPPCPolish);
667 
668  G4MaterialPropertiesTable* photonDetSurfaceProperty =
670 
671  G4double p_mppc[] = {2.00*eV, 3.47*eV};
672  const G4int nbins = sizeof(p_mppc)/sizeof(G4double);
674  assert(sizeof(refl_mppc) == sizeof(p_mppc));
675  G4double effi_mppc[] = {1, 1};
676  assert(sizeof(effi_mppc) == sizeof(p_mppc));
677 
678  photonDetSurfaceProperty->AddProperty("REFLECTIVITY",p_mppc,refl_mppc,nbins);
679  photonDetSurfaceProperty->AddProperty("EFFICIENCY",p_mppc,effi_mppc,nbins);
680 
681  photonDetSurface->SetMaterialPropertiesTable(photonDetSurfaceProperty);
682 
683  new G4LogicalSkinSurface("PhotonDetSurface",logicPhotonDet,photonDetSurface);
684 }
685 
686 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
687 
689 {
690  if (!fmppcSD.Get()) {
691  G4String mppcSDName = "WLS/PhotonDet";
692  WLSPhotonDetSD* mppcSD = new WLSPhotonDetSD(mppcSDName);
693  fmppcSD.Put(mppcSD);
694  }
695  SetSensitiveDetector("PhotonDet_LV", fmppcSD.Get(), true);
696 }
697 
698 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
699 
701 {
703 
705  fClad1RY = fWLSfiberRY + 0.03*fWLSfiberRY;
707 
708  fClad2RX = fClad1RX + 0.03*fWLSfiberRX;
709  fClad2RY = fClad1RY + 0.03*fWLSfiberRY;
711 
715 
718  fCoupleZ = (fWorldSizeZ - fWLSfiberZ) / 2;
719 
721 
723 
726  fMPPCOriginX = std::sin(fMPPCTheta) * (fMPPCDist + fClrfiberZ);
727  fMPPCOriginZ = -fCoupleZ + std::cos(fMPPCTheta) * (fMPPCDist + fClrfiberZ);
728 }
729 
730 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
731 
734 {
735  // We apply successive rotations OF THE OBJECT around the FIXED
736  // axes of the parent's local coordinates; rotations are applied
737  // left-to-right (rotation="r1,r2,r3" => r1 then r2 then r3).
738 
739  G4RotationMatrix rot;
740 
741  unsigned int place = 0;
742 
743  while (place < rotation.size()) {
744 
745  G4double angle;
746  char* p;
747 
748  const G4String tmpstring=rotation.substr(place+1);
749 
750  angle = strtod(tmpstring.c_str(),&p) * deg;
751 
752  if (!p || (*p != (char)',' && *p != (char)'\0')) {
753  G4cerr << "Invalid rotation specification: " <<
754  rotation.c_str() << G4endl;
755  return rot;
756  }
757 
758  G4RotationMatrix thisRotation;
759 
760  switch(rotation.substr(place,1).c_str()[0]) {
761  case 'X': case 'x':
762  thisRotation = G4RotationMatrix(CLHEP::HepRotationX(angle));
763  break;
764  case 'Y': case 'y':
765  thisRotation = G4RotationMatrix(CLHEP::HepRotationY(angle));
766  break;
767  case 'Z': case 'z':
768  thisRotation = G4RotationMatrix(CLHEP::HepRotationZ(angle));
769  break;
770  default:
771  G4cerr << " Invalid rotation specification: "
772  << rotation << G4endl;
773  return rot;
774  }
775 
776  rot = thisRotation * rot;
777  place = rotation.find(',',place);
778  if (place > rotation.size()) break;
779  ++place;
780  }
781 
782  return rot;
783 
784 }
785 
786 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
787 
789 // Set the Geometry of the PhotonDet detector
790 // Pre: shape must be either "Circle" and "Square"
791 {
792  if (shape == "Circle" || shape == "Square" ) fMPPCShape = shape;
794 }
795 
796 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
797 
799 // Set the number of claddings
800 // Pre: 0 <= num <= 2
801 {
802  fNumOfCladLayers = num;
804 }
805 
806 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
807 
809 // Set the TOTAL length of the WLS fiber
810 {
811  fWLSfiberZ = length;
813 }
814 
815 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
816 
818 // Set the Y radius of WLS fiber
819 {
820  fWLSfiberRY = radius;
822 }
823 
824 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
825 
827 // Set the Y radius of Cladding 1
828 {
829  fClad1RY = radius;
831 }
832 
833 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
834 
836 // Set the Y radius of Cladding 2
837 {
838  fClad2RY = radius;
840 }
841 
842 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
843 
845 // Set the half length of the PhotonDet detector
846 // The half length will be the radius if PhotonDet is circular
847 {
848  fMPPCHalfL = halfL;
850 }
851 
852 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
853 
855 // Set the distance between fiber end and PhotonDet
856 {
857  fMPPCDist = gap;
859 }
860 
861 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
862 
864 // Set the Aligment of PhotonDet with respect to the z axis
865 // If theta is 0 deg, then the detector is perfectly aligned
866 // PhotonDet will be deviated by theta from z axis
867 // facing towards the center of the fiber
868 {
869  fMPPCTheta = theta;
871 }
872 
873 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
874 
876 // Set the Surface Roughness between Cladding 1 and WLS fiber
877 // Pre: 0 < roughness <= 1
878 {
879  fSurfaceRoughness = roughness;
881 }
882 
883 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
884 
886 // Set the Polish of the mirror, polish of 1 is a perfect mirror surface
887 // Pre: 0 < polish <= 1
888 {
889  fMirrorPolish = polish;
891 }
892 
893 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
894 
896 // Set the Reflectivity of the mirror, reflectivity of 1 is a perfect mirror
897 // Pre: 0 < reflectivity <= 1
898 {
899  fMirrorReflectivity = reflectivity;
901 }
902 
903 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
904 
906 // Set the Polish of the PhotonDet, polish of 1 is a perfect mirror surface
907 // Pre: 0 < polish <= 1
908 {
909  fMPPCPolish = polish;
911 }
912 
913 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
914 
916 // Set the Reflectivity of the PhotonDet, reflectivity of 1 is a perfect mirror
917 // Pre: 0 < reflectivity <= 1
918 {
919  fMPPCReflectivity = reflectivity;
921 }
922 
923 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
924 
926 // Toggle to place the mirror or not at one end (-z end) of the fiber
927 // True means place the mirror, false means otherwise
928 {
929  fMirrorToggle = flag;
931 }
932 
933 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
934 
936 // Set the ratio of the x and y radius of the ellipse (x/y)
937 // a ratio of 1 would produce a circle
938 {
939  fXYRatio = r;
941 }
942 
943 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
944 
946 // Set the length of the scintillator bar
947 {
948  fBarLength = length;
950 }
951 
952 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
953 
955 // Set the side of the scintillator bar
956 {
957  fBarBase = side;
959 }
960 
961 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
962 
964 // Set the radius of the fiber hole
965 {
966  fHoleRadius = radius;
968 }
969 
970 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
971 
973 // Set thickness of the coating on the bars
974 {
975  fCoatingThickness = thick;
977 }
978 
979 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
980 
982 // Set inner radius of the corner bar coating
983 {
984  fCoatingRadius = radius;
986 }
987 
988 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
989 
991 
992 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
993 
995 
996 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
997 
999 
1000 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
1001 
1003 
1004 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
1005 
1007 
1008 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
1009 
1011 
1012 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
1013 
1015  { return fCoatingThickness; }
1016 
1017 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
1018 
1020 
1021 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
1022 
1024 {
1025  return fWLSfiberOrigin + fWLSfiberZ;
1026 }
1027 
1028 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
1029 
1031 {
1032  if (fNumOfCladLayers == 2) return fClad2RY;
1033  if (fNumOfCladLayers == 1) return fClad1RY;
1034  return fWLSfiberRY;
1035 }
1036 
1037 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
1038 
1040 {
1041  return fSurfaceRoughness;
1042 }
1043 
1044 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
1045 
1046 // Return True if the fiber construction is ideal
1048 {
1049  return fSurfaceRoughness == 1. && fXYRatio == 1.
1050  && (!fMirrorToggle ||
1051  (fMirrorPolish == 1. && fMirrorReflectivity == 1.));
1052 }
1053 
1054 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
1055 
1057  G4Material* material = G4Material::GetMaterial(name,true);
1058  return material;
1059 }
virtual G4VPhysicalVolume * Construct()
static const double cm
Definition: G4SIunits.hh:118
WLSDetectorMessenger * fDetectorMessenger
CLHEP::Hep3Vector G4ThreeVector
CLHEP::HepRotation G4RotationMatrix
static G4Material * GetMaterial(const G4String &name, G4bool warning=true)
Definition: G4Material.cc:604
Definition: G4Box.hh:64
G4String name
Definition: TRTMaterials.hh:40
void SetUserLimits(G4UserLimits *pULimits)
value_type & Get() const
Definition: G4Cache.hh:282
Definition: G4Tubs.hh:85
static void Clean()
Definition: G4SolidStore.cc:79
static G4double angle[DIM]
Definition of the WLSMaterials class.
int G4int
Definition: G4Types.hh:78
Definition of the WLSDetectorConstruction class.
G4MaterialPropertyVector * AddProperty(const char *key, G4double *PhotonEnergies, G4double *PropertyValues, G4int NumEntries)
static G4RotationMatrix StringToRotationMatrix(G4String rotation)
static G4PhysicalVolumeStore * GetInstance()
static const double ms
Definition: G4SIunits.hh:169
G4Cache< WLSPhotonDetSD * > fmppcSD
static const double deg
Definition: G4SIunits.hh:151
bool G4bool
Definition: G4Types.hh:79
static const double nm
Definition: G4SIunits.hh:111
static const double twopi
Definition: G4SIunits.hh:75
static G4LogicalVolumeStore * GetInstance()
static G4SolidStore * GetInstance()
static G4GeometryManager * GetInstance()
void SetSensitiveDetector(const G4String &logVolName, G4VSensitiveDetector *aSD, G4bool multi=false)
void ReinitializeGeometry(G4bool destroyFirst=false, G4bool prop=true)
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
Definition: G4Exception.cc:41
static const double rad
Definition: G4SIunits.hh:148
static G4RunManager * GetRunManager()
Definition: G4RunManager.cc:79
static const double eV
Definition: G4SIunits.hh:212
const G4double x[NPOINTSGL]
Definition of the WLSPhotonDetSD class.
#define G4endl
Definition: G4ios.hh:61
static const double m
Definition: G4SIunits.hh:128
void OpenGeometry(G4VPhysicalVolume *vol=0)
G4Material * FindMaterial(G4String)
double G4double
Definition: G4Types.hh:76
Definition of the WLSDetectorMessenger class.
static WLSMaterials * GetInstance()
Definition: WLSMaterials.cc:62
void SetMaterialPropertiesTable(G4MaterialPropertiesTable *anMPT)
#define DBL_MAX
Definition: templates.hh:83
void Put(const value_type &val) const
Definition: G4Cache.hh:286
static const double mm
Definition: G4SIunits.hh:114
G4GLOB_DLL std::ostream G4cerr
G4VPhysicalVolume * ConstructDetector()