Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-06-07 07:53:16

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 ExN04CalorimeterROGeometry.cc
0027 /// \brief Implementation of the ExN04CalorimeterROGeometry class
0028 
0029 #include "ExN04CalorimeterROGeometry.hh"
0030 
0031 #include "ExN04DummySD.hh"
0032 
0033 #include "G4Box.hh"
0034 #include "G4LogicalVolume.hh"
0035 #include "G4Material.hh"
0036 #include "G4PVPlacement.hh"
0037 #include "G4PVReplica.hh"
0038 #include "G4SDManager.hh"
0039 #include "G4SystemOfUnits.hh"
0040 #include "G4ThreeVector.hh"
0041 #include "G4Tubs.hh"
0042 #include "G4VPhysicalVolume.hh"
0043 
0044 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0045 ExN04CalorimeterROGeometry::ExN04CalorimeterROGeometry() : G4VReadOutGeometry()
0046 {
0047 #include "ExN04DetectorParameterDef.icc"
0048 }
0049 
0050 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0051 ExN04CalorimeterROGeometry::ExN04CalorimeterROGeometry(G4String aString)
0052   : G4VReadOutGeometry(aString)
0053 {
0054 #include "ExN04DetectorParameterDef.icc"
0055 }
0056 
0057 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0058 ExN04CalorimeterROGeometry::~ExN04CalorimeterROGeometry() {}
0059 
0060 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0061 G4VPhysicalVolume* ExN04CalorimeterROGeometry::Build()
0062 {
0063   // A dummy material is used to fill the volumes of the readout geometry.
0064   // ( It will be allowed to set a NULL pointer in volumes of such virtual
0065   // division in future, since this material is irrelevant for tracking.)
0066   G4Material* dummyMat = new G4Material(name = "dummyMat", 1., 1. * g / mole, 1. * g / cm3);
0067 
0068   // Builds the ReadOut World:
0069   G4Box* ROWorldBox = new G4Box("ROWorldBox", fexpHall_x, fexpHall_y, fexpHall_z);
0070   G4LogicalVolume* ROWorldLog =
0071     new G4LogicalVolume(ROWorldBox, dummyMat, "ROWorldLogical", 0, 0, 0);
0072   G4PVPlacement* ROWorldPhys =
0073     new G4PVPlacement(0, G4ThreeVector(), "ROWorldPhysical", ROWorldLog, 0, false, 0);
0074   // Calorimeter volume:
0075   G4VSolid* caloROtub = new G4Tubs("caloROtub", fcaloTubs_rmin, fcaloTubs_rmax, fcaloTubs_dz,
0076                                    fcaloTubs_sphi, fcaloTubs_dphi);
0077   G4LogicalVolume* caloROlog = new G4LogicalVolume(caloROtub, dummyMat, "caloROlogical", 0, 0, 0);
0078   G4VPhysicalVolume* caloROphys =
0079     new G4PVPlacement(0, G4ThreeVector(), "calROphysical", caloROlog, ROWorldPhys, false, 0);
0080 
0081   // -------------------------------
0082   // Calorimeter readout division:
0083   // -------------------------------
0084   // Phi division first: 48 sectors
0085   G4VSolid* caloROphiDivisionTub = new G4Tubs("caloROphiDivision", fcaloCell_rmin, fcaloCell_rmax,
0086                                               fcaloCell_dz, fcaloCell_sphi, fcaloCell_dphi);
0087   G4LogicalVolume* caloROphiDivisionLog =
0088     new G4LogicalVolume(caloROphiDivisionTub, dummyMat, "caloROphiDivisionLogical", 0, 0, 0);
0089   G4VPhysicalVolume* caloROphiDivisionPhys =
0090     new G4PVReplica("caloROphiDivisionPhysical", caloROphiDivisionLog, caloROphys, kPhi,
0091                     fsegmentsinPhi, fcaloCell_dphi);
0092   // then z division: 20 slices:
0093   G4VSolid* caloROcellTub = new G4Tubs("caloROcellTub", fcaloRing_rmin, fcaloRing_rmax,
0094                                        fcaloRing_dz, fcaloRing_sphi, fcaloRing_dphi);
0095   G4LogicalVolume* caloROcellLog =
0096     new G4LogicalVolume(caloROcellTub, dummyMat, "caloROcellLogical", 0, 0, 0);
0097   //  G4VPhysicalVolume * caloROcellPhys =
0098   new G4PVReplica("caloROcellPhysical", caloROcellLog, caloROphiDivisionPhys, kZAxis, fsegmentsinZ,
0099                   2. * fcaloRing_dz);
0100 
0101   // Flags the cells as sensitive .The pointer here serves
0102   //  as a flag only to check for sensitivity.
0103   //  (Could we make it by a simple cast of a non-NULL value ?)
0104   ExN04DummySD* dummySensi = new ExN04DummySD;
0105   caloROcellLog->SetSensitiveDetector(dummySensi);
0106 
0107   return ROWorldPhys;
0108 }