Geant4_10
FCALCryostatVolumes.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 // Author: Mathieu Fontaine Rachid Mazini
27 // fontaine@lps.umontreal.ca Rachid.Mazini@cern.ch
28 // Language: C++
29 // Tested on : g++
30 // Prerequisites: None
31 // Purpose: Source file defining the differents volumes
32 // in the cryostat
33 // Developped: 10-March-2000 M.F.
34 //
35 //-----------------------------------------------------------------------------
36 
37 #include "FCALCryostatVolumes.hh"
38 
40 
41 #include "FCALEMModule.hh"
42 #include "FCALHadModule.hh"
43 
44 #include "G4PhysicalConstants.hh"
45 #include "G4SystemOfUnits.hh"
46 #include "G4Box.hh"
47 #include "G4Tubs.hh"
48 #include "G4Trd.hh"
49 #include "G4LogicalVolume.hh"
50 #include "G4VPhysicalVolume.hh"
51 #include "G4PVPlacement.hh"
52 #include "G4SubtractionSolid.hh"
53 
54 #include "G4ThreeVector.hh"
55 #include "G4RotationMatrix.hh"
56 #include "G4VisAttributes.hh"
57 #include "G4Colour.hh"
58 
60 {
61 #include "FCALCryostatVolumesParameters.input"
62 }
63 
65 
67 {
68 
69  //-----------------------------
70  // construction of materials
71  //-----------------------------
72 
73  FCALMaterialConsultant * FCALMaterials = new FCALMaterialConsultant();
74 
75  FCALMaterials->construct();
76 
77 
78 //-----------------------------------------
79 // G4VisAttributes * ColorOfIron = new G4VisAttributes(G4Colour(0.3,0.3,0.3));
80  G4VisAttributes * ColorOfLead = new G4VisAttributes(G4Colour(0.5,0.5,0.5));
81  G4VisAttributes * ColorOfAir = new G4VisAttributes(G4Colour(1.,1.,1.));
82 // G4VisAttributes * ColorOfLarg = new G4VisAttributes(G4Colour(1.0, 1.0, 0.0));
83 
84 
85  //-----------------------------
86  // Cryostat
87  //-----------------------------
88  G4Tubs * SolidCryostat =
89  new G4Tubs("CryostatSolid", CryostatRMin, CryostatRMax, CryostatLenght,
90  StartingPhi, DPhi);
91  G4LogicalVolume * LogicalCryostat =
92  new G4LogicalVolume(SolidCryostat,FCALMaterials->Material("Iron"),
93  "CryostatLogical");
94 
95  // LogicalCryostat->SetVisAttributes(ColorOfIron);
97 
98 
99  //------------------------------
100  // Insulation
101  //------------------------------
102  G4Tubs * SolidInsulation =
103  new G4Tubs("InsulationSolid", InsulationRMin, InsulationRMax,
104  InsulationLenght, StartingPhi, DPhi);
105  G4LogicalVolume * LogicalInsulation =
106  new G4LogicalVolume(SolidInsulation, FCALMaterials->Material("Air"),
107  "InsulationLogical");
108 // G4VPhysicalVolume * PhysicalInsulation =
109  new G4PVPlacement(0, G4ThreeVector(), LogicalInsulation, "InsulationPhysical",
110  LogicalCryostat, 0, 0);
111 
112  LogicalInsulation->SetVisAttributes(ColorOfAir);
113  // LogicalInsulation->SetVisAttributes(G4VisAttributes::Invisible);
114 
115 
116  //-------------------------------------
117  // Air to replace Iron inside Cryostat
118  //-------------------------------------
119  /*
120  G4Tubs * SolidAirCryostat =
121  new G4Tubs("AirCryostatSolid", CryostatRMin, LArgRMax, CryostatLength,
122  StartingPhi, DPhi);
123  G4LogicalVolume * LogicalAirCryostat =
124  new G4LogicalVolume(SolidAirCryostat, FCALMaterials->Material("Air"),
125  "AirCryostatLogical");
126  G4VPhysicalVolume * PhysicalAirCryostat =
127  new G4PVPlacement(0, 0, LogicalAirCryostat, "AirCryostatPhysical",
128  LogicalCryostat, 0, 0);
129 
130  LogicalAirCryostat->SetVisAttributes(ColorOfAir);
131  // LogicalAirCryostat->SetVisAttributes(G4VisAttributes::Invisible);
132  */
133 
134 
135  //--------------------
136  // Liquid Argon
137  //--------------------
138  G4Tubs * SolidLArg =
139  new G4Tubs("LArgSolid", LArgRMin, LArgRMax, LArgLenght,StartingPhi,DPhi);
140  G4LogicalVolume * LogicalLArg =
141  new G4LogicalVolume(SolidLArg, FCALMaterials->Material("LiquidArgon"),
142  "LArgLogical");
143  G4VPhysicalVolume * PhysicalLArg =
144  new G4PVPlacement(0,G4ThreeVector(LArgPosX, LArgPosY, LArgPosZ),
145  LogicalLArg, "LArgPhysical", LogicalCryostat, 0,0);
146 
147  // LogicalLArg->SetVisAttributes(ColorOfLarg);
149 
150  //-------------------
151  // Front Excluder
152  //-------------------
153  G4Box * SolidFrontExcluder =
154  new G4Box("FrontExcluderSolid", FrontExcluderSizeX, FrontExcluderSizeY,
155  FrontExcluderSizeZ);
156  G4LogicalVolume * LogicalFrontExcluder =
157  new G4LogicalVolume(SolidFrontExcluder, FCALMaterials->Material("Air")
158  , "FrontExcluderLogical");
159 
160 // G4VPhysicalVolume * PhysicalFrontExcluder =
161  new G4PVPlacement(0,G4ThreeVector(FrontExcluderPosX, FrontExcluderPosY,
162  FrontExcluderPosZ), "FrontExcluderPhysical",
163  LogicalFrontExcluder, PhysicalLArg, 0,0);
164 
165  LogicalFrontExcluder->SetVisAttributes(ColorOfLead);
166  // LogicalFrontExcluder->SetVisAttributes(G4VisAttributes::Invisible);
167 
168 
169  //--------------------
170  // Back Excluder
171  //--------------------
172  G4Trd * SolidBackExcluder =
173  new G4Trd("BackExcluderSolid", BackExcluderSize1X, BackExcluderSize2X,
174  BackExcluderSize1Y, BackExcluderSize2Y, BackExcluderSizeZ);
175  G4LogicalVolume * LogicalBackExcluder =
176  new G4LogicalVolume(SolidBackExcluder, FCALMaterials->Material("Air"),
177  "BackExcluderLogical");
178 
179  G4RotationMatrix * BackExcluderRotationMatrix = new G4RotationMatrix();
180  BackExcluderRotationMatrix->rotateX(BackExcluderRotX);
181 
182 // G4VPhysicalVolume * PhysicalBackExcluder =
183  new G4PVPlacement(BackExcluderRotationMatrix,
184  G4ThreeVector(BackExcluderPosX, BackExcluderPosY,
185  BackExcluderPosZ), "BackExcluder", LogicalBackExcluder,
186  PhysicalLArg, 0,0);
187 
188  LogicalBackExcluder->SetVisAttributes(ColorOfLead);
189  // LogicalBackExcluder->SetVisAttributes(G4VisAttributes::Invisible);
190 
191 
192  //------------------------
193  // fcal envelope
194  //------------------------
195  G4Tubs * SolidFCALEnvelope =
196  new G4Tubs("FCALEnvelopeSolid", FCALEnvelopeRMin, FCALEnvelopeRMax,
197  FCALEnvelopeLenght, FCALEnvelopeStartPhi, FCALEnvelopeDPhi);
198 
199  G4LogicalVolume * LogicalFCALEnvelope =
200  new G4LogicalVolume(SolidFCALEnvelope, FCALMaterials->Material("LiquidArgon"),
201  "FCALEnvelopeLogical");
202 
203  G4RotationMatrix * FCALRotationMatrix = new G4RotationMatrix();
204  FCALRotationMatrix->rotateX(FCALEnvelopeRotX);
205  // FCALRotationMatrix->rotateY(FCALEnvelopeRotY);
206 
207 // G4VPhysicalVolume * PhysicalFCALEnvelopp =
208  new G4PVPlacement(FCALRotationMatrix,
209  G4ThreeVector(FCALEnvelopePosX,FCALEnvelopePosY,FCALEnvelopePosZ)
210  , LogicalFCALEnvelope, "FCALEnvelopePhysical", LogicalLArg, 0,0);
211 
212  //LogicalFCALEnvelope->SetVisAttributes(ColorOfIron);
213  LogicalFCALEnvelope->SetVisAttributes(G4VisAttributes::Invisible);
214 
215  //-----------------------------
216  // FCAL electromagnetic Module
217  //-----------------------------
218  EmModule = new FCALEMModule();
219  G4LogicalVolume * LogicalFCALEmModule = EmModule->Construct();
220 
221  G4RotationMatrix * EmModuleRot = new G4RotationMatrix();
222  EmModuleRot->rotateZ(ModuleRotZ);
223 
224 // G4VPhysicalVolume * PhysicalFCALEmModule =
225  new G4PVPlacement(EmModuleRot,
226  G4ThreeVector(FCALEmModulePosX,FCALEmModulePosY,FCALEmModulePosZ),
227  LogicalFCALEmModule,"FCALEmModulePhysical",LogicalFCALEnvelope,0,0);
228 
229 
230  //-----------------------------
231  // hadronic fcal
232  //----------------------------
233  HadModule = new FCALHadModule();
234  G4LogicalVolume * LogicalFCALHadModule = HadModule->Construct();
235 
236  G4RotationMatrix * HadModuleRot = new G4RotationMatrix();
237  HadModuleRot->rotateZ(ModuleRotZ);
238 
239 // G4VPhysicalVolume * PhysicalFCALHadModule =
240  new G4PVPlacement(HadModuleRot,
241  G4ThreeVector(FCALHadModulePosX,FCALHadModulePosY,FCALHadModulePosZ),
242  LogicalFCALHadModule, "FCALHadModulePhysical",LogicalFCALEnvelope,0,0);
243 
244 
245 
246  //-------------------------
247  // Returning the mother
248  //-------------------------
249 
250  return LogicalCryostat;
251 
252 }
CLHEP::Hep3Vector G4ThreeVector
CLHEP::HepRotation G4RotationMatrix
Definition: G4Box.hh:63
static FCALMaterialConsultant * construct()
Definition: G4Tubs.hh:84
G4LogicalVolume * Construct()
G4LogicalVolume * Construct()
Definition: G4Trd.hh:71
G4Material * Material(G4String)
G4LogicalVolume * Construct()
static const G4VisAttributes Invisible
HepRotation & rotateZ(double delta)
Definition: Rotation.cc:92
void SetVisAttributes(const G4VisAttributes *pVA)