ECCE @ EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
G4ErrorFreeTrajState.hh
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file G4ErrorFreeTrajState.hh
1 //
2 // ********************************************************************
3 // * License and Disclaimer *
4 // * *
5 // * The Geant4 software is copyright of the Copyright Holders of *
6 // * the Geant4 Collaboration. It is provided under the terms and *
7 // * conditions of the Geant4 Software License, included in the file *
8 // * LICENSE and available at http://cern.ch/geant4/license . These *
9 // * include a list of copyright holders. *
10 // * *
11 // * Neither the authors of this software system, nor their employing *
12 // * institutes,nor the agencies providing financial support for this *
13 // * work make any representation or warranty, express or implied, *
14 // * regarding this software system or assume any liability for its *
15 // * use. Please see the license in the file LICENSE and URL above *
16 // * for the full disclaimer and the limitation of liability. *
17 // * *
18 // * This code implementation is the result of the scientific and *
19 // * technical work of the GEANT4 collaboration. *
20 // * By using, copying, modifying or distributing the software (or *
21 // * any work based on the software) you agree to acknowledge its *
22 // * use in resulting scientific publications, and indicate your *
23 // * acceptance of all terms of the Geant4 Software license. *
24 // ********************************************************************
25 //
26 //
27 //
28 // Class Description:
29 //
30 // Represents a free G4ErrorTrajState
31 // It can be represented by the 5 variables
32 // 1/p, lambda, phi, y_perp, z_perp
33 // where lambda and phi are the dip and azimuthal angles related
34 // to the momentum components in the following way:
35 // p_x = p cos(lambda) cos(phi) ! lambda = 90 - theta
36 // p_y = p cos(lambda) sin(phi)
37 // p_z = p sin(lambda)
38 // y_perp and z_perp are the coordinates of the trajectory in a
39 // local orthonormal reference frame with the x_perp axis along the
40 // particle direction, the y_perp being parallel to the x-y plane.
41 //
42 // This class also takes care of propagating the error associated to
43 // the trajectory
44 
45 // History:
46 // - Created: P. Arce
47 // --------------------------------------------------------------------
48 
49 #ifndef G4ErrorFreeTrajState_hh
50 #define G4ErrorFreeTrajState_hh
51 
52 #include "globals.hh"
53 
54 #include "G4ErrorMatrix.hh"
55 
56 #include "G4ErrorTrajState.hh"
57 #include "G4ErrorFreeTrajParam.hh"
58 
59 #include "G4Point3D.hh"
60 #include "G4Vector3D.hh"
61 
63 
65 {
66  public: // with description
67 
69  G4ErrorFreeTrajState( const G4String& partName,
70  const G4Point3D& pos,
71  const G4Vector3D& mom,
72  const G4ErrorTrajErr& errmat = G4ErrorTrajErr(5,0) );
73  // Constructor by providing particle, position and momentum
74 
76  // Constructor by providing G4ErrorSurfaceTrajState
77 
79 
80  virtual G4int Update( const G4Track* aTrack );
81  // update parameters from G4Track
82 
83  virtual G4int PropagateError( const G4Track* aTrack );
84  // propagate the error along the step
85 
86  virtual void Dump( std::ostream& out = G4cout ) const;
87  // dump TrajState parameters
88 
89  friend
90  std::ostream& operator<<(std::ostream&, const G4ErrorFreeTrajState& ts);
91 
92  // Set and Get methods
93 
94  virtual void SetPosition( const G4Point3D pos )
95  { SetParameters( pos, fMomentum ); }
96 
97  virtual void SetMomentum( const G4Vector3D& mom )
98  { SetParameters( fPosition, mom ); }
99 
100  void SetParameters( const G4Point3D& pos, const G4Vector3D& mom )
101  {
102  fPosition = pos;
103  fMomentum = mom;
104  fTrajParam.SetParameters( pos, mom );
105  }
106 
108  { return fTrajParam; }
109 
111  { return theTransfMat; }
112 
113  private:
114 
115  void Init();
116  // define TrajState type and build charge
117 
118  G4int PropagateErrorMSC( const G4Track* aTrack );
119  // add the error associated to multiple scattering
120 
121  void CalculateEffectiveZandA( const G4Material* mate, double& effZ, double& effA );
122  // calculate effective Z and A (needed by PropagateErrorMSC)
123 
124  G4int PropagateErrorIoni( const G4Track* aTrack );
125  // add the error associated to ionization energy loss
126 
127 
128  private:
129 
131 
133 
134  G4bool theFirstStep; // to count if transf mat is updated or initialized
135 };
136 
137 #endif