source: trunk/source/graphics_reps/test/BuildCalorimeter.hh@ 1290

Last change on this file since 1290 was 1274, checked in by garnier, 16 years ago

update...

File size: 4.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//
27// $Id: BuildCalorimeter.hh,v 1.4 2006/06/29 19:07:35 gunter Exp $
28// GEANT4 tag $Name: $
29//
30#ifndef BUILDCALORIMETER_HH
31#define BUILDCALORIMETER_HH
32
33#include "G4PVPlacement.hh"
34#include "G4LogicalVolume.hh"
35#include "G4Box.hh"
36#include "G4Tubs.hh"
37#include "G4Material.hh"
38#include "G4VisAttributes.hh"
39
40G4VPhysicalVolume* BuildCalorimeter()
41{
42 G4double offset=22.5,xTlate,yTlate;
43 G4int i,j,copyNo;
44 G4double z = 13.;
45 G4double a = 26.98*g/mole;
46 G4double density = 2.7*g/cm3;
47 G4Material myMaterial("Aluminium", z, a, density);
48
49 G4VisAttributes* red = new G4VisAttributes (G4Colour(1,0,0));
50 G4VisAttributes* green = new G4VisAttributes (G4Colour(0,1,0));
51 G4VisAttributes* blue = new G4VisAttributes (G4Colour(0,0,1));
52
53 G4Box *myWorldBox= new G4Box ("WBox",10000,10000,10000);
54 G4Box *myCalBox = new G4Box ("CBox",1500,1500,1000);
55// G4Tubs *myTargetTube = new G4Tubs ("TTube",0,22.5,1000,0,360);
56 G4Tubs *myTargetTube = new G4Tubs ("TTube",0,22.5,100,0,360);
57
58 G4LogicalVolume *myWorldLog=new G4LogicalVolume(myWorldBox,&myMaterial,
59 "WLog",0,0,0);
60 G4LogicalVolume *myCalLog=new G4LogicalVolume(myCalBox,&myMaterial,
61 "CLog",0,0,0);
62 myCalLog -> SetVisAttributes (green);
63 G4LogicalVolume *myTargetLog=new G4LogicalVolume(myTargetTube,&myMaterial,
64 "TLog",0,0,0);
65 myTargetLog -> SetVisAttributes (blue);
66
67 G4PVPlacement *myWorldPhys=new G4PVPlacement(0,G4ThreeVector(),
68 "WPhys",
69 myWorldLog,
70 0,false,0);
71 G4PVPlacement *myCalPhys=new G4PVPlacement(0,G4ThreeVector(),
72 "CalPhys",
73 myCalLog,
74 myWorldPhys,false,0);
75
76 G4String tName1("TPhys1"); // Allow all target physicals to share
77 // same name (delayed copy)
78 copyNo=0;
79 //for (j=1;j<=25;j++)
80 for (j=1;j<=3;j++)
81 {
82 yTlate=-1000.0-40.0+j*80.0;
83
84 //for (i=1;i<=50;i++)
85 for (i=1;i<=5;i++)
86 {
87 copyNo++;
88 xTlate=-1000.0-20.0+i*45.0-offset;
89 G4PVPlacement *myTargetPhys=new G4PVPlacement(0,G4ThreeVector(xTlate,yTlate,0),
90 tName1,
91 myTargetLog,
92 myCalPhys,
93 false,
94 copyNo);
95 }
96 }
97
98 G4String tName2("TPhys2"); // Allow all target physicals to share
99 // same name (delayed copy)
100 copyNo=0;
101 //for (j=1;j<=26;j++)
102 for (j=1;j<=4;j++)
103 {
104 yTlate=-1000.0-80.0+j*80.0;
105 //for (i=1;i<=50;i++)
106 for (i=1;i<=5;i++)
107 {
108 copyNo++;
109 xTlate=-1000.0-20.0+i*45.0;
110 G4PVPlacement *myTargetPhys=new G4PVPlacement(0,G4ThreeVector(xTlate,yTlate,0),
111 tName2,
112 myTargetLog,
113 myCalPhys,
114 false,
115 copyNo);
116 }
117 }
118
119 return myWorldPhys;
120}
121#endif
122
123
124
Note: See TracBrowser for help on using the repository browser.