G4ErrorTrajState.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: G4ErrorTrajState.hh 69766 2013-05-14 14:33:55Z gcosmo $
00028 //
00029 //
00030 // Class Description:
00031 //
00032 // Base class for the trajectory state
00033 
00034 // History:
00035 // - Created:   P. Arce
00036 // --------------------------------------------------------------------
00037 
00038 #ifndef G4ErrorTrajState_hh
00039 #define G4ErrorTrajState_hh
00040 
00041 #include "globals.hh"
00042 #include "G4Track.hh"
00043 #include "G4Point3D.hh"
00044 #include "G4Vector3D.hh"
00045 #include "G4ErrorTrajErr.hh"
00046 
00047 enum G4eTSType{ G4eTS_FREE, G4eTS_OS };
00048 
00049 class G4ErrorTrajState
00050 {
00051  public:  // with description
00052 
00053   G4ErrorTrajState() : fCharge(0.), theG4Track(0), iverbose(0) {}
00054 
00055   G4ErrorTrajState( const G4String& partType, const G4Point3D& pos,
00056                     const G4Vector3D& mom,
00057                     const G4ErrorTrajErr& errmat = G4ErrorTrajErr(5,0) );
00058     // Constructor by providing particle, position and momentum
00059 
00060   virtual ~G4ErrorTrajState(){}
00061 
00062   void SetData( const G4String& partType, const G4Point3D& pos,
00063                 const G4Vector3D& mom );
00064     // Set particle, position and momentum
00065 
00066   void BuildCharge();
00067     // Build charge based on particle type
00068 
00069   friend
00070   std::ostream& operator<<(std::ostream&, const G4ErrorTrajState& ts);
00071 
00072   virtual G4int PropagateError( const G4Track* ); 
00073     // Propagate the error along the step
00074 
00075   virtual G4int Update( const G4Track* ){ return -1; }
00076     // Update parameters from G4Track
00077  
00078   void UpdatePosMom( const G4Point3D& pos, const G4Vector3D& mom );
00079     // Update position and momentum
00080 
00081   void DumpPosMomError( std::ostream& out = G4cout ) const;
00082     // Dump position, momentum and error
00083 
00084   virtual void Dump( std::ostream& out = G4cout ) const = 0;
00085     // Abstract method to dump all TrajState parameters
00086   
00087   // Set and Get methods 
00088 
00089   const G4String& GetParticleType() const
00090     { return fParticleType;}
00091   void SetParticleType( const G4String& partType )
00092     { fParticleType = partType;}
00093 
00094   G4Point3D GetPosition() const
00095     { return fPosition; }
00096   virtual void SetPosition( const G4Point3D pos )
00097     { fPosition = pos; }
00098 
00099   G4Vector3D GetMomentum() const
00100     { return fMomentum; }
00101   virtual void SetMomentum( const G4Vector3D& mom )
00102     { fMomentum = mom; }
00103 
00104   G4ErrorTrajErr GetError() const
00105     { return fError; }
00106   virtual void SetError( G4ErrorTrajErr em )
00107     { fError = em; }
00108 
00109   G4Track* GetG4Track() const
00110     { return theG4Track; }
00111   void SetG4Track( G4Track* trk )
00112     { theG4Track = trk; }
00113 
00114   G4double GetCharge() const
00115     { return fCharge; }
00116   void SetCharge( G4double ch )
00117     { fCharge = ch; }
00118 
00119   virtual G4eTSType GetTSType() const
00120     { return theTSType; }
00121 
00122  protected:
00123 
00124   G4String fParticleType;
00125   G4Point3D fPosition;
00126   G4Vector3D fMomentum;
00127   G4double fCharge;
00128   G4ErrorTrajErr fError;
00129 
00130   G4eTSType theTSType;
00131 
00132   G4Track* theG4Track;
00133 
00134   G4int iverbose;
00135 };
00136 
00137 #endif

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