Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:16:57

0001 //
0002 // ********************************************************************
0003 // * License and Disclaimer                                           *
0004 // *                                                                  *
0005 // * The  Geant4 software  is  copyright of the Copyright Holders  of *
0006 // * the Geant4 Collaboration.  It is provided  under  the terms  and *
0007 // * conditions of the Geant4 Software License,  included in the file *
0008 // * LICENSE and available at  http://cern.ch/geant4/license .  These *
0009 // * include a list of copyright holders.                             *
0010 // *                                                                  *
0011 // * Neither the authors of this software system, nor their employing *
0012 // * institutes,nor the agencies providing financial support for this *
0013 // * work  make  any representation or  warranty, express or implied, *
0014 // * regarding  this  software system or assume any liability for its *
0015 // * use.  Please see the license in the file  LICENSE  and URL above *
0016 // * for the full disclaimer and the limitation of liability.         *
0017 // *                                                                  *
0018 // * This  code  implementation is the result of  the  scientific and *
0019 // * technical work of the GEANT4 collaboration.                      *
0020 // * By using,  copying,  modifying or  distributing the software (or *
0021 // * any work based  on the software)  you  agree  to acknowledge its *
0022 // * use  in  resulting  scientific  publications,  and indicate your *
0023 // * acceptance of all terms of the Geant4 Software license.          *
0024 // ********************************************************************
0025 //
0026 //   Author:             Mathieu Fontaine           Rachid Mazini
0027 //                       fontaine@lps.umontreal.ca  Rachid.Mazini@cern.ch
0028 //   Language:           C++
0029 //   Tested on :         g++
0030 //   Prerequisites:      None
0031 //   Purpose:            Source file defining the differents volumes
0032 //                       in the cryostat
0033 //   Developped:         10-March-2000   M.F.
0034 //
0035 //-----------------------------------------------------------------------------
0036 
0037 #include "FCALCryostatVolumes.hh"
0038 
0039 #include "FCALMaterialConsultant.hh"
0040 
0041 #include "FCALEMModule.hh"
0042 #include "FCALHadModule.hh"
0043 
0044 #include "G4PhysicalConstants.hh"
0045 #include "G4SystemOfUnits.hh"
0046 #include "G4Box.hh"
0047 #include "G4Tubs.hh"
0048 #include "G4Trd.hh"
0049 #include "G4LogicalVolume.hh"
0050 #include "G4VPhysicalVolume.hh"
0051 #include "G4PVPlacement.hh"
0052 #include "G4SubtractionSolid.hh"
0053 
0054 #include "G4ThreeVector.hh"
0055 #include "G4RotationMatrix.hh"
0056 #include "G4VisAttributes.hh"
0057 #include "G4Colour.hh"
0058 
0059 FCALCryostatVolumes::FCALCryostatVolumes()
0060 {
0061 #include "FCALCryostatVolumesParameters.input"
0062 }
0063 
0064 FCALCryostatVolumes::~FCALCryostatVolumes() {;}
0065 
0066 G4LogicalVolume * FCALCryostatVolumes::Construct()
0067 {
0068 
0069   //-----------------------------
0070   // construction of materials
0071   //-----------------------------
0072   
0073   FCALMaterialConsultant * FCALMaterials = 
0074     FCALMaterialConsultant::GetInstance();
0075 
0076 
0077 //-----------------------------------------
0078 //  G4VisAttributes * ColorOfIron = new G4VisAttributes(G4Colour(0.3,0.3,0.3));
0079   G4VisAttributes * ColorOfLead = new G4VisAttributes(G4Colour(0.5,0.5,0.5));
0080   G4VisAttributes * ColorOfAir  = new G4VisAttributes(G4Colour(1.,1.,1.));
0081 //  G4VisAttributes * ColorOfLarg = new G4VisAttributes(G4Colour(1.0, 1.0, 0.0));
0082 
0083 
0084   //-----------------------------
0085   // Cryostat
0086   //-----------------------------
0087   G4Tubs * SolidCryostat = 
0088     new G4Tubs("CryostatSolid", CryostatRMin, CryostatRMax, CryostatLenght,
0089            StartingPhi, DPhi);
0090   G4LogicalVolume * LogicalCryostat = 
0091     new G4LogicalVolume(SolidCryostat,FCALMaterials->Material("Iron"),
0092             "CryostatLogical");
0093  
0094   // LogicalCryostat->SetVisAttributes(ColorOfIron);
0095   LogicalCryostat->SetVisAttributes(G4VisAttributes::GetInvisible());
0096  
0097 
0098   //------------------------------
0099   // Insulation
0100   //------------------------------
0101   G4Tubs * SolidInsulation = 
0102     new G4Tubs("InsulationSolid", InsulationRMin, InsulationRMax, 
0103            InsulationLenght, StartingPhi, DPhi);
0104   G4LogicalVolume * LogicalInsulation = 
0105     new G4LogicalVolume(SolidInsulation, FCALMaterials->Material("Air"),
0106             "InsulationLogical");
0107 //  G4VPhysicalVolume * PhysicalInsulation = 
0108     new G4PVPlacement(0, G4ThreeVector(), LogicalInsulation, "InsulationPhysical",
0109               LogicalCryostat, 0, 0);
0110   
0111   LogicalInsulation->SetVisAttributes(ColorOfAir);
0112   // LogicalInsulation->SetVisAttributes(G4VisAttributes::GetInvisible());
0113 
0114 
0115   //-------------------------------------
0116   //  Air to replace Iron inside Cryostat
0117   //-------------------------------------
0118   /*  
0119   G4Tubs * SolidAirCryostat = 
0120     new G4Tubs("AirCryostatSolid", CryostatRMin, LArgRMax, CryostatLength, 
0121            StartingPhi, DPhi);
0122   G4LogicalVolume * LogicalAirCryostat =
0123     new G4LogicalVolume(SolidAirCryostat, FCALMaterials->Material("Air"),
0124             "AirCryostatLogical");
0125   G4VPhysicalVolume * PhysicalAirCryostat =
0126     new G4PVPlacement(0, 0, LogicalAirCryostat, "AirCryostatPhysical",
0127               LogicalCryostat, 0, 0);
0128 
0129    LogicalAirCryostat->SetVisAttributes(ColorOfAir);
0130   // LogicalAirCryostat->SetVisAttributes(G4VisAttributes::GetInvisible());  
0131   */
0132 
0133 
0134   //--------------------
0135   // Liquid Argon
0136   //--------------------
0137     G4Tubs * SolidLArg = 
0138       new G4Tubs("LArgSolid", LArgRMin, LArgRMax, LArgLenght,StartingPhi,DPhi);
0139     G4LogicalVolume * LogicalLArg = 
0140       new G4LogicalVolume(SolidLArg, FCALMaterials->Material("LiquidArgon"),
0141             "LArgLogical");
0142     G4VPhysicalVolume * PhysicalLArg = 
0143       new G4PVPlacement(0,G4ThreeVector(LArgPosX, LArgPosY, LArgPosZ), 
0144             LogicalLArg, "LArgPhysical", LogicalCryostat, 0,0);
0145 
0146     // LogicalLArg->SetVisAttributes(ColorOfLarg);
0147     LogicalLArg->SetVisAttributes(G4VisAttributes::GetInvisible());
0148 
0149   //-------------------
0150   // Front Excluder
0151   //-------------------
0152   G4Box * SolidFrontExcluder = 
0153     new G4Box("FrontExcluderSolid", FrontExcluderSizeX, FrontExcluderSizeY,
0154           FrontExcluderSizeZ);  
0155   G4LogicalVolume * LogicalFrontExcluder =
0156     new G4LogicalVolume(SolidFrontExcluder, FCALMaterials->Material("Air")
0157             , "FrontExcluderLogical");
0158 
0159 //  G4VPhysicalVolume * PhysicalFrontExcluder =
0160     new G4PVPlacement(0,G4ThreeVector(FrontExcluderPosX, FrontExcluderPosY,
0161               FrontExcluderPosZ), "FrontExcluderPhysical",
0162               LogicalFrontExcluder, PhysicalLArg, 0,0);
0163 
0164   LogicalFrontExcluder->SetVisAttributes(ColorOfLead);
0165   // LogicalFrontExcluder->SetVisAttributes(G4VisAttributes::GetInvisible());
0166 
0167 
0168   //--------------------
0169   // Back Excluder
0170   //--------------------
0171   G4Trd * SolidBackExcluder =
0172     new G4Trd("BackExcluderSolid", BackExcluderSize1X, BackExcluderSize2X,
0173           BackExcluderSize1Y, BackExcluderSize2Y, BackExcluderSizeZ);
0174   G4LogicalVolume * LogicalBackExcluder = 
0175     new G4LogicalVolume(SolidBackExcluder, FCALMaterials->Material("Air"),
0176             "BackExcluderLogical");
0177 
0178   G4RotationMatrix * BackExcluderRotationMatrix = new G4RotationMatrix();
0179   BackExcluderRotationMatrix->rotateX(BackExcluderRotX);
0180 
0181 //  G4VPhysicalVolume * PhysicalBackExcluder =
0182     new G4PVPlacement(BackExcluderRotationMatrix,
0183               G4ThreeVector(BackExcluderPosX, BackExcluderPosY,
0184               BackExcluderPosZ), "BackExcluder", LogicalBackExcluder, 
0185               PhysicalLArg, 0,0);
0186 
0187   LogicalBackExcluder->SetVisAttributes(ColorOfLead);
0188   // LogicalBackExcluder->SetVisAttributes(G4VisAttributes::GetInvisible());
0189 
0190 
0191   //------------------------
0192   // fcal envelope
0193   //------------------------
0194   G4Tubs * SolidFCALEnvelope = 
0195     new G4Tubs("FCALEnvelopeSolid", FCALEnvelopeRMin, FCALEnvelopeRMax, 
0196            FCALEnvelopeLenght, FCALEnvelopeStartPhi, FCALEnvelopeDPhi);
0197   
0198   G4LogicalVolume * LogicalFCALEnvelope = 
0199     new G4LogicalVolume(SolidFCALEnvelope, FCALMaterials->Material("LiquidArgon"),
0200             "FCALEnvelopeLogical");
0201 
0202   G4RotationMatrix * FCALRotationMatrix = new G4RotationMatrix();
0203   FCALRotationMatrix->rotateX(FCALEnvelopeRotX);
0204   //  FCALRotationMatrix->rotateY(FCALEnvelopeRotY);
0205 
0206 //  G4VPhysicalVolume *  PhysicalFCALEnvelopp = 
0207     new G4PVPlacement(FCALRotationMatrix, 
0208               G4ThreeVector(FCALEnvelopePosX,FCALEnvelopePosY,FCALEnvelopePosZ)
0209               , LogicalFCALEnvelope, "FCALEnvelopePhysical", LogicalLArg, 0,0);
0210 
0211   //LogicalFCALEnvelope->SetVisAttributes(ColorOfIron);
0212   LogicalFCALEnvelope->SetVisAttributes(G4VisAttributes::GetInvisible());
0213 
0214   //-----------------------------
0215   // FCAL electromagnetic Module
0216   //-----------------------------
0217   EmModule = new FCALEMModule();
0218   G4LogicalVolume * LogicalFCALEmModule  = EmModule->Construct();
0219 
0220   G4RotationMatrix * EmModuleRot = new G4RotationMatrix();
0221   EmModuleRot->rotateZ(ModuleRotZ);
0222 
0223 //  G4VPhysicalVolume * PhysicalFCALEmModule = 
0224     new G4PVPlacement(EmModuleRot, 
0225               G4ThreeVector(FCALEmModulePosX,FCALEmModulePosY,FCALEmModulePosZ),
0226               LogicalFCALEmModule,"FCALEmModulePhysical",LogicalFCALEnvelope,0,0);
0227 
0228        
0229   //-----------------------------
0230   // hadronic fcal
0231   //----------------------------
0232   HadModule = new FCALHadModule();
0233   G4LogicalVolume * LogicalFCALHadModule  = HadModule->Construct();
0234 
0235   G4RotationMatrix * HadModuleRot = new G4RotationMatrix();
0236   HadModuleRot->rotateZ(ModuleRotZ);
0237   
0238 //  G4VPhysicalVolume * PhysicalFCALHadModule =
0239     new G4PVPlacement(HadModuleRot, 
0240               G4ThreeVector(FCALHadModulePosX,FCALHadModulePosY,FCALHadModulePosZ),
0241               LogicalFCALHadModule, "FCALHadModulePhysical",LogicalFCALEnvelope,0,0);
0242   
0243 
0244 
0245   //-------------------------
0246   // Returning the mother
0247   //-------------------------
0248 
0249   return LogicalCryostat;
0250 
0251 }
0252