Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-12-17 09:28: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 //
0027 /// \file optical/LXe/src/LXeWLSSlab.cc
0028 /// \brief Implementation of the LXeWLSSlab class
0029 //
0030 //
0031 #include "LXeWLSSlab.hh"
0032 
0033 #include "LXeWLSFiber.hh"
0034 
0035 #include "G4Box.hh"
0036 #include "G4LogicalVolume.hh"
0037 #include "G4Material.hh"
0038 #include "G4SystemOfUnits.hh"
0039 #include "globals.hh"
0040 
0041 G4LogicalVolume* LXeWLSSlab::fScintSlab_log = nullptr;
0042 
0043 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0044 
0045 LXeWLSSlab::LXeWLSSlab(G4RotationMatrix* pRot, const G4ThreeVector& tlate,
0046                        G4LogicalVolume* pMotherLogical, G4bool pMany, G4int pCopyNo,
0047                        LXeDetectorConstruction* c)
0048   : G4PVPlacement(
0049       pRot, tlate,
0050       new G4LogicalVolume(new G4Box("temp", 1., 1., 1.), G4Material::GetMaterial("Vacuum"), "temp"),
0051       "Slab", pMotherLogical, pMany, pCopyNo),
0052     fConstructor(c)
0053 {
0054   CopyValues();
0055 
0056   G4double slab_x = fScint_x / 2.;
0057   G4double slab_y = fScint_y / 2.;
0058 
0059   auto ScintSlab_box = new G4Box("Slab", slab_x, slab_y, fSlab_z);
0060 
0061   fScintSlab_log =
0062     new G4LogicalVolume(ScintSlab_box, G4Material::GetMaterial("Polystyrene"), "Slab");
0063 
0064   G4double spacing = 2. * slab_y / fNfibers;
0065 
0066   auto rm = new G4RotationMatrix();
0067   rm->rotateY(90. * deg);
0068 
0069   // Place fibers
0070   for (G4int i = 0; i < fNfibers; ++i) {
0071     G4double Y = -(spacing) * (fNfibers - 1) * 0.5 + i * spacing;
0072     new LXeWLSFiber(rm, G4ThreeVector(0., Y, 0.), fScintSlab_log, false, 0, fConstructor);
0073   }
0074 
0075   SetLogicalVolume(fScintSlab_log);
0076 }
0077 
0078 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0079 
0080 void LXeWLSSlab::CopyValues()
0081 {
0082   fScint_x = fConstructor->GetScintX();
0083   fScint_y = fConstructor->GetScintY();
0084   fScint_z = fConstructor->GetScintZ();
0085   fNfibers = fConstructor->GetNFibers();
0086   fSlab_z = fConstructor->GetSlabZ();
0087 }