Back to home page

EIC code displayed by LXR

 
 

    


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

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 /// \file materials/include/G4LatticePhysical.hh
0027 /// \brief Definition of the G4LatticePhysical class
0028 //
0029 // 20131114  Add verbosity for diagnostic output
0030 // 20131116  Replace G4Transform3D with G4RotationMatrix
0031 
0032 #ifndef G4LatticePhysical_h
0033 #define G4LatticePhysical_h 1
0034 
0035 #include "G4LatticeLogical.hh"
0036 #include "G4RotationMatrix.hh"
0037 #include "G4ThreeVector.hh"
0038 
0039 class G4LatticePhysical
0040 {
0041  public:
0042   G4LatticePhysical(const G4LatticeLogical* Lat = nullptr,
0043     const G4RotationMatrix* Rot = nullptr);  // Use FRAME rotation
0044   virtual ~G4LatticePhysical() = default;
0045 
0046   void SetVerboseLevel(G4int vb) { verboseLevel = vb; }
0047 
0048   // NOTE:  Pass by value to allow in-situ rotations
0049   G4double MapKtoV(G4int, G4ThreeVector) const;
0050   G4ThreeVector MapKtoVDir(G4int, G4ThreeVector) const;
0051 
0052   void SetLatticeLogical(const G4LatticeLogical* Lat) { fLattice = Lat; }
0053   void SetPhysicalOrientation(const G4RotationMatrix* Rot);  // FRAME rotation
0054   void SetLatticeOrientation(G4double, G4double);
0055   void SetMillerOrientation(G4int, G4int, G4int);
0056 
0057  public:
0058   const G4LatticeLogical* GetLattice() const { return fLattice; }
0059 
0060   G4double GetScatteringConstant() const { return fLattice->GetScatteringConstant(); }
0061   G4double GetAnhDecConstant() const { return fLattice->GetAnhDecConstant(); }
0062   G4double GetLDOS() const { return fLattice->GetLDOS(); }
0063   G4double GetSTDOS() const { return fLattice->GetSTDOS(); }
0064   G4double GetFTDOS() const { return fLattice->GetFTDOS(); }
0065   G4double GetBeta() const { return fLattice->GetBeta(); }
0066   G4double GetGamma() const { return fLattice->GetGamma(); }
0067   G4double GetLambda() const { return fLattice->GetLambda(); }
0068   G4double GetMu() const { return fLattice->GetMu(); }
0069 
0070   // Apply orientation transforms to specified vector
0071   G4ThreeVector RotateToGlobal(const G4ThreeVector& dir) const;
0072   G4ThreeVector RotateToLocal(const G4ThreeVector& dir) const;
0073 
0074  private:
0075   G4int verboseLevel{0};  // Enable diagnostic output
0076 
0077   G4double fTheta{0}, fPhi{0};  // Lattice orientation within object
0078   const G4LatticeLogical* fLattice;  // Underlying lattice parameters
0079 
0080   G4RotationMatrix fLocalToGlobal;
0081   G4RotationMatrix fGlobalToLocal;
0082 };
0083 
0084 #endif