Geant4 Cross Reference |
1 // 2 // ******************************************************************** 3 // * License and Disclaimer * 4 // * * 5 // * The Geant4 software is copyright of the Copyright Holders of * 6 // * the Geant4 Collaboration. It is provided under the terms and * 7 // * conditions of the Geant4 Software License, included in the file * 8 // * LICENSE and available at http://cern.ch/geant4/license . These * 9 // * include a list of copyright holders. * 10 // * * 11 // * Neither the authors of this software system, nor their employing * 12 // * institutes,nor the agencies providing financial support for this * 13 // * work make any representation or warranty, express or implied, * 14 // * regarding this software system or assume any liability for its * 15 // * use. Please see the license in the file LICENSE and URL above * 16 // * for the full disclaimer and the limitation of liability. * 17 // * * 18 // * This code implementation is the result of the scientific and * 19 // * technical work of the GEANT4 collaboration. * 20 // * By using, copying, modifying or distributing the software (or * 21 // * any work based on the software) you agree to acknowledge its * 22 // * use in resulting scientific publications, and indicate your * 23 // * acceptance of all terms of the Geant4 Software license. * 24 // ******************************************************************** 25 // 26 // Author: Alexei Sytov 27 // Co-author: Gianfranco PaternĂ² (modifications & testing) 28 29 #ifndef G4ChannelingFastSimCrystalData_h 30 #define G4ChannelingFastSimCrystalData_h 1 31 32 #include "G4ios.hh" 33 #include "globals.hh" 34 #include <CLHEP/Units/SystemOfUnits.h> 35 #include "G4ThreeVector.hh" 36 #include "Randomize.hh" 37 #include "G4Material.hh" 38 #include <unordered_map> 39 40 #include "G4VChannelingFastSimCrystalData.hh" 41 #include "G4ChannelingFastSimInterpolation.hh" 42 43 /** \file G4ChannelingFastSimCrystalData.hh 44 * \brief Definition of the G4ChannelingFastSimCrystalData class 45 * The class inherits G4VChannelingFastSimCrystalData containing the data and properties 46 * related to the crystal lattice. 47 * The functions related to the crystal geometry (transformation of coordinates and angles 48 * from the reference system of the bounding box of the local volume to 49 * the crystal lattice co-rotating reference system and vice versa) and 50 * initialization function SetMaterialProperties are compiled in this class. 51 */ 52 53 class G4ChannelingFastSimCrystalData : public G4VChannelingFastSimCrystalData 54 { 55 public: 56 57 G4ChannelingFastSimCrystalData(); 58 virtual ~G4ChannelingFastSimCrystalData() = default; 59 60 public: 61 62 ///find and upload crystal lattice input files, calculate all the basic values 63 ///(to do only once) 64 void SetMaterialProperties(const G4Material* crystal, 65 const G4String &lattice, 66 const G4String &filePath); 67 68 ///calculate the coordinates in the co-rotating reference system 69 ///within a channel (periodic cell) 70 ///(connected with crystal planes/axes either bent or straight) 71 G4ThreeVector CoordinatesFromBoxToLattice(const G4ThreeVector &pos0); 72 73 ///calculate the coordinates in the Box reference system 74 ///(connected with the bounding box of the volume) 75 G4ThreeVector CoordinatesFromLatticeToBox(const G4ThreeVector &pos); 76 77 ///change the channel if necessary, recalculate x o y 78 G4ThreeVector ChannelChange(G4double &x, G4double &y, G4double &z); 79 80 ///calculate the horizontal angle in the co-rotating reference system 81 ///within a channel (periodic cell) 82 ///(connected with crystal planes/axes either bent or straight) 83 G4double AngleXFromBoxToLattice(G4double tx, G4double z) 84 {return tx-AngleXShift(z)-GetCUtetax(z);} 85 86 ///calculate the horizontal angle in the Box reference system 87 ///(connected with the bounding box of the volume) 88 G4double AngleXFromLatticeToBox(G4double tx, G4double z) 89 {return tx+AngleXShift(z)+GetCUtetax(z);} 90 91 ///auxialiary function to transform the horizontal angle 92 G4double AngleXShift(G4double z){return fMiscutAngle + z*fCurv;} 93 94 ///get channel width in x and y 95 G4double GetChannelWidthX(){return fDx;} 96 G4double GetChannelWidthY(){return fDy;} 97 98 private: 99 100 ///variables 101 G4int fNsteps=353;//number of steps per channeling oscillation 102 G4double fR0=1.1*CLHEP::fermi;//*A^(1/3) - radius of nucleus 103 104 ///Values related to coordinate transformation 105 long long int fNChannelx=0;//horizontal number of channel 106 //(either straight of bent) inside the box 107 long long int fNChannely=0;//vertical number of channel (either straight of bent) 108 //inside the box; =0 in the case of planes 109 110 ///values related to the crystal lattice 111 G4int fNpointsx=0,fNpointsy=0;// number of horizontal and vertical nodes of 112 // interpolation 113 G4double fDx=0, fDy=0;// channel (periodic cell) 114 //horizontal and vertical dimensions 115 116 ///fundamental constants of material 117 std::vector <G4double> fN0; // nuclear concentration 118 std::vector <G4double> fU1; // amplitude of thermal oscillations 119 std::vector <G4double> fZ1;//atomic number of each element 120 std::vector <G4double> fAN; //atomic mass of each element 121 }; 122 123 #endif 124