Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:59: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 // G4QuadrupoleMagField
0027 //
0028 // Class description:
0029 //
0030 // Class for creation of quadrupole magnetic field
0031 //   fGradient - is the gradient value for quadrupole magnetic lense.
0032 // Then the magnetic field components are:
0033 //   Bx = B[0] = fGradient*X ,
0034 //   By = B[1] = fGradient*Y ,
0035 //   Bz = B[2] = 0 .
0036 // Here X,Y,Z are the coordinates of a space point of interest.
0037 
0038 // 03.02.1997, V.Grichine - Created
0039 // 11.05.2012, B.Riese  - Allow displaced origin and rotation
0040 // -------------------------------------------------------------------
0041 #ifndef G4QUADRUPOLEMAGFIELD_HH
0042 #define G4QUADRUPOLEMAGFIELD_HH
0043 
0044 #include "G4MagneticField.hh"
0045 #include "G4ThreeVector.hh"
0046 #include "G4RotationMatrix.hh"
0047 
0048 class G4QuadrupoleMagField : public G4MagneticField
0049 {
0050   public:
0051 
0052     G4QuadrupoleMagField(G4double pGradient);
0053     G4QuadrupoleMagField(      G4double pGradient, 
0054                          const G4ThreeVector& pOrigin, 
0055                                G4RotationMatrix* pMatrix);
0056    ~G4QuadrupoleMagField() override;
0057 
0058     void GetFieldValue(const G4double yTrack[],
0059                              G4double B[]     ) const override;
0060     G4Field* Clone() const override;
0061 
0062   private:
0063 
0064     G4double          fGradient = 0.0;
0065     G4ThreeVector     fOrigin = G4ThreeVector(0.0, 0.0, 0.0);
0066     G4RotationMatrix* fpMatrix = nullptr;
0067 };
0068 
0069 #endif