From b60cc39c68b9da48c6c337b6ac032eb1c8401f6d Mon Sep 17 00:00:00 2001
From: Morfouace <pierre.morfouace@cea.fr>
Date: Tue, 10 Jan 2023 17:25:06 +0100
Subject: [PATCH] Updating Sofia project

---
 NPLib/Detectors/Sofia/GladFieldMap.cxx |  2 +-
 Projects/s455/Analysis.cxx             | 15 ++++++++-------
 Projects/s455/Analysis.h               |  4 ++++
 3 files changed, 13 insertions(+), 8 deletions(-)

diff --git a/NPLib/Detectors/Sofia/GladFieldMap.cxx b/NPLib/Detectors/Sofia/GladFieldMap.cxx
index ef72f6f80..00cca76db 100644
--- a/NPLib/Detectors/Sofia/GladFieldMap.cxx
+++ b/NPLib/Detectors/Sofia/GladFieldMap.cxx
@@ -48,7 +48,7 @@ GladFieldMap::GladFieldMap() {
   m_bin = 50;
   m_Current = 2135.;
   m_Scale = m_Current/3583.81;
-  m_Glad_Entrance = TVector3(0,0,-1.135*m);
+  m_Glad_Entrance = TVector3(0,0,-1.1135*m);
   m_Glad_TurningPoint = TVector3(0,0,0);
   m_Tilt = -14.*deg;
   m_B = m_Scale*m_Bmax;
diff --git a/Projects/s455/Analysis.cxx b/Projects/s455/Analysis.cxx
index 4085ae48f..e1eaa3147 100644
--- a/Projects/s455/Analysis.cxx
+++ b/Projects/s455/Analysis.cxx
@@ -104,8 +104,8 @@ void Analysis::Init(){
   m_GladField = new GladFieldMap();
   m_GladField->SetCurrent(2135.);
   //m_GladField->SetGladEntrance(0, 0.02*m, 2.774*m + 0.5405*m);
-  m_GladField->SetGladEntrance(0, 0, -1.135*m);
-  //m_GladField->SetGladTurningPoint(0, 0.02*m, 2.774*m  + 0.5405*m + 1.135*m);
+  m_GladField->SetGladEntrance(0, 0, -1.1135*m);
+  //m_GladField->SetGladTurningPoint(0, 0.02*m, 2.774*m  + 0.5405*m + 1.1135*m);
   m_GladField->SetGladTurningPoint(0, 0, 0);
   m_GladField->SetGladTiltAngle(-14.*deg);
   m_GladField->LoadMap("GladFieldMap_50mm.dat");
@@ -610,11 +610,8 @@ void Analysis::FissionFragmentAnalysis(int which_cathode){
         }
       }
 
-      // *** Calculation Theta_out *** //
-      double DistanceStartToG = 2.774*m + 0.5405*m +1.135*m;
-      double DistanceATToG = 2.774*m + 0.5405*m +1.135*m - DistancePlasticToCathode[which_cathode-1];
-      double DistanceStartToA = 2.3155*m;
-      double DistanceStartToMW2 = 2.651*m;
+  
+      DistanceATToG = DistanceStartToG - DistancePlasticToCathode[which_cathode-1];
       double Theta0 = 20.*deg;//m_GladField->GetCentralTheta();
       double XA = 0;
       double ZA = DistanceStartToA - DistanceStartToG;
@@ -900,6 +897,10 @@ void Analysis::End(){
 ////////////////////////////////////////////////////////////////////////////////
 void Analysis::InitParameter(){
   
+  DistanceStartToG = 2.774*m + 0.5405*m + 1.1135*m;
+  DistanceStartToA = 2.3155*m;
+  DistanceStartToMW2 = 2.651*m;
+
   DistancePlasticToCathode[0] = 285;//Distance to Pb1 
   DistancePlasticToCathode[1] = 385;//Distance to Pb2 
   DistancePlasticToCathode[2] = 335.;//Distance to C 
diff --git a/Projects/s455/Analysis.h b/Projects/s455/Analysis.h
index acd91cb9a..995d3a2c5 100644
--- a/Projects/s455/Analysis.h
+++ b/Projects/s455/Analysis.h
@@ -88,6 +88,10 @@ class Analysis: public NPL::VAnalysis{
     double fZBeta_p1;
 
     double DistancePlasticToCathode[3];
+    double DistanceStartToG;
+    double DistanceStartToA;
+    double DistanceStartToMW2;
+    double DistanceATToG;
 
     TCutG* cut_Pb1[14];
     TCutG* cut_Pb2[14];
-- 
GitLab