Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:58:01

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 
0028 #ifndef G4ChannelingFastSimCrystalData_h
0029 #define G4ChannelingFastSimCrystalData_h 1
0030 
0031 #include "G4ios.hh"
0032 #include "globals.hh"
0033 #include <CLHEP/Units/SystemOfUnits.h>
0034 #include "G4ThreeVector.hh"
0035 #include "Randomize.hh"
0036 #include "G4Material.hh"
0037 #include <unordered_map>
0038 
0039 #include "G4VChannelingFastSimCrystalData.hh"
0040 #include "G4ChannelingFastSimInterpolation.hh"
0041 
0042 /** \file G4ChannelingFastSimCrystalData.hh
0043 * \brief Definition of the G4ChannelingFastSimCrystalData class
0044 * The class inherits G4VChannelingFastSimCrystalData containing the data and properties
0045 * related to the crystal lattice.
0046 * The functions related to the crystal geometry (transformation of coordinates and angles
0047 * from the reference system of the bounding box of the local volume to
0048 * the crystal lattice co-rotating reference system and vice versa) and
0049 * initialization function SetMaterialProperties are compiled in this class.
0050 */
0051 
0052 class G4ChannelingFastSimCrystalData  : public G4VChannelingFastSimCrystalData
0053 {
0054 public:
0055 
0056     G4ChannelingFastSimCrystalData();
0057     virtual ~G4ChannelingFastSimCrystalData() = default;
0058 
0059 public:
0060 
0061     ///find and upload crystal lattice input files, calculate all the basic values
0062     ///(to do only once)
0063     void SetMaterialProperties(const G4Material* crystal, const G4String &lattice);
0064 
0065     ///calculate the coordinates in the co-rotating reference system
0066     ///within a channel (periodic cell)
0067     ///(connected with crystal planes/axes either bent or straight)
0068     G4ThreeVector CoordinatesFromBoxToLattice(const G4ThreeVector &pos0);
0069 
0070     ///calculate the coordinates in the Box reference system
0071     ///(connected with the bounding box of the volume)
0072     G4ThreeVector CoordinatesFromLatticeToBox(const G4ThreeVector &pos);
0073 
0074     ///change the channel if necessary, recalculate x o y
0075     G4ThreeVector ChannelChange(G4double &x, G4double &y, G4double &z);
0076 
0077     ///calculate the horizontal angle in the co-rotating reference system
0078     ///within a channel (periodic cell)
0079     ///(connected with crystal planes/axes either bent or straight)
0080     G4double AngleXFromBoxToLattice(G4double tx, G4double z)
0081     {return tx-AngleXShift(z)-GetCUtetax(z);}
0082 
0083     ///calculate the horizontal angle in the Box reference system
0084     ///(connected with the bounding box of the volume)
0085     G4double AngleXFromLatticeToBox(G4double tx, G4double z)
0086     {return tx+AngleXShift(z)+GetCUtetax(z);}
0087 
0088     ///auxialiary function to transform the horizontal angle
0089     G4double AngleXShift(G4double z){return fMiscutAngle + z*fCurv;}
0090 
0091 private:
0092 
0093     ///variables
0094     G4int fNsteps=353;//number of steps per channeling oscillation
0095     G4double fR0=1.1*CLHEP::fermi;//*A^(1/3) - radius of nucleus
0096 
0097     ///Values related to coordinate transformation
0098     long long int fNChannelx=0;//horizontal number of channel
0099                              //(either straight of bent) inside the box
0100     long long int fNChannely=0;//vertical number of channel (either straight of bent)
0101                              //inside the box; =0 in the case of planes
0102 
0103     ///values related to the crystal lattice
0104     G4int fNpointsx=0,fNpointsy=0;// number of horizontal and vertical nodes of
0105                                   // interpolation
0106     G4double fDx=0, fDy=0;// channel (periodic cell)
0107                       //horizontal and vertical dimensions
0108 
0109     ///fundamental constants of material
0110     std::vector <G4double> fN0; // nuclear concentration
0111     std::vector <G4double> fU1; // amplitude of thermal oscillations
0112     std::vector <G4double> fZ1;//atomic number of each element
0113     std::vector <G4double> fAN; //atomic mass of each element
0114 };
0115 
0116 #endif