Commit fb0186b7 authored by Adrien Matta's avatar Adrien Matta
Browse files

* Progress on SamuraiMagnetcField

        - Now project particle in FDC2 plan
parent 10022c46
Pipeline #121348 passed with stages
in 6 minutes and 2 seconds
......@@ -30,10 +30,26 @@ using namespace NPUNITS;
using namespace std;
ClassImp(SamuraiFieldMap);
////////////////////////////////////////////////////////////////////////////////
TVector3 SamuraiFieldMap::PropagateToFDC2(TVector3 pos, TVector3 dir, double angle,double R){
// go to FDC2 frame reference
pos.RotateY(-angle);
dir.RotateY(-angle);
double deltaZ=R-pos.Z();
dir*=deltaZ/dir.Z();
pos+=dir;
cout << pos.Z() << " " << R << endl;
pos.SetX(pos.X());
pos.RotateY(angle);
return pos;
}
////////////////////////////////////////////////////////////////////////////////
std::vector< TVector3 > SamuraiFieldMap::Propagate(double rmax, double Brho, TVector3 pos, TVector3 dir){
pos.RotateY(m_angle);
dir.RotateY(m_angle);
dir=dir.Unit();
// Property of a particle with the correct Brho:
// We assume a 4He to compute v
// The choice of the particle is of no importance
......@@ -95,7 +111,11 @@ std::vector< TVector3 > SamuraiFieldMap::Propagate(double rmax, double Brho, TVe
r = sqrt(pos.X()*pos.X()+pos.Z()*pos.Z());
count++;
}
imp=imp.Unit();
pos = PropagateToFDC2(pos, imp, (59.930-90.0)*deg, 3686.77 + 880.745/2.);
pos.RotateY(-m_angle);
track.push_back(pos);
return track;
}
......
......@@ -69,7 +69,7 @@ class SamuraiFieldMap{
// return a 3D track of the particle in the field
std::vector< TVector3 > Propagate(double rmax, double Brho, TVector3 pos, TVector3 dir);
void func(NPL::Particle& N, TVector3 pos, TVector3 dir, TVector3& new_pos, TVector3& new_dir);
//TVector3 PropagateToFDC2(double angle,double);
TVector3 PropagateToFDC2(TVector3 pos, TVector3 dir,double angle,double R);
//
ClassDef(SamuraiFieldMap,1);
};
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment