Back to home page

EIC code displayed by LXR

 
 

    


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

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 //
0027 //
0028 // Class Description:
0029 //
0030 // Holds the 5 independent variables of the trajectory for a
0031 // G4ErrorFreeTrajState object. It is not used for anything but for
0032 // printing, but anyhow it is updated everytime the position and
0033 // momentum are updated.
0034 
0035 // History:
0036 // - Created: Pedro Arce, September 2004
0037 // --------------------------------------------------------------------
0038 
0039 #ifndef G4ErrorFreeTrajParam_hh
0040 #define G4ErrorFreeTrajParam_hh
0041 
0042 #include "G4Point3D.hh"
0043 #include "G4Vector3D.hh"
0044 
0045 #include "globals.hh"
0046 #include "G4Track.hh"
0047 
0048 class G4ErrorFreeTrajParam
0049 {
0050  public:  // with description
0051   G4ErrorFreeTrajParam()
0052     : fInvP(0.)
0053     , fLambda(0.)
0054     , fPhi(0.)
0055     , fYPerp(0.)
0056     , fZPerp(0.)
0057   {}
0058   G4ErrorFreeTrajParam(const G4Point3D& pos, const G4Vector3D& mom);
0059   // build parameters from position and momentum
0060 
0061   G4ErrorFreeTrajParam(const G4ErrorFreeTrajParam&) = default;
0062   G4ErrorFreeTrajParam(G4ErrorFreeTrajParam&&)      = default;
0063   // The copy and move constructors
0064 
0065   virtual ~G4ErrorFreeTrajParam() {}
0066 
0067   G4ErrorFreeTrajParam& operator=(const G4ErrorFreeTrajParam&) = default;
0068   G4ErrorFreeTrajParam& operator=(G4ErrorFreeTrajParam&&) = default;
0069   // The copy and move assignment operators
0070 
0071   void Update(const G4Track* aTrack);
0072   // update parameters from G4Track
0073 
0074   friend std::ostream& operator<<(std::ostream&,
0075                                   const G4ErrorFreeTrajParam& ts);
0076 
0077   // Set and Get methods
0078 
0079   void SetParameters(const G4Point3D& pos, const G4Vector3D& mom);
0080 
0081   G4Vector3D GetDirection() const { return fDir; }
0082 
0083   G4double GetInvP() const { return fInvP; }
0084   G4double GetLambda() const { return fLambda; }
0085   G4double GetPhi() const { return fPhi; }
0086   G4double GetYPerp() const { return fYPerp; }
0087   G4double GetZPerp() const { return fZPerp; }
0088 
0089  private:
0090   G4Vector3D fDir;   // direction to which YPerp, ZPerp refer
0091   G4double fInvP;    // inverse of momentum
0092   G4double fLambda;  // 90 - theta angle of direction
0093   G4double fPhi;     // phi angle of direction
0094   G4double fYPerp;   // Y coordinate
0095   G4double fZPerp;   // Z coordinate
0096 };
0097 
0098 #endif