Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-06-06 07:55:42

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 /// \file B03DetectorConstruction.cc
0027 /// \brief Implementation of the B03DetectorConstruction class
0028 
0029 #include "B03DetectorConstruction.hh"
0030 
0031 #include "G4Box.hh"
0032 #include "G4Colour.hh"
0033 #include "G4LogicalVolume.hh"
0034 #include "G4Material.hh"
0035 #include "G4PVPlacement.hh"
0036 #include "G4PhysicalConstants.hh"
0037 #include "G4SystemOfUnits.hh"
0038 #include "G4ThreeVector.hh"
0039 #include "G4Tubs.hh"
0040 #include "G4Types.hh"
0041 #include "G4VisAttributes.hh"
0042 #include "globals.hh"
0043 
0044 // for importance biasing
0045 #include "G4IStore.hh"
0046 
0047 // For Primitive Scorers
0048 #include "G4MultiFunctionalDetector.hh"
0049 #include "G4PSNofCollision.hh"
0050 #include "G4PSPopulation.hh"
0051 #include "G4PSTrackCounter.hh"
0052 #include "G4PSTrackLength.hh"
0053 #include "G4SDManager.hh"
0054 #include "G4SDParticleFilter.hh"
0055 
0056 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0057 
0058 B03DetectorConstruction::B03DetectorConstruction() : G4VUserDetectorConstruction()
0059 {
0060   ;
0061 }
0062 
0063 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0064 
0065 B03DetectorConstruction::~B03DetectorConstruction()
0066 {
0067   ;
0068 }
0069 
0070 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0071 
0072 G4VPhysicalVolume* B03DetectorConstruction::Construct()
0073 {
0074   G4double pos_x;
0075   G4double pos_y;
0076   G4double pos_z;
0077 
0078   G4double density, pressure, temperature;
0079   G4double A;
0080   G4int Z;
0081 
0082   G4String name, symbol;
0083   G4double z;
0084   G4double fractionmass;
0085 
0086   A = 1.01 * g / mole;
0087   G4Element* elH = new G4Element(name = "Hydrogen", symbol = "H", Z = 1, A);
0088 
0089   A = 12.01 * g / mole;
0090   G4Element* elC = new G4Element(name = "Carbon", symbol = "C", Z = 6, A);
0091 
0092   A = 16.00 * g / mole;
0093   G4Element* elO = new G4Element(name = "Oxygen", symbol = "O", Z = 8, A);
0094 
0095   A = 22.99 * g / mole;
0096   G4Element* elNa = new G4Element(name = "Natrium", symbol = "Na", Z = 11, A);
0097 
0098   A = 200.59 * g / mole;
0099   G4Element* elHg = new G4Element(name = "Hg", symbol = "Hg", Z = 80, A);
0100 
0101   A = 26.98 * g / mole;
0102   G4Element* elAl = new G4Element(name = "Aluminium", symbol = "Al", Z = 13, A);
0103 
0104   A = 28.09 * g / mole;
0105   G4Element* elSi = new G4Element(name = "Silicon", symbol = "Si", Z = 14, A);
0106 
0107   A = 39.1 * g / mole;
0108   G4Element* elK = new G4Element(name = "K", symbol = "K", Z = 19, A);
0109 
0110   A = 69.72 * g / mole;
0111   G4Element* elCa = new G4Element(name = "Calzium", symbol = "Ca", Z = 31, A);
0112 
0113   A = 55.85 * g / mole;
0114   G4Element* elFe = new G4Element(name = "Iron", symbol = "Fe", Z = 26, A);
0115 
0116   density = universe_mean_density;  // from PhysicalConstants.h
0117   pressure = 3.e-18 * pascal;
0118   temperature = 2.73 * kelvin;
0119   G4Material* Galactic = new G4Material(name = "Galactic", z = 1., A = 1.01 * g / mole, density,
0120                                         kStateGas, temperature, pressure);
0121 
0122   density = 2.03 * g / cm3;
0123   G4Material* Concrete = new G4Material("Concrete", density, 10);
0124   Concrete->AddElement(elH, fractionmass = 0.01);
0125   Concrete->AddElement(elO, fractionmass = 0.529);
0126   Concrete->AddElement(elNa, fractionmass = 0.016);
0127   Concrete->AddElement(elHg, fractionmass = 0.002);
0128   Concrete->AddElement(elAl, fractionmass = 0.034);
0129   Concrete->AddElement(elSi, fractionmass = 0.337);
0130   Concrete->AddElement(elK, fractionmass = 0.013);
0131   Concrete->AddElement(elCa, fractionmass = 0.044);
0132   Concrete->AddElement(elFe, fractionmass = 0.014);
0133   Concrete->AddElement(elC, fractionmass = 0.001);
0134 
0135   /////////////////////////////
0136   // world cylinder volume
0137   ////////////////////////////
0138 
0139   // world solid
0140 
0141   G4double innerRadiusCylinder = 0 * cm;
0142   G4double outerRadiusCylinder = 101 * cm;  // dont't have scoring
0143                                             // cells coinside eith world volume boundary
0144   //  G4double heightCylinder       = 105*cm;
0145   G4double heightCylinder = 100 * cm;
0146   G4double startAngleCylinder = 0 * deg;
0147   G4double spanningAngleCylinder = 360 * deg;
0148 
0149   G4Tubs* worldCylinder = new G4Tubs("worldCylinder", innerRadiusCylinder, outerRadiusCylinder,
0150                                      heightCylinder, startAngleCylinder, spanningAngleCylinder);
0151 
0152   // logical world
0153 
0154   G4LogicalVolume* worldCylinder_log =
0155     new G4LogicalVolume(worldCylinder, Galactic, "worldCylinder_log");
0156 
0157   name = "shieldWorld";
0158   fWorldVolume = new G4PVPlacement(0, G4ThreeVector(0, 0, 0), worldCylinder_log, name, 0, false, 0);
0159 
0160   // creating 18 slobs of 10 cm thick concrete
0161 
0162   G4double innerRadiusShield = 0 * cm;
0163   G4double outerRadiusShield = 100 * cm;
0164   G4double heightShield = 90 * cm;
0165   G4double startAngleShield = 0 * deg;
0166   G4double spanningAngleShield = 360 * deg;
0167 
0168   G4Tubs* aShield = new G4Tubs("aShield", innerRadiusShield, outerRadiusShield, heightShield,
0169                                startAngleShield, spanningAngleShield);
0170 
0171   // logical shield
0172 
0173   G4LogicalVolume* aShield_log = new G4LogicalVolume(aShield, Concrete, "aShield_log");
0174 
0175   G4VisAttributes* pShieldVis = new G4VisAttributes(G4Colour(0.0, 0.0, 1.0));
0176   pShieldVis->SetForceSolid(true);
0177   aShield_log->SetVisAttributes(pShieldVis);
0178 
0179   // physical shields
0180 
0181   name = "concreteShield";
0182 
0183   pos_x = 0 * cm;
0184   pos_y = 0 * cm;
0185   pos_z = 0;
0186 
0187   new G4PVPlacement(0, G4ThreeVector(pos_x, pos_y, pos_z), aShield_log, name, worldCylinder_log,
0188                     false, 0);
0189 
0190   return fWorldVolume;
0191 }
0192 
0193 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0194 
0195 // void B03DetectorConstruction::ConstructSDandField()
0196 // {
0197 //   ;
0198 // }
0199 
0200 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0201 
0202 G4VPhysicalVolume* B03DetectorConstruction::GetWorldVolume()
0203 {
0204   return fWorldVolume;
0205 }
0206 
0207 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0208 
0209 G4VPhysicalVolume& B03DetectorConstruction::GetWorldVolumeAddress() const
0210 {
0211   return *fWorldVolume;
0212 }
0213 
0214 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......