Geant4 Cross Reference |
1 // 1 // 2 // ******************************************* 2 // ******************************************************************** 3 // * License and Disclaimer 3 // * License and Disclaimer * 4 // * 4 // * * 5 // * The Geant4 software is copyright of th 5 // * The Geant4 software is copyright of the Copyright Holders of * 6 // * the Geant4 Collaboration. It is provided 6 // * the Geant4 Collaboration. It is provided under the terms and * 7 // * conditions of the Geant4 Software License 7 // * conditions of the Geant4 Software License, included in the file * 8 // * LICENSE and available at http://cern.ch/ 8 // * LICENSE and available at http://cern.ch/geant4/license . These * 9 // * include a list of copyright holders. 9 // * include a list of copyright holders. * 10 // * 10 // * * 11 // * Neither the authors of this software syst 11 // * Neither the authors of this software system, nor their employing * 12 // * institutes,nor the agencies providing fin 12 // * institutes,nor the agencies providing financial support for this * 13 // * work make any representation or warran 13 // * work make any representation or warranty, express or implied, * 14 // * regarding this software system or assum 14 // * regarding this software system or assume any liability for its * 15 // * use. Please see the license in the file 15 // * use. Please see the license in the file LICENSE and URL above * 16 // * for the full disclaimer and the limitatio 16 // * for the full disclaimer and the limitation of liability. * 17 // * 17 // * * 18 // * This code implementation is the result 18 // * This code implementation is the result of the scientific and * 19 // * technical work of the GEANT4 collaboratio 19 // * technical work of the GEANT4 collaboration. * 20 // * By using, copying, modifying or distri 20 // * By using, copying, modifying or distributing the software (or * 21 // * any work based on the software) you ag 21 // * any work based on the software) you agree to acknowledge its * 22 // * use in resulting scientific publicati 22 // * use in resulting scientific publications, and indicate your * 23 // * acceptance of all terms of the Geant4 Sof 23 // * acceptance of all terms of the Geant4 Software license. * 24 // ******************************************* 24 // ******************************************************************** 25 // 25 // 26 // Author: Mathieu Fontaine 26 // Author: Mathieu Fontaine Rachid Mazini 27 // fontaine@lps.umontrea 27 // fontaine@lps.umontreal.ca Rachid.Mazini@cern.ch 28 // Language: C++ 28 // Language: C++ 29 // Tested on : g++ 29 // Tested on : g++ 30 // Prerequisites: None 30 // Prerequisites: None 31 // Purpose: Source file defining 31 // Purpose: Source file defining the differents volumes 32 // in the cryostat 32 // in the cryostat 33 // Developped: 10-March-2000 M.F. 33 // Developped: 10-March-2000 M.F. 34 // 34 // 35 //-------------------------------------------- 35 //----------------------------------------------------------------------------- 36 36 37 #include "FCALCryostatVolumes.hh" 37 #include "FCALCryostatVolumes.hh" 38 38 39 #include "FCALMaterialConsultant.hh" 39 #include "FCALMaterialConsultant.hh" 40 40 41 #include "FCALEMModule.hh" 41 #include "FCALEMModule.hh" 42 #include "FCALHadModule.hh" 42 #include "FCALHadModule.hh" 43 43 44 #include "G4PhysicalConstants.hh" << 44 45 #include "G4SystemOfUnits.hh" << 46 #include "G4Box.hh" 45 #include "G4Box.hh" 47 #include "G4Tubs.hh" 46 #include "G4Tubs.hh" 48 #include "G4Trd.hh" 47 #include "G4Trd.hh" 49 #include "G4LogicalVolume.hh" 48 #include "G4LogicalVolume.hh" 50 #include "G4VPhysicalVolume.hh" 49 #include "G4VPhysicalVolume.hh" 51 #include "G4PVPlacement.hh" 50 #include "G4PVPlacement.hh" 52 #include "G4SubtractionSolid.hh" 51 #include "G4SubtractionSolid.hh" 53 52 54 #include "G4ThreeVector.hh" 53 #include "G4ThreeVector.hh" 55 #include "G4RotationMatrix.hh" 54 #include "G4RotationMatrix.hh" 56 #include "G4VisAttributes.hh" 55 #include "G4VisAttributes.hh" 57 #include "G4Colour.hh" 56 #include "G4Colour.hh" 58 57 59 FCALCryostatVolumes::FCALCryostatVolumes() 58 FCALCryostatVolumes::FCALCryostatVolumes() 60 { 59 { 61 #include "FCALCryostatVolumesParameters.input" 60 #include "FCALCryostatVolumesParameters.input" 62 } 61 } 63 62 64 FCALCryostatVolumes::~FCALCryostatVolumes() {; 63 FCALCryostatVolumes::~FCALCryostatVolumes() {;} 65 64 66 G4LogicalVolume * FCALCryostatVolumes::Constru 65 G4LogicalVolume * FCALCryostatVolumes::Construct() 67 { 66 { 68 67 69 //----------------------------- 68 //----------------------------- 70 // construction of materials 69 // construction of materials 71 //----------------------------- 70 //----------------------------- 72 71 73 FCALMaterialConsultant * FCALMaterials = << 72 FCALMaterialConsultant * FCALMaterials = new FCALMaterialConsultant(); 74 FCALMaterialConsultant::GetInstance(); << 73 >> 74 FCALMaterials->construct(); 75 75 76 76 77 //----------------------------------------- 77 //----------------------------------------- 78 // G4VisAttributes * ColorOfIron = new G4VisA 78 // G4VisAttributes * ColorOfIron = new G4VisAttributes(G4Colour(0.3,0.3,0.3)); 79 G4VisAttributes * ColorOfLead = new G4VisAtt 79 G4VisAttributes * ColorOfLead = new G4VisAttributes(G4Colour(0.5,0.5,0.5)); 80 G4VisAttributes * ColorOfAir = new G4VisAtt 80 G4VisAttributes * ColorOfAir = new G4VisAttributes(G4Colour(1.,1.,1.)); 81 // G4VisAttributes * ColorOfLarg = new G4VisA 81 // G4VisAttributes * ColorOfLarg = new G4VisAttributes(G4Colour(1.0, 1.0, 0.0)); 82 82 83 83 84 //----------------------------- 84 //----------------------------- 85 // Cryostat 85 // Cryostat 86 //----------------------------- 86 //----------------------------- 87 G4Tubs * SolidCryostat = 87 G4Tubs * SolidCryostat = 88 new G4Tubs("CryostatSolid", CryostatRMin, 88 new G4Tubs("CryostatSolid", CryostatRMin, CryostatRMax, CryostatLenght, 89 StartingPhi, DPhi); 89 StartingPhi, DPhi); 90 G4LogicalVolume * LogicalCryostat = 90 G4LogicalVolume * LogicalCryostat = 91 new G4LogicalVolume(SolidCryostat,FCALMate 91 new G4LogicalVolume(SolidCryostat,FCALMaterials->Material("Iron"), 92 "CryostatLogical"); 92 "CryostatLogical"); 93 93 94 // LogicalCryostat->SetVisAttributes(ColorOf 94 // LogicalCryostat->SetVisAttributes(ColorOfIron); 95 LogicalCryostat->SetVisAttributes(G4VisAttri << 95 LogicalCryostat->SetVisAttributes(G4VisAttributes::Invisible); 96 96 97 97 98 //------------------------------ 98 //------------------------------ 99 // Insulation 99 // Insulation 100 //------------------------------ 100 //------------------------------ 101 G4Tubs * SolidInsulation = 101 G4Tubs * SolidInsulation = 102 new G4Tubs("InsulationSolid", InsulationRM 102 new G4Tubs("InsulationSolid", InsulationRMin, InsulationRMax, 103 InsulationLenght, StartingPhi, DPhi); 103 InsulationLenght, StartingPhi, DPhi); 104 G4LogicalVolume * LogicalInsulation = 104 G4LogicalVolume * LogicalInsulation = 105 new G4LogicalVolume(SolidInsulation, FCALM 105 new G4LogicalVolume(SolidInsulation, FCALMaterials->Material("Air"), 106 "InsulationLogical"); 106 "InsulationLogical"); 107 // G4VPhysicalVolume * PhysicalInsulation = 107 // G4VPhysicalVolume * PhysicalInsulation = 108 new G4PVPlacement(0, G4ThreeVector(), Logi << 108 new G4PVPlacement(0, 0, LogicalInsulation, "InsulationPhysical", 109 LogicalCryostat, 0, 0); 109 LogicalCryostat, 0, 0); 110 110 111 LogicalInsulation->SetVisAttributes(ColorOfA 111 LogicalInsulation->SetVisAttributes(ColorOfAir); 112 // LogicalInsulation->SetVisAttributes(G4Vis << 112 // LogicalInsulation->SetVisAttributes(G4VisAttributes::Invisible); 113 113 114 114 115 //------------------------------------- 115 //------------------------------------- 116 // Air to replace Iron inside Cryostat 116 // Air to replace Iron inside Cryostat 117 //------------------------------------- 117 //------------------------------------- 118 /* 118 /* 119 G4Tubs * SolidAirCryostat = 119 G4Tubs * SolidAirCryostat = 120 new G4Tubs("AirCryostatSolid", CryostatRMi 120 new G4Tubs("AirCryostatSolid", CryostatRMin, LArgRMax, CryostatLength, 121 StartingPhi, DPhi); 121 StartingPhi, DPhi); 122 G4LogicalVolume * LogicalAirCryostat = 122 G4LogicalVolume * LogicalAirCryostat = 123 new G4LogicalVolume(SolidAirCryostat, FCAL 123 new G4LogicalVolume(SolidAirCryostat, FCALMaterials->Material("Air"), 124 "AirCryostatLogical"); 124 "AirCryostatLogical"); 125 G4VPhysicalVolume * PhysicalAirCryostat = 125 G4VPhysicalVolume * PhysicalAirCryostat = 126 new G4PVPlacement(0, 0, LogicalAirCryostat 126 new G4PVPlacement(0, 0, LogicalAirCryostat, "AirCryostatPhysical", 127 LogicalCryostat, 0, 0); 127 LogicalCryostat, 0, 0); 128 128 129 LogicalAirCryostat->SetVisAttributes(ColorO 129 LogicalAirCryostat->SetVisAttributes(ColorOfAir); 130 // LogicalAirCryostat->SetVisAttributes(G4Vi << 130 // LogicalAirCryostat->SetVisAttributes(G4VisAttributes::Invisible); 131 */ 131 */ 132 132 133 133 134 //-------------------- 134 //-------------------- 135 // Liquid Argon 135 // Liquid Argon 136 //-------------------- 136 //-------------------- 137 G4Tubs * SolidLArg = 137 G4Tubs * SolidLArg = 138 new G4Tubs("LArgSolid", LArgRMin, LArgRM 138 new G4Tubs("LArgSolid", LArgRMin, LArgRMax, LArgLenght,StartingPhi,DPhi); 139 G4LogicalVolume * LogicalLArg = 139 G4LogicalVolume * LogicalLArg = 140 new G4LogicalVolume(SolidLArg, FCALMater 140 new G4LogicalVolume(SolidLArg, FCALMaterials->Material("LiquidArgon"), 141 "LArgLogical"); 141 "LArgLogical"); 142 G4VPhysicalVolume * PhysicalLArg = 142 G4VPhysicalVolume * PhysicalLArg = 143 new G4PVPlacement(0,G4ThreeVector(LArgPo 143 new G4PVPlacement(0,G4ThreeVector(LArgPosX, LArgPosY, LArgPosZ), 144 LogicalLArg, "LArgPhysical", LogicalCryo 144 LogicalLArg, "LArgPhysical", LogicalCryostat, 0,0); 145 145 146 // LogicalLArg->SetVisAttributes(ColorOfLa 146 // LogicalLArg->SetVisAttributes(ColorOfLarg); 147 LogicalLArg->SetVisAttributes(G4VisAttribu << 147 LogicalLArg->SetVisAttributes(G4VisAttributes::Invisible); 148 148 149 //------------------- 149 //------------------- 150 // Front Excluder 150 // Front Excluder 151 //------------------- 151 //------------------- 152 G4Box * SolidFrontExcluder = 152 G4Box * SolidFrontExcluder = 153 new G4Box("FrontExcluderSolid", FrontExclu 153 new G4Box("FrontExcluderSolid", FrontExcluderSizeX, FrontExcluderSizeY, 154 FrontExcluderSizeZ); 154 FrontExcluderSizeZ); 155 G4LogicalVolume * LogicalFrontExcluder = 155 G4LogicalVolume * LogicalFrontExcluder = 156 new G4LogicalVolume(SolidFrontExcluder, FC 156 new G4LogicalVolume(SolidFrontExcluder, FCALMaterials->Material("Air") 157 , "FrontExcluderLogical"); 157 , "FrontExcluderLogical"); 158 158 159 // G4VPhysicalVolume * PhysicalFrontExcluder 159 // G4VPhysicalVolume * PhysicalFrontExcluder = 160 new G4PVPlacement(0,G4ThreeVector(FrontExc 160 new G4PVPlacement(0,G4ThreeVector(FrontExcluderPosX, FrontExcluderPosY, 161 FrontExcluderPosZ), "FrontExcluderPh 161 FrontExcluderPosZ), "FrontExcluderPhysical", 162 LogicalFrontExcluder, PhysicalLArg, 162 LogicalFrontExcluder, PhysicalLArg, 0,0); 163 163 164 LogicalFrontExcluder->SetVisAttributes(Color 164 LogicalFrontExcluder->SetVisAttributes(ColorOfLead); 165 // LogicalFrontExcluder->SetVisAttributes(G4 << 165 // LogicalFrontExcluder->SetVisAttributes(G4VisAttributes::Invisible); 166 166 167 167 168 //-------------------- 168 //-------------------- 169 // Back Excluder 169 // Back Excluder 170 //-------------------- 170 //-------------------- 171 G4Trd * SolidBackExcluder = 171 G4Trd * SolidBackExcluder = 172 new G4Trd("BackExcluderSolid", BackExclude 172 new G4Trd("BackExcluderSolid", BackExcluderSize1X, BackExcluderSize2X, 173 BackExcluderSize1Y, BackExcluderSize2Y 173 BackExcluderSize1Y, BackExcluderSize2Y, BackExcluderSizeZ); 174 G4LogicalVolume * LogicalBackExcluder = 174 G4LogicalVolume * LogicalBackExcluder = 175 new G4LogicalVolume(SolidBackExcluder, FCA 175 new G4LogicalVolume(SolidBackExcluder, FCALMaterials->Material("Air"), 176 "BackExcluderLogical"); 176 "BackExcluderLogical"); 177 177 178 G4RotationMatrix * BackExcluderRotationMatri 178 G4RotationMatrix * BackExcluderRotationMatrix = new G4RotationMatrix(); 179 BackExcluderRotationMatrix->rotateX(BackExcl 179 BackExcluderRotationMatrix->rotateX(BackExcluderRotX); 180 180 181 // G4VPhysicalVolume * PhysicalBackExcluder = 181 // G4VPhysicalVolume * PhysicalBackExcluder = 182 new G4PVPlacement(BackExcluderRotationMatr 182 new G4PVPlacement(BackExcluderRotationMatrix, 183 G4ThreeVector(BackExcluderPosX, Back 183 G4ThreeVector(BackExcluderPosX, BackExcluderPosY, 184 BackExcluderPosZ), "BackExcluder", L 184 BackExcluderPosZ), "BackExcluder", LogicalBackExcluder, 185 PhysicalLArg, 0,0); 185 PhysicalLArg, 0,0); 186 186 187 LogicalBackExcluder->SetVisAttributes(ColorO 187 LogicalBackExcluder->SetVisAttributes(ColorOfLead); 188 // LogicalBackExcluder->SetVisAttributes(G4V << 188 // LogicalBackExcluder->SetVisAttributes(G4VisAttributes::Invisible); 189 189 190 190 191 //------------------------ 191 //------------------------ 192 // fcal envelope 192 // fcal envelope 193 //------------------------ 193 //------------------------ 194 G4Tubs * SolidFCALEnvelope = 194 G4Tubs * SolidFCALEnvelope = 195 new G4Tubs("FCALEnvelopeSolid", FCALEnvelo 195 new G4Tubs("FCALEnvelopeSolid", FCALEnvelopeRMin, FCALEnvelopeRMax, 196 FCALEnvelopeLenght, FCALEnvelopeStart 196 FCALEnvelopeLenght, FCALEnvelopeStartPhi, FCALEnvelopeDPhi); 197 197 198 G4LogicalVolume * LogicalFCALEnvelope = 198 G4LogicalVolume * LogicalFCALEnvelope = 199 new G4LogicalVolume(SolidFCALEnvelope, FCA 199 new G4LogicalVolume(SolidFCALEnvelope, FCALMaterials->Material("LiquidArgon"), 200 "FCALEnvelopeLogical"); 200 "FCALEnvelopeLogical"); 201 201 202 G4RotationMatrix * FCALRotationMatrix = new 202 G4RotationMatrix * FCALRotationMatrix = new G4RotationMatrix(); 203 FCALRotationMatrix->rotateX(FCALEnvelopeRotX 203 FCALRotationMatrix->rotateX(FCALEnvelopeRotX); 204 // FCALRotationMatrix->rotateY(FCALEnvelope 204 // FCALRotationMatrix->rotateY(FCALEnvelopeRotY); 205 205 206 // G4VPhysicalVolume * PhysicalFCALEnvelopp 206 // G4VPhysicalVolume * PhysicalFCALEnvelopp = 207 new G4PVPlacement(FCALRotationMatrix, 207 new G4PVPlacement(FCALRotationMatrix, 208 G4ThreeVector(FCALEnvelopePosX,FCALE 208 G4ThreeVector(FCALEnvelopePosX,FCALEnvelopePosY,FCALEnvelopePosZ) 209 , LogicalFCALEnvelope, "FCALEnvelope 209 , LogicalFCALEnvelope, "FCALEnvelopePhysical", LogicalLArg, 0,0); 210 210 211 //LogicalFCALEnvelope->SetVisAttributes(Colo 211 //LogicalFCALEnvelope->SetVisAttributes(ColorOfIron); 212 LogicalFCALEnvelope->SetVisAttributes(G4VisA << 212 LogicalFCALEnvelope->SetVisAttributes(G4VisAttributes::Invisible); 213 213 214 //----------------------------- 214 //----------------------------- 215 // FCAL electromagnetic Module 215 // FCAL electromagnetic Module 216 //----------------------------- 216 //----------------------------- 217 EmModule = new FCALEMModule(); 217 EmModule = new FCALEMModule(); 218 G4LogicalVolume * LogicalFCALEmModule = EmM 218 G4LogicalVolume * LogicalFCALEmModule = EmModule->Construct(); 219 219 220 G4RotationMatrix * EmModuleRot = new G4Rotat 220 G4RotationMatrix * EmModuleRot = new G4RotationMatrix(); 221 EmModuleRot->rotateZ(ModuleRotZ); 221 EmModuleRot->rotateZ(ModuleRotZ); 222 222 223 // G4VPhysicalVolume * PhysicalFCALEmModule = 223 // G4VPhysicalVolume * PhysicalFCALEmModule = 224 new G4PVPlacement(EmModuleRot, 224 new G4PVPlacement(EmModuleRot, 225 G4ThreeVector(FCALEmModulePosX,FCALE 225 G4ThreeVector(FCALEmModulePosX,FCALEmModulePosY,FCALEmModulePosZ), 226 LogicalFCALEmModule,"FCALEmModulePhy 226 LogicalFCALEmModule,"FCALEmModulePhysical",LogicalFCALEnvelope,0,0); 227 227 228 228 229 //----------------------------- 229 //----------------------------- 230 // hadronic fcal 230 // hadronic fcal 231 //---------------------------- 231 //---------------------------- 232 HadModule = new FCALHadModule(); 232 HadModule = new FCALHadModule(); 233 G4LogicalVolume * LogicalFCALHadModule = Ha 233 G4LogicalVolume * LogicalFCALHadModule = HadModule->Construct(); 234 234 235 G4RotationMatrix * HadModuleRot = new G4Rota 235 G4RotationMatrix * HadModuleRot = new G4RotationMatrix(); 236 HadModuleRot->rotateZ(ModuleRotZ); 236 HadModuleRot->rotateZ(ModuleRotZ); 237 237 238 // G4VPhysicalVolume * PhysicalFCALHadModule 238 // G4VPhysicalVolume * PhysicalFCALHadModule = 239 new G4PVPlacement(HadModuleRot, 239 new G4PVPlacement(HadModuleRot, 240 G4ThreeVector(FCALHadModulePosX,FCAL 240 G4ThreeVector(FCALHadModulePosX,FCALHadModulePosY,FCALHadModulePosZ), 241 LogicalFCALHadModule, "FCALHadModule 241 LogicalFCALHadModule, "FCALHadModulePhysical",LogicalFCALEnvelope,0,0); 242 242 243 243 244 244 245 //------------------------- 245 //------------------------- 246 // Returning the mother 246 // Returning the mother 247 //------------------------- 247 //------------------------- 248 248 249 return LogicalCryostat; 249 return LogicalCryostat; 250 250 251 } 251 } 252 << 253 252