Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-09-15 08:58:21

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 // Author:      Alexei Sytov
0027 
0028 #ifndef G4ChannelingFastSimInterpolation_h
0029 #define G4ChannelingFastSimInterpolation_h
0030 
0031 #include "G4PhysicsVector.hh"
0032 #include "G4Physics2DVector.hh"
0033 #include "G4ThreeVector.hh"
0034 #include "G4PhysicsLinearVector.hh"
0035 
0036 /** \file G4ChannelingFastSimInterpolation.hh
0037 * \brief Definition of the G4ChannelingFastSimInterpolation class
0038 * The class includes spline interpolation coefficients for the important functions
0039 * needed in Channeling FastSimulation model, i.e. electric fields, nuclear and
0040 * electron densities and minimum energy of ionization. All the functions have
0041 * transverse coordinates as arguments (x for crystal planes, x and y for crystal axes).
0042 * All the functions are calculated in the co-rotating reference system (along crystal
0043 * planes/axes).
0044 */
0045 
0046 class G4ChannelingFastSimInterpolation {
0047 
0048 public:
0049     G4ChannelingFastSimInterpolation(G4double dx0,
0050                                    G4double dy0,
0051                                    G4int nPointsx0,
0052                                    G4int nPointsy0,
0053                                    G4int iModel0);
0054     ~G4ChannelingFastSimInterpolation() = default;
0055 
0056     ///Get Spline Function
0057     G4double GetIF(G4double xx, G4double yy);
0058 
0059     ///Set spline coefficients
0060     void SetCoefficients1D(G4double AI0,
0061                            G4double BI0,
0062                            G4double CI0,
0063                            G4double DI0,
0064                            G4int i);
0065     void SetCoefficients2D(G4double AI3D0,
0066                            G4double BI3D0,
0067                            G4double CI3D0,
0068                            G4int i,
0069                            G4int j,
0070                            G4int k);
0071 
0072 private:
0073     G4double Spline1D(G4double xx);
0074     G4double Spline2D(G4double xx, G4double yy);// cubic spline of 2-variable function
0075 
0076     G4double fDx=0., fDy=0.; //channel width and height
0077     G4double fStepi=0., fStepj=0.; //interpolation steps in x and y, respectively
0078     G4double fStepi2=0.; //=fStepi*fStepi
0079     G4int nPointsx=0, nPointsy=0; //number of interpolation nodes in x and y, respectively
0080 
0081     std::vector <G4double> fAI;
0082     std::vector <G4double> fBI;
0083     std::vector <G4double> fCI;
0084     std::vector <G4double> fDI;
0085 
0086     std::vector<std::vector<G4double>> fAI3D;
0087     std::vector<std::vector<G4double>> fBI3D;
0088     std::vector<std::vector<G4double>> fCI3D;
0089     std::vector<std::vector<G4double>> fAI3D3;
0090     std::vector<std::vector<G4double>> fBI3D3;
0091     std::vector<std::vector<G4double>> fCI3D3;
0092 
0093     G4int iModel=1;
0094 
0095 };
0096 
0097 #endif