Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-04-05 07:50:51

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 RE03DetectorConstruction.cc
0027 /// \brief Implementation of the RE03DetectorConstruction class
0028 
0029 #include "RE03DetectorConstruction.hh"
0030 
0031 #include "G4Box.hh"
0032 #include "G4Colour.hh"
0033 #include "G4LogicalVolume.hh"
0034 #include "G4Material.hh"
0035 #include "G4MultiFunctionalDetector.hh"
0036 #include "G4NistManager.hh"
0037 #include "G4PSEnergyDeposit.hh"
0038 #include "G4PSNofStep.hh"
0039 #include "G4PSTrackLength.hh"
0040 #include "G4PVPlacement.hh"
0041 #include "G4SDManager.hh"
0042 #include "G4SDParticleFilter.hh"
0043 #include "G4SystemOfUnits.hh"
0044 #include "G4VPrimitiveScorer.hh"
0045 #include "G4VisAttributes.hh"
0046 #include "G4ios.hh"
0047 
0048 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0049 RE03DetectorConstruction::RE03DetectorConstruction()
0050   : G4VUserDetectorConstruction(),
0051     fAir(0),
0052     fWater(0),
0053     fWorldPhys(0),
0054     fPhantomPhys(0),
0055     fConstructed(false)
0056 {
0057   ;
0058 }
0059 
0060 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0061 RE03DetectorConstruction::~RE03DetectorConstruction()
0062 {
0063   ;
0064 }
0065 
0066 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0067 G4VPhysicalVolume* RE03DetectorConstruction::Construct()
0068 {
0069   if (!fConstructed) {
0070     fConstructed = true;
0071     DefineMaterials();
0072     SetupGeometry();
0073   }
0074   return fWorldPhys;
0075 }
0076 
0077 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0078 void RE03DetectorConstruction::DefineMaterials()
0079 {
0080   //-------- NIST Materials -----------------------------------------------
0081   //  Material Information imported from NIST database.
0082   G4NistManager* NISTman = G4NistManager::Instance();
0083   fWater = NISTman->FindOrBuildMaterial("G4_WATER");
0084   fAir = NISTman->FindOrBuildMaterial("G4_AIR");
0085 }
0086 
0087 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0088 void RE03DetectorConstruction::SetupGeometry()
0089 {
0090   //
0091   // World
0092   //
0093   G4VSolid* worldSolid = new G4Box("World", 2. * m, 2. * m, 2. * m);
0094   G4LogicalVolume* worldLogical = new G4LogicalVolume(worldSolid, fAir, "World");
0095   fWorldPhys = new G4PVPlacement(0, G4ThreeVector(), worldLogical, "World", 0, false, 0);
0096 
0097   //
0098   // Phantom
0099   //
0100   G4VSolid* phantomSolid = new G4Box("Calor", 1. * m, 1. * m, 1. * m);
0101   G4LogicalVolume* phantomLogical = new G4LogicalVolume(phantomSolid, fWater, "Phantom");
0102   fPhantomPhys =
0103     new G4PVPlacement(0, G4ThreeVector(), phantomLogical, "Phantom", worldLogical, false, 0);
0104   //
0105   // Visualization attributes
0106   //
0107   // worldLogical->SetVisAttributes(G4VisAttributes::GetInvisible());
0108   G4VisAttributes* simpleBoxVisAtt = new G4VisAttributes(G4Colour(1.0, 1.0, 1.0));
0109   simpleBoxVisAtt->SetVisibility(true);
0110   phantomLogical->SetVisAttributes(simpleBoxVisAtt);
0111 }
0112 
0113 void RE03DetectorConstruction::ConstructSDandField()
0114 {
0115   ;
0116 }