Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-04-10 08:05:40

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