G4ErrorSurfaceTrajState.hh

Go to the documentation of this file.
00001 //
00002 // ********************************************************************
00003 // * License and Disclaimer                                           *
00004 // *                                                                  *
00005 // * The  Geant4 software  is  copyright of the Copyright Holders  of *
00006 // * the Geant4 Collaboration.  It is provided  under  the terms  and *
00007 // * conditions of the Geant4 Software License,  included in the file *
00008 // * LICENSE and available at  http://cern.ch/geant4/license .  These *
00009 // * include a list of copyright holders.                             *
00010 // *                                                                  *
00011 // * Neither the authors of this software system, nor their employing *
00012 // * institutes,nor the agencies providing financial support for this *
00013 // * work  make  any representation or  warranty, express or implied, *
00014 // * regarding  this  software system or assume any liability for its *
00015 // * use.  Please see the license in the file  LICENSE  and URL above *
00016 // * for the full disclaimer and the limitation of liability.         *
00017 // *                                                                  *
00018 // * This  code  implementation is the result of  the  scientific and *
00019 // * technical work of the GEANT4 collaboration.                      *
00020 // * By using,  copying,  modifying or  distributing the software (or *
00021 // * any work based  on the software)  you  agree  to acknowledge its *
00022 // * use  in  resulting  scientific  publications,  and indicate your *
00023 // * acceptance of all terms of the Geant4 Software license.          *
00024 // ********************************************************************
00025 //
00026 //
00027 // $Id: G4ErrorSurfaceTrajState.hh 69766 2013-05-14 14:33:55Z gcosmo $
00028 //
00029 //
00030 // Class description:
00031 //
00032 // Represents a trajectory state on a surface.
00033 // It can be represented by the 5 variables:
00034 //      1/p, v', w', v, w
00035 // where v'=dv/du and w'=dw/du in an orthonormal coordinate system
00036 // with axis u, v and w.
00037 
00038 // History:
00039 //
00040 // - Created:   P. Arce 
00041 // --------------------------------------------------------------------
00042 
00043 #ifndef G4ErrorSurfaceTrajState_hh
00044 #define G4ErrorSurfaceTrajState_hh
00045 
00046 #include "globals.hh"
00047 
00048 #include "G4ErrorTrajState.hh"
00049 #include "G4ErrorSurfaceTrajParam.hh"
00050 #include "G4ErrorFreeTrajState.hh"
00051 
00052 #include "G4Point3D.hh"
00053 #include "G4Vector3D.hh"
00054 #include "G4Plane3D.hh"
00055 
00056 class G4ErrorSurfaceTrajState : public G4ErrorTrajState
00057 {
00058 
00059  public:  // with description
00060 
00061   G4ErrorSurfaceTrajState( const G4String& partType, const G4Point3D& pos,
00062                            const G4Vector3D& mom, const G4Plane3D& plane,
00063                            const G4ErrorTrajErr& errmat = G4ErrorTrajErr(5,0) );
00064     // Constructor by providing particle, position, momentum and
00065     // G4Plane3D surface
00066 
00067   G4ErrorSurfaceTrajState( const G4String& partType, const G4Point3D& pos,
00068                            const G4Vector3D& mom, const G4Vector3D& vecV,
00069                            const G4Vector3D& vecW,
00070                            const G4ErrorTrajErr& errmat = G4ErrorTrajErr(5,0) );
00071     // Constructor by providing particle, position, momentum and
00072     // two vectors on surface
00073 
00074   G4ErrorSurfaceTrajState( G4ErrorFreeTrajState& tpSC, const G4Plane3D& plane );
00075     // Constructor by providing G4ErrorFreeTrajState and G4Plane3D surface
00076 
00077   G4ErrorSurfaceTrajState( G4ErrorFreeTrajState& tpSC, const G4Vector3D& vecV,
00078                            const G4Vector3D& vecW  , G4ErrorMatrix &transfM);
00079     // Constructor by providing G4ErrorFreeTrajState and two vectors on surface
00080 
00081   ~G4ErrorSurfaceTrajState(){}
00082   G4ErrorMatrix   BuildErrorMatrix( G4ErrorFreeTrajState& tpSC, const G4Vector3D& vecV,
00083                                     const G4Vector3D& vecW );
00084     // Build the error matrix from a free state plus the vectors of the surface
00085 
00086   virtual void Dump( std::ostream& out = G4cout ) const;
00087 
00088   friend
00089     std::ostream& operator<<(std::ostream&, const G4ErrorSurfaceTrajState& ts);
00090 
00091   // Set and Get methods 
00092 
00093   G4ErrorSurfaceTrajParam GetParameters() const
00094     { return fTrajParam; }
00095   void SetParameters( const G4Point3D& pos, const G4Vector3D& mom,
00096                       const G4Vector3D& vecV, const G4Vector3D& vecW )
00097     {
00098       fPosition = pos;
00099       fMomentum = mom;
00100       fTrajParam.SetParameters( pos, mom, vecV, vecW );
00101     }
00102 
00103   void SetParameters( const G4Point3D& pos, const G4Vector3D& mom,
00104                       const G4Plane3D& plane )
00105     {
00106       fPosition = pos;
00107       fMomentum = mom;
00108       fTrajParam.SetParameters( pos, mom, plane );
00109     }
00110 
00111   G4Vector3D GetVectorV() const
00112     { return fTrajParam.GetVectorV(); }
00113 
00114   G4Vector3D GetVectorW() const
00115     { return fTrajParam.GetVectorW(); }
00116 
00117   virtual void SetPosition( const G4Point3D pos )
00118     { SetParameters( pos, fMomentum, GetVectorV(), GetVectorW() ); }
00119 
00120   virtual void SetMomentum( const G4Vector3D& mom )
00121     { SetParameters( fPosition, mom, GetVectorV(), GetVectorW() ); }
00122     
00123  private:
00124 
00125   void Init();
00126     // Define Trajectory State type and build charge
00127 
00128  private:
00129 
00130   G4ErrorSurfaceTrajParam fTrajParam;
00131 
00132 };
00133 
00134 #endif

Generated on Mon May 27 17:48:12 2013 for Geant4 by  doxygen 1.4.7