diff --git a/NPLib/Detectors/PISTA/TFPMWPhysics.cxx b/NPLib/Detectors/PISTA/TFPMWPhysics.cxx
index 9c1c1bbcbe8c56dff1cbd9e18b3c902e439c8cff..f088f42dc21ca7d78efdb2657b35e94107889ec7 100644
--- a/NPLib/Detectors/PISTA/TFPMWPhysics.cxx
+++ b/NPLib/Detectors/PISTA/TFPMWPhysics.cxx
@@ -30,7 +30,7 @@
 #include <limits>
 #include <filesystem>
 using namespace std;
- 
+
 //   NPL
 #include "RootInput.h"
 #include "RootOutput.h"
@@ -156,7 +156,7 @@ void TFPMWPhysics::BuildPhysicalEvent() {
     //ChargeY.push_back(QSumY[DetN]);
     PositionX.push_back(PosX);
     PositionY.push_back(PosY);
-    
+
     //Here we linearise the position if the yaml file is found
     if (LoadLinea == true){
       int IndexX = (DetN-1) * 2;
@@ -358,12 +358,14 @@ void TFPMWPhysics::CalculateFocalPlanePosition(double Zf){
 
     double t = (Z3-Zf)/(Z2-Zf);
     Xf = 1./(t-1)*(t*X2-X3);
-    Thetaf = atan((X3-X2)/(Z3-Z2));
 
     Z2 = DetPosZ[2]+m_GapSize;
     Z3 = DetPosZ[3]+m_GapSize;
     Yf = 1./(t-1)*(t*Y2-Y3);
 
+    Thetaf = atan((X3-X2)/(Z3-Z2));
+    Phif = atan((Y3-Y2)/(Z3-Z2));
+
     if (LoadLinea == true){
       Z2 = DetPosZ[2]-m_GapSize;
       Z3 = DetPosZ[3]-m_GapSize; 
@@ -374,12 +376,13 @@ void TFPMWPhysics::CalculateFocalPlanePosition(double Zf){
 
       double t = (Z3-Zf)/(Z2-Zf);
       XfLin = 1./(t-1)*(t*X2Lin-X3Lin);
-      ThetafLin = atan((X3Lin-X2Lin)/(Z3-Z2));
 
       Z2 = DetPosZ[2]+m_GapSize;
       Z3 = DetPosZ[3]+m_GapSize;
       YfLin = 1./(t-1)*(t*Y2Lin-Y3Lin);
 
+      ThetafLin = atan((X3Lin-X2Lin)/(Z3-Z2));
+      PhifLin = atan((Y3Lin-Y2Lin)/(Z3-Z2));
     } //end load yaml true
   }
 }
@@ -694,9 +697,11 @@ void TFPMWPhysics::Clear() {
   XfLin = -1000;
   YfLin = -1000; 
   Thetaf = -1000;
+  Phif = -1000;
   Theta_in = -1000;
   Phi_in = -1000;
   ThetafLin = -1000;
+  PhifLin = -1000;
   Theta_in_Lin = -1000;
   Phi_in_Lin = -1000;
 
diff --git a/NPLib/Detectors/PISTA/TFPMWPhysics.h b/NPLib/Detectors/PISTA/TFPMWPhysics.h
index 2957538a1d8caa7300e2a93029b6bbdc42606470..959ebba21235d0097d7d337299042caa34771f07 100644
--- a/NPLib/Detectors/PISTA/TFPMWPhysics.h
+++ b/NPLib/Detectors/PISTA/TFPMWPhysics.h
@@ -85,6 +85,8 @@ class TFPMWPhysics : public TObject, public NPL::VDetector {
     double YfLin;
     double Thetaf;
     double ThetafLin;
+    double Phif;
+    double PhifLin;
     double Xt;
     double Yt;
     double XtLin;