Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-02-23 09:22:32

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 Par01/src/Par01ParallelWorldForPion.cc
0027 /// \brief Implementation of the Par01ParallelWorldForPion class
0028 //
0029 //
0030 #include "Par01ParallelWorldForPion.hh"
0031 
0032 #include "Par01PionShowerModel.hh"
0033 
0034 #include "G4Box.hh"
0035 #include "G4LogicalVolume.hh"
0036 #include "G4NistManager.hh"
0037 #include "G4PVPlacement.hh"
0038 #include "G4Region.hh"
0039 #include "G4RegionStore.hh"
0040 #include "G4SystemOfUnits.hh"
0041 #include "G4ThreeVector.hh"
0042 
0043 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0044 
0045 Par01ParallelWorldForPion::Par01ParallelWorldForPion(G4String worldName)
0046   : G4VUserParallelWorld(worldName)
0047 {
0048   ;
0049 }
0050 
0051 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0052 
0053 Par01ParallelWorldForPion::~Par01ParallelWorldForPion()
0054 {
0055   ;
0056 }
0057 
0058 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0059 
0060 void Par01ParallelWorldForPion::Construct()
0061 {
0062   // -- Get nist material manager
0063   G4NistManager* nistManager = G4NistManager::Instance();
0064 
0065   // Build materials
0066   G4Material* air = nistManager->FindOrBuildMaterial("G4_AIR");
0067 
0068   // -------------------------------
0069   //  Build parallel/ghost geometry:
0070   // -------------------------------
0071 
0072   // -- Obtain clone of mass geometry world from GetWorld() base class utility:
0073   G4VPhysicalVolume* ghostWorld = GetWorld();
0074   // -- Why needed ? No default ?
0075   ghostWorld->GetLogicalVolume()->SetMaterial(air);
0076   G4Region* parallelWorldRegion = new G4Region("ParallelWorldRegion");
0077   parallelWorldRegion->AddRootLogicalVolume(ghostWorld->GetLogicalVolume());
0078 
0079   // -- Create box for encompassing Elec.+Had. calorimeters together:
0080   G4double detectSize = 125 * cm;
0081   G4Box* ghostBox = new G4Box("GhostBox", detectSize + 5 * cm, detectSize + 5 * cm, 80 * cm);
0082   // -- Build the subsequent logical volume:
0083   G4LogicalVolume* ghostLogical = new G4LogicalVolume(ghostBox,
0084                                                       air,  // -- no material : IMPOSSIBLE !!!
0085                                                       "GhostLogical", 0, 0, 0);
0086   // -- And place this logical volume in the parallel geometry:
0087   new G4PVPlacement(0, G4ThreeVector(0., 0., 175 * cm), "GhostPhysical", ghostLogical, ghostWorld,
0088                     false, 0);
0089 
0090   // -----------------------
0091   //  Setup fast simulation:
0092   // -----------------------
0093 
0094   // -- Make Elec+Had logical volume becoming a region:
0095   G4cout << "Declaring region..." << G4endl;
0096   G4Region* ghostRegion = new G4Region("GhostCalorimeterRegion");
0097   G4cout << "... region declared. Setting it the ghostLogical volume..." << G4endl;
0098   ghostRegion->AddRootLogicalVolume(ghostLogical);
0099   G4cout << "... succes.\n" << G4endl;
0100 }
0101 
0102 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0103 
0104 void Par01ParallelWorldForPion::ConstructSD()
0105 {
0106   G4RegionStore* regionStore = G4RegionStore::GetInstance();
0107 
0108   G4Region* ghostRegion = regionStore->GetRegion("GhostCalorimeterRegion");
0109   // -- Attach fast simulation model (create the G4FastSimulationManager if needed):
0110   new Par01PionShowerModel("ghostPionShowerModel", ghostRegion);
0111 }