Back to home page

EIC code displayed by LXR

 
 

    


Warning, file /include/Geant4/G4StokesVector.hh was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).

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 // Geant4 Class header file
0027 //
0028 // File name:     G4StokesVector
0029 //
0030 // Author:        Andreas Schaelicke
0031 //
0032 // Class Description:
0033 //   Provides Stokesvector representation employed in implementation of
0034 //   polarized processes.
0035 //   - store three components of a stokesvector
0036 //   - distinguish between boson or fermion state (different transformations)
0037 //   - provide unique definition of reference frame (cf. G4PolarizationHelper)
0038 
0039 #ifndef G4StokesVector_h
0040 #define G4StokesVector_h 1
0041 
0042 #include "G4ThreeVector.hh"
0043 #include "G4RotationMatrix.hh"
0044 
0045 class G4StokesVector : public G4ThreeVector
0046 {
0047  public:
0048   G4StokesVector();
0049   explicit G4StokesVector(const G4ThreeVector& v);
0050   ~G4StokesVector() = default;
0051 
0052   G4bool IsZero() const;
0053 
0054   inline G4double p1() const { return x(); }
0055   inline G4double p2() const { return y(); }
0056   inline G4double p3() const { return z(); }
0057 
0058   inline G4double Transverse() const { return perp(); }
0059 
0060   inline G4ThreeVector PolSqr() const
0061   {
0062     return G4ThreeVector(x() * x(), y() * y(), z() * z());
0063   }
0064   inline G4ThreeVector PolSqrt() const
0065   {
0066     return G4ThreeVector(std::sqrt(x()), std::sqrt(y()), std::sqrt(z()));
0067   }
0068   G4ThreeVector PolError(const G4StokesVector& sum2, long n);
0069 
0070   // Ratio of 3-vectors.
0071   G4ThreeVector PolDiv(const G4StokesVector&);
0072 
0073   inline void SetPhoton() { fIsPhoton = true; }
0074 
0075   void RotateAz(G4ThreeVector nInteractionFrame,
0076                 G4ThreeVector particleDirection);
0077   void InvRotateAz(G4ThreeVector nInteractionFrame,
0078                    G4ThreeVector particleDirection);
0079   void RotateAz(G4double cosphi, G4double sinphi);
0080   G4double GetBeta();
0081 
0082   void DiceUniform();
0083   void DiceP1();
0084   void DiceP2();
0085   void DiceP3();
0086 
0087   void FlipP3();
0088 
0089   // standard vectors:
0090   static const G4StokesVector ZERO;
0091   static const G4StokesVector P1;
0092   static const G4StokesVector P2;
0093   static const G4StokesVector P3;
0094   static const G4StokesVector M1;
0095   static const G4StokesVector M2;
0096   static const G4StokesVector M3;
0097 
0098  private:
0099   G4bool fIsPhoton;
0100 };
0101 
0102 #endif