Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-09-14 08:29:00

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