Geant4  10.03.p02
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
ExExChDetectorConstruction.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 //
28 //
29 //
30 
32 #include "G4RunManager.hh"
33 
34 #include "G4Material.hh"
35 #include "G4NistManager.hh"
36 
37 #include "G4Box.hh"
38 #include "G4Tubs.hh"
39 #include "G4SubtractionSolid.hh"
40 #include "G4LogicalVolume.hh"
41 #include "G4PVPlacement.hh"
42 #include "G4UniformMagField.hh"
43 #include "G4SystemOfUnits.hh"
44 #include "G4PhysicalConstants.hh"
45 
46 #include "G4GeometryManager.hh"
47 #include "G4PhysicalVolumeStore.hh"
48 #include "G4LogicalVolumeStore.hh"
49 #include "G4SolidStore.hh"
50 
51 #include "G4VisAttributes.hh"
52 #include "G4Colour.hh"
53 
54 #include "G4SDManager.hh"
56 
57 #include "XLatticeManager3.hh"
58 
59 #include "XLogicalAtomicLattice.hh"
61 #include "XLogicalBase.hh"
62 #include "XUnitCell.hh"
63 
76 
77 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
78 
80 fWorldLogic(0),fXtalLogic(0){
81 
82  //SiSD standard parameters
83  fSiSD = true;
84  fSSDSize = G4ThreeVector(3.8 * CLHEP::centimeter,
85  3.8 * CLHEP::centimeter,
86  640. * CLHEP::micrometer);
87  fSSDXtalDistance[0] = - (9998.) * CLHEP::millimeter;
88  fSSDXtalDistance[1] = - (320.) * CLHEP::millimeter;
89  fSSDXtalDistance[2] = + (10756.) * CLHEP::millimeter;
90 
91  //SiSD Box standard parameters
92  fSSDBoxSize = G4ThreeVector(25. * CLHEP::centimeter,
93  25. * CLHEP::centimeter,
94  10. * CLHEP::centimeter);
95  fSSDBoxThickness = 4. * CLHEP::millimeter;
96 
97  //Beampipe standard parameters
98  fBeamPipe = false;
99  fBeamPipeThickness = (0.3) * CLHEP::centimeter;
100  fBeamPipeRadius = (15.6) * CLHEP::centimeter;
101  fXtal = true;
102  fXtalAngle = G4ThreeVector(0.,0.,0.);
103  fXtalSize = G4ThreeVector(1. * CLHEP::millimeter,
104  70. * CLHEP::millimeter,
105  1.94 * CLHEP::millimeter);
106  fXtalCurvatureRadius = G4ThreeVector(38.416 * CLHEP::meter,
107  0. * CLHEP::meter,
108  0. * CLHEP::meter);
109 
110  fXtalCellSize = G4ThreeVector(5.431 * CLHEP::angstrom,
111  5.431 * CLHEP::angstrom,
112  5.431 * CLHEP::angstrom);
113 
114  fXtalCellAngle = G4ThreeVector(90.*CLHEP::deg,
115  90.*CLHEP::deg,
116  90.*CLHEP::deg);
117 
118  fXtalTVA = 0.075 * CLHEP::angstrom;
119  fXtalMiller = G4ThreeVector(2,2,0);
120 
121  SetXtalMaterial("G4_Si");
122 
123  fMessenger = new ExExChDetectorConstructionMessenger(this);
124 }
125 
126 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.....
127 
129 }
130 
131 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.....
132 
134 }
135 
136 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
137 
139  //** World **//
140  fWorldSize = G4ThreeVector(1. * CLHEP::meter,
141  1. * CLHEP::meter,
142  30. * CLHEP::meter);
143  fWorldMaterial = G4NistManager::
144  Instance()->FindOrBuildMaterial("G4_Galactic");
145 
146  fWorldSolid = new G4Box("World",
147  fWorldSize.x()/2.,
148  fWorldSize.y()/2.,
149  fWorldSize.z()/2.);
150 
151  fWorldLogic = new G4LogicalVolume(fWorldSolid,
152  fWorldMaterial,
153  "World");
154 
155  fWorldPhysical = new G4PVPlacement(0,
156  G4ThreeVector(),
157  fWorldLogic,
158  "World",
159  0,
160  false,
161  0);
162 
163  //** SiSD **//
164 
165  if(fSiSD){
166  for(unsigned int i1=0;i1<3;i1++){
167  G4LogicalVolume* fSSDBoxLogic = ConstructSiSD(i1);
168 
169  G4ThreeVector vBoxPosition =
170  G4ThreeVector(+fSSDBoxSize.x()/4.,
171  -fSSDBoxSize.y()/4.,
172  fSSDXtalDistance[i1]);
173 
174  new G4PVPlacement(0,
175  vBoxPosition,
176  fSSDBoxLogic,"SiSD",
177  fWorldLogic,
178  false,
179  i1);
180  }
181  }
182  //** BeamPipe **//
183  if(fBeamPipe){
184  G4double fBeamPipeFromSiSDDistance = 20. * CLHEP::centimeter;
185 
186  G4ThreeVector fBeamPipeA0Position =
187  G4ThreeVector(0.,
188  0.,
189  fSSDXtalDistance[0] + std::fabs(fSSDXtalDistance[1] -
190  fSSDXtalDistance[0])/2.);
191 
192  G4double fBeamPipeA0Length =
193  std::fabs(fSSDXtalDistance[1] - fSSDXtalDistance[0]) -
194  2. * (fSSDSize.z()/2.) - 2. * fBeamPipeFromSiSDDistance;
195 
196  G4LogicalVolume* fBeamPipeA0Logic =
197  ConstructBeamPipe(fBeamPipeA0Length);
198 
199  new G4PVPlacement(0,
200  fBeamPipeA0Position,
201  fBeamPipeA0Logic,
202  "BeamPipeA0",
203  fWorldLogic,
204  false,
205  0);
206 
207  G4ThreeVector fBeamPipeA1Position =
208  G4ThreeVector(0.,0.,+ std::fabs(fSSDXtalDistance[2]) /2.);
209  G4double fBeamPipeA1Length =
210  std::fabs(fSSDXtalDistance[2]) - 2. * (fSSDSize.z()/2.) -
211  2. * fBeamPipeFromSiSDDistance;
212 
213  G4LogicalVolume* fBeamPipeA1Logic =
214  ConstructBeamPipe(fBeamPipeA1Length);
215 
216  new G4PVPlacement(0,
217  fBeamPipeA1Position,
218  fBeamPipeA1Logic,
219  "BeamPipeA1",
220  fWorldLogic,
221  false,
222  1);
223  }
224 #ifndef G4MULTITHREADED
225  G4String SDname;
226  G4VSensitiveDetector* telescope =
227  new ExExChSensitiveDetector(SDname="/telescope");
229  for(unsigned int i1=0;i1<3;i1++){
230  fSSDLogic[i1]->SetSensitiveDetector(telescope);
231  }
232 #endif
233  //** Crystal **//
234  if(fXtal){
235  ConstructXtalTarget();
236  }
237 
238  return fWorldPhysical;
239 }
240 
241 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
242 
243 #ifdef G4MULTITHREADED
244 void ExExChDetectorConstruction::ConstructSDandField(){
245  G4String SDname;
246  G4VSensitiveDetector* telescope =
247  new ExExChSensitiveDetector(SDname="/telescope");
249  for(unsigned int i1=0;i1<3;i1++){
250  fSSDLogic[i1]->SetSensitiveDetector(telescope);
251  }
252 }
253 #else
254 void ExExChDetectorConstruction::ConstructSDandField(){
255 }
256 #endif
257 
258 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
259 
260 G4LogicalVolume* ExExChDetectorConstruction::ConstructSiSD(G4int copyNo){
263  G4Material* Galactic =
265  G4double fFoilThickness = 0.024 * CLHEP::millimeter;
266 
267  //** SiSD Box **//
268  G4Box* fSSDBoxEnvelopeSolid =
269  new G4Box("SiSDBoxEnvelope",
270  fSSDBoxSize.x()/2.,
271  fSSDBoxSize.y()/2.,
272  fSSDBoxSize.z()/2. + fFoilThickness);
273 
274  G4LogicalVolume* fSSDBoxEnvelopeLogic =
275  new G4LogicalVolume(fSSDBoxEnvelopeSolid,
276  Galactic,
277  "SiSDBoxEnvelope");
278 
279  //** SiSD Active Area **//
280  G4Box* fSSDSolid = new G4Box("SiSD",
281  fSSDSize.x()/2.,
282  fSSDSize.y()/2.,
283  fSSDSize.z()/2.);
284  fSSDLogic[copyNo] = new G4LogicalVolume(fSSDSolid,Si,"SiSD");
285 
286  //** SiSD Box **//
287  G4Box* fSSDBoxSolidA = new G4Box("SiSDBoxA",
288  fSSDBoxSize.x()/2.,
289  fSSDBoxSize.y()/2.,
290  fSSDBoxSize.z()/2.);
291 
292  G4Box* fSSDBoxSolidB = new G4Box("SiSDBoxB",
293  fSSDBoxSize.x()/2. - fSSDBoxThickness/2.,
294  fSSDBoxSize.y()/2. - fSSDBoxThickness/2.,
295  fSSDBoxSize.z()/2. - fSSDBoxThickness/2.);
296 
297  G4Box* fSSDBoxSolidC = new G4Box("SiSDBoxC",
298  fSSDSize.x()/2. + fSSDBoxThickness/2.,
299  fSSDSize.y()/2. + fSSDBoxThickness/2.,
300  fSSDBoxSize.z()/2.);
301 
302  G4Box* fSSDBoxSolidD = new G4Box("SiSDBoxD",
303  fSSDSize.x()/2.,
304  fSSDSize.y()/2.,
305  fSSDBoxSize.z());
306 
307  G4Box* fSSDBoxFoilSolid = new G4Box("SSDBoxFoil",
308  fSSDSize.x()/2.,
309  fSSDSize.y()/2.,
310  fFoilThickness);
311  G4SubtractionSolid* fSSDBoxSolid =
312  new G4SubtractionSolid("SiSDBox",
313  fSSDBoxSolidA,
314  fSSDBoxSolidB);
315 
316  fSSDBoxSolid = new G4SubtractionSolid("SiSDBox",
317  fSSDBoxSolid,
318  fSSDBoxSolidC,
319  0,
320  G4ThreeVector(-fSSDBoxSize.x()/4.,
321  fSSDBoxSize.y()/4.,
322  0.));
323 
324  G4SubtractionSolid* fSSDBoxInternalSolid =
325  new G4SubtractionSolid("SiSDBoxInternalSolid",
326  fSSDBoxSolidC,
327  fSSDBoxSolidD);
328 
329  G4LogicalVolume* fSSDBoxLogic = new G4LogicalVolume(fSSDBoxSolid,
330  Al,
331  "SiSDBox");
332  G4LogicalVolume* fSSDBoxInternalLogic =
333  new G4LogicalVolume(fSSDBoxInternalSolid,
334  Al,
335  "SiSDBox");
336 
337  G4LogicalVolume* fSSDBoxFoilLogic = new G4LogicalVolume(fSSDBoxFoilSolid,
338  Al,
339  "SiSDBoxFoil");
340 
341  G4VisAttributes* fSSDBoxVisAttribute =
342  new G4VisAttributes(G4Colour(0.7,0.7,0.7));
343  fSSDBoxVisAttribute->SetForceSolid(true);
344  fSSDBoxLogic->SetVisAttributes(fSSDBoxVisAttribute);
345  fSSDBoxInternalLogic->SetVisAttributes(fSSDBoxVisAttribute);
346 
347  G4VisAttributes* fSSDBoxFoilVisAttribute =
348  new G4VisAttributes(G4Colour(0.8,0.8,0.8));
349  fSSDBoxFoilVisAttribute->SetForceSolid(false);
350  fSSDBoxFoilLogic->SetVisAttributes(fSSDBoxFoilVisAttribute);
351 
352  G4VisAttributes* fSiSDVisAttribute =
353  new G4VisAttributes(G4Colour(1.0,0.65,0.0));
354  fSiSDVisAttribute->SetForceSolid(true);
355  fSSDLogic[copyNo]->SetVisAttributes(fSiSDVisAttribute);
356 
357  //** Add to Physical World **//
358  new G4PVPlacement(0,
359  G4ThreeVector(-fSSDBoxSize.x()/4.,fSSDBoxSize.y()/4.,0.),
360  fSSDLogic[copyNo],"SiSD",
361  fSSDBoxEnvelopeLogic,
362  false,
363  copyNo);
364  new G4PVPlacement(0,
365  G4ThreeVector(),
366  fSSDBoxLogic,"SiSDBox",
367  fSSDBoxEnvelopeLogic,
368  false,
369  copyNo);
370 
371  new G4PVPlacement(0,
372  G4ThreeVector(-fSSDBoxSize.x()/4.,fSSDBoxSize.y()/4.,0.),
373  fSSDBoxInternalLogic,"SiSDBox",
374  fSSDBoxEnvelopeLogic,
375  false,
376  copyNo);
377 
378  new G4PVPlacement(0,
379  G4ThreeVector(-fSSDBoxSize.x()/4.,
380  fSSDBoxSize.y()/4.,
381  (fSSDBoxSize.z()/2. - fFoilThickness/2.)),
382  fSSDBoxFoilLogic,"SiSDBoxFoil",
383  fSSDBoxEnvelopeLogic,
384  false,
385  copyNo);
386 
387  new G4PVPlacement(0,
388  G4ThreeVector(-fSSDBoxSize.x()/4.,
389  fSSDBoxSize.y()/4.,
390  -(fSSDBoxSize.z()/2. - fFoilThickness/2.)),
391  fSSDBoxFoilLogic,"SiSDBoxFoil",
392  fSSDBoxEnvelopeLogic,
393  false,
394  G4int(copyNo*2+1));
395 
396  return fSSDBoxEnvelopeLogic;
397 }
398 
399 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
400 
401 G4LogicalVolume* ExExChDetectorConstruction::ConstructBeamPipe(G4double length){
402  G4Material* Galactic =
404  G4Material* Mylar =
406 
407  // Definition of vacuum
408  G4double z = 7.;
409  G4double a = 14.007*CLHEP::g/CLHEP::mole;
411  G4double pressure = 1.E-8 * 1.E-3 * CLHEP::bar;
412  G4double temperature = 300.*CLHEP::kelvin;
413 
414  G4Material* Vacuum = new G4Material("Vacuum",
415  z,
416  a,
417  density,
418  kStateGas,
419  temperature,
420  pressure);
421 
422  // Definition of stainless steel (not in NIST) for pipes
429  G4double density_SS = 8.06*CLHEP::g/CLHEP::cm3;
430  G4int ncomponents_SS =6;
431  G4double fractionmass;
432 
433  G4Material* StainlessSteel =
434  new G4Material("StainlessSteel", density_SS, ncomponents_SS);
435  StainlessSteel->AddElement(elC, fractionmass=0.001);
436  StainlessSteel->AddElement(elSi, fractionmass=0.007);
437  StainlessSteel->AddElement(elCr, fractionmass=0.18);
438  StainlessSteel->AddElement(elMn, fractionmass=0.01);
439  StainlessSteel->AddElement(elFe, fractionmass=0.712);
440  StainlessSteel->AddElement(elNi, fractionmass=0.09);
441 
442  // Visualization attributes
443  G4VisAttributes* fBeamPipeVisAttribute =
444  new G4VisAttributes(G4Colour(0.0,1.0,0.0));
445  fBeamPipeVisAttribute->SetForceSolid(true);
446 
447  G4VisAttributes* fBeamPipeInsideVisAttribute =
448  new G4VisAttributes(G4Colour(0.0,0.0,1.0));
449  fBeamPipeInsideVisAttribute->SetForceSolid(false);
450 
451  // Variables
452  G4double fMylarThickness = 10. * CLHEP::millimeter;
453 
454  //** BeamPipe **//
455  G4Tubs* fBeamPipeEnvelopeSolid =
456  new G4Tubs("BeamPipeEnvelope",
457  0.,
458  fBeamPipeRadius + fBeamPipeThickness,
459  length * 0.5 + fMylarThickness * 0.5 * 4.,
460  0*CLHEP::deg,
461  360*CLHEP::deg);
462 
463  G4LogicalVolume* fBeamPipeEnvelopeLogic =
464  new G4LogicalVolume(fBeamPipeEnvelopeSolid,
465  Galactic,
466  "BeamPipeEnvelope");
467 
468 
469  G4Tubs* fBeamPipeSolid = new G4Tubs("BeamPipe",
470  fBeamPipeRadius,
471  fBeamPipeRadius + fBeamPipeThickness,
472  length * 0.5,
473  0*CLHEP::deg,
474  360*CLHEP::deg);
475  G4LogicalVolume* fBeamPipeLogic = new G4LogicalVolume(fBeamPipeSolid,
476  StainlessSteel,
477  "BeamPipe");
478  fBeamPipeLogic->SetVisAttributes(fBeamPipeVisAttribute);
479  new G4PVPlacement(0,
480  G4ThreeVector(),
481  fBeamPipeLogic,
482  "BeamPipe",
483  fBeamPipeEnvelopeLogic,
484  false,
485  0);
486 
487 
488  G4Tubs* fBeamPipeInsideSolid = new G4Tubs("BeamPipeInside",
489  0.,
490  fBeamPipeRadius,
491  length * 0.5,
492  0*CLHEP::deg,
493  360*CLHEP::deg);
494  G4LogicalVolume* fBeamPipeInsideLogic =
495  new G4LogicalVolume(fBeamPipeInsideSolid,
496  Vacuum,
497  "BeamPipeInside");
498  fBeamPipeInsideLogic->SetVisAttributes(fBeamPipeInsideVisAttribute);
499  new G4PVPlacement(0,
500  G4ThreeVector(),
501  fBeamPipeInsideLogic,
502  "BeamPipeInside",
503  fBeamPipeEnvelopeLogic,
504  false,
505  0);
506 
507 
508  G4Tubs* fBeamPipeMylarSolid =
509  new G4Tubs("BeamPipeMylar",
510  0.,
511  fBeamPipeRadius + fBeamPipeThickness,
512  fMylarThickness * 0.5,
513  0*CLHEP::deg,
514  360*CLHEP::deg);
515 
516  G4LogicalVolume* fBeamPipeMylarLogic =
517  new G4LogicalVolume(fBeamPipeMylarSolid,
518  Mylar,
519  "BeamPipeMylar");
520  fBeamPipeMylarLogic->SetVisAttributes(fBeamPipeInsideVisAttribute);
521  new G4PVPlacement(0,
522  G4ThreeVector(0.,
523  0.,
524  +(length + fMylarThickness * 2.) / 2.),
525  fBeamPipeMylarLogic,
526  "BeamPipeMylar",
527  fBeamPipeEnvelopeLogic,
528  false,
529  0);
530 
531  new G4PVPlacement(0,
532  G4ThreeVector(0.,
533  0.,
534  -(length + fMylarThickness * 2.) / 2.),
535  fBeamPipeMylarLogic,
536  "BeamPipeMylar",
537  fBeamPipeEnvelopeLogic,
538  false,
539  1);
540 
541  return fBeamPipeEnvelopeLogic;
542 }
543 
544 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
545 
546 void ExExChDetectorConstruction::ConstructXtalTarget(){
547  if(fXtalCurvatureRadius.x() != 0.){
548  double fXtalAngleOut =
549  fXtalAngle.y() + fXtalSize.z()/fXtalCurvatureRadius.x();
550  fXtalSolid = new G4Tubs("Target",
551  fXtalCurvatureRadius.x() - fXtalSize.x()/2,
552  fXtalCurvatureRadius.x() + fXtalSize.x()/2,
553  fXtalSize.y()/2.,
554  fXtalAngle.y(),
555  fXtalAngleOut);
556  }
557  else{
558  fXtalSolid = new G4Box("Target",
559  fXtalSize.x()/2.,
560  fXtalSize.y()/2.,
561  fXtalSize.z()/2.);
562  }
563 
564  fXtalLogic = new G4LogicalVolume(fXtalSolid,fXtalMaterial,"Target");
565 
566  G4RotationMatrix* vRotationMatrix =
567  new G4RotationMatrix; // Rotates X and Z axes only
568 
569  if(fXtalCurvatureRadius.x() != 0.){
570  vRotationMatrix->rotateX(fXtalAngle.x()-CLHEP::pi*0.5);
571  vRotationMatrix->rotateY(fXtalAngle.y());
572  vRotationMatrix->rotateZ(fXtalAngle.z());
573  fXtalPhysical =
574  new G4PVPlacement(vRotationMatrix,
575  G4ThreeVector(-fXtalCurvatureRadius.x(),0.,0.),
576  fXtalLogic,"Target",
577  fWorldLogic,
578  false,
579  0);
580  }
581  else{
582  vRotationMatrix->rotateX(fXtalAngle.x());
583  vRotationMatrix->rotateY(fXtalAngle.y());
584  vRotationMatrix->rotateZ(fXtalAngle.z());
585  fXtalPhysical =
586  new G4PVPlacement(vRotationMatrix,
587  G4ThreeVector(0.,0.,0.),
588  fXtalLogic,"Target",
589  fWorldLogic,
590  false,
591  0);
592  }
593 
594  //----------------------------------------
595  // Create XLogicalLattice
596  //----------------------------------------
597  XLogicalLattice* logicalLattice = new XLogicalLattice();
598  double vScatteringConstant =
600  logicalLattice->SetScatteringConstant(vScatteringConstant);
601 
602  //----------------------------------------
603  // Create XLogicalBase
604  //----------------------------------------
605  XLogicalAtomicLatticeDiamond *diamond_lattice =
607  G4Element* element = G4NistManager::
608  Instance()->FindOrBuildElement(G4int(fXtalMaterial->GetZ()));
609  XLogicalBase *base = new XLogicalBase(element,diamond_lattice);
610 
611  //----------------------------------------
612  // Create XUnitCell
613  //----------------------------------------
614  XUnitCell* myCell = new XUnitCell();
615  myCell->SetSize(fXtalCellSize);
616  myCell->AddBase(base);
617 
618  //----------------------------------------
619  // Create XPhysicalLattice
620  //----------------------------------------
621  XPhysicalLattice* physicalLattice =
622  new XPhysicalLattice(fXtalPhysical, logicalLattice);
623  physicalLattice->SetUnitCell(myCell);
624  physicalLattice->SetMillerOrientation(G4int(fXtalMiller.x()),
625  G4int(fXtalMiller.y()),
626  G4int(fXtalMiller.z()));
627  physicalLattice->SetLatticeOrientation(fXtalAngle.x(),
628  fXtalAngle.y(),
629  fXtalAngle.z());
630  physicalLattice->SetThermalVibrationAmplitude(fXtalTVA);
631  physicalLattice->SetCurvatureRadius(fXtalCurvatureRadius);
632 
633  //----------------------------------------
634  // Register XPhysicalLattice
635  //----------------------------------------
636  if(XLatticeManager3::
637  GetXLatticeManager()->GetXPhysicalLattice(fXtalPhysical)
638  != physicalLattice){
640  GetXLatticeManager()->RegisterLattice(physicalLattice);
641  }
642 
643 }
644 
645 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.
646 
648  G4Material* vMaterial = G4Material::GetMaterial(name, false);
649 
650  if(!vMaterial){
651  vMaterial = G4NistManager::Instance()->FindOrBuildMaterial(name);
652  }
653 
654  if (vMaterial && vMaterial != fXtalMaterial) {
655  G4cout << "DetectorConstructor::SetXtalMaterial() - New Xtal Material: "
656  << vMaterial->GetName() << G4endl;
657  fXtalMaterial = vMaterial;
658  if(fXtalLogic){
659  fXtalLogic->SetMaterial(vMaterial);
661  }
662  }
663 }
664 
665 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
666 
668  if(fXtalMaterial) {
669  return fXtalMaterial->GetName();
670  }
671  return "";
672 }
673 
674 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
675 
677  if(fXtalCurvatureRadius != cr) {
679  fXtalCurvatureRadius = cr;
680  }
681 }
682 
683 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
684 
686  if(fXtalSize != size) {
688  fXtalSize = size;
689  }
690 }
691 
692 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
693 
695  if(fXtalAngle != angle) {
697  fXtalAngle = angle;
698  }
699 }
700 
701 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
702 
704  if(fXtalCellSize != cellsize) {
706  fXtalCellSize = cellsize;
707  }
708 }
709 
710 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
711 
713  if(fXtalMiller != miller) {
715  fXtalMiller = miller;
716  }
717 }
718 
719 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
720 
722  G4ThreeVector cellangle) {
723  if(fXtalCellAngle != cellangle) {
725  fXtalCellAngle = cellangle;
726  }
727 }
728 
729 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
730 
732  G4double thermvibr) {
733  if(fXtalTVA != thermvibr) {
735  fXtalTVA = thermvibr;
736  }
737 }
738 
739 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo..
void GeometryHasBeenModified(G4bool prop=true)
const XML_Char * name
Definition: expat.h:151
G4Material * FindOrBuildMaterial(const G4String &name, G4bool isotopes=true, G4bool warning=false)
Definition of the XCrystalCharacteristicArray class.
void SetThermalVibrationAmplitude(G4double)
static XLatticeManager3 * GetXLatticeManager()
G4double GetZ() const
Definition: G4Material.cc:623
CLHEP::Hep3Vector G4ThreeVector
HepRotation & rotateX(double delta)
Definition: Rotation.cc:66
double x() const
CLHEP::HepRotation G4RotationMatrix
Definition of the XLogicalBase class.
void SetSize(G4ThreeVector)
Definition: XUnitCell.cc:76
std::vector< ExP01TrackerHit * > a
Definition: ExP01Classes.hh:33
static G4Material * GetMaterial(const G4String &name, G4bool warning=true)
Definition: G4Material.cc:602
Definition: G4Box.hh:64
Definition of the XLatticeManager3 class.
const G4String & GetName() const
Definition: G4Material.hh:178
Definition: G4Tubs.hh:85
static G4double angle[DIM]
void SetScatteringConstant(G4double)
HepRotation & rotateY(double delta)
Definition: Rotation.cc:79
Definition of the XLogicalAtomicLatticeDiamond class.
const XML_Char int const XML_Char int const XML_Char * base
Definition: expat.h:331
int G4int
Definition: G4Types.hh:78
static G4NistManager * Instance()
double z() const
void SetForceSolid(G4bool=true)
static constexpr double g
void SetUnitCell(XUnitCell *)
static constexpr double centimeter
Definition: SystemOfUnits.h:66
G4GLOB_DLL std::ostream G4cout
static constexpr double meter
Definition: SystemOfUnits.h:70
void PhysicsHasBeenModified()
Definition of the XCrystalPlanarMoliereElectronDensity class.
Definition of the XCrystalIntegratedDensityPlanar class.
static constexpr double millimeter
Definition: SystemOfUnits.h:62
static constexpr double micrometer
Definition: SystemOfUnits.h:80
Definition of the XCrystalPlanarMoliereTempPotential class.
Definition of the XCrystalPlanarMoliereElectricField class.
void AddBase(XLogicalBase *)
Definition: XUnitCell.cc:100
Definition of the ExExChSensitiveDetector class.
void AddNewDetector(G4VSensitiveDetector *aSD)
Definition: G4SDManager.cc:71
bool RegisterLattice(XPhysicalLattice *)
static G4RunManager * GetRunManager()
Definition: G4RunManager.cc:79
static constexpr double deg
void SetMillerOrientation(int, int, int)
void SetCurvatureRadius(G4ThreeVector)
void SetLatticeOrientation(G4double, G4double)
static constexpr double bar
Definition of the XCrystalPlanarNucleiDensity class.
static G4SDManager * GetSDMpointer()
Definition: G4SDManager.cc:40
void SetXtalMaterial(const G4String &name)
double y() const
Definition of the XLogicalAtomicLattice class.
tuple z
Definition: test.py:28
static constexpr double universe_mean_density
HepRotation & rotateZ(double delta)
Definition: Rotation.cc:92
static constexpr double second
#define G4endl
Definition: G4ios.hh:61
void AddElement(G4Element *element, G4int nAtoms)
Definition: G4Material.cc:362
Definition of the XCrystalPlanarMolierePotential class.
static constexpr double mole
double G4double
Definition: G4Types.hh:76
G4Element * FindOrBuildElement(G4int Z, G4bool isotopes=true)
void SetMaterial(G4Material *pMaterial)
Definition of the XUnitCell class.
void SetVisAttributes(const G4VisAttributes *pVA)
void SetSensitiveDetector(G4VSensitiveDetector *pSDetector)
Definition of the XCrystalIntegratedDensityHub class.
static constexpr double kelvin
static constexpr double pi
Definition: SystemOfUnits.h:54
static constexpr double angstrom
Definition: SystemOfUnits.h:82
static constexpr double cm3
Definition of the ExExChDetectorConstruction class.