source: trunk/source/geometry/solids/test/SolidsChecker/src/Sc01DetectorConstruction.cc @ 1316

Last change on this file since 1316 was 1316, checked in by garnier, 14 years ago

update geant4-09-04-beta-cand-01 interfaces-V09-03-09 vis-V09-03-08

File size: 22.3 KB
Line 
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: Sc01DetectorConstruction.cc,v 1.13 2006/12/13 15:43:42 gunter Exp $
27//
28//  GEANT 4 class header file
29//
30//      This is a version for maximum particle set
31//  History:
32//       27.01.04  V. Grichine based on test10 detector construction
33//       
34//
35
36#include "Sc01DetectorConstruction.hh"
37#include "Sc01DetectorMessenger.hh"
38
39#include "G4Material.hh"
40#include "G4MaterialTable.hh"
41#include "G4Element.hh"
42#include "G4ElementTable.hh"
43
44#include "G4Box.hh"
45#include "G4Orb.hh"
46#include "G4Tubs.hh"
47#include "G4Sphere.hh"
48#include "G4Cons.hh"
49#include "G4Hype.hh"
50#include "G4Para.hh"
51#include "G4Torus.hh"
52#include "G4Trd.hh"
53
54#include "G4Polycone.hh"
55
56#include "G4TwistedBox.hh"
57#include "G4TwistedTrd.hh"
58#include "G4TwistedTrap.hh"
59
60#include "G4BooleanSolid.hh"
61#include "G4DisplacedSolid.hh"
62#include "G4UnionSolid.hh"
63#include "G4IntersectionSolid.hh"
64#include "G4SubtractionSolid.hh"
65#include "G4ReflectedSolid.hh"
66
67#include "G4LogicalBorderSurface.hh"
68#include "G4OpticalSurface.hh"
69#include "G4LogicalVolume.hh"
70#include "G4ThreeVector.hh"
71#include "G4PVPlacement.hh"
72#include "G4VisAttributes.hh"
73#include "G4VVisManager.hh"
74#include "G4Colour.hh"
75#include "G4TransportationManager.hh"
76#include "G4GeometryManager.hh"
77#include "G4StateManager.hh"
78#include "G4UImanager.hh"
79#include "G4RunManager.hh"
80#include "G4ios.hh"
81
82///////////////////////////////////////////////////////////////
83
84Sc01DetectorConstruction::Sc01DetectorConstruction()
85  : aVolume(0), PhysicalVolume(0), Water(0), Water1(0), aSurface(0)
86{
87  detectorMessenger = new Sc01DetectorMessenger (this);
88}
89
90////////////////////////////////////////////////////////////////
91
92Sc01DetectorConstruction::~Sc01DetectorConstruction()
93{
94}
95
96////////////////////////////////////////////////////////////////
97
98void Sc01DetectorConstruction::SwitchDetector()
99{
100  G4RunManager::GetRunManager()->DefineWorldVolume(PhysicalVolume);
101}
102
103///////////////////////////////////////////////////////////////
104
105G4VPhysicalVolume*
106Sc01DetectorConstruction::SelectDetector( const G4String& val )
107{
108
109  // fHallSize = 2.8*m;
110  fHallSize = 4.8*m;
111
112  G4Box * Hall
113          = new G4Box("Hall", fHallSize,fHallSize,fHallSize );
114
115  G4LogicalVolume * Hall_log
116          = new G4LogicalVolume (Hall, Water, "Hall_L", 0,0,0);
117
118  PhysicalVolume
119          = new G4PVPlacement(0,G4ThreeVector(),"Hall_P",Hall_log,0,false,0);
120
121 
122
123  G4Box* b1 = new G4Box ( "b1", 100*cm, 50*cm, 50*cm );
124  G4Box* b2 = new G4Box ( "b2", 50*cm, 100*cm, 50*cm );
125
126  if (val == "Sphere")
127  {
128      aVolume = new G4Sphere ( "aSphere", 80.0*cm, 100.0*cm, 
129                          0.0*deg, 300.0*deg,10.0*deg, 130.0*deg);
130
131    //    aVolume = new G4Sphere("aSphere", 2400*mm, 2404*mm,
132    //                          -7.349220986995449*deg,
133    //                          14.6984419739909*deg,
134    //                          80.16372565937344*deg,
135    //                          19.67254868125311*deg      );
136  }
137  else if (val == "Orb")
138  {
139   aVolume = new G4Orb ( "aOrb", 10.0*cm );
140  }
141  else if (val == "Box") 
142  {         
143    aVolume = new G4Box ( "aBox", 10*cm, 10*cm, 10*cm );
144  }
145  else if (val == "Cone")
146  {       
147    aVolume = new G4Cons ( "aCone", 2*cm, 6*cm, 8*cm, 14*cm,
148                           10*cm, 10*deg, 300*deg ); 
149  //  10*cm, 10*deg, 300*deg );
150                           //  0., pi);
151  }
152  else if (val == "manyCons")
153  {       
154    aVolume = new G4Cons ( "aCone", 2*cm, 6*cm, 8*cm, 14*cm,
155                           10*cm, 10*deg, 300*deg ); 
156  //  10*cm, 10*deg, 300*deg );
157                           //  0., pi);
158
159 
160  }
161  else if (val == "Tube")
162  {
163    //  aVolume = new G4Tubs ( "aTube", 5*cm, 10*cm, 7*cm, 70*deg, 100*deg);
164    //    aVolume = new G4Tubs ( "aTube", 5*cm, 10*cm, 7*cm, 10*deg, 300*deg);
165    aVolume = new G4Tubs ( "aTube", 0.*mm, 1300*mm, 2700*mm,
166                                    0.*deg, 360*deg );
167  }
168  else if (val == "Hype")
169  {
170    aVolume = new G4Hype ("aHype", 10*cm, 20*cm, 0*deg, 360*deg, 10*cm );
171  }
172  else if (val == "Torus")
173  {
174    // aVolume = new G4Torus ("aTorus", 10*cm, 15*cm, 20*cm, 0*deg, 60*deg);
175    aVolume = new G4Torus ("aTorus", 25*cm, 26*cm, 290*cm, 0*deg, 90*deg);
176    G4LogicalVolume* aVolume_log  = new G4LogicalVolume(aVolume, Water1, "aVolume_L", 0,0,0);
177    G4RotationMatrix* rot = new G4RotationMatrix();
178    rot->rotateX(-90*degree);
179    // G4VPhysicalVolume * aVolume_phys1 =
180      new G4PVPlacement(rot,G4ThreeVector(0*cm, 0*cm, 0*cm),val, 
181                        aVolume_log, PhysicalVolume, false, 0);
182  }
183  else if (val == "Para")
184  {
185    aVolume = new G4Para ("aPara", 8*cm, 10*cm, 12*cm, 30*deg, 45*deg, 60*deg);
186  }
187  else if (val == "Trd")
188  {
189    aVolume = new G4Trd ("aTrd", 80*cm, 100*cm, 70*cm, 90*cm, 100*cm);
190  }
191  else if (val == "b1Ub2") 
192  {         
193    aVolume = new G4UnionSolid("b1Ub2",b1,b2);
194    /*
195    G4Box * box1 = new G4Box("Box1",1092.500000,240.103374,92.000000);
196    G4Box * box2 = new G4Box("Box2",540.103374,792.500000,92.000000);
197
198    G4double L1 = 1104;
199
200    aVolume =
201    new G4UnionSolid("ECShapeBoxes",
202                     box1,
203                     box2,
204                     0,
205                     G4ThreeVector(-L1/2.,
206                                   L1/2.,
207                                   0.));
208    */
209  }
210  else if (val == "b1Ib2") 
211  {         
212    aVolume = new G4IntersectionSolid("b1Ib2",b1,b2);
213  }
214  else if (val == "b1Sb2") 
215  {         
216    aVolume = new G4SubtractionSolid("b1Sb2",b1,b2);
217  }
218  else if (val == "b1Ib1") 
219  {         
220    aVolume = new G4IntersectionSolid("b1Ib1",b1,b1);
221  }
222  else if (val == "b1Ub1") 
223  {         
224    aVolume = new G4UnionSolid("b1Ub1",b1,b1);
225  }
226  else if (val == "b1Sb1") 
227  {         
228    aVolume = new G4SubtractionSolid("b1Sb1",b1,b1);
229  }
230  else if (val == "TwistedBox")
231  {
232    aVolume = new G4TwistedBox("aTwistedBox",40*deg,5*cm,8*cm,15*cm) ;
233  }
234  else if (val == "TwistedTrd")
235  {
236    aVolume = new G4TwistedTrd("aTwistedTrd",5*cm,10*cm,8*cm,15*cm,18*cm,20*deg);
237  }
238  else if (val == "TwistedTrap")
239  {
240    aVolume = new G4TwistedTrap("aTwistedTrap",40*deg,5*cm,7*cm,8*cm,15*cm);
241  }
242  else if ( val == "TwistedTrap2") 
243  {
244    aVolume = new G4TwistedTrap("aTwistedTrap2",
245                                20*deg,    // twist angle
246                                80*cm,         // half z length
247                                10*deg,      // direction between end planes
248                                40*deg,        // defined by polar and azimutal angles.
249                                8*cm,        // half y length at -pDz
250                                11*cm,        // half x length at -pDz,-pDy
251                                16*cm,        // half x length at -pDz,+pDy
252                                8*cm,        // half y length at +pDz
253                                11*cm,         // half x length at +pDz,-pDy
254                                16*cm,        // half x length at +pDz,+pDy
255                                -50*deg        // tilt angle at +pDz
256                                ) ;
257  }
258
259  else
260  {
261    //   G4Exception("Sc01DetectorConstruction::SelectDetector() - Invalid shape!");
262  }
263  if(val == "manyCons")
264  {
265
266    G4Cons* cons1 = new G4Cons ( "cons1", 2*cm, 3*cm, 4*cm, 6*cm,
267                           10*cm, 0*deg, 360*deg );
268    G4Cons* cons2 = new G4Cons ( "cons2", 3*cm, 4*cm, 6*cm, 8*cm,
269                           10*cm, 0*deg, 360*deg );
270    G4Cons* cons3 = new G4Cons ( "cons3", 4*cm, 5*cm, 8*cm, 10*cm,
271                           10*cm, 0*deg, 360*deg );
272
273    G4LogicalVolume* lcons1 = new G4LogicalVolume(cons1, Water1,"lcons1",0,0,0);
274    G4LogicalVolume* lcons2 = new G4LogicalVolume(cons2, Water1,"lcons2",0,0,0);
275    G4LogicalVolume* lcons3 = new G4LogicalVolume(cons3, Water1,"lcons3",0,0,0);
276
277    // G4VPhysicalVolume * pcons1 =
278    new G4PVPlacement(0,G4ThreeVector(0*cm, 0*cm, 0*cm),
279                      "pcons1",lcons1,PhysicalVolume, false, 0); 
280    // G4VPhysicalVolume * pcons2 =
281    new G4PVPlacement(0,G4ThreeVector(0*cm, 0*cm, 0*cm),
282                      "pcons2",lcons2,PhysicalVolume, false, 0); 
283    // G4VPhysicalVolume * pcons3 =
284    new G4PVPlacement(0,G4ThreeVector(0*cm, 0*cm, 0*cm),
285                      "pcons3",lcons3,PhysicalVolume, false, 0); 
286  } 
287  else
288  {
289    G4Torus* solidFiber =
290      new G4Torus("clad",0.,1.*cm,10.*cm,0.*deg,180.*deg);    // external
291
292    G4Torus* solidCore =
293      new G4Torus("core",0.,0.5*cm,10.*cm,0.*deg,180.*deg); // internal
294
295    G4LogicalVolume* logicFiber =
296    new G4LogicalVolume(solidFiber,Water1,"FiberClad",0,0,0);
297
298    G4LogicalVolume* logicCore =
299    new G4LogicalVolume(solidCore,Water1,"FiberCore",0,0,0);
300
301  G4VPhysicalVolume * aVolume_phys1 =
302  new G4PVPlacement(0,0,logicFiber,"FiberClad",Hall_log,false,0);
303
304  // G4VPhysicalVolume * aVolume_phys2 =
305  // new G4PVPlacement(0,0,logicCore,"FiberCore",logicFiber,false,0);
306  new G4PVPlacement(0,0,"FiberCore",logicCore,aVolume_phys1,false,0);
307
308  /*
309  G4LogicalVolume* aVolume_log
310
311    //  = new G4LogicalVolume(aVolume, Water1, "aVolume_L", 0,0,0);
312
313    //  =  GetConePolycone();
314   
315  G4VPhysicalVolume * aVolume_phys1
316    = new G4PVPlacement(0,G4ThreeVector(0*cm, 0*cm, 0*cm),val,
317                        aVolume_log, PhysicalVolume, false, 0);
318
319
320  */
321//--------- Visualization attributes -------------------------------
322
323  //  G4VisAttributes* BoxVisAtt= new G4VisAttributes(G4Colour(1.0,1.0,1.0));
324  //  Hall_log  ->SetVisAttributes(BoxVisAtt);
325  Hall_log  ->SetVisAttributes (G4VisAttributes::Invisible);
326
327  // aVolume_log ->SetVisAttributes(BoxVisAtt);
328  // logicTracker->SetVisAttributes(BoxVisAtt);
329
330  // G4VisAttributes* ChamberVisAtt = new G4VisAttributes(G4Colour(0.0,1.0,0.0));
331  //  aVolume_log->SetVisAttributes(ChamberVisAtt);
332
333//--------- example of User Limits -------------------------------
334
335
336
337  /*
338  G4VPhysicalVolume * aVolume_phys1
339    = new G4PVPlacement(0,G4ThreeVector(50*cm, 0*cm, 0*cm),val,
340                        aVolume_log, PhysicalVolume, false, 0);
341  G4VPhysicalVolume * aVolume_phys2
342    = new G4PVPlacement(0,G4ThreeVector(-50*cm, 0*cm, 0*cm),val,
343                        aVolume_log, PhysicalVolume, false, 0);
344  G4VPhysicalVolume * aVolume_phys3
345    = new G4PVPlacement(0,G4ThreeVector(0*cm, 50*cm, 0*cm),val,
346                        aVolume_log, PhysicalVolume, false, 0);
347  G4VPhysicalVolume * aVolume_phys4
348    = new G4PVPlacement(0,G4ThreeVector(0*cm, -50*cm, 0*cm),val,
349                        aVolume_log, PhysicalVolume, false, 0);
350  G4VPhysicalVolume * aVolume_phys5
351    = new G4PVPlacement(0,G4ThreeVector(0*cm, 0*cm, 50*cm),val,
352                        aVolume_log, PhysicalVolume, false, 0);
353  G4VPhysicalVolume * aVolume_phys6
354    = new G4PVPlacement(0,G4ThreeVector(0*cm, 0*cm, -50*cm),val,
355                    aVolume_log, PhysicalVolume, false, 0);
356  */
357
358  // ------------ Surfaces definition ------------------
359
360//  G4LogicalBorderSurface* BorderSurfaces[12];   
361  G4LogicalBorderSurface* BorderSurfaces[2];   
362 
363BorderSurfaces[0] = new G4LogicalBorderSurface("VolumeSurface",
364                               PhysicalVolume,
365                               aVolume_phys1,
366                               aSurface);
367
368  BorderSurfaces[6] = new G4LogicalBorderSurface("VolumeSurface",
369                               aVolume_phys1,
370                               PhysicalVolume,
371                               aSurface);
372/*
373  BorderSurfaces[1] = new G4LogicalBorderSurface("VolumeSurface",
374                               PhysicalVolume,
375                               aVolume_phys2,
376                               aSurface);
377  BorderSurfaces[2] = new G4LogicalBorderSurface("VolumeSurface",
378                               PhysicalVolume,
379                               aVolume_phys3,
380                               aSurface);
381  BorderSurfaces[3] = new G4LogicalBorderSurface("VolumeSurface",
382                               PhysicalVolume,
383                               aVolume_phys4,
384                               aSurface);
385  BorderSurfaces[4] = new G4LogicalBorderSurface("VolumeSurface",
386                               PhysicalVolume,
387                               aVolume_phys5,
388                               aSurface);
389  BorderSurfaces[5] = new G4LogicalBorderSurface("VolumeSurface",
390                               PhysicalVolume,
391                               aVolume_phys6,
392                               aSurface);
393  BorderSurfaces[6] = new G4LogicalBorderSurface("VolumeSurface",
394                               aVolume_phys1,
395                               PhysicalVolume,
396                               aSurface);
397  BorderSurfaces[7] = new G4LogicalBorderSurface("VolumeSurface",
398                               aVolume_phys2,
399                               PhysicalVolume,
400                               aSurface);
401  BorderSurfaces[8] = new G4LogicalBorderSurface("VolumeSurface",
402                               aVolume_phys3,
403                               PhysicalVolume,
404                               aSurface);
405  BorderSurfaces[9] = new G4LogicalBorderSurface("VolumeSurface",
406                               aVolume_phys4,
407                               PhysicalVolume,
408                               aSurface);
409  BorderSurfaces[10] = new G4LogicalBorderSurface("VolumeSurface",
410                               aVolume_phys5,
411                               PhysicalVolume,
412                               aSurface);
413  BorderSurfaces[11] = new G4LogicalBorderSurface("VolumeSurface",
414                               aVolume_phys6,
415                               PhysicalVolume,
416                               aSurface);
417*/
418  }
419  G4cout << "You select " << val << " detector" << G4endl;
420
421  return PhysicalVolume;
422}
423
424
425
426G4VPhysicalVolume* Sc01DetectorConstruction::SelectTubeSector()
427{
428  G4double a,z,density;
429
430  G4Material* Al =
431    new G4Material("Aluminum", z=13., a=26.98*g/mole, density=1.782*mg/cm3);
432
433  G4Material* Vacuum =
434    new G4Material("Galactic", z=1., a=1.01*g/mole,density= universe_mean_density,
435                   kStateGas, 3.e-18*pascal, 2.73*kelvin);
436
437
438
439
440  G4int i, sections_ = 12; // 12;
441
442  G4double cof, dPhi, sPhi;
443
444  sPhi = twopi/sections_;
445  cof = 1.;
446  dPhi = cof*sPhi;
447
448  G4cout<<"sections_ = "<<sections_<<G4endl;
449
450  G4double lab_x = 20.0*m;
451  G4double lab_y = 20.0*m;
452  G4double lab_z = 20.0*m;
453
454  fHallSize = lab_x;
455
456  G4cout<<"m = "<<m<<"; degree = "<<degree<<G4endl;
457
458  // world volume
459
460  G4Box* lab_S = new G4Box("lab",lab_x,lab_y,lab_z);
461
462  G4LogicalVolume*  lab_L = new G4LogicalVolume(lab_S,
463                              Vacuum, "lab", 0, 0, 0);
464
465  // tube section
466
467  G4Tubs* arcSection_S = new G4Tubs("arcSection",
468                              6.*m, 10.*m, 2.*m,
469                              0., dPhi            );
470
471  G4cout<<"dPhi = "<<dPhi<<G4endl;
472
473  G4LogicalVolume* arcSection_L = new G4LogicalVolume(arcSection_S,
474                                     Al, "arcSection", 0, 0, 0);
475
476  for( i = 0; i < sections_; i++)
477  {
478    G4RotationMatrix rot;
479    rot.rotateZ( sPhi*i );
480
481    G4cout<<"i = "<<i<<";  i*sPhi = "<<i*sPhi<<G4endl;
482
483    G4cout<<"cos(i*sPhi)= "<<std::cos(i*sPhi)
484          <<";  std::sin(i*sPhi) = "<<std::sin(i*sPhi)<<G4endl<<G4endl;
485
486    G4cout<<rot.xx()<<"\t\t"<<rot.xy()<<"\t\t"<<rot.xz()<<G4endl;
487    G4cout<<rot.yx()<<"\t\t"<<rot.yy()<<"\t\t"<<rot.yz()<<G4endl;
488    G4cout<<rot.zx()<<"\t\t"<<rot.zy()<<"\t\t"<<rot.zz()<<G4endl<<G4endl;
489
490    G4Transform3D transf(rot, G4ThreeVector() );
491
492    // G4VPhysicalVolume* arcSection_P =
493    new G4PVPlacement(transf, arcSection_L,
494                      "section", lab_L, false, i, true);
495  } 
496  G4VPhysicalVolume* lab_P= new G4PVPlacement(0, G4ThreeVector(),
497                           lab_L, "lab", 0, false, 0);
498
499  G4VisAttributes* labVisAtt = new G4VisAttributes(G4Colour());
500  labVisAtt -> SetVisibility(1);
501  lab_L -> SetVisAttributes(labVisAtt);
502
503  G4VisAttributes* aSVisAtt =
504  new G4VisAttributes(G4Colour(1.0,0.0,0.0,1.0));
505  aSVisAtt -> SetForceWireframe(1);
506  arcSection_L -> SetVisAttributes(aSVisAtt);
507
508  return lab_P;
509
510}
511
512///////////////////////////////////////////////////////////////////////
513//
514//
515
516G4LogicalVolume* Sc01DetectorConstruction::GetConePolycone()
517{
518
519  G4double cryoMotherZplan[] = {-3490.*mm,
520                              -2850.*mm,
521                              -2849.*mm, 
522                               2849.*mm, 
523                               2850.*mm, 
524                               3490.*mm};
525
526  G4double cryoMotherRin[]   = { 1149.8*mm, 
527                               1149.8*mm,
528                               1149.8*mm,
529                               1149.8*mm,
530                               1149.8*mm,
531                               1149.8*mm};
532
533  G4double cryoMotherRout[]  = { 2890.*mm, 
534                               2890.*mm,
535                               2250.*mm,
536                               2250.*mm,
537                               2890.*mm,
538                               2890.*mm}; 
539
540  // LArVG4DetectorParameters* parameters = LArVG4DetectorParameters::GetInstance();
541
542  // Get the z-Shift from the detector parameters routine.
543
544  G4double zShift = 4.*cm;               // parameters->GetValue("LArEMECZshift");
545
546   // Adjust mother volume size.
547
548G4int lastPlaneCryo = ( sizeof(cryoMotherZplan) / sizeof(G4double) );
549
550cryoMotherZplan[lastPlaneCryo-1] += zShift;
551
552cryoMotherZplan[0] -= zShift;
553
554G4String cryoMotherName = "LAr::Barrel::Cryostat::MotherVolume";
555
556G4Polycone* cryoMotherShape =
557   new G4Polycone(cryoMotherName,          // name
558                   0.,                     // starting phi
559                   twopi,                  // total phi
560                   lastPlaneCryo,          // number of z planes
561                   cryoMotherZplan,        // position of z planes   
562                   cryoMotherRin,          // tangent distance to inner surface
563                   cryoMotherRout );       // tangent distance to outer surface
564
565
566
567 G4LogicalVolume* lvPolycone = new G4LogicalVolume(cryoMotherShape,
568                                                   Water1,
569                                                  "lvPolycone");
570
571
572// #  Material  Zmin     Dz     Rmin1     Rmax1     Rmin2    Rmax2
573// { 11,  Al, 316.000,  22.500, 120.800, 122.021, 140.779, 142.000},
574
575// the cone is positioned at Zmin+Dz, hence 316cm+22.5cm...
576
577  G4Cons* coneATLAS = new G4Cons("coneATLAS",120.8*cm, 122.021*cm, 
578                                            140.779*cm, 142.0*cm,
579                                            22.5*cm/2., 0., 2*pi              );
580
581  G4LogicalVolume* lvCone = new G4LogicalVolume(coneATLAS,
582                                       Water1,
583                                      "lvCone");
584
585// G4VPhysicalVolume*  pvCone =
586    new G4PVPlacement(0, G4ThreeVector( 0, 0, 316.0*cm + 22.5*cm ),
587                                       lvCone ,
588                                      "pvCone",
589                                       lvPolycone,
590                                       false,
591                                       0                );
592
593
594  G4VisAttributes* ChamberVisAtt = new G4VisAttributes(G4Colour(1.0,1.0,0.0));
595  lvCone->SetVisAttributes(ChamberVisAtt);
596
597  return lvPolycone;
598}
599
600
601
602void Sc01DetectorConstruction::SetMaterial()
603{
604  G4String name, symbol;
605  G4double density = 1.00*g/cm3;
606  G4double a, iz;
607  Water = new G4Material(name="Water", density, 2);
608  Water1 = new G4Material(name="Water1", density, 2);
609  a = 1*g/mole;
610  G4Element* elH = new G4Element(name="Hydrogen", symbol="H", iz=1., a);
611  a = 16.00*g/mole;
612  G4Element* elO = new G4Element(name="Oxygen", symbol="O", iz=8., a);
613
614  Water->AddElement(elH, .66);
615  Water->AddElement(elO, .34);
616  Water1->AddElement(elH, .66);
617  Water1->AddElement(elO, .34);
618
619  const G4int NUMENTRIES = 5;
620  G4double RINDEX_WATER [NUMENTRIES];
621  G4double RINDEX_WATER1 [NUMENTRIES];
622  G4double REFLECTIVITY [NUMENTRIES];
623  G4double EFFICIENCY [NUMENTRIES];
624 
625  for (int i=0; i<NUMENTRIES; i++) {
626    RINDEX_WATER1[i]=5.0;
627    RINDEX_WATER[i]=1.33;
628    REFLECTIVITY[i]=0.9;
629    EFFICIENCY[i]=1.0;
630  } 
631  G4double PHENERGY[NUMENTRIES] =
632            { 0.0, 1.0, 2.0, 3.0, 4.0};
633  G4MaterialPropertiesTable *WaterMPT = new G4MaterialPropertiesTable();
634  G4MaterialPropertiesTable *WaterMPT1 = new G4MaterialPropertiesTable();
635  WaterMPT->AddProperty("RINDEX", PHENERGY, RINDEX_WATER, NUMENTRIES);
636  WaterMPT1->AddProperty("RINDEX", PHENERGY, RINDEX_WATER1, NUMENTRIES);
637  Water->SetMaterialPropertiesTable(WaterMPT);
638  Water1->SetMaterialPropertiesTable(WaterMPT1);
639
640  aSurface = new G4OpticalSurface ( "aSurface" );
641  aSurface->SetType(dielectric_metal);
642  aSurface->SetFinish(polishedfrontpainted);
643  aSurface->SetModel(glisur); 
644  G4MaterialPropertiesTable* SurfaceMPT = new G4MaterialPropertiesTable();
645  SurfaceMPT->AddProperty("REFLECTIVITY", PHENERGY, REFLECTIVITY, NUMENTRIES);
646  SurfaceMPT->AddProperty("EFFICIENCY", PHENERGY, EFFICIENCY, NUMENTRIES);
647  aSurface->SetMaterialPropertiesTable ( SurfaceMPT );
648}
649
650G4VPhysicalVolume* Sc01DetectorConstruction::Construct()
651{
652  SetMaterial();
653
654  //-------------------Hall ----------------------------------
655  // return SelectTubeSector(); 
656  return SelectDetector ("Torus");
657}
658
659
Note: See TracBrowser for help on using the repository browser.