Back to home page

EIC code displayed by LXR

 
 

    


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

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 //
0027 /// \file RE05/src/RE05CalorimeterParallelWorld.cc
0028 /// \brief Implementation of the RE05CalorimeterParallelWorld class
0029 //
0030 #include "RE05CalorimeterParallelWorld.hh"
0031 
0032 #include "RE05CalorimeterSD.hh"
0033 
0034 #include "G4Box.hh"
0035 #include "G4LogicalVolume.hh"
0036 #include "G4Material.hh"
0037 #include "G4PVPlacement.hh"
0038 #include "G4PVReplica.hh"
0039 #include "G4SDManager.hh"
0040 #include "G4SystemOfUnits.hh"
0041 #include "G4ThreeVector.hh"
0042 #include "G4Tubs.hh"
0043 #include "G4VPhysicalVolume.hh"
0044 #include "G4VisAttributes.hh"
0045 
0046 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0047 
0048 RE05CalorimeterParallelWorld::RE05CalorimeterParallelWorld(G4String& parallelWorldName)
0049   : G4VUserParallelWorld(parallelWorldName)
0050 {
0051 #include "RE05DetectorParameterDef.icc"
0052 }
0053 
0054 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0055 
0056 RE05CalorimeterParallelWorld::~RE05CalorimeterParallelWorld() {}
0057 
0058 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0059 
0060 void RE05CalorimeterParallelWorld::Construct()
0061 {
0062   G4Material* dummyMat = 0;
0063 
0064   // the ReadOut World:
0065   G4VPhysicalVolume* ROWorldPhys = GetWorld();
0066   G4LogicalVolume* ROWorldLog = ROWorldPhys->GetLogicalVolume();
0067 
0068   // Calorimeter volume:
0069   G4VSolid* caloROtub = new G4Tubs("caloROtub", fCaloTubs_rmin, fCaloTubs_rmax, fCaloTubs_dz,
0070                                    fCaloTubs_sphi, fCaloTubs_dphi);
0071   G4LogicalVolume* caloROlog = new G4LogicalVolume(caloROtub, dummyMat, "caloROlogical", 0, 0, 0);
0072   //  G4VPhysicalVolume* caloROphys =
0073   new G4PVPlacement(0, G4ThreeVector(), caloROlog, "calROphysical", ROWorldLog, false, 0);
0074 
0075   // -------------------------------
0076   // Calorimeter readout division:
0077   // -------------------------------
0078   // Phi division first: 48 sectors
0079   G4VSolid* caloROphiDivisionTub = new G4Tubs("caloROphiDivision", fCaloCell_rmin, fCaloCell_rmax,
0080                                               fCaloCell_dz, fCaloCell_sphi, fCaloCell_dphi);
0081   G4LogicalVolume* caloROphiDivisionLog =
0082     new G4LogicalVolume(caloROphiDivisionTub, dummyMat, "caloROphiDivisionLogical", 0, 0, 0);
0083   //  G4VPhysicalVolume* caloROphiDivisionPhys =
0084   new G4PVReplica("caloROphiDivisionPhysical", caloROphiDivisionLog, caloROlog, kPhi,
0085                   fSegmentsinPhi, fCaloCell_dphi);
0086   // then z division: 20 slices:
0087   G4VSolid* caloROcellTub = new G4Tubs("caloROcellTub", fCaloRing_rmin, fCaloRing_rmax,
0088                                        fCaloRing_dz, fCaloRing_sphi, fCaloRing_dphi);
0089   G4LogicalVolume* caloROcellLog =
0090     new G4LogicalVolume(caloROcellTub, dummyMat, "caloROcellLogical", 0, 0, 0);
0091   //  G4VPhysicalVolume * caloROcellPhys =
0092   new G4PVReplica("caloROcellPhysical", caloROcellLog, caloROphiDivisionLog, kZAxis, fSegmentsinZ,
0093                   2. * fCaloRing_dz);
0094 }
0095 
0096 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0097 
0098 void RE05CalorimeterParallelWorld::ConstructSD()
0099 {
0100   G4String calorimeterSDname = "/mydet/calorimeter";
0101   RE05CalorimeterSD* calorimeterSD = new RE05CalorimeterSD(calorimeterSDname);
0102   G4SDManager::GetSDMpointer()->AddNewDetector(calorimeterSD);
0103   SetSensitiveDetector("caloROcellLogical", calorimeterSD);
0104 }
0105 
0106 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......