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 //
0029 // Class description:
0030 //
0031 // Represents a trajectory state on a surface.
0032 // It can be represented by the 5 variables:
0033 //      1/p, v', w', v, w
0034 // where v'=dv/du and w'=dw/du in an orthonormal coordinate system
0035 // with axis u, v and w.
0036 
0037 // History:
0038 //
0039 // - Created:   P. Arce
0040 // --------------------------------------------------------------------
0041 
0042 #ifndef G4ErrorSurfaceTrajState_hh
0043 #define G4ErrorSurfaceTrajState_hh
0044 
0045 #include "globals.hh"
0046 
0047 #include "G4ErrorTrajState.hh"
0048 #include "G4ErrorSurfaceTrajParam.hh"
0049 #include "G4ErrorFreeTrajState.hh"
0050 
0051 #include "G4Point3D.hh"
0052 #include "G4Vector3D.hh"
0053 #include "G4Plane3D.hh"
0054 
0055 class G4ErrorSurfaceTrajState : public G4ErrorTrajState
0056 {
0057  public:  // with description
0058   G4ErrorSurfaceTrajState(const G4String& partType, const G4Point3D& pos,
0059                           const G4Vector3D& mom, const G4Plane3D& plane,
0060                           const G4ErrorTrajErr& errmat = G4ErrorTrajErr(5, 0));
0061   // Constructor by providing particle, position, momentum and
0062   // G4Plane3D surface
0063 
0064   G4ErrorSurfaceTrajState(const G4String& partType, const G4Point3D& pos,
0065                           const G4Vector3D& mom, const G4Vector3D& vecV,
0066                           const G4Vector3D& vecW,
0067                           const G4ErrorTrajErr& errmat = G4ErrorTrajErr(5, 0));
0068   // Constructor by providing particle, position, momentum and
0069   // two vectors on surface
0070 
0071   G4ErrorSurfaceTrajState(G4ErrorFreeTrajState& tpSC, const G4Plane3D& plane);
0072   // Constructor by providing G4ErrorFreeTrajState and G4Plane3D surface
0073 
0074   G4ErrorSurfaceTrajState(G4ErrorFreeTrajState& tpSC, const G4Vector3D& vecV,
0075                           const G4Vector3D& vecW, G4ErrorMatrix& transfM);
0076   // Constructor by providing G4ErrorFreeTrajState and two vectors on surface
0077 
0078   ~G4ErrorSurfaceTrajState() {}
0079   G4ErrorMatrix BuildErrorMatrix(G4ErrorFreeTrajState& tpSC,
0080                                  const G4Vector3D& vecV,
0081                                  const G4Vector3D& vecW);
0082   // Build the error matrix from a free state plus the vectors of the surface
0083 
0084   virtual void Dump(std::ostream& out = G4cout) const;
0085 
0086   friend std::ostream& operator<<(std::ostream&,
0087                                   const G4ErrorSurfaceTrajState& ts);
0088 
0089   // Set and Get methods
0090 
0091   G4ErrorSurfaceTrajParam GetParameters() const { return fTrajParam; }
0092   void SetParameters(const G4Point3D& pos, const G4Vector3D& mom,
0093                      const G4Vector3D& vecV, const G4Vector3D& vecW)
0094   {
0095     fPosition = pos;
0096     fMomentum = mom;
0097     fTrajParam.SetParameters(pos, mom, vecV, vecW);
0098   }
0099 
0100   void SetParameters(const G4Point3D& pos, const G4Vector3D& mom,
0101                      const G4Plane3D& plane)
0102   {
0103     fPosition = pos;
0104     fMomentum = mom;
0105     fTrajParam.SetParameters(pos, mom, plane);
0106   }
0107 
0108   G4Vector3D GetVectorV() const { return fTrajParam.GetVectorV(); }
0109 
0110   G4Vector3D GetVectorW() const { return fTrajParam.GetVectorW(); }
0111 
0112   virtual void SetPosition(const G4Point3D pos)
0113   {
0114     SetParameters(pos, fMomentum, GetVectorV(), GetVectorW());
0115   }
0116 
0117   virtual void SetMomentum(const G4Vector3D& mom)
0118   {
0119     SetParameters(fPosition, mom, GetVectorV(), GetVectorW());
0120   }
0121 
0122  private:
0123   void Init();
0124   // Define Trajectory State type and build charge
0125 
0126  private:
0127   G4ErrorSurfaceTrajParam fTrajParam;
0128 };
0129 
0130 #endif