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