From 8aea02754e70bbad5b7008677fdd752462bee127 Mon Sep 17 00:00:00 2001
From: Charlie Paxman <cp00474@surrey.ac.uk>
Date: Mon, 24 Oct 2022 12:17:50 +0100
Subject: [PATCH] *e793s - (d,t) spec fac first pass + new CS2 function for
 (d,t), not fully operational + minnor tweaks elsewhere

---
 Projects/e793s/Analysis.cxx                   |  34 +-
 Projects/e793s/Analysis.h                     |   7 +-
 .../e793s/Detector/mugast_01Sep22.detector    | 138 +++
 .../mugast_01Sep22_Test_Z0p00.detector        | 138 +++
 .../mugast_01Sep22_Test_Z3p00.detector        | 138 +++
 .../mugast_01Sep22_Test_Zn3p00.detector       | 138 +++
 Projects/e793s/Detector/mugast_08Nov.detector | 138 +++
 .../e793s/Detector/mugast_11Jul22.detector    | 138 +++
 .../e793s/Detector/mugast_14Oct22.detector    | 138 +++
 .../e793s/Detector/mugast_14Oct22_2.detector  | 138 +++
 .../e793s/Detector/mugast_18Oct22.detector    | 138 +++
 .../Detector/mugast_18Oct22_Tx0p5.detector    | 138 +++
 .../Detector/mugast_18Oct22_Tx2.detector      | 138 +++
 .../Detector/mugast_30Aug22_2p06um.detector   | 138 +++
 .../e793s/Detector/mugast_Test2um.detector    | 138 +++
 .../Detector/mugast_testingMG1dip.detector    | 138 +++
 Projects/e793s/Reaction/47Kdd_08Nov.reaction  |  28 +
 Projects/e793s/Reaction/47Kdd_Sim.reaction    |   8 +-
 .../e793s/Reaction/47Kdp_14Oct22.reaction     |  28 +
 .../e793s/Reaction/47Kdp_14Oct22_2.reaction   |  28 +
 .../e793s/Reaction/47Kdp_18Oct22.reaction     |  28 +
 .../Reaction/47Kdp_30Aug22_2p06um.reaction    |  28 +
 .../e793s/Reaction/47Kdt_18Oct22.reaction     |  30 +
 Projects/e793s/Reaction/47Kpp_08Nov.reaction  |  28 +
 Projects/e793s/Reaction/47Kpp_Sim.reaction    |  34 +
 .../e793s/Reaction/IsotropicDeuterons.source  |  12 +
 .../e793s/Reaction/IsotropicProtons.source    |  12 +
 .../Sim_47Kdp_26May22_v2_0143.reaction        |  34 +
 Projects/e793s/exp.sh                         |  82 +-
 Projects/e793s/macro/CS2.h                    |  54 +-
 Projects/e793s/macro/CS2_dt.h                 | 915 ++++++++++++++++++
 Projects/e793s/macro/DrawPlots.h              | 491 ++++++----
 Projects/e793s/macro/Plots_47Kdd.C            |  52 +
 Projects/e793s/macro/Plots_47Kdp.C            |  65 ++
 Projects/e793s/macro/Plots_47Kdt.C            |  38 +-
 Projects/e793s/sim.sh                         |  56 +-
 36 files changed, 3801 insertions(+), 223 deletions(-)
 create mode 100755 Projects/e793s/Detector/mugast_01Sep22.detector
 create mode 100755 Projects/e793s/Detector/mugast_01Sep22_Test_Z0p00.detector
 create mode 100755 Projects/e793s/Detector/mugast_01Sep22_Test_Z3p00.detector
 create mode 100755 Projects/e793s/Detector/mugast_01Sep22_Test_Zn3p00.detector
 create mode 100755 Projects/e793s/Detector/mugast_08Nov.detector
 create mode 100755 Projects/e793s/Detector/mugast_11Jul22.detector
 create mode 100755 Projects/e793s/Detector/mugast_14Oct22.detector
 create mode 100755 Projects/e793s/Detector/mugast_14Oct22_2.detector
 create mode 100755 Projects/e793s/Detector/mugast_18Oct22.detector
 create mode 100755 Projects/e793s/Detector/mugast_18Oct22_Tx0p5.detector
 create mode 100755 Projects/e793s/Detector/mugast_18Oct22_Tx2.detector
 create mode 100755 Projects/e793s/Detector/mugast_30Aug22_2p06um.detector
 create mode 100644 Projects/e793s/Detector/mugast_Test2um.detector
 create mode 100644 Projects/e793s/Detector/mugast_testingMG1dip.detector
 create mode 100755 Projects/e793s/Reaction/47Kdd_08Nov.reaction
 create mode 100755 Projects/e793s/Reaction/47Kdp_14Oct22.reaction
 create mode 100755 Projects/e793s/Reaction/47Kdp_14Oct22_2.reaction
 create mode 100755 Projects/e793s/Reaction/47Kdp_18Oct22.reaction
 create mode 100755 Projects/e793s/Reaction/47Kdp_30Aug22_2p06um.reaction
 create mode 100755 Projects/e793s/Reaction/47Kdt_18Oct22.reaction
 create mode 100755 Projects/e793s/Reaction/47Kpp_08Nov.reaction
 create mode 100755 Projects/e793s/Reaction/47Kpp_Sim.reaction
 create mode 100755 Projects/e793s/Reaction/IsotropicDeuterons.source
 create mode 100755 Projects/e793s/Reaction/IsotropicProtons.source
 create mode 100644 Projects/e793s/Reaction/Sim_47Kdp_26May22_v2_0143.reaction
 create mode 100644 Projects/e793s/macro/CS2_dt.h
 create mode 100644 Projects/e793s/macro/Plots_47Kdd.C

diff --git a/Projects/e793s/Analysis.cxx b/Projects/e793s/Analysis.cxx
index 646433aa6..c04cbfdd9 100755
--- a/Projects/e793s/Analysis.cxx
+++ b/Projects/e793s/Analysis.cxx
@@ -225,14 +225,20 @@ void Analysis::TreatEvent(){
     // MUST2
     int TelescopeNumber = M2->TelescopeNumber[countMust2];
 
+    /**/
     if(isSim && !isPhaseSpace){
-      ThetaCM_detected_MM->Fill(ReactionConditions->GetThetaCM());
-      ThetaLab_detected_MM->Fill(ReactionConditions->GetTheta(0));
-
-      int MMX = TelescopeNumber-1;
-      ThetaCM_detected_MMX[MMX]->Fill(ReactionConditions->GetThetaCM());
-      ThetaLab_detected_MMX[MMX]->Fill(ReactionConditions->GetTheta(0));
+      if(M2->Si_E[countMust2]>0 && M2->CsI_E[countMust2]<=0){
+        /* IS a count in DSSD, but NOT in CsI to exclude punch through  */
+        /* May need further gating in Si_E & _T */
+        ThetaCM_detected_MM->Fill(ReactionConditions->GetThetaCM());
+        ThetaLab_detected_MM->Fill(ReactionConditions->GetTheta(0));
+
+        int MMX = TelescopeNumber-1;
+        ThetaCM_detected_MMX[MMX]->Fill(ReactionConditions->GetThetaCM());
+        ThetaLab_detected_MMX[MMX]->Fill(ReactionConditions->GetTheta(0));
+      }
     }
+    /**/
 
     /************************************************/
     // Part 1 : Impact Angle
@@ -307,7 +313,20 @@ void Analysis::TreatEvent(){
 
     ThetaLab.push_back(thetalab_tmp/deg);
     PhiLab.push_back(philab_tmp/deg);
-//cout << "here_EndMustLoop" << endl;
+
+    //if(isSim && !isPhaseSpace){
+    //  ThetaCM_detected_MM->Fill(reaction.EnergyLabToThetaCM(elab_tmp, thetalab_tmp)/deg);
+    //  ThetaLab_detected_MM->Fill(thetalab_tmp/deg);
+
+    //  int MMX = TelescopeNumber-1;
+    //  ThetaCM_detected_MMX[MMX]->Fill(reaction.EnergyLabToThetaCM(elab_tmp, thetalab_tmp)/deg);
+    //  ThetaLab_detected_MMX[MMX]->Fill(thetalab_tmp/deg);
+    //}
+
+
+
+
+    //cout << "here_EndMustLoop" << endl;
   }
 
 //cout << "here_BeforeMugastLoop" << endl;
@@ -1106,3 +1125,4 @@ extern "C"{
 
   proxy_analysis p_analysis;
 }
+
diff --git a/Projects/e793s/Analysis.h b/Projects/e793s/Analysis.h
index 3a4ad3872..071c320aa 100755
--- a/Projects/e793s/Analysis.h
+++ b/Projects/e793s/Analysis.h
@@ -42,7 +42,7 @@
 #include <TMath.h>
 #include <bitset>
 
-int NumThetaAngleBins = 1800;// 180 = 1 deg, 360 = 0.5 deg, 900 = 0.2 deg, 1800 = 0.1 deg
+int NumThetaAngleBins = 900;// 180 = 1 deg, 360 = 0.5 deg, 900 = 0.2 deg, 1800 = 0.1 deg
 
 auto ThetaCM_emmitted = new TH1F("ThetaCM_emmitted","ThetaCM_emmitted",NumThetaAngleBins,0,180);
 auto ThetaCM_detected_MM = new TH1F("ThetaCM_detected_MM","ThetaCM_detected_MM",NumThetaAngleBins,0,180);
@@ -53,6 +53,7 @@ auto ThetaLab_detected_MM = new TH1F("ThetaLab_detected_MM","ThetaLab_detected_M
 auto ThetaLab_detected_MG = new TH1F("ThetaLab_detected_MG","ThetaLab_detected_MG",NumThetaAngleBins,0,180);
 //auto HistCline_MM = new TH1F("HistCline_MM","HistClint_MM",NumThetaAngleBins,0,180);
 //auto HistCline_MG = new TH1F("HistCline_MG","HistClint_MG",NumThetaAngleBins,0,180);
+
 double degtorad = M_PI/180.;
 vector<double> clineVal, clineX;
 bool filledCline;
@@ -62,9 +63,6 @@ TH1F *ThetaCM_detected_MMX[5];
 TH1F *ThetaLab_detected_MGX[6];
 TH1F *ThetaLab_detected_MMX[5];
 
-
-
-
 class Analysis: public NPL::VAnalysis{
   public:
     Analysis();
@@ -269,6 +267,7 @@ class Analysis: public NPL::VAnalysis{
     //Simulation Stuff
     bool isSim;
     bool isPhaseSpace;
+    bool excludePoor;
     bool writetoscreen;
     TInitialConditions* Initial;
     TInteractionCoordinates* Interaction;
diff --git a/Projects/e793s/Detector/mugast_01Sep22.detector b/Projects/e793s/Detector/mugast_01Sep22.detector
new file mode 100755
index 000000000..cd1429b52
--- /dev/null
+++ b/Projects/e793s/Detector/mugast_01Sep22.detector
@@ -0,0 +1,138 @@
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%% Target %%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+Target
+  THICKNESS= 2.879799 micrometer
+  ANGLE= 0 deg
+  RADIUS= 10 mm
+  MATERIAL= CD2
+  X= +0.00 millimeter
+  Y= +0.00 millimeter
+  Z= +0.291361 millimeter
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%% MUST2 TELESCOPES %%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+%%%%%%% Telescope 1 %%%%%%%
+M2Telescope
+  X128_Y128 = 	+115.7	+009.5	+355.7	 mm
+  X128_Y1 = 	+104.5	+101.5	+326.4	 mm
+  X1_Y1 = 	+014.0	+101.9	+362.1	 mm
+  X1_Y128 = 	+025.2	+009.8	+391.4	 mm
+  SI=  1.00
+  SILI= 0.00
+  CSI= 1.00
+  VIS= all
+
+%%%%%%% Telescope 2 %%%%%%%
+M2Telescope
+  X128_Y128 = 	-011.5	+102.5	+362.2	 mm
+  X128_Y1 = 	-101.6	+102.4	+325.7	 mm
+  X1_Y1 = 	-113.3	+010.3	+354.7	 mm
+  X1_Y128 = 	-023.1	+010.4	+391.2	 mm
+  SI=  1.00
+  SILI= 0.00
+  CSI= 1.00
+  VIS= all
+
+%%%%%%% Telescope 3 %%%%%%%
+M2Telescope
+  X128_Y128 = 	-113.4	-012.5	+354.6	 mm
+  X128_Y1 = 	-101.7	-104.7	+326.0	 mm
+  X1_Y1 = 	-011.6	-104.6	+362.6	 mm
+  X1_Y128 = 	-023.3	-012.3	+391.2	 mm
+  SI= 1.00
+  SILI= 0.00
+  CSI= 1.00
+  VIS= all
+
+%%%%%%% Telescope 4 %%%%%%%
+M2Telescope
+  X128_Y128 = 	+013.4	-105.0	+362.1	 mm
+  X128_Y1 = 	+103.8	-105.1	+326.3	 mm
+  X1_Y1 = 	+115.3	-012.8	+354.8	 mm
+  X1_Y128 = 	+024.9	-012.7	+390.6	 mm
+  SI= 1.00
+  SILI= 0.00
+  CSI= 1.00
+  VIS= all
+
+%%%%%%% Telescope 5 %%%%%%%
+M2Telescope
+  X128_Y128 = 	+143.2	-086.7	+003.4	 mm
+  X128_Y1 = 	+139.9	+010.4	+002.7	 mm
+  X1_Y1 = 	+140.1	+011.2	+100.0	 mm
+  X1_Y128 = 	+143.4	-086.0	+100.7	 mm
+  SI= 1.00
+  SILI= 0.00
+  CSI= 1.00
+  VIS= all
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%% MUGAST TRAPEZOIDS %%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+Mugast Trapezoid
+  DetectorNumber = 1
+  X128_Y128 = 	-022.7	+042.2	-098.2	 mm
+  X1_Y128 = 	-040.4	+024.6	-098.2	 mm
+  X1_Y1 = 	-120.3	+058.0	-030.9	 mm
+  X128_Y1 = 	-055.3	+122.6	-031.1	 mm
+	
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%				
+Mugast Trapezoid
+  DetectorNumber = 2
+  X128_Y128 = 	-045.6	+014.5	-097.8	 mm
+  X1_Y128 = 	-045.7	-010.8	-097.9	 mm
+  X1_Y1 = 	-125.9	-043.8	-030.8	 mm
+  X128_Y1 = 	-125.7	+047.8	-030.7	 mm
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%				
+Mugast Trapezoid
+  DetectorNumber = 3
+  X128_Y128 = 	-042.5	-022.2	-098.3	 mm
+  X1_Y128 = 	-024.8	-039.9	-098.4	 mm
+  X1_Y1 = 	-058.0	-120.0	-031.4	 mm
+  X128_Y1 = 	-122.7	-055.2	-031.2	 mm
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+Mugast Trapezoid
+  DetectorNumber = 4				
+  X128_Y128 = 	-014.9	-045.6	-098.5	 mm
+  X1_Y128 = 	+010.3	-045.6	-098.6	 mm
+  X1_Y1 = 	+043.6	-125.7	-031.7	 mm
+  X128_Y1 = 	-048.0	-125.6	-031.4	 mm
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+Mugast Trapezoid
+  DetectorNumber = 5				
+  X128_Y128 = 	+021.9	-042.1	-099.1	 mm
+  X1_Y128 = 	+039.8	-024.5	-099.0	 mm
+  X1_Y1 = 	+119.7	-057.7	-032.1	 mm
+  X128_Y1 = 	+055.0	-122.3	-031.9	 mm
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%				
+Mugast Trapezoid
+  DetectorNumber = 7
+  X128_Y128 = 	+042.3	+022.6	-098.5	 mm
+  X1_Y128 = 	+024.5	+040.5	-098.4	 mm
+  X1_Y1 = 	+057.9	+120.0	-030.8	 mm
+  X128_Y1 = 	+122.5	+055.2	-031.3	 mm
+
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%% MODULAR LEAF %%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+
+ModularLeaf 
+  DefaultValue= -5000
+  Leafs= GATCONF_MASTER CONFDEC_AGATA T_CATS2_HF T_MUGAST_CATS2 T_MUGAST_CATS2b E_AGATA T_FAG_CATS2 T_VAMOS_AGATA T_AGATA_CATS2 T_MUGAST_VAMOS T_MUGAST_AGATA T_VAMOS_CATS2 
+%%% Leafs= GATCONF_MASTER CONFDEC_AGATA CONFDEC_VAMOS T_CATS2_HF T_MUGAST_CATS2 T_MUGAST_CATS2b EVAMOS_AGATA E_AGATA T_FAG_CATS2 T_VAMOS_AGATA T_AGATA_CATS2 TVAMOS_MUGAST_HF T_MUGAST_VAMOS T_MUGAST_AGATA T_VAMOS_CATS2 ADC1_9 ADC1_10 ADC1_11 MW_00 MW_01 MW_02 MW_03 MW_04 MW_05 MW_06 MW_07 MW_08 MW_09 MW_10 MW_11 MW_12 MW_13 MW_14 MW_15 MW_16 MW_17 MW_18 MW_19 MW_21
+  X= EVAMOS_AGATA   
+  Y= E_AGATA       
+
diff --git a/Projects/e793s/Detector/mugast_01Sep22_Test_Z0p00.detector b/Projects/e793s/Detector/mugast_01Sep22_Test_Z0p00.detector
new file mode 100755
index 000000000..a96c9ff13
--- /dev/null
+++ b/Projects/e793s/Detector/mugast_01Sep22_Test_Z0p00.detector
@@ -0,0 +1,138 @@
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%% Target %%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+Target
+  THICKNESS= 2.879799 micrometer
+  ANGLE= 0 deg
+  RADIUS= 10 mm
+  MATERIAL= CD2
+  X= +0.00 millimeter
+  Y= +0.00 millimeter
+  Z= +0.00 millimeter
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%% MUST2 TELESCOPES %%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+%%%%%%% Telescope 1 %%%%%%%
+M2Telescope
+  X128_Y128 = 	+115.7	+009.5	+355.7	 mm
+  X128_Y1 = 	+104.5	+101.5	+326.4	 mm
+  X1_Y1 = 	+014.0	+101.9	+362.1	 mm
+  X1_Y128 = 	+025.2	+009.8	+391.4	 mm
+  SI=  1.00
+  SILI= 0.00
+  CSI= 1.00
+  VIS= all
+
+%%%%%%% Telescope 2 %%%%%%%
+M2Telescope
+  X128_Y128 = 	-011.5	+102.5	+362.2	 mm
+  X128_Y1 = 	-101.6	+102.4	+325.7	 mm
+  X1_Y1 = 	-113.3	+010.3	+354.7	 mm
+  X1_Y128 = 	-023.1	+010.4	+391.2	 mm
+  SI=  1.00
+  SILI= 0.00
+  CSI= 1.00
+  VIS= all
+
+%%%%%%% Telescope 3 %%%%%%%
+M2Telescope
+  X128_Y128 = 	-113.4	-012.5	+354.6	 mm
+  X128_Y1 = 	-101.7	-104.7	+326.0	 mm
+  X1_Y1 = 	-011.6	-104.6	+362.6	 mm
+  X1_Y128 = 	-023.3	-012.3	+391.2	 mm
+  SI= 1.00
+  SILI= 0.00
+  CSI= 1.00
+  VIS= all
+
+%%%%%%% Telescope 4 %%%%%%%
+M2Telescope
+  X128_Y128 = 	+013.4	-105.0	+362.1	 mm
+  X128_Y1 = 	+103.8	-105.1	+326.3	 mm
+  X1_Y1 = 	+115.3	-012.8	+354.8	 mm
+  X1_Y128 = 	+024.9	-012.7	+390.6	 mm
+  SI= 1.00
+  SILI= 0.00
+  CSI= 1.00
+  VIS= all
+
+%%%%%%% Telescope 5 %%%%%%%
+M2Telescope
+  X128_Y128 = 	+143.2	-086.7	+003.4	 mm
+  X128_Y1 = 	+139.9	+010.4	+002.7	 mm
+  X1_Y1 = 	+140.1	+011.2	+100.0	 mm
+  X1_Y128 = 	+143.4	-086.0	+100.7	 mm
+  SI= 1.00
+  SILI= 0.00
+  CSI= 1.00
+  VIS= all
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%% MUGAST TRAPEZOIDS %%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+Mugast Trapezoid
+  DetectorNumber = 1
+  X128_Y128 = 	-022.7	+042.2	-098.2	 mm
+  X1_Y128 = 	-040.4	+024.6	-098.2	 mm
+  X1_Y1 = 	-120.3	+058.0	-030.9	 mm
+  X128_Y1 = 	-055.3	+122.6	-031.1	 mm
+	
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%				
+Mugast Trapezoid
+  DetectorNumber = 2
+  X128_Y128 = 	-045.6	+014.5	-097.8	 mm
+  X1_Y128 = 	-045.7	-010.8	-097.9	 mm
+  X1_Y1 = 	-125.9	-043.8	-030.8	 mm
+  X128_Y1 = 	-125.7	+047.8	-030.7	 mm
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%				
+Mugast Trapezoid
+  DetectorNumber = 3
+  X128_Y128 = 	-042.5	-022.2	-098.3	 mm
+  X1_Y128 = 	-024.8	-039.9	-098.4	 mm
+  X1_Y1 = 	-058.0	-120.0	-031.4	 mm
+  X128_Y1 = 	-122.7	-055.2	-031.2	 mm
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+Mugast Trapezoid
+  DetectorNumber = 4				
+  X128_Y128 = 	-014.9	-045.6	-098.5	 mm
+  X1_Y128 = 	+010.3	-045.6	-098.6	 mm
+  X1_Y1 = 	+043.6	-125.7	-031.7	 mm
+  X128_Y1 = 	-048.0	-125.6	-031.4	 mm
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+Mugast Trapezoid
+  DetectorNumber = 5				
+  X128_Y128 = 	+021.9	-042.1	-099.1	 mm
+  X1_Y128 = 	+039.8	-024.5	-099.0	 mm
+  X1_Y1 = 	+119.7	-057.7	-032.1	 mm
+  X128_Y1 = 	+055.0	-122.3	-031.9	 mm
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%				
+Mugast Trapezoid
+  DetectorNumber = 7
+  X128_Y128 = 	+042.3	+022.6	-098.5	 mm
+  X1_Y128 = 	+024.5	+040.5	-098.4	 mm
+  X1_Y1 = 	+057.9	+120.0	-030.8	 mm
+  X128_Y1 = 	+122.5	+055.2	-031.3	 mm
+
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%% MODULAR LEAF %%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+
+ModularLeaf 
+  DefaultValue= -5000
+  Leafs= GATCONF_MASTER CONFDEC_AGATA T_CATS2_HF T_MUGAST_CATS2 T_MUGAST_CATS2b E_AGATA T_FAG_CATS2 T_VAMOS_AGATA T_AGATA_CATS2 T_MUGAST_VAMOS T_MUGAST_AGATA T_VAMOS_CATS2 
+%%% Leafs= GATCONF_MASTER CONFDEC_AGATA CONFDEC_VAMOS T_CATS2_HF T_MUGAST_CATS2 T_MUGAST_CATS2b EVAMOS_AGATA E_AGATA T_FAG_CATS2 T_VAMOS_AGATA T_AGATA_CATS2 TVAMOS_MUGAST_HF T_MUGAST_VAMOS T_MUGAST_AGATA T_VAMOS_CATS2 ADC1_9 ADC1_10 ADC1_11 MW_00 MW_01 MW_02 MW_03 MW_04 MW_05 MW_06 MW_07 MW_08 MW_09 MW_10 MW_11 MW_12 MW_13 MW_14 MW_15 MW_16 MW_17 MW_18 MW_19 MW_21
+  X= EVAMOS_AGATA   
+  Y= E_AGATA       
+
diff --git a/Projects/e793s/Detector/mugast_01Sep22_Test_Z3p00.detector b/Projects/e793s/Detector/mugast_01Sep22_Test_Z3p00.detector
new file mode 100755
index 000000000..d69b6d9f5
--- /dev/null
+++ b/Projects/e793s/Detector/mugast_01Sep22_Test_Z3p00.detector
@@ -0,0 +1,138 @@
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%% Target %%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+Target
+  THICKNESS= 2.879799 micrometer
+  ANGLE= 0 deg
+  RADIUS= 10 mm
+  MATERIAL= CD2
+  X= +0.00 millimeter
+  Y= +0.00 millimeter
+  Z= +3.00 millimeter
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%% MUST2 TELESCOPES %%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+%%%%%%% Telescope 1 %%%%%%%
+M2Telescope
+  X128_Y128 = 	+115.7	+009.5	+355.7	 mm
+  X128_Y1 = 	+104.5	+101.5	+326.4	 mm
+  X1_Y1 = 	+014.0	+101.9	+362.1	 mm
+  X1_Y128 = 	+025.2	+009.8	+391.4	 mm
+  SI=  1.00
+  SILI= 0.00
+  CSI= 1.00
+  VIS= all
+
+%%%%%%% Telescope 2 %%%%%%%
+M2Telescope
+  X128_Y128 = 	-011.5	+102.5	+362.2	 mm
+  X128_Y1 = 	-101.6	+102.4	+325.7	 mm
+  X1_Y1 = 	-113.3	+010.3	+354.7	 mm
+  X1_Y128 = 	-023.1	+010.4	+391.2	 mm
+  SI=  1.00
+  SILI= 0.00
+  CSI= 1.00
+  VIS= all
+
+%%%%%%% Telescope 3 %%%%%%%
+M2Telescope
+  X128_Y128 = 	-113.4	-012.5	+354.6	 mm
+  X128_Y1 = 	-101.7	-104.7	+326.0	 mm
+  X1_Y1 = 	-011.6	-104.6	+362.6	 mm
+  X1_Y128 = 	-023.3	-012.3	+391.2	 mm
+  SI= 1.00
+  SILI= 0.00
+  CSI= 1.00
+  VIS= all
+
+%%%%%%% Telescope 4 %%%%%%%
+M2Telescope
+  X128_Y128 = 	+013.4	-105.0	+362.1	 mm
+  X128_Y1 = 	+103.8	-105.1	+326.3	 mm
+  X1_Y1 = 	+115.3	-012.8	+354.8	 mm
+  X1_Y128 = 	+024.9	-012.7	+390.6	 mm
+  SI= 1.00
+  SILI= 0.00
+  CSI= 1.00
+  VIS= all
+
+%%%%%%% Telescope 5 %%%%%%%
+M2Telescope
+  X128_Y128 = 	+143.2	-086.7	+003.4	 mm
+  X128_Y1 = 	+139.9	+010.4	+002.7	 mm
+  X1_Y1 = 	+140.1	+011.2	+100.0	 mm
+  X1_Y128 = 	+143.4	-086.0	+100.7	 mm
+  SI= 1.00
+  SILI= 0.00
+  CSI= 1.00
+  VIS= all
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%% MUGAST TRAPEZOIDS %%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+Mugast Trapezoid
+  DetectorNumber = 1
+  X128_Y128 = 	-022.7	+042.2	-098.2	 mm
+  X1_Y128 = 	-040.4	+024.6	-098.2	 mm
+  X1_Y1 = 	-120.3	+058.0	-030.9	 mm
+  X128_Y1 = 	-055.3	+122.6	-031.1	 mm
+	
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%				
+Mugast Trapezoid
+  DetectorNumber = 2
+  X128_Y128 = 	-045.6	+014.5	-097.8	 mm
+  X1_Y128 = 	-045.7	-010.8	-097.9	 mm
+  X1_Y1 = 	-125.9	-043.8	-030.8	 mm
+  X128_Y1 = 	-125.7	+047.8	-030.7	 mm
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%				
+Mugast Trapezoid
+  DetectorNumber = 3
+  X128_Y128 = 	-042.5	-022.2	-098.3	 mm
+  X1_Y128 = 	-024.8	-039.9	-098.4	 mm
+  X1_Y1 = 	-058.0	-120.0	-031.4	 mm
+  X128_Y1 = 	-122.7	-055.2	-031.2	 mm
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+Mugast Trapezoid
+  DetectorNumber = 4				
+  X128_Y128 = 	-014.9	-045.6	-098.5	 mm
+  X1_Y128 = 	+010.3	-045.6	-098.6	 mm
+  X1_Y1 = 	+043.6	-125.7	-031.7	 mm
+  X128_Y1 = 	-048.0	-125.6	-031.4	 mm
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+Mugast Trapezoid
+  DetectorNumber = 5				
+  X128_Y128 = 	+021.9	-042.1	-099.1	 mm
+  X1_Y128 = 	+039.8	-024.5	-099.0	 mm
+  X1_Y1 = 	+119.7	-057.7	-032.1	 mm
+  X128_Y1 = 	+055.0	-122.3	-031.9	 mm
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%				
+Mugast Trapezoid
+  DetectorNumber = 7
+  X128_Y128 = 	+042.3	+022.6	-098.5	 mm
+  X1_Y128 = 	+024.5	+040.5	-098.4	 mm
+  X1_Y1 = 	+057.9	+120.0	-030.8	 mm
+  X128_Y1 = 	+122.5	+055.2	-031.3	 mm
+
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%% MODULAR LEAF %%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+
+ModularLeaf 
+  DefaultValue= -5000
+  Leafs= GATCONF_MASTER CONFDEC_AGATA T_CATS2_HF T_MUGAST_CATS2 T_MUGAST_CATS2b E_AGATA T_FAG_CATS2 T_VAMOS_AGATA T_AGATA_CATS2 T_MUGAST_VAMOS T_MUGAST_AGATA T_VAMOS_CATS2 
+%%% Leafs= GATCONF_MASTER CONFDEC_AGATA CONFDEC_VAMOS T_CATS2_HF T_MUGAST_CATS2 T_MUGAST_CATS2b EVAMOS_AGATA E_AGATA T_FAG_CATS2 T_VAMOS_AGATA T_AGATA_CATS2 TVAMOS_MUGAST_HF T_MUGAST_VAMOS T_MUGAST_AGATA T_VAMOS_CATS2 ADC1_9 ADC1_10 ADC1_11 MW_00 MW_01 MW_02 MW_03 MW_04 MW_05 MW_06 MW_07 MW_08 MW_09 MW_10 MW_11 MW_12 MW_13 MW_14 MW_15 MW_16 MW_17 MW_18 MW_19 MW_21
+  X= EVAMOS_AGATA   
+  Y= E_AGATA       
+
diff --git a/Projects/e793s/Detector/mugast_01Sep22_Test_Zn3p00.detector b/Projects/e793s/Detector/mugast_01Sep22_Test_Zn3p00.detector
new file mode 100755
index 000000000..113944371
--- /dev/null
+++ b/Projects/e793s/Detector/mugast_01Sep22_Test_Zn3p00.detector
@@ -0,0 +1,138 @@
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%% Target %%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+Target
+  THICKNESS= 2.879799 micrometer
+  ANGLE= 0 deg
+  RADIUS= 10 mm
+  MATERIAL= CD2
+  X= +0.00 millimeter
+  Y= +0.00 millimeter
+  Z= -3.00 millimeter
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%% MUST2 TELESCOPES %%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+%%%%%%% Telescope 1 %%%%%%%
+M2Telescope
+  X128_Y128 = 	+115.7	+009.5	+355.7	 mm
+  X128_Y1 = 	+104.5	+101.5	+326.4	 mm
+  X1_Y1 = 	+014.0	+101.9	+362.1	 mm
+  X1_Y128 = 	+025.2	+009.8	+391.4	 mm
+  SI=  1.00
+  SILI= 0.00
+  CSI= 1.00
+  VIS= all
+
+%%%%%%% Telescope 2 %%%%%%%
+M2Telescope
+  X128_Y128 = 	-011.5	+102.5	+362.2	 mm
+  X128_Y1 = 	-101.6	+102.4	+325.7	 mm
+  X1_Y1 = 	-113.3	+010.3	+354.7	 mm
+  X1_Y128 = 	-023.1	+010.4	+391.2	 mm
+  SI=  1.00
+  SILI= 0.00
+  CSI= 1.00
+  VIS= all
+
+%%%%%%% Telescope 3 %%%%%%%
+M2Telescope
+  X128_Y128 = 	-113.4	-012.5	+354.6	 mm
+  X128_Y1 = 	-101.7	-104.7	+326.0	 mm
+  X1_Y1 = 	-011.6	-104.6	+362.6	 mm
+  X1_Y128 = 	-023.3	-012.3	+391.2	 mm
+  SI= 1.00
+  SILI= 0.00
+  CSI= 1.00
+  VIS= all
+
+%%%%%%% Telescope 4 %%%%%%%
+M2Telescope
+  X128_Y128 = 	+013.4	-105.0	+362.1	 mm
+  X128_Y1 = 	+103.8	-105.1	+326.3	 mm
+  X1_Y1 = 	+115.3	-012.8	+354.8	 mm
+  X1_Y128 = 	+024.9	-012.7	+390.6	 mm
+  SI= 1.00
+  SILI= 0.00
+  CSI= 1.00
+  VIS= all
+
+%%%%%%% Telescope 5 %%%%%%%
+M2Telescope
+  X128_Y128 = 	+143.2	-086.7	+003.4	 mm
+  X128_Y1 = 	+139.9	+010.4	+002.7	 mm
+  X1_Y1 = 	+140.1	+011.2	+100.0	 mm
+  X1_Y128 = 	+143.4	-086.0	+100.7	 mm
+  SI= 1.00
+  SILI= 0.00
+  CSI= 1.00
+  VIS= all
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%% MUGAST TRAPEZOIDS %%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+Mugast Trapezoid
+  DetectorNumber = 1
+  X128_Y128 = 	-022.7	+042.2	-098.2	 mm
+  X1_Y128 = 	-040.4	+024.6	-098.2	 mm
+  X1_Y1 = 	-120.3	+058.0	-030.9	 mm
+  X128_Y1 = 	-055.3	+122.6	-031.1	 mm
+	
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%				
+Mugast Trapezoid
+  DetectorNumber = 2
+  X128_Y128 = 	-045.6	+014.5	-097.8	 mm
+  X1_Y128 = 	-045.7	-010.8	-097.9	 mm
+  X1_Y1 = 	-125.9	-043.8	-030.8	 mm
+  X128_Y1 = 	-125.7	+047.8	-030.7	 mm
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%				
+Mugast Trapezoid
+  DetectorNumber = 3
+  X128_Y128 = 	-042.5	-022.2	-098.3	 mm
+  X1_Y128 = 	-024.8	-039.9	-098.4	 mm
+  X1_Y1 = 	-058.0	-120.0	-031.4	 mm
+  X128_Y1 = 	-122.7	-055.2	-031.2	 mm
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+Mugast Trapezoid
+  DetectorNumber = 4				
+  X128_Y128 = 	-014.9	-045.6	-098.5	 mm
+  X1_Y128 = 	+010.3	-045.6	-098.6	 mm
+  X1_Y1 = 	+043.6	-125.7	-031.7	 mm
+  X128_Y1 = 	-048.0	-125.6	-031.4	 mm
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+Mugast Trapezoid
+  DetectorNumber = 5				
+  X128_Y128 = 	+021.9	-042.1	-099.1	 mm
+  X1_Y128 = 	+039.8	-024.5	-099.0	 mm
+  X1_Y1 = 	+119.7	-057.7	-032.1	 mm
+  X128_Y1 = 	+055.0	-122.3	-031.9	 mm
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%				
+Mugast Trapezoid
+  DetectorNumber = 7
+  X128_Y128 = 	+042.3	+022.6	-098.5	 mm
+  X1_Y128 = 	+024.5	+040.5	-098.4	 mm
+  X1_Y1 = 	+057.9	+120.0	-030.8	 mm
+  X128_Y1 = 	+122.5	+055.2	-031.3	 mm
+
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%% MODULAR LEAF %%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+
+ModularLeaf 
+  DefaultValue= -5000
+  Leafs= GATCONF_MASTER CONFDEC_AGATA T_CATS2_HF T_MUGAST_CATS2 T_MUGAST_CATS2b E_AGATA T_FAG_CATS2 T_VAMOS_AGATA T_AGATA_CATS2 T_MUGAST_VAMOS T_MUGAST_AGATA T_VAMOS_CATS2 
+%%% Leafs= GATCONF_MASTER CONFDEC_AGATA CONFDEC_VAMOS T_CATS2_HF T_MUGAST_CATS2 T_MUGAST_CATS2b EVAMOS_AGATA E_AGATA T_FAG_CATS2 T_VAMOS_AGATA T_AGATA_CATS2 TVAMOS_MUGAST_HF T_MUGAST_VAMOS T_MUGAST_AGATA T_VAMOS_CATS2 ADC1_9 ADC1_10 ADC1_11 MW_00 MW_01 MW_02 MW_03 MW_04 MW_05 MW_06 MW_07 MW_08 MW_09 MW_10 MW_11 MW_12 MW_13 MW_14 MW_15 MW_16 MW_17 MW_18 MW_19 MW_21
+  X= EVAMOS_AGATA   
+  Y= E_AGATA       
+
diff --git a/Projects/e793s/Detector/mugast_08Nov.detector b/Projects/e793s/Detector/mugast_08Nov.detector
new file mode 100755
index 000000000..22e511841
--- /dev/null
+++ b/Projects/e793s/Detector/mugast_08Nov.detector
@@ -0,0 +1,138 @@
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%% Target %%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+Target
+  THICKNESS= 1.3008 micrometer
+  ANGLE= 0 deg
+  RADIUS= 10 mm
+  MATERIAL= CD2
+  X= +0.00 millimeter
+  Y= +0.00 millimeter
+  Z= +1.3958 millimeter
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%% MUST2 TELESCOPES %%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+%%%%%%% Telescope 1 %%%%%%%
+M2Telescope
+  X128_Y128 = 	+115.7	+009.5	+155.7	 mm
+  X128_Y1 = 	+104.5	+101.5	+126.4	 mm
+  X1_Y1 = 	+014.0	+101.9	+162.1	 mm
+  X1_Y128 = 	+025.2	+009.8	+191.4	 mm
+  SI=  1.00
+  SILI= 0.00
+  CSI= 1.00
+  VIS= all
+
+%%%%%%% Telescope 2 %%%%%%%
+M2Telescope
+  X128_Y128 = 	-011.5	+102.5	+162.2	 mm
+  X128_Y1 = 	-101.6	+102.4	+125.7	 mm
+  X1_Y1 = 	-113.3	+010.3	+154.7	 mm
+  X1_Y128 = 	-023.1	+010.4	+191.2	 mm
+  SI=  1.00
+  SILI= 0.00
+  CSI= 1.00
+  VIS= all
+
+%%%%%%% Telescope 3 %%%%%%%
+M2Telescope
+  X128_Y128 = 	-113.4	-012.5	+154.6	 mm
+  X128_Y1 = 	-101.7	-104.7	+126.0	 mm
+  X1_Y1 = 	-011.6	-104.6	+162.6	 mm
+  X1_Y128 = 	-023.3	-012.3	+191.2	 mm
+  SI= 1.00
+  SILI= 0.00
+  CSI= 1.00
+  VIS= all
+
+%%%%%%% Telescope 4 %%%%%%%
+M2Telescope
+  X128_Y128 = 	+013.4	-105.0	+162.1	 mm
+  X128_Y1 = 	+103.8	-105.1	+126.3	 mm
+  X1_Y1 = 	+115.3	-012.8	+154.8	 mm
+  X1_Y128 = 	+024.9	-012.7	+190.6	 mm
+  SI= 1.00
+  SILI= 0.00
+  CSI= 1.00
+  VIS= all
+
+%%%%%%% Telescope 5 %%%%%%%
+M2Telescope
+  X128_Y128 = 	+143.2	-086.7	+003.4	 mm
+  X128_Y1 = 	+139.9	+010.4	+002.7	 mm
+  X1_Y1 = 	+140.1	+011.2	+100.0	 mm
+  X1_Y128 = 	+143.4	-086.0	+100.7	 mm
+  SI= 1.00
+  SILI= 0.00
+  CSI= 1.00
+  VIS= all
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%% MUGAST TRAPEZOIDS %%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+Mugast Trapezoid
+  DetectorNumber = 1
+  X128_Y128 = 	-022.7	+042.2	-098.2	 mm
+  X1_Y128 = 	-040.4	+024.6	-098.2	 mm
+  X1_Y1 = 	-120.3	+058.0	-030.9	 mm
+  X128_Y1 = 	-055.3	+122.6	-031.1	 mm
+	
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%				
+Mugast Trapezoid
+  DetectorNumber = 2
+  X128_Y128 = 	-045.6	+014.5	-097.8	 mm
+  X1_Y128 = 	-045.7	-010.8	-097.9	 mm
+  X1_Y1 = 	-125.9	-043.8	-030.8	 mm
+  X128_Y1 = 	-125.7	+047.8	-030.7	 mm
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%				
+Mugast Trapezoid
+  DetectorNumber = 3
+  X128_Y128 = 	-042.5	-022.2	-098.3	 mm
+  X1_Y128 = 	-024.8	-039.9	-098.4	 mm
+  X1_Y1 = 	-058.0	-120.0	-031.4	 mm
+  X128_Y1 = 	-122.7	-055.2	-031.2	 mm
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+Mugast Trapezoid
+  DetectorNumber = 4				
+  X128_Y128 = 	-014.9	-045.6	-098.5	 mm
+  X1_Y128 = 	+010.3	-045.6	-098.6	 mm
+  X1_Y1 = 	+043.6	-125.7	-031.7	 mm
+  X128_Y1 = 	-048.0	-125.6	-031.4	 mm
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+Mugast Trapezoid
+  DetectorNumber = 5				
+  X128_Y128 = 	+021.9	-042.1	-099.1	 mm
+  X1_Y128 = 	+039.8	-024.5	-099.0	 mm
+  X1_Y1 = 	+119.7	-057.7	-032.1	 mm
+  X128_Y1 = 	+055.0	-122.3	-031.9	 mm
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%				
+Mugast Trapezoid
+  DetectorNumber = 7
+  X128_Y128 = 	+042.3	+022.6	-098.5	 mm
+  X1_Y128 = 	+024.5	+040.5	-098.4	 mm
+  X1_Y1 = 	+057.9	+120.0	-030.8	 mm
+  X128_Y1 = 	+122.5	+055.2	-031.3	 mm
+
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%% MODULAR LEAF %%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+
+ModularLeaf 
+  DefaultValue= -5000
+  Leafs= GATCONF_MASTER CONFDEC_AGATA T_CATS2_HF T_MUGAST_CATS2 T_MUGAST_CATS2b E_AGATA T_FAG_CATS2 T_VAMOS_AGATA T_AGATA_CATS2 T_MUGAST_VAMOS T_MUGAST_AGATA T_VAMOS_CATS2 
+%%% Leafs= GATCONF_MASTER CONFDEC_AGATA CONFDEC_VAMOS T_CATS2_HF T_MUGAST_CATS2 T_MUGAST_CATS2b EVAMOS_AGATA E_AGATA T_FAG_CATS2 T_VAMOS_AGATA T_AGATA_CATS2 TVAMOS_MUGAST_HF T_MUGAST_VAMOS T_MUGAST_AGATA T_VAMOS_CATS2 ADC1_9 ADC1_10 ADC1_11 MW_00 MW_01 MW_02 MW_03 MW_04 MW_05 MW_06 MW_07 MW_08 MW_09 MW_10 MW_11 MW_12 MW_13 MW_14 MW_15 MW_16 MW_17 MW_18 MW_19 MW_21
+  X= EVAMOS_AGATA   
+  Y= E_AGATA       
+
diff --git a/Projects/e793s/Detector/mugast_11Jul22.detector b/Projects/e793s/Detector/mugast_11Jul22.detector
new file mode 100755
index 000000000..2adca07ad
--- /dev/null
+++ b/Projects/e793s/Detector/mugast_11Jul22.detector
@@ -0,0 +1,138 @@
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%% Target %%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+Target
+  THICKNESS= 2.879799 micrometer
+  ANGLE= 0 deg
+  RADIUS= 10 mm
+  MATERIAL= CD2
+  X= +0.00 millimeter
+  Y= +0.00 millimeter
+  Z= +0.291361 millimeter
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%% MUST2 TELESCOPES %%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+%%%%%%% Telescope 1 %%%%%%%
+M2Telescope
+  X128_Y128 = 	+115.7	+009.5	+155.7	 mm
+  X128_Y1 = 	+104.5	+101.5	+126.4	 mm
+  X1_Y1 = 	+014.0	+101.9	+162.1	 mm
+  X1_Y128 = 	+025.2	+009.8	+191.4	 mm
+  SI=  1.00
+  SILI= 0.00
+  CSI= 1.00
+  VIS= all
+
+%%%%%%% Telescope 2 %%%%%%%
+M2Telescope
+  X128_Y128 = 	-011.5	+102.5	+162.2	 mm
+  X128_Y1 = 	-101.6	+102.4	+125.7	 mm
+  X1_Y1 = 	-113.3	+010.3	+154.7	 mm
+  X1_Y128 = 	-023.1	+010.4	+191.2	 mm
+  SI=  1.00
+  SILI= 0.00
+  CSI= 1.00
+  VIS= all
+
+%%%%%%% Telescope 3 %%%%%%%
+M2Telescope
+  X128_Y128 = 	-113.4	-012.5	+154.6	 mm
+  X128_Y1 = 	-101.7	-104.7	+126.0	 mm
+  X1_Y1 = 	-011.6	-104.6	+162.6	 mm
+  X1_Y128 = 	-023.3	-012.3	+191.2	 mm
+  SI= 1.00
+  SILI= 0.00
+  CSI= 1.00
+  VIS= all
+
+%%%%%%% Telescope 4 %%%%%%%
+M2Telescope
+  X128_Y128 = 	+013.4	-105.0	+162.1	 mm
+  X128_Y1 = 	+103.8	-105.1	+126.3	 mm
+  X1_Y1 = 	+115.3	-012.8	+154.8	 mm
+  X1_Y128 = 	+024.9	-012.7	+190.6	 mm
+  SI= 1.00
+  SILI= 0.00
+  CSI= 1.00
+  VIS= all
+
+%%%%%%% Telescope 5 %%%%%%%
+M2Telescope
+  X128_Y128 = 	+143.2	-086.7	+003.4	 mm
+  X128_Y1 = 	+139.9	+010.4	+002.7	 mm
+  X1_Y1 = 	+140.1	+011.2	+100.0	 mm
+  X1_Y128 = 	+143.4	-086.0	+100.7	 mm
+  SI= 1.00
+  SILI= 0.00
+  CSI= 1.00
+  VIS= all
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%% MUGAST TRAPEZOIDS %%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+Mugast Trapezoid
+  DetectorNumber = 1
+  X128_Y128 = 	-022.7	+042.2	-098.2	 mm
+  X1_Y128 = 	-040.4	+024.6	-098.2	 mm
+  X1_Y1 = 	-120.3	+058.0	-030.9	 mm
+  X128_Y1 = 	-055.3	+122.6	-031.1	 mm
+	
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%				
+Mugast Trapezoid
+  DetectorNumber = 2
+  X128_Y128 = 	-045.6	+014.5	-097.8	 mm
+  X1_Y128 = 	-045.7	-010.8	-097.9	 mm
+  X1_Y1 = 	-125.9	-043.8	-030.8	 mm
+  X128_Y1 = 	-125.7	+047.8	-030.7	 mm
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%				
+Mugast Trapezoid
+  DetectorNumber = 3
+  X128_Y128 = 	-042.5	-022.2	-098.3	 mm
+  X1_Y128 = 	-024.8	-039.9	-098.4	 mm
+  X1_Y1 = 	-058.0	-120.0	-031.4	 mm
+  X128_Y1 = 	-122.7	-055.2	-031.2	 mm
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+Mugast Trapezoid
+  DetectorNumber = 4				
+  X128_Y128 = 	-014.9	-045.6	-098.5	 mm
+  X1_Y128 = 	+010.3	-045.6	-098.6	 mm
+  X1_Y1 = 	+043.6	-125.7	-031.7	 mm
+  X128_Y1 = 	-048.0	-125.6	-031.4	 mm
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+Mugast Trapezoid
+  DetectorNumber = 5				
+  X128_Y128 = 	+021.9	-042.1	-099.1	 mm
+  X1_Y128 = 	+039.8	-024.5	-099.0	 mm
+  X1_Y1 = 	+119.7	-057.7	-032.1	 mm
+  X128_Y1 = 	+055.0	-122.3	-031.9	 mm
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%				
+Mugast Trapezoid
+  DetectorNumber = 7
+  X128_Y128 = 	+042.3	+022.6	-098.5	 mm
+  X1_Y128 = 	+024.5	+040.5	-098.4	 mm
+  X1_Y1 = 	+057.9	+120.0	-030.8	 mm
+  X128_Y1 = 	+122.5	+055.2	-031.3	 mm
+
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%% MODULAR LEAF %%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+
+ModularLeaf 
+  DefaultValue= -5000
+  Leafs= GATCONF_MASTER CONFDEC_AGATA T_CATS2_HF T_MUGAST_CATS2 T_MUGAST_CATS2b E_AGATA T_FAG_CATS2 T_VAMOS_AGATA T_AGATA_CATS2 T_MUGAST_VAMOS T_MUGAST_AGATA T_VAMOS_CATS2 
+%%% Leafs= GATCONF_MASTER CONFDEC_AGATA CONFDEC_VAMOS T_CATS2_HF T_MUGAST_CATS2 T_MUGAST_CATS2b EVAMOS_AGATA E_AGATA T_FAG_CATS2 T_VAMOS_AGATA T_AGATA_CATS2 TVAMOS_MUGAST_HF T_MUGAST_VAMOS T_MUGAST_AGATA T_VAMOS_CATS2 ADC1_9 ADC1_10 ADC1_11 MW_00 MW_01 MW_02 MW_03 MW_04 MW_05 MW_06 MW_07 MW_08 MW_09 MW_10 MW_11 MW_12 MW_13 MW_14 MW_15 MW_16 MW_17 MW_18 MW_19 MW_21
+  X= EVAMOS_AGATA   
+  Y= E_AGATA       
+
diff --git a/Projects/e793s/Detector/mugast_14Oct22.detector b/Projects/e793s/Detector/mugast_14Oct22.detector
new file mode 100755
index 000000000..3d93e3146
--- /dev/null
+++ b/Projects/e793s/Detector/mugast_14Oct22.detector
@@ -0,0 +1,138 @@
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%% Target %%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+Target
+  THICKNESS= +2.8860 micrometer
+  ANGLE= 0 deg
+  RADIUS= 10 mm
+  MATERIAL= CD2
+  X= +0.00 millimeter
+  Y= +0.00 millimeter
+  Z= +0.0561 millimeter
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%% MUST2 TELESCOPES %%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+%%%%%%% Telescope 1 %%%%%%%
+M2Telescope
+  X128_Y128 = 	+115.7	+009.5	+355.7	 mm
+  X128_Y1 = 	+104.5	+101.5	+326.4	 mm
+  X1_Y1 = 	+014.0	+101.9	+362.1	 mm
+  X1_Y128 = 	+025.2	+009.8	+391.4	 mm
+  SI=  1.00
+  SILI= 0.00
+  CSI= 1.00
+  VIS= all
+
+%%%%%%% Telescope 2 %%%%%%%
+M2Telescope
+  X128_Y128 = 	-011.5	+102.5	+362.2	 mm
+  X128_Y1 = 	-101.6	+102.4	+325.7	 mm
+  X1_Y1 = 	-113.3	+010.3	+354.7	 mm
+  X1_Y128 = 	-023.1	+010.4	+391.2	 mm
+  SI=  1.00
+  SILI= 0.00
+  CSI= 1.00
+  VIS= all
+
+%%%%%%% Telescope 3 %%%%%%%
+M2Telescope
+  X128_Y128 = 	-113.4	-012.5	+354.6	 mm
+  X128_Y1 = 	-101.7	-104.7	+326.0	 mm
+  X1_Y1 = 	-011.6	-104.6	+362.6	 mm
+  X1_Y128 = 	-023.3	-012.3	+391.2	 mm
+  SI= 1.00
+  SILI= 0.00
+  CSI= 1.00
+  VIS= all
+
+%%%%%%% Telescope 4 %%%%%%%
+M2Telescope
+  X128_Y128 = 	+013.4	-105.0	+362.1	 mm
+  X128_Y1 = 	+103.8	-105.1	+326.3	 mm
+  X1_Y1 = 	+115.3	-012.8	+354.8	 mm
+  X1_Y128 = 	+024.9	-012.7	+390.6	 mm
+  SI= 1.00
+  SILI= 0.00
+  CSI= 1.00
+  VIS= all
+
+%%%%%%% Telescope 5 %%%%%%%
+M2Telescope
+  X128_Y128 = 	+143.2	-086.7	+003.4	 mm
+  X128_Y1 = 	+139.9	+010.4	+002.7	 mm
+  X1_Y1 = 	+140.1	+011.2	+100.0	 mm
+  X1_Y128 = 	+143.4	-086.0	+100.7	 mm
+  SI= 1.00
+  SILI= 0.00
+  CSI= 1.00
+  VIS= all
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%% MUGAST TRAPEZOIDS %%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+Mugast Trapezoid
+  DetectorNumber = 1
+  X128_Y128 = 	-022.7	+042.2	-098.2	 mm
+  X1_Y128 = 	-040.4	+024.6	-098.2	 mm
+  X1_Y1 = 	-120.3	+058.0	-030.9	 mm
+  X128_Y1 = 	-055.3	+122.6	-031.1	 mm
+	
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%				
+Mugast Trapezoid
+  DetectorNumber = 2
+  X128_Y128 = 	-045.6	+014.5	-097.8	 mm
+  X1_Y128 = 	-045.7	-010.8	-097.9	 mm
+  X1_Y1 = 	-125.9	-043.8	-030.8	 mm
+  X128_Y1 = 	-125.7	+047.8	-030.7	 mm
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%				
+Mugast Trapezoid
+  DetectorNumber = 3
+  X128_Y128 = 	-042.5	-022.2	-098.3	 mm
+  X1_Y128 = 	-024.8	-039.9	-098.4	 mm
+  X1_Y1 = 	-058.0	-120.0	-031.4	 mm
+  X128_Y1 = 	-122.7	-055.2	-031.2	 mm
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+Mugast Trapezoid
+  DetectorNumber = 4				
+  X128_Y128 = 	-014.9	-045.6	-098.5	 mm
+  X1_Y128 = 	+010.3	-045.6	-098.6	 mm
+  X1_Y1 = 	+043.6	-125.7	-031.7	 mm
+  X128_Y1 = 	-048.0	-125.6	-031.4	 mm
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+Mugast Trapezoid
+  DetectorNumber = 5				
+  X128_Y128 = 	+021.9	-042.1	-099.1	 mm
+  X1_Y128 = 	+039.8	-024.5	-099.0	 mm
+  X1_Y1 = 	+119.7	-057.7	-032.1	 mm
+  X128_Y1 = 	+055.0	-122.3	-031.9	 mm
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%				
+Mugast Trapezoid
+  DetectorNumber = 7
+  X128_Y128 = 	+042.3	+022.6	-098.5	 mm
+  X1_Y128 = 	+024.5	+040.5	-098.4	 mm
+  X1_Y1 = 	+057.9	+120.0	-030.8	 mm
+  X128_Y1 = 	+122.5	+055.2	-031.3	 mm
+
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%% MODULAR LEAF %%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+
+ModularLeaf 
+  DefaultValue= -5000
+  Leafs= GATCONF_MASTER CONFDEC_AGATA T_CATS2_HF T_MUGAST_CATS2 T_MUGAST_CATS2b E_AGATA T_FAG_CATS2 T_VAMOS_AGATA T_AGATA_CATS2 T_MUGAST_VAMOS T_MUGAST_AGATA T_VAMOS_CATS2 
+%%% Leafs= GATCONF_MASTER CONFDEC_AGATA CONFDEC_VAMOS T_CATS2_HF T_MUGAST_CATS2 T_MUGAST_CATS2b EVAMOS_AGATA E_AGATA T_FAG_CATS2 T_VAMOS_AGATA T_AGATA_CATS2 TVAMOS_MUGAST_HF T_MUGAST_VAMOS T_MUGAST_AGATA T_VAMOS_CATS2 ADC1_9 ADC1_10 ADC1_11 MW_00 MW_01 MW_02 MW_03 MW_04 MW_05 MW_06 MW_07 MW_08 MW_09 MW_10 MW_11 MW_12 MW_13 MW_14 MW_15 MW_16 MW_17 MW_18 MW_19 MW_21
+  X= EVAMOS_AGATA   
+  Y= E_AGATA       
+
diff --git a/Projects/e793s/Detector/mugast_14Oct22_2.detector b/Projects/e793s/Detector/mugast_14Oct22_2.detector
new file mode 100755
index 000000000..9ff981b42
--- /dev/null
+++ b/Projects/e793s/Detector/mugast_14Oct22_2.detector
@@ -0,0 +1,138 @@
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%% Target %%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+Target
+  THICKNESS= +2.9992 micrometer
+  ANGLE= 0 deg
+  RADIUS= 10 mm
+  MATERIAL= CD2
+  X= +0.00 millimeter
+  Y= +0.00 millimeter
+  Z= +0.4989 millimeter
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%% MUST2 TELESCOPES %%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+%%%%%%% Telescope 1 %%%%%%%
+M2Telescope
+  X128_Y128 = 	+115.7	+009.5	+355.7	 mm
+  X128_Y1 = 	+104.5	+101.5	+326.4	 mm
+  X1_Y1 = 	+014.0	+101.9	+362.1	 mm
+  X1_Y128 = 	+025.2	+009.8	+391.4	 mm
+  SI=  1.00
+  SILI= 0.00
+  CSI= 1.00
+  VIS= all
+
+%%%%%%% Telescope 2 %%%%%%%
+M2Telescope
+  X128_Y128 = 	-011.5	+102.5	+362.2	 mm
+  X128_Y1 = 	-101.6	+102.4	+325.7	 mm
+  X1_Y1 = 	-113.3	+010.3	+354.7	 mm
+  X1_Y128 = 	-023.1	+010.4	+391.2	 mm
+  SI=  1.00
+  SILI= 0.00
+  CSI= 1.00
+  VIS= all
+
+%%%%%%% Telescope 3 %%%%%%%
+M2Telescope
+  X128_Y128 = 	-113.4	-012.5	+354.6	 mm
+  X128_Y1 = 	-101.7	-104.7	+326.0	 mm
+  X1_Y1 = 	-011.6	-104.6	+362.6	 mm
+  X1_Y128 = 	-023.3	-012.3	+391.2	 mm
+  SI= 1.00
+  SILI= 0.00
+  CSI= 1.00
+  VIS= all
+
+%%%%%%% Telescope 4 %%%%%%%
+M2Telescope
+  X128_Y128 = 	+013.4	-105.0	+362.1	 mm
+  X128_Y1 = 	+103.8	-105.1	+326.3	 mm
+  X1_Y1 = 	+115.3	-012.8	+354.8	 mm
+  X1_Y128 = 	+024.9	-012.7	+390.6	 mm
+  SI= 1.00
+  SILI= 0.00
+  CSI= 1.00
+  VIS= all
+
+%%%%%%% Telescope 5 %%%%%%%
+M2Telescope
+  X128_Y128 = 	+143.2	-086.7	+003.4	 mm
+  X128_Y1 = 	+139.9	+010.4	+002.7	 mm
+  X1_Y1 = 	+140.1	+011.2	+100.0	 mm
+  X1_Y128 = 	+143.4	-086.0	+100.7	 mm
+  SI= 1.00
+  SILI= 0.00
+  CSI= 1.00
+  VIS= all
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%% MUGAST TRAPEZOIDS %%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+Mugast Trapezoid
+  DetectorNumber = 1
+  X128_Y128 = 	-022.7	+042.2	-098.2	 mm
+  X1_Y128 = 	-040.4	+024.6	-098.2	 mm
+  X1_Y1 = 	-120.3	+058.0	-030.9	 mm
+  X128_Y1 = 	-055.3	+122.6	-031.1	 mm
+	
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%				
+Mugast Trapezoid
+  DetectorNumber = 2
+  X128_Y128 = 	-045.6	+014.5	-097.8	 mm
+  X1_Y128 = 	-045.7	-010.8	-097.9	 mm
+  X1_Y1 = 	-125.9	-043.8	-030.8	 mm
+  X128_Y1 = 	-125.7	+047.8	-030.7	 mm
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%				
+Mugast Trapezoid
+  DetectorNumber = 3
+  X128_Y128 = 	-042.5	-022.2	-098.3	 mm
+  X1_Y128 = 	-024.8	-039.9	-098.4	 mm
+  X1_Y1 = 	-058.0	-120.0	-031.4	 mm
+  X128_Y1 = 	-122.7	-055.2	-031.2	 mm
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+Mugast Trapezoid
+  DetectorNumber = 4				
+  X128_Y128 = 	-014.9	-045.6	-098.5	 mm
+  X1_Y128 = 	+010.3	-045.6	-098.6	 mm
+  X1_Y1 = 	+043.6	-125.7	-031.7	 mm
+  X128_Y1 = 	-048.0	-125.6	-031.4	 mm
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+Mugast Trapezoid
+  DetectorNumber = 5				
+  X128_Y128 = 	+021.9	-042.1	-099.1	 mm
+  X1_Y128 = 	+039.8	-024.5	-099.0	 mm
+  X1_Y1 = 	+119.7	-057.7	-032.1	 mm
+  X128_Y1 = 	+055.0	-122.3	-031.9	 mm
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%				
+Mugast Trapezoid
+  DetectorNumber = 7
+  X128_Y128 = 	+042.3	+022.6	-098.5	 mm
+  X1_Y128 = 	+024.5	+040.5	-098.4	 mm
+  X1_Y1 = 	+057.9	+120.0	-030.8	 mm
+  X128_Y1 = 	+122.5	+055.2	-031.3	 mm
+
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%% MODULAR LEAF %%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+
+ModularLeaf 
+  DefaultValue= -5000
+  Leafs= GATCONF_MASTER CONFDEC_AGATA T_CATS2_HF T_MUGAST_CATS2 T_MUGAST_CATS2b E_AGATA T_FAG_CATS2 T_VAMOS_AGATA T_AGATA_CATS2 T_MUGAST_VAMOS T_MUGAST_AGATA T_VAMOS_CATS2 
+%%% Leafs= GATCONF_MASTER CONFDEC_AGATA CONFDEC_VAMOS T_CATS2_HF T_MUGAST_CATS2 T_MUGAST_CATS2b EVAMOS_AGATA E_AGATA T_FAG_CATS2 T_VAMOS_AGATA T_AGATA_CATS2 TVAMOS_MUGAST_HF T_MUGAST_VAMOS T_MUGAST_AGATA T_VAMOS_CATS2 ADC1_9 ADC1_10 ADC1_11 MW_00 MW_01 MW_02 MW_03 MW_04 MW_05 MW_06 MW_07 MW_08 MW_09 MW_10 MW_11 MW_12 MW_13 MW_14 MW_15 MW_16 MW_17 MW_18 MW_19 MW_21
+  X= EVAMOS_AGATA   
+  Y= E_AGATA       
+
diff --git a/Projects/e793s/Detector/mugast_18Oct22.detector b/Projects/e793s/Detector/mugast_18Oct22.detector
new file mode 100755
index 000000000..485eedd98
--- /dev/null
+++ b/Projects/e793s/Detector/mugast_18Oct22.detector
@@ -0,0 +1,138 @@
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%% Target %%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+Target
+  THICKNESS= +2.9997 micrometer
+  ANGLE= 0 deg
+  RADIUS= 10 mm
+  MATERIAL= CD2
+  X= +0.00 millimeter
+  Y= +0.00 millimeter
+  Z= +0.2247 millimeter
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%% MUST2 TELESCOPES %%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+%%%%%%% Telescope 1 %%%%%%%
+M2Telescope
+  X128_Y128 = 	+115.7	+009.5	+355.7	 mm
+  X128_Y1 = 	+104.5	+101.5	+326.4	 mm
+  X1_Y1 = 	+014.0	+101.9	+362.1	 mm
+  X1_Y128 = 	+025.2	+009.8	+391.4	 mm
+  SI=  1.00
+  SILI= 0.00
+  CSI= 1.00
+  VIS= all
+
+%%%%%%% Telescope 2 %%%%%%%
+M2Telescope
+  X128_Y128 = 	-011.5	+102.5	+362.2	 mm
+  X128_Y1 = 	-101.6	+102.4	+325.7	 mm
+  X1_Y1 = 	-113.3	+010.3	+354.7	 mm
+  X1_Y128 = 	-023.1	+010.4	+391.2	 mm
+  SI=  1.00
+  SILI= 0.00
+  CSI= 1.00
+  VIS= all
+
+%%%%%%% Telescope 3 %%%%%%%
+M2Telescope
+  X128_Y128 = 	-113.4	-012.5	+354.6	 mm
+  X128_Y1 = 	-101.7	-104.7	+326.0	 mm
+  X1_Y1 = 	-011.6	-104.6	+362.6	 mm
+  X1_Y128 = 	-023.3	-012.3	+391.2	 mm
+  SI= 1.00
+  SILI= 0.00
+  CSI= 1.00
+  VIS= all
+
+%%%%%%% Telescope 4 %%%%%%%
+M2Telescope
+  X128_Y128 = 	+013.4	-105.0	+362.1	 mm
+  X128_Y1 = 	+103.8	-105.1	+326.3	 mm
+  X1_Y1 = 	+115.3	-012.8	+354.8	 mm
+  X1_Y128 = 	+024.9	-012.7	+390.6	 mm
+  SI= 1.00
+  SILI= 0.00
+  CSI= 1.00
+  VIS= all
+
+%%%%%%% Telescope 5 %%%%%%%
+M2Telescope
+  X128_Y128 = 	+143.2	-086.7	+003.4	 mm
+  X128_Y1 = 	+139.9	+010.4	+002.7	 mm
+  X1_Y1 = 	+140.1	+011.2	+100.0	 mm
+  X1_Y128 = 	+143.4	-086.0	+100.7	 mm
+  SI= 1.00
+  SILI= 0.00
+  CSI= 1.00
+  VIS= all
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%% MUGAST TRAPEZOIDS %%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+Mugast Trapezoid
+  DetectorNumber = 1
+  X128_Y128 = 	-022.7	+042.2	-098.2	 mm
+  X1_Y128 = 	-040.4	+024.6	-098.2	 mm
+  X1_Y1 = 	-120.3	+058.0	-030.9	 mm
+  X128_Y1 = 	-055.3	+122.6	-031.1	 mm
+	
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%				
+Mugast Trapezoid
+  DetectorNumber = 2
+  X128_Y128 = 	-045.6	+014.5	-097.8	 mm
+  X1_Y128 = 	-045.7	-010.8	-097.9	 mm
+  X1_Y1 = 	-125.9	-043.8	-030.8	 mm
+  X128_Y1 = 	-125.7	+047.8	-030.7	 mm
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%				
+Mugast Trapezoid
+  DetectorNumber = 3
+  X128_Y128 = 	-042.5	-022.2	-098.3	 mm
+  X1_Y128 = 	-024.8	-039.9	-098.4	 mm
+  X1_Y1 = 	-058.0	-120.0	-031.4	 mm
+  X128_Y1 = 	-122.7	-055.2	-031.2	 mm
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+Mugast Trapezoid
+  DetectorNumber = 4				
+  X128_Y128 = 	-014.9	-045.6	-098.5	 mm
+  X1_Y128 = 	+010.3	-045.6	-098.6	 mm
+  X1_Y1 = 	+043.6	-125.7	-031.7	 mm
+  X128_Y1 = 	-048.0	-125.6	-031.4	 mm
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+Mugast Trapezoid
+  DetectorNumber = 5				
+  X128_Y128 = 	+021.9	-042.1	-099.1	 mm
+  X1_Y128 = 	+039.8	-024.5	-099.0	 mm
+  X1_Y1 = 	+119.7	-057.7	-032.1	 mm
+  X128_Y1 = 	+055.0	-122.3	-031.9	 mm
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%				
+Mugast Trapezoid
+  DetectorNumber = 7
+  X128_Y128 = 	+042.3	+022.6	-098.5	 mm
+  X1_Y128 = 	+024.5	+040.5	-098.4	 mm
+  X1_Y1 = 	+057.9	+120.0	-030.8	 mm
+  X128_Y1 = 	+122.5	+055.2	-031.3	 mm
+
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%% MODULAR LEAF %%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+
+ModularLeaf 
+  DefaultValue= -5000
+  Leafs= GATCONF_MASTER CONFDEC_AGATA T_CATS2_HF T_MUGAST_CATS2 T_MUGAST_CATS2b E_AGATA T_FAG_CATS2 T_VAMOS_AGATA T_AGATA_CATS2 T_MUGAST_VAMOS T_MUGAST_AGATA T_VAMOS_CATS2 
+%%% Leafs= GATCONF_MASTER CONFDEC_AGATA CONFDEC_VAMOS T_CATS2_HF T_MUGAST_CATS2 T_MUGAST_CATS2b EVAMOS_AGATA E_AGATA T_FAG_CATS2 T_VAMOS_AGATA T_AGATA_CATS2 TVAMOS_MUGAST_HF T_MUGAST_VAMOS T_MUGAST_AGATA T_VAMOS_CATS2 ADC1_9 ADC1_10 ADC1_11 MW_00 MW_01 MW_02 MW_03 MW_04 MW_05 MW_06 MW_07 MW_08 MW_09 MW_10 MW_11 MW_12 MW_13 MW_14 MW_15 MW_16 MW_17 MW_18 MW_19 MW_21
+  X= EVAMOS_AGATA   
+  Y= E_AGATA       
+
diff --git a/Projects/e793s/Detector/mugast_18Oct22_Tx0p5.detector b/Projects/e793s/Detector/mugast_18Oct22_Tx0p5.detector
new file mode 100755
index 000000000..6b7cfd43e
--- /dev/null
+++ b/Projects/e793s/Detector/mugast_18Oct22_Tx0p5.detector
@@ -0,0 +1,138 @@
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%% Target %%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+Target
+  THICKNESS= +1.4999 micrometer
+  ANGLE= 0 deg
+  RADIUS= 10 mm
+  MATERIAL= CD2
+  X= +0.00 millimeter
+  Y= +0.00 millimeter
+  Z= +0.2247 millimeter
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%% MUST2 TELESCOPES %%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+%%%%%%% Telescope 1 %%%%%%%
+M2Telescope
+  X128_Y128 = 	+115.7	+009.5	+355.7	 mm
+  X128_Y1 = 	+104.5	+101.5	+326.4	 mm
+  X1_Y1 = 	+014.0	+101.9	+362.1	 mm
+  X1_Y128 = 	+025.2	+009.8	+391.4	 mm
+  SI=  1.00
+  SILI= 0.00
+  CSI= 1.00
+  VIS= all
+
+%%%%%%% Telescope 2 %%%%%%%
+M2Telescope
+  X128_Y128 = 	-011.5	+102.5	+362.2	 mm
+  X128_Y1 = 	-101.6	+102.4	+325.7	 mm
+  X1_Y1 = 	-113.3	+010.3	+354.7	 mm
+  X1_Y128 = 	-023.1	+010.4	+391.2	 mm
+  SI=  1.00
+  SILI= 0.00
+  CSI= 1.00
+  VIS= all
+
+%%%%%%% Telescope 3 %%%%%%%
+M2Telescope
+  X128_Y128 = 	-113.4	-012.5	+354.6	 mm
+  X128_Y1 = 	-101.7	-104.7	+326.0	 mm
+  X1_Y1 = 	-011.6	-104.6	+362.6	 mm
+  X1_Y128 = 	-023.3	-012.3	+391.2	 mm
+  SI= 1.00
+  SILI= 0.00
+  CSI= 1.00
+  VIS= all
+
+%%%%%%% Telescope 4 %%%%%%%
+M2Telescope
+  X128_Y128 = 	+013.4	-105.0	+362.1	 mm
+  X128_Y1 = 	+103.8	-105.1	+326.3	 mm
+  X1_Y1 = 	+115.3	-012.8	+354.8	 mm
+  X1_Y128 = 	+024.9	-012.7	+390.6	 mm
+  SI= 1.00
+  SILI= 0.00
+  CSI= 1.00
+  VIS= all
+
+%%%%%%% Telescope 5 %%%%%%%
+M2Telescope
+  X128_Y128 = 	+143.2	-086.7	+003.4	 mm
+  X128_Y1 = 	+139.9	+010.4	+002.7	 mm
+  X1_Y1 = 	+140.1	+011.2	+100.0	 mm
+  X1_Y128 = 	+143.4	-086.0	+100.7	 mm
+  SI= 1.00
+  SILI= 0.00
+  CSI= 1.00
+  VIS= all
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%% MUGAST TRAPEZOIDS %%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+Mugast Trapezoid
+  DetectorNumber = 1
+  X128_Y128 = 	-022.7	+042.2	-098.2	 mm
+  X1_Y128 = 	-040.4	+024.6	-098.2	 mm
+  X1_Y1 = 	-120.3	+058.0	-030.9	 mm
+  X128_Y1 = 	-055.3	+122.6	-031.1	 mm
+	
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%				
+Mugast Trapezoid
+  DetectorNumber = 2
+  X128_Y128 = 	-045.6	+014.5	-097.8	 mm
+  X1_Y128 = 	-045.7	-010.8	-097.9	 mm
+  X1_Y1 = 	-125.9	-043.8	-030.8	 mm
+  X128_Y1 = 	-125.7	+047.8	-030.7	 mm
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%				
+Mugast Trapezoid
+  DetectorNumber = 3
+  X128_Y128 = 	-042.5	-022.2	-098.3	 mm
+  X1_Y128 = 	-024.8	-039.9	-098.4	 mm
+  X1_Y1 = 	-058.0	-120.0	-031.4	 mm
+  X128_Y1 = 	-122.7	-055.2	-031.2	 mm
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+Mugast Trapezoid
+  DetectorNumber = 4				
+  X128_Y128 = 	-014.9	-045.6	-098.5	 mm
+  X1_Y128 = 	+010.3	-045.6	-098.6	 mm
+  X1_Y1 = 	+043.6	-125.7	-031.7	 mm
+  X128_Y1 = 	-048.0	-125.6	-031.4	 mm
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+Mugast Trapezoid
+  DetectorNumber = 5				
+  X128_Y128 = 	+021.9	-042.1	-099.1	 mm
+  X1_Y128 = 	+039.8	-024.5	-099.0	 mm
+  X1_Y1 = 	+119.7	-057.7	-032.1	 mm
+  X128_Y1 = 	+055.0	-122.3	-031.9	 mm
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%				
+Mugast Trapezoid
+  DetectorNumber = 7
+  X128_Y128 = 	+042.3	+022.6	-098.5	 mm
+  X1_Y128 = 	+024.5	+040.5	-098.4	 mm
+  X1_Y1 = 	+057.9	+120.0	-030.8	 mm
+  X128_Y1 = 	+122.5	+055.2	-031.3	 mm
+
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%% MODULAR LEAF %%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+
+ModularLeaf 
+  DefaultValue= -5000
+  Leafs= GATCONF_MASTER CONFDEC_AGATA T_CATS2_HF T_MUGAST_CATS2 T_MUGAST_CATS2b E_AGATA T_FAG_CATS2 T_VAMOS_AGATA T_AGATA_CATS2 T_MUGAST_VAMOS T_MUGAST_AGATA T_VAMOS_CATS2 
+%%% Leafs= GATCONF_MASTER CONFDEC_AGATA CONFDEC_VAMOS T_CATS2_HF T_MUGAST_CATS2 T_MUGAST_CATS2b EVAMOS_AGATA E_AGATA T_FAG_CATS2 T_VAMOS_AGATA T_AGATA_CATS2 TVAMOS_MUGAST_HF T_MUGAST_VAMOS T_MUGAST_AGATA T_VAMOS_CATS2 ADC1_9 ADC1_10 ADC1_11 MW_00 MW_01 MW_02 MW_03 MW_04 MW_05 MW_06 MW_07 MW_08 MW_09 MW_10 MW_11 MW_12 MW_13 MW_14 MW_15 MW_16 MW_17 MW_18 MW_19 MW_21
+  X= EVAMOS_AGATA   
+  Y= E_AGATA       
+
diff --git a/Projects/e793s/Detector/mugast_18Oct22_Tx2.detector b/Projects/e793s/Detector/mugast_18Oct22_Tx2.detector
new file mode 100755
index 000000000..fb58360e3
--- /dev/null
+++ b/Projects/e793s/Detector/mugast_18Oct22_Tx2.detector
@@ -0,0 +1,138 @@
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%% Target %%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+Target
+  THICKNESS= +5.9994 micrometer
+  ANGLE= 0 deg
+  RADIUS= 10 mm
+  MATERIAL= CD2
+  X= +0.00 millimeter
+  Y= +0.00 millimeter
+  Z= +0.2247 millimeter
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%% MUST2 TELESCOPES %%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+%%%%%%% Telescope 1 %%%%%%%
+M2Telescope
+  X128_Y128 = 	+115.7	+009.5	+355.7	 mm
+  X128_Y1 = 	+104.5	+101.5	+326.4	 mm
+  X1_Y1 = 	+014.0	+101.9	+362.1	 mm
+  X1_Y128 = 	+025.2	+009.8	+391.4	 mm
+  SI=  1.00
+  SILI= 0.00
+  CSI= 1.00
+  VIS= all
+
+%%%%%%% Telescope 2 %%%%%%%
+M2Telescope
+  X128_Y128 = 	-011.5	+102.5	+362.2	 mm
+  X128_Y1 = 	-101.6	+102.4	+325.7	 mm
+  X1_Y1 = 	-113.3	+010.3	+354.7	 mm
+  X1_Y128 = 	-023.1	+010.4	+391.2	 mm
+  SI=  1.00
+  SILI= 0.00
+  CSI= 1.00
+  VIS= all
+
+%%%%%%% Telescope 3 %%%%%%%
+M2Telescope
+  X128_Y128 = 	-113.4	-012.5	+354.6	 mm
+  X128_Y1 = 	-101.7	-104.7	+326.0	 mm
+  X1_Y1 = 	-011.6	-104.6	+362.6	 mm
+  X1_Y128 = 	-023.3	-012.3	+391.2	 mm
+  SI= 1.00
+  SILI= 0.00
+  CSI= 1.00
+  VIS= all
+
+%%%%%%% Telescope 4 %%%%%%%
+M2Telescope
+  X128_Y128 = 	+013.4	-105.0	+362.1	 mm
+  X128_Y1 = 	+103.8	-105.1	+326.3	 mm
+  X1_Y1 = 	+115.3	-012.8	+354.8	 mm
+  X1_Y128 = 	+024.9	-012.7	+390.6	 mm
+  SI= 1.00
+  SILI= 0.00
+  CSI= 1.00
+  VIS= all
+
+%%%%%%% Telescope 5 %%%%%%%
+M2Telescope
+  X128_Y128 = 	+143.2	-086.7	+003.4	 mm
+  X128_Y1 = 	+139.9	+010.4	+002.7	 mm
+  X1_Y1 = 	+140.1	+011.2	+100.0	 mm
+  X1_Y128 = 	+143.4	-086.0	+100.7	 mm
+  SI= 1.00
+  SILI= 0.00
+  CSI= 1.00
+  VIS= all
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%% MUGAST TRAPEZOIDS %%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+Mugast Trapezoid
+  DetectorNumber = 1
+  X128_Y128 = 	-022.7	+042.2	-098.2	 mm
+  X1_Y128 = 	-040.4	+024.6	-098.2	 mm
+  X1_Y1 = 	-120.3	+058.0	-030.9	 mm
+  X128_Y1 = 	-055.3	+122.6	-031.1	 mm
+	
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%				
+Mugast Trapezoid
+  DetectorNumber = 2
+  X128_Y128 = 	-045.6	+014.5	-097.8	 mm
+  X1_Y128 = 	-045.7	-010.8	-097.9	 mm
+  X1_Y1 = 	-125.9	-043.8	-030.8	 mm
+  X128_Y1 = 	-125.7	+047.8	-030.7	 mm
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%				
+Mugast Trapezoid
+  DetectorNumber = 3
+  X128_Y128 = 	-042.5	-022.2	-098.3	 mm
+  X1_Y128 = 	-024.8	-039.9	-098.4	 mm
+  X1_Y1 = 	-058.0	-120.0	-031.4	 mm
+  X128_Y1 = 	-122.7	-055.2	-031.2	 mm
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+Mugast Trapezoid
+  DetectorNumber = 4				
+  X128_Y128 = 	-014.9	-045.6	-098.5	 mm
+  X1_Y128 = 	+010.3	-045.6	-098.6	 mm
+  X1_Y1 = 	+043.6	-125.7	-031.7	 mm
+  X128_Y1 = 	-048.0	-125.6	-031.4	 mm
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+Mugast Trapezoid
+  DetectorNumber = 5				
+  X128_Y128 = 	+021.9	-042.1	-099.1	 mm
+  X1_Y128 = 	+039.8	-024.5	-099.0	 mm
+  X1_Y1 = 	+119.7	-057.7	-032.1	 mm
+  X128_Y1 = 	+055.0	-122.3	-031.9	 mm
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%				
+Mugast Trapezoid
+  DetectorNumber = 7
+  X128_Y128 = 	+042.3	+022.6	-098.5	 mm
+  X1_Y128 = 	+024.5	+040.5	-098.4	 mm
+  X1_Y1 = 	+057.9	+120.0	-030.8	 mm
+  X128_Y1 = 	+122.5	+055.2	-031.3	 mm
+
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%% MODULAR LEAF %%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+
+ModularLeaf 
+  DefaultValue= -5000
+  Leafs= GATCONF_MASTER CONFDEC_AGATA T_CATS2_HF T_MUGAST_CATS2 T_MUGAST_CATS2b E_AGATA T_FAG_CATS2 T_VAMOS_AGATA T_AGATA_CATS2 T_MUGAST_VAMOS T_MUGAST_AGATA T_VAMOS_CATS2 
+%%% Leafs= GATCONF_MASTER CONFDEC_AGATA CONFDEC_VAMOS T_CATS2_HF T_MUGAST_CATS2 T_MUGAST_CATS2b EVAMOS_AGATA E_AGATA T_FAG_CATS2 T_VAMOS_AGATA T_AGATA_CATS2 TVAMOS_MUGAST_HF T_MUGAST_VAMOS T_MUGAST_AGATA T_VAMOS_CATS2 ADC1_9 ADC1_10 ADC1_11 MW_00 MW_01 MW_02 MW_03 MW_04 MW_05 MW_06 MW_07 MW_08 MW_09 MW_10 MW_11 MW_12 MW_13 MW_14 MW_15 MW_16 MW_17 MW_18 MW_19 MW_21
+  X= EVAMOS_AGATA   
+  Y= E_AGATA       
+
diff --git a/Projects/e793s/Detector/mugast_30Aug22_2p06um.detector b/Projects/e793s/Detector/mugast_30Aug22_2p06um.detector
new file mode 100755
index 000000000..1c40b6854
--- /dev/null
+++ b/Projects/e793s/Detector/mugast_30Aug22_2p06um.detector
@@ -0,0 +1,138 @@
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%% Target %%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+Target
+  THICKNESS= +2.061189 micrometer
+  ANGLE= 0 deg
+  RADIUS= 10 mm
+  MATERIAL= CD2
+  X= +0.00 millimeter
+  Y= +0.00 millimeter
+  Z= +0.747633 millimeter
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%% MUST2 TELESCOPES %%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+%%%%%%% Telescope 1 %%%%%%%
+M2Telescope
+  X128_Y128 = 	+115.7	+009.5	+155.7	 mm
+  X128_Y1 = 	+104.5	+101.5	+126.4	 mm
+  X1_Y1 = 	+014.0	+101.9	+162.1	 mm
+  X1_Y128 = 	+025.2	+009.8	+191.4	 mm
+  SI=  1.00
+  SILI= 0.00
+  CSI= 1.00
+  VIS= all
+
+%%%%%%% Telescope 2 %%%%%%%
+M2Telescope
+  X128_Y128 = 	-011.5	+102.5	+162.2	 mm
+  X128_Y1 = 	-101.6	+102.4	+125.7	 mm
+  X1_Y1 = 	-113.3	+010.3	+154.7	 mm
+  X1_Y128 = 	-023.1	+010.4	+191.2	 mm
+  SI=  1.00
+  SILI= 0.00
+  CSI= 1.00
+  VIS= all
+
+%%%%%%% Telescope 3 %%%%%%%
+M2Telescope
+  X128_Y128 = 	-113.4	-012.5	+154.6	 mm
+  X128_Y1 = 	-101.7	-104.7	+126.0	 mm
+  X1_Y1 = 	-011.6	-104.6	+162.6	 mm
+  X1_Y128 = 	-023.3	-012.3	+191.2	 mm
+  SI= 1.00
+  SILI= 0.00
+  CSI= 1.00
+  VIS= all
+
+%%%%%%% Telescope 4 %%%%%%%
+M2Telescope
+  X128_Y128 = 	+013.4	-105.0	+162.1	 mm
+  X128_Y1 = 	+103.8	-105.1	+126.3	 mm
+  X1_Y1 = 	+115.3	-012.8	+154.8	 mm
+  X1_Y128 = 	+024.9	-012.7	+190.6	 mm
+  SI= 1.00
+  SILI= 0.00
+  CSI= 1.00
+  VIS= all
+
+%%%%%%% Telescope 5 %%%%%%%
+M2Telescope
+  X128_Y128 = 	+143.2	-086.7	+003.4	 mm
+  X128_Y1 = 	+139.9	+010.4	+002.7	 mm
+  X1_Y1 = 	+140.1	+011.2	+100.0	 mm
+  X1_Y128 = 	+143.4	-086.0	+100.7	 mm
+  SI= 1.00
+  SILI= 0.00
+  CSI= 1.00
+  VIS= all
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%% MUGAST TRAPEZOIDS %%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+Mugast Trapezoid
+  DetectorNumber = 1
+  X128_Y128 = 	-022.7	+042.2	-098.2	 mm
+  X1_Y128 = 	-040.4	+024.6	-098.2	 mm
+  X1_Y1 = 	-120.3	+058.0	-030.9	 mm
+  X128_Y1 = 	-055.3	+122.6	-031.1	 mm
+	
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%				
+Mugast Trapezoid
+  DetectorNumber = 2
+  X128_Y128 = 	-045.6	+014.5	-097.8	 mm
+  X1_Y128 = 	-045.7	-010.8	-097.9	 mm
+  X1_Y1 = 	-125.9	-043.8	-030.8	 mm
+  X128_Y1 = 	-125.7	+047.8	-030.7	 mm
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%				
+Mugast Trapezoid
+  DetectorNumber = 3
+  X128_Y128 = 	-042.5	-022.2	-098.3	 mm
+  X1_Y128 = 	-024.8	-039.9	-098.4	 mm
+  X1_Y1 = 	-058.0	-120.0	-031.4	 mm
+  X128_Y1 = 	-122.7	-055.2	-031.2	 mm
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+Mugast Trapezoid
+  DetectorNumber = 4				
+  X128_Y128 = 	-014.9	-045.6	-098.5	 mm
+  X1_Y128 = 	+010.3	-045.6	-098.6	 mm
+  X1_Y1 = 	+043.6	-125.7	-031.7	 mm
+  X128_Y1 = 	-048.0	-125.6	-031.4	 mm
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+Mugast Trapezoid
+  DetectorNumber = 5				
+  X128_Y128 = 	+021.9	-042.1	-099.1	 mm
+  X1_Y128 = 	+039.8	-024.5	-099.0	 mm
+  X1_Y1 = 	+119.7	-057.7	-032.1	 mm
+  X128_Y1 = 	+055.0	-122.3	-031.9	 mm
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%				
+Mugast Trapezoid
+  DetectorNumber = 7
+  X128_Y128 = 	+042.3	+022.6	-098.5	 mm
+  X1_Y128 = 	+024.5	+040.5	-098.4	 mm
+  X1_Y1 = 	+057.9	+120.0	-030.8	 mm
+  X128_Y1 = 	+122.5	+055.2	-031.3	 mm
+
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%% MODULAR LEAF %%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+
+ModularLeaf 
+  DefaultValue= -5000
+  Leafs= GATCONF_MASTER CONFDEC_AGATA T_CATS2_HF T_MUGAST_CATS2 T_MUGAST_CATS2b E_AGATA T_FAG_CATS2 T_VAMOS_AGATA T_AGATA_CATS2 T_MUGAST_VAMOS T_MUGAST_AGATA T_VAMOS_CATS2 
+%%% Leafs= GATCONF_MASTER CONFDEC_AGATA CONFDEC_VAMOS T_CATS2_HF T_MUGAST_CATS2 T_MUGAST_CATS2b EVAMOS_AGATA E_AGATA T_FAG_CATS2 T_VAMOS_AGATA T_AGATA_CATS2 TVAMOS_MUGAST_HF T_MUGAST_VAMOS T_MUGAST_AGATA T_VAMOS_CATS2 ADC1_9 ADC1_10 ADC1_11 MW_00 MW_01 MW_02 MW_03 MW_04 MW_05 MW_06 MW_07 MW_08 MW_09 MW_10 MW_11 MW_12 MW_13 MW_14 MW_15 MW_16 MW_17 MW_18 MW_19 MW_21
+  X= EVAMOS_AGATA   
+  Y= E_AGATA       
+
diff --git a/Projects/e793s/Detector/mugast_Test2um.detector b/Projects/e793s/Detector/mugast_Test2um.detector
new file mode 100644
index 000000000..1cb2c275f
--- /dev/null
+++ b/Projects/e793s/Detector/mugast_Test2um.detector
@@ -0,0 +1,138 @@
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%% Target %%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+Target
+  THICKNESS= 2.00 micrometer
+  ANGLE= 0 deg
+  RADIUS= 10 mm
+  MATERIAL= CD2
+  X= +0.00 millimeter
+  Y= +0.00 millimeter
+  Z= +0.291361 millimeter
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%% MUST2 TELESCOPES %%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+%%%%%%% Telescope 1 %%%%%%%
+M2Telescope
+  X128_Y128 = 	+115.7	+009.5	+155.7	 mm
+  X128_Y1 = 	+104.5	+101.5	+126.4	 mm
+  X1_Y1 = 	+014.0	+101.9	+162.1	 mm
+  X1_Y128 = 	+025.2	+009.8	+191.4	 mm
+  SI=  1.00
+  SILI= 0.00
+  CSI= 1.00
+  VIS= all
+
+%%%%%%% Telescope 2 %%%%%%%
+M2Telescope
+  X128_Y128 = 	-011.5	+102.5	+162.2	 mm
+  X128_Y1 = 	-101.6	+102.4	+125.7	 mm
+  X1_Y1 = 	-113.3	+010.3	+154.7	 mm
+  X1_Y128 = 	-023.1	+010.4	+191.2	 mm
+  SI=  1.00
+  SILI= 0.00
+  CSI= 1.00
+  VIS= all
+
+%%%%%%% Telescope 3 %%%%%%%
+M2Telescope
+  X128_Y128 = 	-113.4	-012.5	+154.6	 mm
+  X128_Y1 = 	-101.7	-104.7	+126.0	 mm
+  X1_Y1 = 	-011.6	-104.6	+162.6	 mm
+  X1_Y128 = 	-023.3	-012.3	+191.2	 mm
+  SI= 1.00
+  SILI= 0.00
+  CSI= 1.00
+  VIS= all
+
+%%%%%%% Telescope 4 %%%%%%%
+M2Telescope
+  X128_Y128 = 	+013.4	-105.0	+162.1	 mm
+  X128_Y1 = 	+103.8	-105.1	+126.3	 mm
+  X1_Y1 = 	+115.3	-012.8	+154.8	 mm
+  X1_Y128 = 	+024.9	-012.7	+190.6	 mm
+  SI= 1.00
+  SILI= 0.00
+  CSI= 1.00
+  VIS= all
+
+%%%%%%% Telescope 5 %%%%%%%
+M2Telescope
+  X128_Y128 = 	+143.2	-086.7	+003.4	 mm
+  X128_Y1 = 	+139.9	+010.4	+002.7	 mm
+  X1_Y1 = 	+140.1	+011.2	+100.0	 mm
+  X1_Y128 = 	+143.4	-086.0	+100.7	 mm
+  SI= 1.00
+  SILI= 0.00
+  CSI= 1.00
+  VIS= all
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%% MUGAST TRAPEZOIDS %%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+Mugast Trapezoid
+  DetectorNumber = 1
+  X128_Y128 = 	-022.7	+042.2	-098.2	 mm
+  X1_Y128 = 	-040.4	+024.6	-098.2	 mm
+  X1_Y1 = 	-120.3	+058.0	-030.9	 mm
+  X128_Y1 = 	-055.3	+122.6	-031.1	 mm
+	
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%				
+Mugast Trapezoid
+  DetectorNumber = 2
+  X128_Y128 = 	-045.6	+014.5	-097.8	 mm
+  X1_Y128 = 	-045.7	-010.8	-097.9	 mm
+  X1_Y1 = 	-125.9	-043.8	-030.8	 mm
+  X128_Y1 = 	-125.7	+047.8	-030.7	 mm
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%				
+Mugast Trapezoid
+  DetectorNumber = 3
+  X128_Y128 = 	-042.5	-022.2	-098.3	 mm
+  X1_Y128 = 	-024.8	-039.9	-098.4	 mm
+  X1_Y1 = 	-058.0	-120.0	-031.4	 mm
+  X128_Y1 = 	-122.7	-055.2	-031.2	 mm
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+Mugast Trapezoid
+  DetectorNumber = 4				
+  X128_Y128 = 	-014.9	-045.6	-098.5	 mm
+  X1_Y128 = 	+010.3	-045.6	-098.6	 mm
+  X1_Y1 = 	+043.6	-125.7	-031.7	 mm
+  X128_Y1 = 	-048.0	-125.6	-031.4	 mm
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+Mugast Trapezoid
+  DetectorNumber = 5				
+  X128_Y128 = 	+021.9	-042.1	-099.1	 mm
+  X1_Y128 = 	+039.8	-024.5	-099.0	 mm
+  X1_Y1 = 	+119.7	-057.7	-032.1	 mm
+  X128_Y1 = 	+055.0	-122.3	-031.9	 mm
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%				
+Mugast Trapezoid
+  DetectorNumber = 7
+  X128_Y128 = 	+042.3	+022.6	-098.5	 mm
+  X1_Y128 = 	+024.5	+040.5	-098.4	 mm
+  X1_Y1 = 	+057.9	+120.0	-030.8	 mm
+  X128_Y1 = 	+122.5	+055.2	-031.3	 mm
+
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%% MODULAR LEAF %%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+
+ModularLeaf 
+  DefaultValue= -5000
+  Leafs= GATCONF_MASTER CONFDEC_AGATA T_CATS2_HF T_MUGAST_CATS2 T_MUGAST_CATS2b E_AGATA T_FAG_CATS2 T_VAMOS_AGATA T_AGATA_CATS2 T_MUGAST_VAMOS T_MUGAST_AGATA T_VAMOS_CATS2 
+%%% Leafs= GATCONF_MASTER CONFDEC_AGATA CONFDEC_VAMOS T_CATS2_HF T_MUGAST_CATS2 T_MUGAST_CATS2b EVAMOS_AGATA E_AGATA T_FAG_CATS2 T_VAMOS_AGATA T_AGATA_CATS2 TVAMOS_MUGAST_HF T_MUGAST_VAMOS T_MUGAST_AGATA T_VAMOS_CATS2 ADC1_9 ADC1_10 ADC1_11 MW_00 MW_01 MW_02 MW_03 MW_04 MW_05 MW_06 MW_07 MW_08 MW_09 MW_10 MW_11 MW_12 MW_13 MW_14 MW_15 MW_16 MW_17 MW_18 MW_19 MW_21
+  X= EVAMOS_AGATA   
+  Y= E_AGATA       
+
diff --git a/Projects/e793s/Detector/mugast_testingMG1dip.detector b/Projects/e793s/Detector/mugast_testingMG1dip.detector
new file mode 100644
index 000000000..f09631e00
--- /dev/null
+++ b/Projects/e793s/Detector/mugast_testingMG1dip.detector
@@ -0,0 +1,138 @@
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%% Target %%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+Target
+  THICKNESS= 2.879799 micrometer
+  ANGLE= 0 deg
+  RADIUS= 10 mm
+  MATERIAL= CD2
+  X= +0.00 millimeter
+  Y= +0.00 millimeter
+  Z= -2.20 millimeter
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%% MUST2 TELESCOPES %%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+%%%%%%% Telescope 1 %%%%%%%
+M2Telescope
+  X128_Y128 = 	+115.7	+009.5	+155.7	 mm
+  X128_Y1 = 	+104.5	+101.5	+126.4	 mm
+  X1_Y1 = 	+014.0	+101.9	+162.1	 mm
+  X1_Y128 = 	+025.2	+009.8	+191.4	 mm
+  SI=  1.00
+  SILI= 0.00
+  CSI= 1.00
+  VIS= all
+
+%%%%%%% Telescope 2 %%%%%%%
+M2Telescope
+  X128_Y128 = 	-011.5	+102.5	+162.2	 mm
+  X128_Y1 = 	-101.6	+102.4	+125.7	 mm
+  X1_Y1 = 	-113.3	+010.3	+154.7	 mm
+  X1_Y128 = 	-023.1	+010.4	+191.2	 mm
+  SI=  1.00
+  SILI= 0.00
+  CSI= 1.00
+  VIS= all
+
+%%%%%%% Telescope 3 %%%%%%%
+M2Telescope
+  X128_Y128 = 	-113.4	-012.5	+154.6	 mm
+  X128_Y1 = 	-101.7	-104.7	+126.0	 mm
+  X1_Y1 = 	-011.6	-104.6	+162.6	 mm
+  X1_Y128 = 	-023.3	-012.3	+191.2	 mm
+  SI= 1.00
+  SILI= 0.00
+  CSI= 1.00
+  VIS= all
+
+%%%%%%% Telescope 4 %%%%%%%
+M2Telescope
+  X128_Y128 = 	+013.4	-105.0	+162.1	 mm
+  X128_Y1 = 	+103.8	-105.1	+126.3	 mm
+  X1_Y1 = 	+115.3	-012.8	+154.8	 mm
+  X1_Y128 = 	+024.9	-012.7	+190.6	 mm
+  SI= 1.00
+  SILI= 0.00
+  CSI= 1.00
+  VIS= all
+
+%%%%%%% Telescope 5 %%%%%%%
+M2Telescope
+  X128_Y128 = 	+143.2	-086.7	+003.4	 mm
+  X128_Y1 = 	+139.9	+010.4	+002.7	 mm
+  X1_Y1 = 	+140.1	+011.2	+100.0	 mm
+  X1_Y128 = 	+143.4	-086.0	+100.7	 mm
+  SI= 1.00
+  SILI= 0.00
+  CSI= 1.00
+  VIS= all
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%% MUGAST TRAPEZOIDS %%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+Mugast Trapezoid
+  DetectorNumber = 1
+  X128_Y128 = 	-022.7	+042.2	-098.2	 mm
+  X1_Y128 = 	-040.4	+024.6	-098.2	 mm
+  X1_Y1 = 	-120.3	+058.0	-030.9	 mm
+  X128_Y1 = 	-055.3	+122.6	-031.1	 mm
+	
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%				
+Mugast Trapezoid
+  DetectorNumber = 2
+  X128_Y128 = 	-045.6	+014.5	-097.8	 mm
+  X1_Y128 = 	-045.7	-010.8	-097.9	 mm
+  X1_Y1 = 	-125.9	-043.8	-030.8	 mm
+  X128_Y1 = 	-125.7	+047.8	-030.7	 mm
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%				
+Mugast Trapezoid
+  DetectorNumber = 3
+  X128_Y128 = 	-042.5	-022.2	-098.3	 mm
+  X1_Y128 = 	-024.8	-039.9	-098.4	 mm
+  X1_Y1 = 	-058.0	-120.0	-031.4	 mm
+  X128_Y1 = 	-122.7	-055.2	-031.2	 mm
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+Mugast Trapezoid
+  DetectorNumber = 4				
+  X128_Y128 = 	-014.9	-045.6	-098.5	 mm
+  X1_Y128 = 	+010.3	-045.6	-098.6	 mm
+  X1_Y1 = 	+043.6	-125.7	-031.7	 mm
+  X128_Y1 = 	-048.0	-125.6	-031.4	 mm
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+Mugast Trapezoid
+  DetectorNumber = 5				
+  X128_Y128 = 	+021.9	-042.1	-099.1	 mm
+  X1_Y128 = 	+039.8	-024.5	-099.0	 mm
+  X1_Y1 = 	+119.7	-057.7	-032.1	 mm
+  X128_Y1 = 	+055.0	-122.3	-031.9	 mm
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%				
+Mugast Trapezoid
+  DetectorNumber = 7
+  X128_Y128 = 	+042.3	+022.6	-098.5	 mm
+  X1_Y128 = 	+024.5	+040.5	-098.4	 mm
+  X1_Y1 = 	+057.9	+120.0	-030.8	 mm
+  X128_Y1 = 	+122.5	+055.2	-031.3	 mm
+
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%% MODULAR LEAF %%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+
+ModularLeaf 
+  DefaultValue= -5000
+  Leafs= GATCONF_MASTER CONFDEC_AGATA T_CATS2_HF T_MUGAST_CATS2 T_MUGAST_CATS2b E_AGATA T_FAG_CATS2 T_VAMOS_AGATA T_AGATA_CATS2 T_MUGAST_VAMOS T_MUGAST_AGATA T_VAMOS_CATS2 
+%%% Leafs= GATCONF_MASTER CONFDEC_AGATA CONFDEC_VAMOS T_CATS2_HF T_MUGAST_CATS2 T_MUGAST_CATS2b EVAMOS_AGATA E_AGATA T_FAG_CATS2 T_VAMOS_AGATA T_AGATA_CATS2 TVAMOS_MUGAST_HF T_MUGAST_VAMOS T_MUGAST_AGATA T_VAMOS_CATS2 ADC1_9 ADC1_10 ADC1_11 MW_00 MW_01 MW_02 MW_03 MW_04 MW_05 MW_06 MW_07 MW_08 MW_09 MW_10 MW_11 MW_12 MW_13 MW_14 MW_15 MW_16 MW_17 MW_18 MW_19 MW_21
+  X= EVAMOS_AGATA   
+  Y= E_AGATA       
+
diff --git a/Projects/e793s/Reaction/47Kdd_08Nov.reaction b/Projects/e793s/Reaction/47Kdd_08Nov.reaction
new file mode 100755
index 000000000..1b82b119f
--- /dev/null
+++ b/Projects/e793s/Reaction/47Kdd_08Nov.reaction
@@ -0,0 +1,28 @@
+%%%%%%%%%%%%%%%%%%%%%% E793S %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+Beam
+  Particle= 47K 
+  ExcitationEnergy= 0 MeV
+  %%-- 7.54789 MeV/u after CATS --%%
+  Energy= 354.75 MeV
+  SigmaEnergy= 0. MeV
+  SigmaThetaX= 0.0  deg
+  SigmaPhiY= 0.0    deg
+  SigmaX= 2.0 millimeter
+  SigmaY= 2.0 millimeter
+  MeanThetaX= 0 deg
+  MeanPhiY= 0 deg
+  MeanX= -3.9164 millimeter 
+  MeanY= +0.0550 millimeter
+ 
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+TwoBodyReaction
+ Beam= 47K
+ Target= 2H
+ Light= 2H
+ Heavy= 47K
+ ExcitationEnergyLight= 0.0 MeV
+ ExcitationEnergyHeavy= 0.0 MeV
+ CrossSectionPath= flat.txt CSR
+ ShootLight= 1
+ ShootHeavy= 0
diff --git a/Projects/e793s/Reaction/47Kdd_Sim.reaction b/Projects/e793s/Reaction/47Kdd_Sim.reaction
index abe498fe3..8c8d11f57 100755
--- a/Projects/e793s/Reaction/47Kdd_Sim.reaction
+++ b/Projects/e793s/Reaction/47Kdd_Sim.reaction
@@ -17,10 +17,10 @@ Beam
  
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 TwoBodyReaction
- Beam= 47K
- Target= 2H
- Light= 2H
- Heavy= 47K
+ Beam=47K
+ Target=2H
+ Light=2H
+ Heavy=47K
 
  ExcitationEnergyLight= 0.0 MeV
  ExcitationEnergyHeavy= 0.0 MeV
diff --git a/Projects/e793s/Reaction/47Kdp_14Oct22.reaction b/Projects/e793s/Reaction/47Kdp_14Oct22.reaction
new file mode 100755
index 000000000..7840f00a3
--- /dev/null
+++ b/Projects/e793s/Reaction/47Kdp_14Oct22.reaction
@@ -0,0 +1,28 @@
+%%%%%%%%%%%%%%%%%%%%%% E793S %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+Beam
+  Particle= 47K 
+  ExcitationEnergy= 0 MeV
+  %%-- 7.54789 MeV/u after CATS --%%
+  Energy= 354.75 MeV
+  SigmaEnergy= 0. MeV
+  SigmaThetaX= 0.0  deg
+  SigmaPhiY= 0.0    deg
+  SigmaX= 2.0 millimeter
+  SigmaY= 2.0 millimeter
+  MeanThetaX= 0 deg
+  MeanPhiY= 0 deg
+  MeanX= -4.1637 millimeter 
+  MeanY= +0.9885 millimeter
+ 
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+TwoBodyReaction
+ Beam= 47K
+ Target= 2H
+ Light= 1H
+ Heavy= 48K
+ ExcitationEnergyLight= 0.0 MeV
+ ExcitationEnergyHeavy= 0.0 MeV
+ CrossSectionPath= flat.txt CSR
+ ShootLight= 1
+ ShootHeavy= 0
diff --git a/Projects/e793s/Reaction/47Kdp_14Oct22_2.reaction b/Projects/e793s/Reaction/47Kdp_14Oct22_2.reaction
new file mode 100755
index 000000000..ed236d7e0
--- /dev/null
+++ b/Projects/e793s/Reaction/47Kdp_14Oct22_2.reaction
@@ -0,0 +1,28 @@
+%%%%%%%%%%%%%%%%%%%%%% E793S %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+Beam
+  Particle= 47K 
+  ExcitationEnergy= 0 MeV
+  %%-- 7.54789 MeV/u after CATS --%%
+  Energy= 354.75 MeV
+  SigmaEnergy= 0. MeV
+  SigmaThetaX= 0.0  deg
+  SigmaPhiY= 0.0    deg
+  SigmaX= 2.0 millimeter
+  SigmaY= 2.0 millimeter
+  MeanThetaX= 0 deg
+  MeanPhiY= 0 deg
+  MeanX= -2.9425 millimeter 
+  MeanY= +0.5028 millimeter
+ 
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+TwoBodyReaction
+ Beam= 47K
+ Target= 2H
+ Light= 1H
+ Heavy= 48K
+ ExcitationEnergyLight= 0.0 MeV
+ ExcitationEnergyHeavy= 0.0 MeV
+ CrossSectionPath= flat.txt CSR
+ ShootLight= 1
+ ShootHeavy= 0
diff --git a/Projects/e793s/Reaction/47Kdp_18Oct22.reaction b/Projects/e793s/Reaction/47Kdp_18Oct22.reaction
new file mode 100755
index 000000000..04064d0cd
--- /dev/null
+++ b/Projects/e793s/Reaction/47Kdp_18Oct22.reaction
@@ -0,0 +1,28 @@
+%%%%%%%%%%%%%%%%%%%%%% E793S %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+Beam
+  Particle= 47K 
+  ExcitationEnergy= 0 MeV
+  %%-- 7.54789 MeV/u after CATS --%%
+  Energy= 354.75 MeV
+  SigmaEnergy= 0. MeV
+  SigmaThetaX= 0.0  deg
+  SigmaPhiY= 0.0    deg
+  SigmaX= 2.0 millimeter
+  SigmaY= 2.0 millimeter
+  MeanThetaX= 0 deg
+  MeanPhiY= 0 deg
+  MeanX= -4.1561 millimeter 
+  MeanY= +0.4701 millimeter
+ 
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+TwoBodyReaction
+ Beam= 47K
+ Target= 2H
+ Light= 1H
+ Heavy= 48K
+ ExcitationEnergyLight= 0.0 MeV
+ ExcitationEnergyHeavy= 0.0 MeV
+ CrossSectionPath= flat.txt CSR
+ ShootLight= 1
+ ShootHeavy= 0
diff --git a/Projects/e793s/Reaction/47Kdp_30Aug22_2p06um.reaction b/Projects/e793s/Reaction/47Kdp_30Aug22_2p06um.reaction
new file mode 100755
index 000000000..c8e79822c
--- /dev/null
+++ b/Projects/e793s/Reaction/47Kdp_30Aug22_2p06um.reaction
@@ -0,0 +1,28 @@
+%%%%%%%%%%%%%%%%%%%%%% E793S %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+Beam
+  Particle= 47K 
+  ExcitationEnergy= 0 MeV
+  %%-- 7.54789 MeV/u after CATS --%%
+  Energy= 354.75 MeV
+  SigmaEnergy= 0. MeV
+  SigmaThetaX= 0.0  deg
+  SigmaPhiY= 0.0    deg
+  SigmaX= 2.0 millimeter
+  SigmaY= 2.0 millimeter
+  MeanThetaX= 0 deg
+  MeanPhiY= 0 deg
+  MeanX= -4.342031 millimeter 
+  MeanY= +0.497130 millimeter
+ 
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+TwoBodyReaction
+ Beam= 47K
+ Target= 2H
+ Light= 1H
+ Heavy= 48K
+ ExcitationEnergyLight= 0.0 MeV
+ ExcitationEnergyHeavy= 0.0 MeV
+ CrossSectionPath= flat.txt CSR
+ ShootLight= 1
+ ShootHeavy= 0
diff --git a/Projects/e793s/Reaction/47Kdt_18Oct22.reaction b/Projects/e793s/Reaction/47Kdt_18Oct22.reaction
new file mode 100755
index 000000000..4105db670
--- /dev/null
+++ b/Projects/e793s/Reaction/47Kdt_18Oct22.reaction
@@ -0,0 +1,30 @@
+%%%%%%%%%%%%%%%%%%%%%% E793S %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+Beam
+  Particle= 47K 
+  ExcitationEnergy= 0 MeV
+  %%-- 7.54789 MeV/u after CATS --%%
+  Energy= 354.75 MeV
+  SigmaEnergy= 0. MeV
+  SigmaThetaX= 0.0  deg
+  SigmaPhiY= 0.0    deg
+  SigmaX= 2.0 millimeter
+  SigmaY= 2.0 millimeter
+  MeanThetaX= 0 deg
+  MeanPhiY= 0 deg
+  MeanX= -4.1561 millimeter 
+  MeanY= +0.4701 millimeter
+ 
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+TwoBodyReaction
+ Beam= 47K
+ Target= 2H
+ Light= 3H
+ Heavy= 46K
+ ExcitationEnergyLight= 0.0 MeV
+ ExcitationEnergyHeavy= 0.0 MeV
+ CrossSectionPath= flat.txt CSR
+ ShootLight= 1
+ ShootHeavy= 0
+ HalfOpenAngleMin =   0 deg
+ HalfOpenAngleMax = 180 deg
diff --git a/Projects/e793s/Reaction/47Kpp_08Nov.reaction b/Projects/e793s/Reaction/47Kpp_08Nov.reaction
new file mode 100755
index 000000000..aef8ef931
--- /dev/null
+++ b/Projects/e793s/Reaction/47Kpp_08Nov.reaction
@@ -0,0 +1,28 @@
+%%%%%%%%%%%%%%%%%%%%%% E793S %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+Beam
+  Particle= 47K 
+  ExcitationEnergy= 0 MeV
+  %%-- 7.54789 MeV/u after CATS --%%
+  Energy= 354.75 MeV
+  SigmaEnergy= 0. MeV
+  SigmaThetaX= 0.0  deg
+  SigmaPhiY= 0.0    deg
+  SigmaX= 2.0 millimeter
+  SigmaY= 2.0 millimeter
+  MeanThetaX= 0 deg
+  MeanPhiY= 0 deg
+  MeanX= -3.9164 millimeter 
+  MeanY= +0.0550 millimeter
+ 
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+TwoBodyReaction
+ Beam= 47K
+ Target= 1H
+ Light= 1H
+ Heavy= 47K
+ ExcitationEnergyLight= 0.0 MeV
+ ExcitationEnergyHeavy= 0.0 MeV
+ CrossSectionPath= flat.txt CSR
+ ShootLight= 1
+ ShootHeavy= 0
diff --git a/Projects/e793s/Reaction/47Kpp_Sim.reaction b/Projects/e793s/Reaction/47Kpp_Sim.reaction
new file mode 100755
index 000000000..59d24ea9e
--- /dev/null
+++ b/Projects/e793s/Reaction/47Kpp_Sim.reaction
@@ -0,0 +1,34 @@
+%%%%%%%%%%%%%%%%%%%%%% E793S %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+Beam
+  Particle= 47K 
+  ExcitationEnergy= 0 MeV
+  %%-- 7.54789 MeV/u after CATS --%%
+  Energy= 354.75 MeV
+  SigmaEnergy= 0. MeV
+  SigmaThetaX= 0.0  deg
+  SigmaPhiY= 0.0    deg
+  SigmaX= 2.0 millimeter
+  SigmaY= 2.0 millimeter
+  MeanThetaX= 0 deg
+  MeanPhiY= 0 deg
+  MeanX= -3.9164 millimeter 
+  MeanY= +0.0550 millimeter
+ 
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+TwoBodyReaction
+ Beam= 47K
+ Target= 1H
+ Light= 1H
+ Heavy= 47K
+
+ ExcitationEnergyLight= 0.0 MeV
+ ExcitationEnergyHeavy= 0.0 MeV
+
+ LabCrossSectionPath= flat.txt CSR
+
+ HalfOpenAngleMin =   0 deg
+ HalfOpenAngleMax = 180 deg
+
+ ShootLight= 1
+ ShootHeavy= 0
diff --git a/Projects/e793s/Reaction/IsotropicDeuterons.source b/Projects/e793s/Reaction/IsotropicDeuterons.source
new file mode 100755
index 000000000..da8c18197
--- /dev/null
+++ b/Projects/e793s/Reaction/IsotropicDeuterons.source
@@ -0,0 +1,12 @@
+%%%%%%%%%%%%%%%%%%%%%% E793S %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+Isotropic
+  EnergyLow = 0 MeV
+  EnergyHigh = 10 MeV
+  HalfOpenAngleMin = 0 deg
+  HalfOpenAngleMax = 180 deg
+  x0 = 0 mm
+  y0 = 0 mm
+  z0 = 0 mm
+  Particle = 2H
+  Multiplicity = 1
diff --git a/Projects/e793s/Reaction/IsotropicProtons.source b/Projects/e793s/Reaction/IsotropicProtons.source
new file mode 100755
index 000000000..bdabca147
--- /dev/null
+++ b/Projects/e793s/Reaction/IsotropicProtons.source
@@ -0,0 +1,12 @@
+%%%%%%%%%%%%%%%%%%%%%% E793S %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+Isotropic
+  EnergyLow = 0 MeV
+  EnergyHigh = 10 MeV
+  HalfOpenAngleMin = 0 deg
+  HalfOpenAngleMax = 180 deg
+  x0 = 0 mm
+  y0 = 0 mm
+  z0 = 0 mm
+  Particle = 1H
+  Multiplicity = 1
diff --git a/Projects/e793s/Reaction/Sim_47Kdp_26May22_v2_0143.reaction b/Projects/e793s/Reaction/Sim_47Kdp_26May22_v2_0143.reaction
new file mode 100644
index 000000000..30ad7b733
--- /dev/null
+++ b/Projects/e793s/Reaction/Sim_47Kdp_26May22_v2_0143.reaction
@@ -0,0 +1,34 @@
+%%%%%%%%%%%%%%%%%%%%%% E793S %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+Beam
+  Particle= 47K 
+  ExcitationEnergy= 0 MeV
+  %%-- 7.54789 MeV/u after CATS --%%
+  Energy= 354.75 MeV
+  SigmaEnergy= 0. MeV
+  SigmaThetaX= 0.0  deg
+  SigmaPhiY= 0.0    deg
+  SigmaX= 2.0 millimeter
+  SigmaY= 2.0 millimeter
+  MeanThetaX= 0 deg
+  MeanPhiY= 0 deg
+  MeanX= -3.989139 millimeter 
+  MeanY= +0.991160 millimeter
+ 
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+TwoBodyReaction
+ Beam= 47K
+ Target= 2H
+ Light= 1H
+ Heavy= 48K
+
+ ExcitationEnergyLight= 0.0 MeV
+ ExcitationEnergyHeavy= 0.143 MeV
+ 
+ LabCrossSectionPath= flat.txt CSR
+
+ ShootLight= 1
+ ShootHeavy= 0
+ 
+ HalfOpenAngleMin =   0 deg
+ HalfOpenAngleMax = 180 deg
diff --git a/Projects/e793s/exp.sh b/Projects/e793s/exp.sh
index 4d78921e4..e60f417cb 100755
--- a/Projects/e793s/exp.sh
+++ b/Projects/e793s/exp.sh
@@ -11,17 +11,91 @@ make -j6;
 #----------------------------------------------------
 #rfile='Reaction/47Kdp_11Jul22.reaction'
 #rfile='Reaction/47Kdt_11Jul22.reaction'
-rfile='Reaction/47Kdd_11Jul22.reaction'
+#rfile='Reaction/47Kdd_11Jul22.reaction'
 #rfile='Reaction/47Kpp_11Jul22.reaction'
+#----------------------------------------------------
+#rfile='Reaction/47Kdp_30Aug22_2p06um.reaction'
+#----------------------------------------------------
+#rfile='Reaction/47Kdp_14Oct22.reaction'
+#rfile='Reaction/47Kdp_14Oct22_2.reaction'
+#----------------------------------------------------
+rfile='Reaction/47Kdp_18Oct22.reaction'
+#rfile='Reaction/47Kdt_18Oct22.reaction'
 #====================================================
 #dfile='Detector/mugast_08Nov.detector'
 #----------------------------------------------------
-dfile='Detector/mugast_11Jul22.detector'
+#dfile='Detector/mugast_11Jul22.detector'
+#dfile='Detector/mugast_Test2um.detector'
+#dfile='Detector/mugast_17Jul22_MM+200mm.detector'
+#dfile='Detector/mugast_17Jul22_MM+203mm.detector'
+#dfile='Detector/mugast_17Jul22_MM+210mm.detector'
+#dfile='Detector/mugast_17Jul22_MM+190mm.detector' #DO ME!!!
+#----------------------------------------------------
+#dfile='Detector/mugast_01Sep22.detector'
+#----------------------------------------------------
+#dfile='Detector/mugast_14Oct22.detector'
+#dfile='Detector/mugast_14Oct22_2.detector'
+dfile='Detector/mugast_18Oct22.detector'
 #====================================================
 
 
+smallTest='_Test'
 ptI='_PartI'
 ptII='_PartII'
+ptA='_PartA'
+ptB='_PartB'
+ptC='_PartC'
+
+echo 'CURRENTLY EXCLUDING RUNS 51 AND 52!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!'
+echo 'CURRENTLY EXCLUDING RUNS 51 AND 52!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!'
+echo 'CURRENTLY EXCLUDING RUNS 51 AND 52!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!'
+echo 'CURRENTLY EXCLUDING RUNS 51 AND 52!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!'
+echo 'CURRENTLY EXCLUDING RUNS 51 AND 52!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!'
+echo 'CURRENTLY EXCLUDING RUNS 51 AND 52!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!'
+echo 'CURRENTLY EXCLUDING RUNS 51 AND 52!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!'
+echo 'CURRENTLY EXCLUDING RUNS 51 AND 52!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!'
+echo 'CURRENTLY EXCLUDING RUNS 51 AND 52!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!'
+echo 'CURRENTLY EXCLUDING RUNS 51 AND 52!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!'
+echo 'CURRENTLY EXCLUDING RUNS 51 AND 52!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!'
+echo 'CURRENTLY EXCLUDING RUNS 51 AND 52!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!'
+echo 'CURRENTLY EXCLUDING RUNS 51 AND 52!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!'
+echo 'CURRENTLY EXCLUDING RUNS 51 AND 52!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!'
+echo 'CURRENTLY EXCLUDING RUNS 51 AND 52!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!'
+echo 'CURRENTLY EXCLUDING RUNS 51 AND 52!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!'
+echo 'CURRENTLY EXCLUDING RUNS 51 AND 52!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!'
+echo 'CURRENTLY EXCLUDING RUNS 51 AND 52!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!'
+echo 'CURRENTLY EXCLUDING RUNS 51 AND 52!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!'
+echo 'CURRENTLY EXCLUDING RUNS 51 AND 52!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!'
+echo 'CURRENTLY EXCLUDING RUNS 51 AND 52!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!'
+echo 'CURRENTLY EXCLUDING RUNS 51 AND 52!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!'
+echo 'CURRENTLY EXCLUDING RUNS 51 AND 52!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!'
+echo 'CURRENTLY EXCLUDING RUNS 51 AND 52!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!'
+echo 'CURRENTLY EXCLUDING RUNS 51 AND 52!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!'
+echo 'CURRENTLY EXCLUDING RUNS 51 AND 52!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!'
+echo 'CURRENTLY EXCLUDING RUNS 51 AND 52!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!'
+echo 'CURRENTLY EXCLUDING RUNS 51 AND 52!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!'
+echo 'CURRENTLY EXCLUDING RUNS 51 AND 52!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!'
+
+#npanalysis --definition Exp -R RunToTreat_PartI.txt -E $rfile -D $dfile -C Calibration.txt -O $1$ptI;
+#npanalysis --definition Exp -R RunToTreat_PartI_2.txt -E $rfile -D $dfile -C Calibration.txt -O $1$ptI;
+#npanalysis --definition Exp -R RunToTreat_PartII.txt -E $rfile -D $dfile -C Calibration.txt -O $1$ptII;
+npanalysis --definition Exp -R RunToTreat_PartA.txt -E $rfile -D $dfile -C Calibration.txt -O $1$ptA;
+npanalysis --definition Exp -R RunToTreat_PartB.txt -E $rfile -D $dfile -C Calibration.txt -O $1$ptB;
+npanalysis --definition Exp -R RunToTreat_PartC.txt -E $rfile -D $dfile -C Calibration.txt -O $1$ptC;
 
-npanalysis --definition Exp -R RunToTreat_PartI.txt -E $rfile -D $dfile -C Calibration.txt -O $1$ptI;
-npanalysis --definition Exp -R RunToTreat_PartII.txt -E $rfile -D $dfile -C Calibration.txt -O $1$ptII;
+echo 'CURRENTLY EXCLUDING RUNS 51 AND 52!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!'
+echo 'CURRENTLY EXCLUDING RUNS 51 AND 52!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!'
+echo 'CURRENTLY EXCLUDING RUNS 51 AND 52!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!'
+echo 'CURRENTLY EXCLUDING RUNS 51 AND 52!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!'
+echo 'CURRENTLY EXCLUDING RUNS 51 AND 52!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!'
+echo 'CURRENTLY EXCLUDING RUNS 51 AND 52!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!'
+echo 'CURRENTLY EXCLUDING RUNS 51 AND 52!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!'
+echo 'CURRENTLY EXCLUDING RUNS 51 AND 52!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!'
+echo 'CURRENTLY EXCLUDING RUNS 51 AND 52!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!'
+echo 'CURRENTLY EXCLUDING RUNS 51 AND 52!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!'
+echo 'CURRENTLY EXCLUDING RUNS 51 AND 52!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!'
+echo 'CURRENTLY EXCLUDING RUNS 51 AND 52!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!'
+echo 'CURRENTLY EXCLUDING RUNS 51 AND 52!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!'
+echo 'CURRENTLY EXCLUDING RUNS 51 AND 52!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!'
+#npanalysis --definition Exp --definition ExcludeThePoor -R RunToTreat_PartI.txt -E $rfile -D $dfile -C Calibration.txt -O $1$ptI;
+#npanalysis --definition Exp --definition ExcludeThePoor -R RunToTreat_PartII.txt -E $rfile -D $dfile -C Calibration.txt -O $1$ptII;
diff --git a/Projects/e793s/macro/CS2.h b/Projects/e793s/macro/CS2.h
index d35f3ebe3..462cd89d7 100644
--- a/Projects/e793s/macro/CS2.h
+++ b/Projects/e793s/macro/CS2.h
@@ -125,7 +125,11 @@ void CS(double Energy, double Spin, double spdf, double angmom){
   //double ElasticNorm = 5.8, ElasticNormErr = 1.3; // DeuteronNorm in elastics, 5.8 +- 1.3
   //double ElasticNorm = 2.70, ElasticNormErr = 0.46; // For thicker 
   //double ElasticNorm = 2.8, ElasticNormErr = 0.7; // DeuteronNorm in elastics, 2.8 +- 0.7
-  double ElasticNorm = 2.363, ElasticNormErr = 0.000; // DeuteronNorm in elastics, reconstructed from determined thickness
+  //double ElasticNorm = 2.363, ElasticNormErr = 0.000; // DeuteronNorm in elastics, reconstructed from determined thickness
+  //double ElasticNorm = 3.7, ElasticNormErr = 0.000; // Estimated 'goal' normalization
+
+  double ElasticNorm = 0.000220, ElasticNormErr = 0.000; //14Oct22
+
 
   orbitalname.clear();
   orbital.clear();
@@ -157,10 +161,10 @@ void CS(double Energy, double Spin, double spdf, double angmom){
   }
 
   /* Reduce by factor of 10,000 */
-  ElasticNorm /= 10000.;
-  //ElasticNorm /= 1000.;
-  ElasticNormErr /= 10000.;
-  //ElasticNormErr /= 1000.;
+  //ElasticNorm /= 10000.;
+  ////ElasticNorm /= 1000.;
+  //ElasticNormErr /= 10000.;
+  ////ElasticNormErr /= 1000.;
   double nodes;
 
   if(spdf==1){
@@ -205,7 +209,8 @@ void CS(double Energy, double Spin, double spdf, double angmom){
   //auto file = new TFile("../SolidAngle_HistFile_19Jul22_47Kdp_0p000.root");
   //auto file = new TFile("../SolidAngle_HistFile_19Jul22_47Kdp_1p981.root");
   //auto file = new TFile("../SolidAngle_HistFile_19Jul22_47Kdp_4p393.root");
-  auto file = new TFile("../SolidAngle_HistFile_30Jul22_47Kdp_0p000_ThetaBin0p5.root");
+  //auto file = new TFile("../SolidAngle_HistFile_30Jul22_47Kdp_0p000_ThetaBin0p5.root");
+  auto file = new TFile("../SolidAngle_HistFile_10Aug22_TrueStripRemoval.root");
   //auto file = new TFile("../SolidAngle_HistFile_New.root");
   /* ADD OPTION TO CHANGE SOLID ANGLE FILE DEPENDING ON PEAK!!!!*/
   TH1F* SolidAngle = (TH1F*) file->FindObjectAny("SolidAngle_Lab_MG");
@@ -329,6 +334,17 @@ void CS(double Energy, double Spin, double spdf, double angmom){
   TheoryDiffCross->GetXaxis()->SetTitle("ThetaLab [deg]");
   TheoryDiffCross->Draw();
 
+  /** TEMP **/
+  cout << "UNSCALED THEORY DIFF CROSS SECTION EVALUATED AT DATA POINTS:::" << endl;
+  cout << setprecision(6);
+  for(int i=0; i<20; i++){
+    cout << anglecentres.at(i) << "\t" << TheoryDiffCross->Eval(anglecentres.at(i)) << endl;
+
+  }
+  cout << setprecision(3);
+  cout << "......................" << endl;
+  /** **** **/
+
   /* Convert AoSA into Differential Cross Section */
   //cout << " SCALING BY NORMALIZATION = " << ElasticNorm << endl;
   //gAoSA->GetYaxis()->SetTitle("d#sigma/d#Omega [mb/msr]");
@@ -568,8 +584,8 @@ vector<vector<double>> GetExpDiffCross(double Energy){
      * Specific peak of interest selected from the vector by   *
      * global variable indexE                                  */
 
-    //AllPeaks_OneGate = FitKnownPeaks_RtrnArry(gate, 0.0); cout << "!!!!!!! NO SLIDING SHIFT!!!!!" << endl;
-    AllPeaks_OneGate = FitKnownPeaks_RtrnArry(gate, 0.0);  cout << "!!!!!!! WITH A VARIABLE SLIDING SHIFT!!!!!!!!!!!!!!!!!!!!!!!!!" << endl;
+    AllPeaks_OneGate = FitKnownPeaks_RtrnArry(gate, 0.0); cout << "!!!!!!! NO SLIDING SHIFT!!!!!" << endl;
+    //AllPeaks_OneGate = FitKnownPeaks_RtrnArry(gate, 0.0);  cout << "!!!!!!! WITH A VARIABLE SLIDING SHIFT!!!!!!!!!!!!!!!!!!!!!!!!!" << endl;
     //double slideshift = 0.00218*(((max-min)/2.)+min) - 0.29645; AllPeaks_OneGate = FitKnownPeaks_RtrnArry(gate, slideshift);  cout << "!!!!!!! WITH A FIXED SLIDING SHIFT!!!!!!!!!!!!!!!!!!!!!!!!!" << endl;
     
     /* Write PS-subtracted spectrum to list */
@@ -609,14 +625,12 @@ vector<vector<double>> GetExpDiffCross(double Energy){
 ////////////////////////////////////////////////////////////////////////////////
 TH1F* PullThetaLabHist(int i, double minTheta, double gatesize){
   //TFile* file = new TFile("GateThetaLabHistograms.root","READ");
-  //TFile* file = new TFile("GateThetaLabHistograms_20May22.root","READ");
-  //TFile* file = new TFile("GateThetaLabHistograms_0p05BinWidth.root","READ");
-  //TFile* file = new TFile("GateThetaLabHistograms_ReadMe.root","READ");
-  //TFile* file = new TFile("GateThetaLabHistograms_26May22_v2.root","READ");
-  //TFile* file = new TFile("GateThetaLabHistograms_26May22_v2_bin0p02.root","READ");
-  //TFile* file = new TFile("GateThetaLabHistograms_2p5degAngles_26May22v2.root","READ");
-  //TFile* file = new TFile("GateThetaLabHistograms_11Apr22_20angles.root","READ");
-  TFile* file = new TFile("GateThetaLabHistograms_11Jul22.root","READ");
+  //TFile* file = new TFile("GateThetaLabHistograms_11Jul22.root","READ");
+  //TFile* file = new TFile("GateThetaLabHistograms_10Aug22_TrueStripRemoval.root","READ");
+  //TFile* file = new TFile("GateThetaLabHistograms_29Aug22_TrueStripRemoval_0p05.root","READ");
+  //TFile* file = new TFile("GateThetaLabHistograms_22Sep22_NoRun51-52.root","READ");
+  TFile* file = new TFile("GateThetaLabHistograms_47Kdp_18Oct22_bin0p2.root","READ");
+
   string histname = "cThetaLabGate_" 
 	          + to_string((int) (minTheta+(i*gatesize))) + "-" 
 		  + to_string((int) (minTheta+((i+1)*gatesize)));
@@ -631,7 +645,8 @@ TH1F* PullThetaLabHist(int i, double minTheta, double gatesize){
 TH1F* PullPhaseSpaceHist(int i, double minTheta, double gatesize){
   //TFile* file = new TFile("GatePhaseSpaceThetaLabHistograms_ReadMe.root","READ");
   //TFile* file = new TFile("GatePhaseSpaceThetaLabHistograms_2p5degAngles_26May22v2.root","READ");
-  TFile* file = new TFile("GatePhaseSpaceThetaLabHistograms_11Jul22.root","READ");
+  //TFile* file = new TFile("GatePhaseSpaceThetaLabHistograms_11Jul22.root","READ");
+  TFile* file = new TFile("GatePhaseSpaceThetaLabHistograms_29Aug22_TrueStripRemoval_0p05.root","READ");
   string histname = "cPSpaceThetaLabGate_" 
 	          + to_string((int) (minTheta+(i*gatesize))) + "-" 
 		  + to_string((int) (minTheta+((i+1)*gatesize)));
@@ -892,9 +907,8 @@ TGraph* FindNormalisation(TGraph* theory, TGraphErrors* experiment){
     cout << "multip by " << xs[0] << endl;
   }
   
-  for(int i=0; i<theory->GetN(); i++){ g->SetPoint(g->GetN(),X[i],xs[0]*Y[i]); }
-
-  //for(int i=0; i<theory->GetN(); i++){ g->SetPoint(i,X[i],xs[0]*Y[i]); }
+  //for(int i=0; i<theory->GetN(); i++){ g->SetPoint(g->GetN(),X[i],xs[0]*Y[i]); }
+  for(int i=0; i<theory->GetN(); i++){ g->SetPoint(i,X[i],xs[0]*Y[i]); }
 
   if(loud){
     cout << "End:   X[0] = " << g->GetPointX(4) << " Y[0] = " << g->GetPointY(4) << endl;
diff --git a/Projects/e793s/macro/CS2_dt.h b/Projects/e793s/macro/CS2_dt.h
new file mode 100644
index 000000000..1218e3d70
--- /dev/null
+++ b/Projects/e793s/macro/CS2_dt.h
@@ -0,0 +1,915 @@
+/* Predefine functions */
+vector<vector<double>> GetExpDiffCross(double Energy);
+TH1F* PullThetaCMHist(int i, double minTheta, double gatesize);
+//TH1F* PullPhaseSpaceHist(int i, double minTheta, double gatesize);
+void Scale(TGraph* g , TGraphErrors* ex);
+TGraph* TWOFNR(double E, double J0, double J, double n, double l, double j);
+double ToMininize(const double* parameter);
+TGraph* FindNormalisation(TGraph* theory, TGraphErrors* experiment);
+TList* peakFitList = new TList();
+
+/* Global variables */
+vector<Double_t> anglecentres, anglewidth;
+TGraph* currentThry;
+TGraphErrors* staticExp;
+int indexE;
+double globalS, globalSerr;
+
+/* Output volume toggle */
+bool loud = 1;
+
+/* Scale method toggle */
+bool scaleTogether = 1;
+
+/* String for image */
+string orbitalname;
+string orbital;
+
+
+////////////////////////////////////////////////////////////////////////////////
+void canclone(TCanvas* major, int padNum, string name){
+  string minorName = "./CS2_Figures/" + name + ".root";
+  cout << minorName << endl;
+  TFile* minorFile = new TFile(minorName.c_str(),"READ");
+  TCanvas* minor = (TCanvas*) minorFile->FindObjectAny("c_peakFits");
+ 
+  major->cd(padNum);
+  TPad *pad = (TPad*)gPad;
+  minor->cd();
+  TObject *obj, *clone;
+  pad->Range(minor->GetX1(),minor->GetY1(),minor->GetX2(),minor->GetY2());
+  pad->SetTickx(minor->GetTickx());
+  pad->SetTicky(minor->GetTicky());
+  pad->SetGridx(minor->GetGridx());
+  pad->SetGridy(minor->GetGridy());
+  pad->SetLogx(minor->GetLogx());
+  pad->SetLogy(minor->GetLogy());
+  pad->SetLogz(minor->GetLogz());
+  pad->SetBorderSize(minor->GetBorderSize());
+  pad->SetBorderMode(minor->GetBorderMode());
+  minor->TAttLine::Copy((TAttLine&)*pad);
+  minor->TAttFill::Copy((TAttFill&)*pad);
+  minor->TAttPad::Copy((TAttPad&)*pad);
+
+  TIter next(minor->GetListOfPrimitives());
+  gROOT->SetSelectedPad(pad);
+  while ((obj=next())) {
+     clone = obj->Clone();
+     obj->Draw("SAME");
+     pad->GetListOfPrimitives()->Add(clone,obj->GetDrawOption());
+  }
+  pad->Modified();
+  pad->Update();
+  major->cd(padNum);
+  pad->Draw();
+}
+
+////////////////////////////////////////////////////////////////////////////////
+void CS_Diagnosis(){
+
+  auto majorCanv = new TCanvas("CompareCanv","CompareCanv",1500,1500);
+  majorCanv->Divide(3,3);
+  canclone(majorCanv, 1, "c_peakFits_110_112"); 
+  canclone(majorCanv, 2, "c_peakFits_115_118"); 
+  canclone(majorCanv, 3, "c_peakFits_120_122"); 
+  canclone(majorCanv, 4, "c_peakFits_125_128"); 
+  canclone(majorCanv, 5, "c_peakFits_130_132"); 
+  canclone(majorCanv, 6, "c_peakFits_135_138"); 
+  canclone(majorCanv, 7, "c_peakFits_140_142"); 
+  canclone(majorCanv, 8, "c_peakFits_145_148"); 
+  canclone(majorCanv, 9, "c_peakFits_150_152"); 
+
+}
+
+////////////////////////////////////////////////////////////////////////////////
+void CS(){
+/* Overload function */
+/*
+  cout << " Inputs:\n Experimental...\n\t - Energy of state\n\t - Spin of state" << endl;
+  cout << " Theory...\n\t - Orbital l\n\t - Orbital j\n\t - Orbital n\n\n" << endl;
+
+  cout << "  0f5/2 | -----  |  --?-- |   l=3, j=2.5, n=0" << endl;
+  cout << "        |        |        |" << endl;
+  cout << "  1p1/2 | -----  |  --?-- |   l=1, j=0.5, n=1" << endl;
+  cout << "  1p3/2 | -----  |  --?-- |   l=1, j=1.5, n=1" << endl;
+  cout << "  0f7/2 | -----  |  ===== |" << endl;
+  cout << "        |        |        |" << endl;
+  cout << "  0d3/2 | -----  |  ===== |" << endl;
+  cout << "  1s1/2 | --x--  |  ===== |" << endl;
+  cout << "        |        |        |" << endl;
+  cout << "        |   p    |    n   |" << endl;
+*/
+
+  cout << "- CS(stateE, stateSp, orb_l, orb_j, nodes) "<< endl;
+  cout << "---- 0.143, p3/2 = CS(0.143, 2, 1, 1.5) "<< endl;
+  cout << "---- 0.279, p3/2 = CS(0.279, 2, 1, 1.5) "<< endl;
+  cout << "---- 0.728, f7/2 = CS(0.728, 3, 3, 3.5) "<< endl;
+  cout << "---- 0.968, p1/2 = CS(0.968, 0, 1, 0.5) "<< endl;
+  cout << "---- 1.410, p3/2 = CS(1.410, 1, 1, 1.5) "<< endl;
+  cout << "---- 1.981, p3/2 = CS(1.981, 1, 1, 0.5) "<< endl;
+  cout << "---- 2.410, p3/2 = CS(2.410, 0, 1, 0.5) "<< endl;
+  cout << "---- 3.2  , f7/2 = CS(3.2  , 3, 3, 3.5) "<< endl;
+  cout << "---- 3.6  , f5/2 = CS(3.6  , 3, 3, 2.5) "<< endl;
+  cout << "---- 3.8  , f5/2 = CS(3.8  , 3, 3, 2.5) "<< endl;
+  cout << "---- 4.1  , f5/2 = CS(4.1  , 3, 3, 2.5) "<< endl;
+  cout << "---- 4.4  , f5/2 = CS(4.4  , 3, 3, 2.5) "<< endl;
+
+
+}
+
+////////////////////////////////////////////////////////////////////////////////
+void CS(double Energy, double Spin, double spdf, double angmom){
+  // p3/2 -> spdf = 1, angmom = 1.5
+  // J0 is incident spin, which is 47K g.s. therefore J0 = 1/2
+  double J0 = 0.5;
+  //double ElasticNorm = 5.8, ElasticNormErr = 1.3; // DeuteronNorm in elastics, 5.8 +- 1.3
+  //double ElasticNorm = 2.70, ElasticNormErr = 0.46; // For thicker 
+  //double ElasticNorm = 2.8, ElasticNormErr = 0.7; // DeuteronNorm in elastics, 2.8 +- 0.7
+  //double ElasticNorm = 2.363, ElasticNormErr = 0.000; // DeuteronNorm in elastics, reconstructed from determined thickness
+  //double ElasticNorm = 3.7, ElasticNormErr = 0.000; // Estimated 'goal' normalization
+
+  double ElasticNorm = 0.000220, ElasticNormErr = 0.000; //14Oct22
+
+
+  orbitalname.clear();
+  orbital.clear();
+  if(spdf==0){
+    if(angmom==0.5){
+      orbitalname="s_{1/2}";
+      orbital="s12";
+    } else { 
+      orbitalname="?????";
+      orbital="???";
+    }
+  } else if (spdf==2){
+    if(angmom==1.5){
+      orbitalname="d_{3/2}";
+      orbital="d32";
+    } else if (angmom==2.5) {
+      orbitalname="d_{5/2}";
+      orbital="d52";
+    } else { 
+      orbitalname="?????";
+      orbital="???";
+    }
+  } else if (spdf==3){
+    if(angmom==3.5){
+      orbitalname="f_{7/2}";
+      orbital="f72";
+    } else { 
+      orbitalname="?????";
+      orbital="???";
+    }
+  } else {
+    orbitalname="?????";
+    orbital="???";
+  }
+
+// EDITED UP TO HERE!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+
+  /* Reduce by factor of 10,000 */
+  //ElasticNorm /= 10000.;
+  ////ElasticNorm /= 1000.;
+  //ElasticNormErr /= 10000.;
+  ////ElasticNormErr /= 1000.;
+  double nodes;
+
+  if(spdf==0){
+    nodes=1;
+  }
+  else if(spdf==3 || spdf == 2){
+    nodes=0;
+  }
+  else{
+    cout << " INPUT NODES::" << endl;
+    cin >> nodes;
+  }
+
+  /* Clean global variables, in case of multiple runs */
+  indexE = 100;
+  anglecentres.clear();
+  anglewidth.clear();
+  globalS=0.;
+  globalSerr=0.;
+  peakFitList->Clear();
+
+  /* Retrieve array index of the entered peak energy */
+  /* numpeaks and Energy[] defined globally in KnownPeakFitter.h */
+  bool found = 0;
+  for(int i=0;i<numPeaks;i++){
+    if(abs(Energy-means_dt[i])<0.01){
+      cout << "========================================================" << endl;
+      cout << "Identified as state #" << i << ", E = " << means_dt[i] << endl;
+      indexE = i;
+      found = 1;
+    }
+  }
+  if(!found){
+    cout << "========================================================" << endl;
+    cout << "NO STATE AT THAT ENERGY INDENTIFIED!! CHECK KNOWN PEAKS!!" << endl;
+    return;
+  }
+
+  /* Solid Angle (from simulation) */
+  /* ADD OPTION TO CHANGE SOLID ANGLE FILE DEPENDING ON PEAK!!!!*/
+  auto file = new TFile("../SolidAngle_HistFile_18Oct22_47Kdt.root");
+  /* ADD OPTION TO CHANGE SOLID ANGLE FILE DEPENDING ON PEAK!!!!*/
+  TH1F* SolidAngle = (TH1F*) file->FindObjectAny("SolidAngle_CM_MM");
+  TCanvas* c_SolidAngle = new TCanvas("c_SolidAngle","c_SolidAngle",1000,1000);
+  SolidAngle->Draw("HIST");
+  SolidAngle->GetXaxis()->SetRangeUser(00.,30.);
+  /* (canvas deleted after Area/SA calculation) */
+ 
+  /* Area of experimental peaks */
+  TCanvas* c_PeakArea = new TCanvas("c_PeakArea","c_PeakArea",1000,1000);
+  vector<vector<double>> areaArray = GetExpDiffCross(means_dt[indexE]);
+  delete c_PeakArea;
+
+  // Array: peakenergy, peakarea, areaerror, anglemin, anglemax
+  if(loud){
+    for(int i=0; i<areaArray.size();i++){
+      cout << i << " " 
+    	   << areaArray[i][0] << " " 
+	   << areaArray[i][1] << " "
+	   << areaArray[i][2] << " "
+	   << areaArray[i][3] << " "
+	   << areaArray[i][4] << endl;
+    }
+  }
+
+  /* AoSA = Area/Solid Angle [#/msr] */
+  /* dSdO = Experimental Diff. Cross Sect. (Area/Solid Angle *Norm) [mb/msr] */
+  vector<Double_t> AoSA, AoSAerr;
+  vector<Double_t> expDCS, expDCSerr;
+  for(int i=0; i<areaArray.size();i++){
+    int binmin = SolidAngle->FindBin(areaArray[i][3]+0.0001);
+    int binmax = SolidAngle->FindBin(areaArray[i][4]-0.0001);
+
+//cout << "binmin " << binmin << " to binmax " << binmax << endl;
+
+    anglecentres.push_back(((areaArray[i][4]-areaArray[i][3])/2.)+areaArray[i][3]);
+    anglewidth.push_back(areaArray[i][4]-areaArray[i][3]);
+
+    double tempsum=0, tempsumerr=0;
+    for(int x=binmin;x<binmax+1;x++){
+      tempsum += SolidAngle->GetBinContent(x);
+      tempsumerr += SolidAngle->GetBinError(x);
+      if(loud){cout << x << endl;}
+    }
+    if(loud){cout << "TEST CHECK " << tempsum << " +- " << tempsumerr << endl;}
+
+    double SAerr;
+    double SA = SolidAngle->IntegralAndError(binmin,binmax,SAerr);
+    SA = SA*1000.;       //sr->msr
+    SAerr = SAerr*1000.; //sr->msr
+
+    /* Area over Solid angle ONLY */
+    AoSA.push_back(areaArray[i][1]/SA);
+    AoSAerr.push_back((areaArray[i][1]/SA) 
+		    * sqrt( pow(areaArray[i][2]/areaArray[i][1],2) 
+			    + pow(SAerr/SA,2)));
+
+    /* Differential Cross Section */
+    /* NOTE: DON'T INCLUDE NORM ERROR IN ERR PROPAGATION AS IT IS SYSTEMATIC! */
+    double tempvalue = (areaArray[i][1]/SA)*ElasticNorm; 
+    expDCS.push_back(tempvalue);
+    double temperror = tempvalue
+		     * sqrt( pow(areaArray[i][2]/areaArray[i][1],2)
+		           + pow(SAerr/SA,2)
+			   //+ pow(ElasticNormErr/ElasticNorm,2)
+			   );
+    expDCSerr.push_back(temperror);
+
+    if(loud){
+      cout << "Angle " << areaArray[i][3] << " to " << areaArray[i][4] 
+	   << ", centre " << anglecentres[i]
+	   << ": Area = " << areaArray[i][1] << " +- " << areaArray[i][2] << " cnts" 
+	   << "  SA = " << SA << " +- " << SAerr << " msr" 
+           << "  Area/SA = " << AoSA[i] << " +- " << AoSAerr[i] << " counts/msr"
+	   << setprecision(5)
+           << "  Norm = " << ElasticNorm << " +- " << ElasticNormErr
+	   << " (don't include norm err in propagation)"
+           << "  dSdO = " << tempvalue << " +- " << temperror  
+	   << setprecision(3)
+	   << endl;
+    }
+  }
+  //delete c_SolidAngle;
+  
+  /* Graph of Area/Solid Angle*/
+  TCanvas* c_AoSA = new TCanvas("c_AoSA","c_AoSA",1000,1000);
+  c_AoSA->SetLogy();
+  TGraphErrors* gAoSA = new TGraphErrors(
+		  anglecentres.size(), //n
+		  &(anglecentres[0]), &(AoSA[0]), //x, y
+		  //&(anglewidth[0]), &(AoSAerr[0]) );
+		  0, &(AoSAerr[0]) );  //errX, errY 
+  gAoSA->SetTitle("Area/SolidAngle");
+  gAoSA->GetXaxis()->SetTitle("ThetaCM [deg]");
+  gAoSA->GetYaxis()->SetTitle("Counts/#Omega [counts/msr]");
+  gAoSA->Draw();
+
+  /* Graph of experimental diff. cross sect (dSigma/dOmega) */
+  TCanvas* c_dSdO = new TCanvas("c_dSdO","c_dSdO",1000,1000);
+  c_dSdO->SetLogy();
+  TGraphErrors* gdSdO = new TGraphErrors(
+		  anglecentres.size(),
+		  &(anglecentres[0]), &(expDCS[0]),
+		  //&(anglewidth[0]), &(AoSAerr[0]) );
+		  0, &(expDCSerr[0]) );
+  gdSdO->SetTitle("Differential Cross Section");
+  gdSdO->GetXaxis()->SetTitle("#theta_{lab} [deg]");
+  gdSdO->GetXaxis()->SetTitleOffset(1.2);
+  gdSdO->GetXaxis()->SetTitleSize(0.04);
+  gdSdO->GetYaxis()->SetTitle("d#sigma/d#Omega [mb/msr]");
+  gdSdO->GetYaxis()->SetTitleOffset(1.2);
+  gdSdO->GetYaxis()->SetTitleSize(0.04);
+  gdSdO->Draw();
+  c_dSdO->Update();
+
+  /* TWOFNR diff. cross section, in mb/msr */ 
+  TCanvas* c_TWOFNR = new TCanvas("c_TWOFNR","c_TWOFNR",1000,1000);
+  c_TWOFNR->SetLogy();
+  TGraph* TheoryDiffCross = TWOFNR(means_dt[indexE], J0, Spin, nodes, spdf, angmom); 
+  TheoryDiffCross->GetYaxis()->SetTitle("d#sigma/d#Omega [mb/msr]"); //msr set in func above
+  TheoryDiffCross->GetXaxis()->SetTitle("ThetaCM [deg]");
+  TheoryDiffCross->Draw();
+
+  /** TEMP **/
+  cout << "UNSCALED THEORY DIFF CROSS SECTION EVALUATED AT DATA POINTS:::" << endl;
+  cout << setprecision(6);
+  for(int i=0; i<20; i++){
+    cout << anglecentres.at(i) << "\t" << TheoryDiffCross->Eval(anglecentres.at(i)) << endl;
+
+  }
+  cout << setprecision(3);
+  cout << "......................" << endl;
+  /** **** **/
+
+  /* Convert AoSA into Differential Cross Section */
+  //cout << " SCALING BY NORMALIZATION = " << ElasticNorm << endl;
+  //gAoSA->GetYaxis()->SetTitle("d#sigma/d#Omega [mb/msr]");
+
+
+  /* Scaled and compared on same plot */ 
+/* 
+  cout << "USING BASIC SCALING METHOD..." << endl;
+  TGraph* ScaledTWOFNR = TheoryDiffCross;
+  TCanvas* c_Compare = new TCanvas("c_Compare","c_Compare",1000,1000);
+  Scale(ScaledTWOFNR,gAoSA);
+  c_Compare->SetLogy();
+  gAoSA->SetLineColor(kRed);
+  gAoSA->SetMarkerColor(kRed);
+  gAoSA->SetMarkerStyle(21);
+  gAoSA->Draw("AP");
+  ScaledTWOFNR->Draw("SAME");
+*/
+
+  /* Using Chi2 minimizaiton */
+  cout << "USING CHI2 MINIMIZAITON..." << endl;
+  TCanvas* c_Chi2Min = new TCanvas("c_Chi2Min","c_Chi2Min",1000,1000);
+  gStyle->SetPadLeftMargin(0.12);
+  gStyle->SetPadRightMargin(0.03);
+  //c_Chi2Min->SetLogy();
+
+  TPad *pad1 = new TPad("pad1","pad1",0,0.25,1,1);
+  TPad *pad2 = new TPad("pad2","pad2",0,0,1,0.25);
+  pad1->SetTopMargin(0.1);
+  pad1->SetBottomMargin(0.00001);
+  pad1->SetBorderMode(0);
+  pad1->SetLogy();
+  pad1->SetTickx();
+  pad1->SetTicky();
+  pad2->SetTopMargin(0.00001);
+  pad2->SetBottomMargin(0.3);
+  pad2->SetBorderMode(0);
+  pad2->SetTickx();
+  pad2->SetTicky();
+  pad1->Draw();
+  pad2->Draw();
+  pad1->cd();
+
+  TGraph* Final = FindNormalisation(TheoryDiffCross,gdSdO);
+  gdSdO->SetLineColor(kRed);
+  gdSdO->SetMarkerColor(kRed);
+  gdSdO->SetMarkerStyle(21);
+  /* Construct file name string */
+  /**/  ostringstream tempstream;
+  /**/  if(means_dt[indexE]<1.0){tempstream << 0;}
+  /**/  tempstream << (int) (means_dt[indexE]*1000);
+  /**/  tempstream << "_" << orbital; 
+  /**/  tempstream << "_spin" << Spin;
+  /**/  string tempstr = tempstream.str();
+  /* Construct hist title string */
+  /**/  ostringstream textstream;
+  /**/  textstream << std::fixed << setprecision(3);
+  /**/  textstream << "   " << means_dt[indexE];
+  /**/  textstream << " MeV, ";
+  /**/  textstream <<  orbitalname;
+  /**/  textstream << ", spin " << (int)Spin;
+  /**/	textstream << " --> S = " << globalS 
+  /**/	           << " +- " << globalSerr;
+  /**/  string textstring = textstream.str(); 
+
+  gdSdO->SetTitle(textstring.c_str());
+  gdSdO->GetYaxis()->SetTitleOffset(1.3);
+  gdSdO->GetYaxis()->SetTitleSize(0.042);
+  gdSdO->GetXaxis()->SetRangeUser(103.,157.);
+  gdSdO->Draw("AP");
+  Final->Draw("SAME");
+
+
+  pad2->cd();
+  TGraphErrors* gResid = new TGraphErrors(*gdSdO);
+  for(int n=0; n < gResid->GetN(); n++){
+    double x = gdSdO->GetPointX(n);
+    double residual = gdSdO->GetPointY(n) - Final->Eval(x);
+    gResid->SetPoint(n,x,residual);
+    gResid->SetPointError(n,0,gdSdO->GetErrorY(n));
+  }
+  TLine* markzero = new TLine(103.,0.,157.,0.);
+  gResid->SetTitle("");
+  gResid->GetXaxis()->SetRangeUser(103.,157.);
+  gResid->GetYaxis()->SetTitle("Residuals");
+  gResid->GetYaxis()->SetTitleSize(0.15);
+  gResid->GetYaxis()->SetTitleOffset(0.36);
+  gResid->GetYaxis()->SetLabelSize(0.08);
+  gResid->GetYaxis()->SetNdivisions(305);
+  gResid->GetXaxis()->SetTitleSize(0.15);
+  gResid->GetXaxis()->SetTitleOffset(0.8);
+  gResid->GetXaxis()->SetLabelSize(0.1);
+  gResid->GetXaxis()->SetTickLength(0.1);
+  gResid->Draw();
+  markzero->SetLineStyle(2);
+  markzero->Draw("same");
+
+  //pad1->cd();
+  //TText* orb = new TText(0.5,0.2,"TESTING!!!!!!!!!!!");//orbitalname.c_str());
+  //orb->Draw("SAME");
+
+  string savestring1 = "./CS2_Figures/"+tempstr+".root";
+  string savestring2 = "./CS2_Figures/"+tempstr+".pdf";
+  c_Chi2Min->SaveAs(savestring1.c_str());
+  c_Chi2Min->SaveAs(savestring2.c_str());
+
+  cout << YELLOW
+       << " -----  C2S = (2J+1)S = (2*" << (int)Spin << "+1)S = (" 
+       << (int)((2.*Spin)+1.) << ")S = " 
+       << ((2.*Spin)+1.) * globalS << "  ----- " 
+       << RESET << endl;
+
+
+  //delete c_AoSA;
+  //delete c_dSdO;
+}
+
+////////////////////////////////////////////////////////////////////////////////
+vector<vector<double>> GetExpDiffCross(double Energy){
+  cout << "========================================================" << endl;
+  vector<vector<double>> AllPeaks_OneGate;
+  vector<vector<double>> OnePeak_AllGates;
+  /****CHANGE ANGLE GATING****/
+  int numAngleBins = 7;//10;
+  double widthAngleBins = 5.;//2.;
+  double firstAngle = 0.;//3.;
+  /***************************/
+  double x[numAngleBins], y[numAngleBins];
+  //TList* list = new TList();
+
+  /* Determine scaling factor for PhaseSpace */
+  TCanvas* c_ExSubPSpace = new TCanvas("c_ExSubPSpace","c_ExSubPSpace",1000,1000);
+  double trackScale = 0.0;
+  //if(scaleTogether){
+    TH1F* baseEx = PullThetaCMHist(0,firstAngle,widthAngleBins);
+  //  TH1F* basePS = PullPhaseSpaceHist(0,firstAngle,widthAngleBins);
+    for(int i=1; i<numAngleBins;i++){
+      TH1F* addEx = PullThetaCMHist(i,firstAngle,widthAngleBins); baseEx->Add(addEx,1.);
+  //    TH1F* addPS = PullPhaseSpaceHist(i,firstAngle,widthAngleBins); basePS->Add(addPS,1.);
+    }
+
+    /* Subtract flat background equal to smallest bin in range */
+    baseEx->GetXaxis()->SetRange(baseEx->FindBin(-1.),baseEx->FindBin(1.));
+    double minValueInRange = baseEx->GetBinContent(baseEx->GetMinimumBin());
+    baseEx->GetXaxis()->UnZoom();
+    cout << "Subtracting background of " << minValueInRange << endl;
+    for(int b=1; b<baseEx->GetNbinsX() ; b++){
+      baseEx->SetBinContent(b,baseEx->GetBinContent(b)-minValueInRange);
+    }
+
+    /* Begin scaling within range, track changes */
+    //basePS->Scale(0.1);
+    //trackScale = 0.1;
+    //int numAngleBinsScale = baseEx->GetNbinsX();
+    //int nbinlow = basePS->FindBin(4.); int nbinhigh = basePS->FindBin(8.0);
+    //for(int b=nbinlow; b<nbinhigh; b++){
+    //  if(baseEx->GetBinContent(b) > 0.0 && basePS->GetBinContent(b) > baseEx->GetBinContent(b)){
+    //	while(basePS->GetBinContent(b) > baseEx->GetBinContent(b)){
+    //      basePS->Scale(0.99999);
+    //      trackScale *= 0.99999;
+    //    }
+    //  }
+    //}
+    //baseEx->Add(basePS,-1.);
+    baseEx->SetName("Ex");//SubPSpace");
+    baseEx->SetTitle("Ex");//SubPSpace");
+    baseEx->Draw();
+    cout << "PhaseSpace -> ExpData scaling = ZERO! NO PHASE SPACE!" << endl;//" << trackScale << endl;
+  //}
+
+  /* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! */
+  /* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! */
+  // TEMPORARY!!! REMOVE LAST THREE BINS ON HIGH ENERGY STATES!!!
+  if(means_dt[indexE] > 3.0){numAngleBins-=3;}
+  /* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! */
+  /* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! */
+
+
+  for(int i=0; i<numAngleBins;i++){
+    double min = firstAngle + (i*widthAngleBins);
+    double max = min + widthAngleBins;
+    cout << "===================================" << endl;
+    cout << "min: " << min << " max: " << max << endl;
+  
+    stringstream tmp; tmp << fixed << setprecision(0); 
+    tmp << "c_peakFits_dt_" << min << "_" << max; 
+    string tmp2 = tmp.str();
+    TCanvas* c_peakFits = new TCanvas("c_peakFits",tmp2.c_str(),1000,1000);
+
+    /* Retrieve theta-gated Ex TH1F from file GateThetaLabHistograms.root */
+    /* To change angle gates, run GateThetaLab_MultiWrite() */
+    TH1F* gate = PullThetaCMHist(i,firstAngle,widthAngleBins);
+    //TH1F* pspace = PullPhaseSpaceHist(i,firstAngle,widthAngleBins);
+
+    /* Scale the Phase Space at this angle... */
+    /* ... for all angles together */
+    //if(scaleTogether){
+    //  gate->Add(pspace,-trackScale);
+    //} 
+    /* ... or seperately for each angular bin */
+    /* NOTE THAT THIS DOES NOT ACCOUNT FOR FLAT BACKGROUND */
+    //else {
+    //  if(pspace->Integral() > 50.){ // Non-garbage histogram
+    //    pspace->Scale(0.01);
+    //	trackScale=0.01;
+    //    int numAngleBins = gate->GetNbinsX();
+    //    for(int b=0; b<numAngleBins; b++){
+    //	  if(loud){cout << " FROM " << pspace->GetBinContent(b) << 
+    //		         " > " << gate->GetBinContent(b); 
+    //	  }
+    //      while(pspace->GetBinContent(b) > gate->GetBinContent(b)){
+    //        pspace->Scale(0.9999);
+    //	    trackScale*=0.9999;
+    //	  }
+    //	  if(loud){cout << " TO " << pspace->GetBinContent(b) << 
+    //	  	      " > " << gate->GetBinContent(b) << endl;
+    //	  }
+    //    }
+    //    cout << " !!! SCALE FOR THIS ANGLE = " << trackScale << endl;
+    //    gate->Add(pspace,-1);
+    //  }
+    //}
+
+    /* Subtract flat background equal to smallest bin in range */
+    /* ????? */
+    /*
+    gate->GetXaxis()->SetRange(gate->FindBin(-1.),gate->FindBin(1.));
+    double minValueInRange = gate->GetBinContent(gate->GetMinimumBin());
+    gate->GetXaxis()->UnZoom();
+    cout << "Subtracting background of " << minValueInRange << endl;
+    for(int b=1; b<gate->GetNbinsX() ; b++){
+      gate->SetBinContent(b,gate->GetBinContent(b)-minValueInRange);
+    }
+    */
+
+    /* Retrieve array containing all fits, for one angle gate. *
+     * Specific peak of interest selected from the vector by   *
+     * global variable indexE                                  */
+
+    AllPeaks_OneGate = FitKnownPeaks_dt_RtrnArry(gate, 0.0); cout << "!!!!!!! NO SLIDING SHIFT!!!!!" << endl;
+    //AllPeaks_OneGate = FitKnownPeaks_RtrnArry(gate, 0.0);  cout << "!!!!!!! WITH A VARIABLE SLIDING SHIFT!!!!!!!!!!!!!!!!!!!!!!!!!" << endl;
+    //double slideshift = 0.00218*(((max-min)/2.)+min) - 0.29645; AllPeaks_OneGate = FitKnownPeaks_RtrnArry(gate, slideshift);  cout << "!!!!!!! WITH A FIXED SLIDING SHIFT!!!!!!!!!!!!!!!!!!!!!!!!!" << endl;
+    
+    /* Write PS-subtracted spectrum to list */
+    //list->Add(gate);
+    //list->Add(c_peakFits);
+    gate->GetXaxis()->SetRangeUser(-1.0,+8.0);
+    string filename = "./CS2_Figures/";
+    filename += tmp2 + ".root";
+    c_peakFits->SaveAs(filename.c_str());
+    //auto tempfile = new TFile(filename.c_str(),"UPDATE"); //Reopen newly made file
+    //auto templist = new TList();
+    //templist->Add();
+
+
+    /* Check correct OneGate vector is selected */
+    cout << "area of " << means_dt[indexE] << " = "
+	 << AllPeaks_OneGate[indexE][1] 
+	 << " +- " << AllPeaks_OneGate[indexE][2] 
+	 << endl;
+
+    /* Add min and max angle to end of relevant OneGate vector */
+    AllPeaks_OneGate[indexE].push_back(min);
+    AllPeaks_OneGate[indexE].push_back(max);
+
+    /* Push relevant OneGate vector to end of AllGates vector */
+    OnePeak_AllGates.push_back(AllPeaks_OneGate[indexE]);
+    delete c_peakFits; 
+  }
+
+  /* Write PS-subtracted spectrum to file */
+  //TFile* outfile = new TFile("GateThetaLab_ExMinusGatePhaseSpace.root","RECREATE");
+  //list->Write("GateThetaLab_ExMinusPhaseSpace",TObject::kSingleKey);
+
+  return OnePeak_AllGates;
+}
+
+////////////////////////////////////////////////////////////////////////////////
+TH1F* PullThetaCMHist(int i, double minTheta, double gatesize){
+  //TFile* file = new TFile("GateThetaCMHistograms_47Kdt_18Oct22_bin0p2.root","READ");
+  TFile* file = new TFile("GateThetaCMHistograms_21Oct22_47Kdt.root","READ");
+
+  string histname = "cThetaCMGate_" 
+	          + to_string((int) (minTheta+(i*gatesize))) + "-" 
+		  + to_string((int) (minTheta+((i+1)*gatesize)));
+  cout << "Loading " << histname << endl;
+  TList *list = (TList*)file->Get("GateThetaCMHistograms");
+  TH1F* hist = (TH1F*)list->FindObject(histname.c_str());
+//  file->Close();
+  return hist;
+}
+
+////////////////////////////////////////////////////////////////////////////////
+/*
+TH1F* PullPhaseSpaceHist(int i, double minTheta, double gatesize){
+  //TFile* file = new TFile("GatePhaseSpaceThetaCMHistograms_ReadMe.root","READ");
+  //TFile* file = new TFile("GatePhaseSpaceThetaCMHistograms_2p5degAngles_26May22v2.root","READ");
+  //TFile* file = new TFile("GatePhaseSpaceThetaCMHistograms_11Jul22.root","READ");
+  TFile* file = new TFile("GatePhaseSpaceThetaCMHistograms_29Aug22_TrueStripRemoval_0p05.root","READ");
+  string histname = "cPSpaceThetaCMGate_" 
+	          + to_string((int) (minTheta+(i*gatesize))) + "-" 
+		  + to_string((int) (minTheta+((i+1)*gatesize)));
+  cout << "Loading " << histname << endl;
+  TList *list = (TList*)file->Get("GatePhaseSpaceThetaCMHistograms");
+  TH1F* hist = (TH1F*)list->FindObject(histname.c_str());
+  file->Close();
+  return hist;
+}
+*/
+
+////////////////////////////////////////////////////////////////////////////////
+void Scale(TGraph* g , TGraphErrors* ex){
+  double scale;
+  double mean = 0 ;
+  double* eX = ex->GetX();
+  double* eY = ex->GetY();
+  double totalW = 0;
+  double W = 0;
+  for(int i = 0 ; i < ex->GetN() ; i++){
+    if(eY[i]>1 && eY[i] <1e4){
+      // Incremental Error weighted average
+      W = 1./ex->GetErrorY(i);
+      scale = eY[i]/g->Eval(eX[i]);
+      totalW +=W;
+      mean = mean + W*(scale - mean)/(totalW);
+    }
+  }
+
+  //scaleTWOFNR = mean;
+  cout << "SCALED THEORY BY " << mean << endl;
+  cout << " therefore S = " << 1/mean << " ??" << endl;  
+  
+  double* x = g->GetX();
+  double* y = g->GetY();
+  for(unsigned int i = 0 ; i < g->GetN() ; i++)
+    g->SetPoint(i,x[i],y[i]*mean);
+}
+
+////////////////////////////////////////////////////////////////////////////////
+//TGraph* TWOFNR(double E, double J0, double J, double n, double l, double j, const char* model){
+TGraph* TWOFNR(double E, double J0, double J, double n, double l, double j){
+  /* This function mved between directories in order to run TWOFNR in proper *
+   * location. This is, weirdly, the least tempremental way of doing this.   */
+
+//  cout << "========================================================" << endl;
+//  int johnson, tandyval;
+//  cout << "Using Johnson-Soper ..."; johnson=5; tandyval=0;
+  //cout << "Using Johnson-Tandy 1 ..."; johnson=6; tandyval=1;
+  //cout << "Using Johnson-Tandy 2 ..."; johnson=6; tandyval=2;
+  //cout << "Using Johnson-Tandy 3 ..."; johnson=6; tandyval=3;
+  //cout << "Using Johnson-Tandy 4 ..."; johnson=6; tandyval=4;
+
+//  int modelA,modelB;
+////  switch (model):{
+////    case 'K': case 'k':{
+////      cout << " ... Koning-Delaroche." << endl; modelA=6; modelB=4;
+////    }
+//    case 'C': case 'c':{
+////      cout << " ... and Chapel-Hill." << endl; modelA=2; modelB=2;
+////    }      
+////    case 'B': case 'b':{
+////      cout << " ... Bechetti-Greenlees." << endl; modelA=1; modelB=1;
+////    }
+////  }
+
+
+  char origDirchar[200];
+  getcwd(origDirchar,200);
+  string origDir{origDirchar};
+  string twofnrDir = "/home/charlottepaxman/Programs/TWOFNR";
+  cout << "Current directory    " << origDir << endl;
+  cout << "Moving to directory  " << twofnrDir << endl;
+  chdir(twofnrDir.c_str());
+  //Check
+  system("pwd"); 
+  cout << "===================================" << endl;
+
+  /* Delete existing tran.jjj & 24.jjj files */
+  remove("tran.jjj");
+  remove("24.jjj");
+
+  double BeamEnergy =  7.7;
+  double QValue = -2.112 - E;
+
+  std::ofstream Front_Input("in.front");
+  Front_Input << "jjj" << std::endl;
+  Front_Input << "pipo" << std::endl;
+  Front_Input << 5 << std::endl;
+  Front_Input << 0 << std::endl;
+  Front_Input << 0 << std::endl;
+  Front_Input << BeamEnergy << std::endl;
+  Front_Input << 47 << " " << 19 << std::endl;
+  Front_Input << 1 << std::endl;
+  Front_Input << 1 << std::endl;
+  Front_Input << "0 0 0" << std::endl;
+  Front_Input << l << " " << j << std::endl;
+  Front_Input << n << std::endl;
+  Front_Input << 2 << std::endl;
+  Front_Input << QValue << std::endl; 
+  Front_Input << 1 << std::endl;
+  Front_Input << J0 << std::endl;
+  Front_Input << 1 << std::endl;
+  Front_Input << 1 << std::endl;
+  Front_Input << 1 << std::endl;
+  Front_Input << J << std::endl;
+  Front_Input << 1 << std::endl;
+  Front_Input << 2 << std::endl;
+  Front_Input << 1 << std::endl;
+  Front_Input << 1 << std::endl;
+  Front_Input << 1.25 << " " << 0.65 << std::endl;
+  Front_Input << 6.0 << std::endl;
+  Front_Input << 0 << std::endl;
+  Front_Input << 0 << std::endl;
+
+  Front_Input.close();
+
+  cout << "Filled front20 input file." << endl;
+  cout << "Executing front20..." << endl;
+  system("(exec ~/Programs/TWOFNR/front20 < in.front > /dev/null)"); 
+    ifstream checkfront("tran.jjj");
+    if(!checkfront){
+      //front20 fail!
+      cout << " !! ERROR !! \n front20 failed to complete" << endl;
+      return 0;
+    } else {
+      cout << "-> tran.jjj generated (success not guaranteed)" << endl;
+      checkfront.close();
+    }
+
+  /* in.twofnr instructs twofnr20 to evaluate tran.jjj */
+  cout << "Executing twofnr20..." << endl;
+  system("(exec ~/Programs/TWOFNR/twofnr20 < in.twofnr > /dev/null)");
+    ifstream checktwofnr("24.jjj");
+    if(!checktwofnr){
+      //twofnr20 fail!
+      cout << " !! ERROR !! \n twofnr20 failed to complete" << endl;
+      terminate();
+//      return 0;
+    } else {
+      cout << "-> twofnr20 complete!" << endl;
+      checktwofnr.close();
+    }
+
+  /* In file read, %lg means read this column, %*lg means ignore column */
+  //TGraph* CS = new TGraph("24.jjj");
+  TGraph* CS = new TGraph("21.jjj","%lg %lg %*lg"); 
+
+  //mb/sr->mb/msr is x1/1000
+  for(int i=0; i<CS->GetN(); i++){
+    double x, newy;
+    CS->GetPoint(i,x,newy);
+    newy=newy/1000;
+    CS->SetPoint(i,x,newy);
+  }
+
+
+  cout << "===================================" << endl;
+  cout << "Current directory    " << twofnrDir << endl;
+  cout << "Moving to directory  " << origDir << endl;
+  chdir(origDir.c_str());
+  system("pwd"); 
+  cout << "========================================================" << endl;
+
+  return CS;
+}
+
+////////////////////////////////////////////////////////////////////////////////
+double Chi2(TGraph* theory, TGraphErrors* exper){
+  double Chi2 = 0;
+  double chi = 0;
+
+  //cout << setprecision(8);
+  //for(int i = 1 ; i < exper->GetN() ; i++){
+  for(int i = 0 ; i < exper->GetN() ; i++){
+    if(exper->GetPointY(i)>1.0e-8){ //0){
+      //chi=(exper->Eval(anglecentres[i])-theory->Eval(anglecentres[i]) ) / (exper->GetErrorY(i));
+      chi=(exper->GetPointY(i) - theory->Eval(anglecentres[i]) ) / (exper->GetErrorY(i));
+      //cout << "COMPARE::::: " << exper->Eval(anglecentres[i]) << " TO " << exper->GetPointY(i) << endl;
+      Chi2 +=chi*chi;
+    }
+  }
+  if(loud){cout << "Chi2 = " << Chi2 << endl;}
+  return Chi2;
+  //cout << setprecision(3);
+}
+
+////////////////////////////////////////////////////////////////////////////////
+double ToMininize(const double* parameter){
+  static int f = 0 ;
+  TGraph* g = new TGraph();
+  double* X = currentThry->GetX(); // gets valies from global g1 = tgraph passed to find norm
+  double* Y = currentThry->GetY();
+  for(int i = 0 ; i < currentThry->GetN() ; i++){
+    g->SetPoint(g->GetN(),X[i],parameter[0]*Y[i]); // scales this tgraph by parameter
+  }
+  double chi2  = Chi2(g,staticExp);  //compares theory tgraph to experimental tgrapherrors by chi2
+  return chi2;
+}
+
+////////////////////////////////////////////////////////////////////////////////
+TGraph* FindNormalisation(TGraph* theory, TGraphErrors* experiment){
+  /* (dSdO)meas = S * (dSdO)calc */
+
+  // Set global variable
+  currentThry = theory;
+  staticExp = experiment;
+
+  // Construct minimiser
+  const char* minName ="Minuit";const char* algoName="Migrad";
+  ROOT::Math::Minimizer* min =
+    ROOT::Math::Factory::CreateMinimizer(minName, algoName);
+  min->SetValidError(true);
+
+  // Number of parameters (should only be 1 for me)
+  int mysize = 1;
+
+  // Create funciton wrapper for minimizer
+  // a IMultiGenFunction type
+  ROOT::Math::Functor f(&ToMininize,mysize);
+  min->SetFunction(f);
+  
+  // Set range of parameter(??)
+  double* parameter = new double[mysize];
+  for(unsigned int i = 0 ; i < mysize ; i++){
+    parameter[i] = 0.8;
+    char name[4];
+    sprintf(name,"S%d",i+1);
+    min->SetLimitedVariable(i,name,parameter[i],0.01,0,10);
+  }
+ 
+
+  ///// TO IMPROVE: FIND WAY OF OBTAINING NDF AND PRINT CHI2/NDF /////
+
+  // Minimise
+  min->Minimize();
+  const double *xs = min->X();
+  const double *err = min->Errors(); 
+
+  // Write out
+  for(int i = 0  ; i < mysize ; i++){
+    cout << Form("S%d=",i+1) << xs[i] << "(" << err[i] << ")" << endl;
+  }
+
+  /* Store S value in global variable, to access for drawing on plots */
+  globalS = xs[0];
+  globalSerr = err[0];
+
+  // Return the Fitted CS
+  TGraph* g = new TGraph(); 
+  double* X = theory->GetX();
+  double* Y = theory->GetY();
+  if(loud){
+    cout << setprecision(8);
+    cout << "Start: X[0] = " << theory->GetPointX(4) << " Y[0] = " << theory->GetPointY(4) << endl;
+    cout << "multip by " << xs[0] << endl;
+  }
+  
+  //for(int i=0; i<theory->GetN(); i++){ g->SetPoint(g->GetN(),X[i],xs[0]*Y[i]); }
+  for(int i=0; i<theory->GetN(); i++){ g->SetPoint(i,X[i],xs[0]*Y[i]); }
+
+  if(loud){
+    cout << "End:   X[0] = " << g->GetPointX(4) << " Y[0] = " << g->GetPointY(4) << endl;
+    cout << setprecision(3);
+  }
+
+  return g;
+}
diff --git a/Projects/e793s/macro/DrawPlots.h b/Projects/e793s/macro/DrawPlots.h
index 559e79836..40bd316cc 100755
--- a/Projects/e793s/macro/DrawPlots.h
+++ b/Projects/e793s/macro/DrawPlots.h
@@ -12,7 +12,7 @@ NPL::Reaction Scdp("47Sc(d,p)48Sc@355");
 NPL::Reaction K46dp("46K(d,p)47K@355");
 
 NPL::Reaction Kdp("47K(d,p)48K@355");
-NPL::Reaction Kdt("47K(d,t)46K@355");
+NPL::Reaction Kdt("47K(d,t)46K@355");//@355");
 NPL::Reaction Kdd("47K(d,d)47K@355");
 NPL::Reaction Kpp("47K(p,p)47K@355");
 NPL::Reaction K12C12C("47K(12C,12C)47K@355");
@@ -48,9 +48,9 @@ TChain* Chain(std::string TreeName, std::vector<std::string>& file, bool EventLi
 void LoadChain47Kdp(){
   vector<string> files;
   
-//  files.push_back("../../../Outputs/Analysis/OriginalValues_ptI.root");
-//  files.push_back("../../../Outputs/Analysis/OriginalValues_ptII.root");
-//  files.push_back("../../../Outputs/Analysis/OriginalValues_ptIII.root");
+  //files.push_back("../../../Outputs/Analysis/OriginalValues_ptI.root");
+  //files.push_back("../../../Outputs/Analysis/OriginalValues_ptII.root");
+  //files.push_back("../../../Outputs/Analysis/OriginalValues_ptIII.root");
 
   //files.push_back("../../../Outputs/Analysis/47Kdp_08Nov_PartI.root");
   //files.push_back("../../../Outputs/Analysis/47Kdp_08Nov_PartII.root");
@@ -59,50 +59,32 @@ void LoadChain47Kdp(){
   //files.push_back("../../../Outputs/Analysis/47Kdp_11Apr22_PartI.root");
   //files.push_back("../../../Outputs/Analysis/47Kdp_11Apr22_PartII.root");
 
-  /* As above, with thicker target! */
-  //files.push_back("../../../Outputs/Analysis/47Kdp_26May22_v2_PartI.root");
-  //files.push_back("../../../Outputs/Analysis/47Kdp_26May22_v2_PartII.root");
-
-  /* Fix Z=0 */
-  //files.push_back("../../../Outputs/Analysis/47Kdp_27May22_PartI.root");
-  //files.push_back("../../../Outputs/Analysis/47Kdp_27May22_PartII.root");
-
-  /* Not fixed, but Z near 0 */
-  //files.push_back("../../../Outputs/Analysis/47Kdp_01Jul22_PartI.root");
-  //files.push_back("../../../Outputs/Analysis/47Kdp_01Jul22_PartII.root");
-
   /* New target thickness analysis */
-  files.push_back("../../../Outputs/Analysis/47Kdp_11Jul22_PartI.root");
-  files.push_back("../../../Outputs/Analysis/47Kdp_11Jul22_PartII.root");
+  //files.push_back("../../../Outputs/Analysis/47Kdp_11Jul22_PartI.root");
+  //files.push_back("../../../Outputs/Analysis/47Kdp_11Jul22_PartII.root");
+
+  //files.push_back("../../../Outputs/Analysis/47Kdp_10Aug22_TrueStripRemoval_PartI.root");
+  //files.push_back("../../../Outputs/Analysis/47Kdp_10Aug22_TrueStripRemoval_PartII.root");
+  
+  //files.push_back("../../../Outputs/Analysis/47Kdp_22Sep22_RmvMM5_NoRun51-52_PartI.root");
+  //files.push_back("../../../Outputs/Analysis/47Kdp_22Sep22_RmvMM5_NoRun51-52_PartII.root");
+  
+  /*************************/
 
+  files.push_back("../../../Outputs/Analysis/47Kdp_18Oct22_PartI.root");
+  files.push_back("../../../Outputs/Analysis/47Kdp_18Oct22_PartII.root");
 
   chain = Chain("PhysicsTree",files,true);
 }
 
 void LoadChain47Kdt(){
   vector<string> files;
-  //files.push_back("../../../Outputs/Analysis/47Kdt_13May22_PartI.root");
-  //files.push_back("../../../Outputs/Analysis/47Kdt_13May22_PartII.root");
-  //files.push_back("../../../Outputs/Analysis/47Kdt_25May22_TestingDiffTimeCalib_PartI.root");
-  //files.push_back("../../../Outputs/Analysis/47Kdt_25May22_TestingDiffTimeCalib_PartII.root");
   
   /* Offset MM1 timing by -5 */
-  //files.push_back("../../../Outputs/Analysis/47Kdt_22Jun22_PartI.root");
-  //files.push_back("../../../Outputs/Analysis/47Kdt_22Jun22_PartII.root");
+  /* Push MM1-4 +200mm in Z */
 
-  /* As above, with 01Jul22 XYZT */
-  //files.push_back("../../../Outputs/Analysis/47Kdt_22Jun22_PartI.root");
-  //files.push_back("../../../Outputs/Analysis/47Kdt_22Jun22_PartII.root");
-
-  /* As above, with 11Jul22 XYZT */
-  //files.push_back("../../../Outputs/Analysis/47Kdt_11Jul22_PartI.root");
-  //files.push_back("../../../Outputs/Analysis/47Kdt_11Jul22_PartII.root");
-
-  files.push_back("../../../Outputs/Analysis/47Kdt_14Jul22_PartI.root");
-  files.push_back("../../../Outputs/Analysis/47Kdt_14Jul22_PartII.root");
-
-
-  //files.push_back("../../../Outputs/Analysis/TESTING_PartII.root");
+  files.push_back("../../../Outputs/Analysis/47Kdt_18Oct22_PartI.root");
+  files.push_back("../../../Outputs/Analysis/47Kdt_18Oct22_PartII.root");
 
   chain = Chain("PhysicsTree",files,true);
 }
@@ -112,9 +94,19 @@ void LoadChain47Kdd(){
   //files.push_back("../../../Outputs/Analysis/47Kdd_08Nov_PartI.root");
   //files.push_back("../../../Outputs/Analysis/47Kdd_08Nov_PartII.root");
 
-  files.push_back("../../../Outputs/Analysis/47Kdd_11Jul22_PartI.root");
-  files.push_back("../../../Outputs/Analysis/47Kdd_11Jul22_PartII.root");
+  //files.push_back("../../../Outputs/Analysis/47Kdd_11Jul22_PartI.root");
+  //files.push_back("../../../Outputs/Analysis/47Kdd_11Jul22_PartII.root");
  
+  /* Removing MM5x103+ */
+  //files.push_back("../../../Outputs/Analysis/47Kdd_01Sep22_RemoveMoreMM5_PartI.root");
+  //files.push_back("../../../Outputs/Analysis/47Kdd_01Sep22_RemoveMoreMM5_PartII.root");
+
+  /* Now without runs 51&52, due to CATS not being in the trigger for these runs */
+  files.push_back("../../../Outputs/Analysis/47Kdd_21Sep22_RmvMM5_NoRun51-52_PartI.root");
+  files.push_back("../../../Outputs/Analysis/47Kdd_21Sep22_RmvMM5_NoRun51-52_PartII.root");
+  //cout << RED << " ONLY USING ONE PART OF THE SORT" << RESET << endl;
+
+
   chain = Chain("PhysicsTree",files,true);
 }
 
@@ -152,65 +144,39 @@ void DrawParticleStates(TCanvas* canvas){
   
   canvas->Update();
   double max = canvas->GetUymax();
-  TLine *Sn = new TLine(4.644, 0.0, 4.644, max);
-    Sn->SetLineColor(kRed);
-    Sn->SetLineStyle(7);
-    Sn->Draw();
   TLine *gs = new TLine(0.000, 0.0, 0.000, max);
     gs->SetLineColor(kGreen);
     gs->SetLineStyle(7);
     gs->Draw();
+  TLine *Sn = new TLine(4.644, 0.0, 4.644, max);
+    Sn->SetLineColor(kRed);
+    Sn->SetLineStyle(7);
+    Sn->Draw();
 
-  TLine** lines = new TLine*[numPeaks];
-  for(int j = 0; j < numPeaks; j++){
-    lines[j] = new TLine(means[j],0.0,means[j],max);
-    lines[j]->SetLineStyle(8);
-    lines[j]->SetLineColor(kGray);
-    lines[j]->Draw();
+  
+/*  if(reactionName=="47K(d,p)"){
+    TLine** lines = new TLine*[numPeaks];
+    for(int j = 0; j < numPeaks; j++){
+      lines[j] = new TLine(means[j],0.0,means[j],max);
+      lines[j]->SetLineStyle(8);
+      lines[j]->SetLineColor(kGray);
+      lines[j]->Draw();
+    }
   }
-
-/*
-  TLine *l0143 = new TLine(0.143, 0.0, 0.143, max);
-    l0143->SetLineStyle(kDashed);
-    l0143->Draw();
-  TLine *l0728 = new TLine(0.728, 0.0, 0.728, max);
-    l0728->SetLineStyle(kDotted);
-    l0728->Draw();
-  TLine *l0968 = new TLine(0.968, 0.0, 0.968, max);
-    l0968->SetLineStyle(kDotted);
-    l0968->Draw();
-  TLine *l1410 = new TLine(1.410, 0.0, 1.410, max);
-    l1410->SetLineStyle(kDotted);
-    l1410->Draw();
-  TLine *l1981 = new TLine(1.981, 0.0, 1.981, max);
-    l1981->SetLineStyle(kDotted);
-    l1981->Draw("same");
-  TLine *l2410 = new TLine(2.410, 0.0, 2.410, max);
-    l2410->SetLineStyle(kDotted);
-    l2410->Draw("same");
-  TLine *l2907 = new TLine(2.907, 0.0, 2.907, max);
-    l2907->SetLineStyle(kDotted);
-    l2907->Draw("same");
-  TLine *l3200 = new TLine(3.2, 0.0, 3.2, max);
-    l3200->SetLineStyle(kDotted);
-    l3200->Draw("same");
-  TLine *l3605 = new TLine(3.605, 0.0, 3.605, max);
-    l3605->SetLineStyle(kDotted);
-    l3605->Draw("same");
-  TLine *l3800 = new TLine(3.792, 0.0, 3.792, max);
-    l3800->SetLineStyle(kDotted);
-    l3800->Draw("same");
-  TLine *l3870 = new TLine(3.876, 0.0, 3.876, max);
-    l3870->SetLineStyle(kDotted);
-    l3870->Draw("same");
-  TLine *l4100 = new TLine(4.1, 0.0, 4.1, max);
-    l4100->SetLineStyle(kDotted);
-    l4100->Draw("same");
- TLine *l4510 = new TLine(4.51, 0.0, 4.51, max);
-    l4510->SetLineStyle(kDotted);
-    l4510->Draw("same");
-
 */
+//  if(reactionName=="47K(d,t)"){
+    TLine *l1945 = new TLine(1.945, 0.0, 1.945, max);
+    l1945->SetLineStyle(kDashed);
+    l1945->Draw();
+ 
+    TLine *l2233 = new TLine(2.233, 0.0, 2.233, max);
+    l2233->SetLineStyle(kDashed);
+    l2233->Draw();
+
+    TLine *l3344 = new TLine(3.344, 0.0, 3.344, max);
+    l3344->SetLineStyle(kDashed);
+    l3344->Draw();
+//  }
 }
 
 void plot_kine(NPL::Reaction r, double Ex,Color_t c,int w, int s){
@@ -219,7 +185,7 @@ void plot_kine(NPL::Reaction r, double Ex,Color_t c,int w, int s){
   g->SetLineColor(c) ;
   g->SetLineStyle(s) ;
   g->SetLineWidth(w) ;
-  g->Draw("c");
+  g->Draw("c same");
 }
 
 void plot_state(double Ex,double max,Color_t c,int w, int s){
@@ -267,6 +233,9 @@ void Draw_1DGamma_DetGate(){
   string gate = timegate 
 	      + " && " + det_gate
 	      + " && " + exclBmDcy;
+  if(reactionName=="47K(d,t)"){
+    gate = gate + " && cutTritons && cutTime";
+  }
 
   TCanvas *cEg = new TCanvas("cEg","cEg",1000,1000);
   gStyle->SetOptStat(0);
@@ -366,18 +335,27 @@ void Load_1DParticle_SubPhaseSpace(){
 }
 
 void Draw_1DParticle(){
+  string gate2;
+  string gate3;
   string gate = timegate 
 	      + " && " + det_gate
               + " && Ex@.size()==1";
+  if(reactionName=="47K(d,t)"){
+    gate = gate + " && cutTritons && cutTime";
+  }
 
   TCanvas *cEx = new TCanvas("cEx","cEx",1000,1000);
-  chain->Draw("Ex>>Ep(600,-15,15)", gate.c_str(),"");
+  chain->Draw("Ex>>Ep(400,-2,8)", gate.c_str(),"");
   TH1F* Ep = (TH1F*) gDirectory->Get("Ep");
-//  Ep->SetTitle("Ex");
   Ep->GetXaxis()->SetTitle("Ex [MeV]");
-  Ep->GetYaxis()->SetTitle("Counts / 0.05 MeV");
+  Ep->GetYaxis()->SetTitle("Counts / 0.025 MeV");
+
+  if(reactionName=="47K(d,t)"){
+    Ep->Rebin(2); 
+    Ep->GetYaxis()->SetTitle("Counts / 0.05 MeV");
+  }
 
-  DrawParticleStates(cEx);
+  if(reactionName=="47K(d,p)"){DrawParticleStates(cEx);}
 }
 
 void Load_2DParticleGamma(){
@@ -392,6 +370,9 @@ void Draw_2DParticleGamma(){
   string gate = timegate 
 	      + " && " + det_gate
               + " && Ex@.size()==1";
+  if(reactionName=="47K(d,t)"){
+    gate = gate + " && cutTritons && cutTime";
+  }
 
   TCanvas *cExEg = new TCanvas("cExEg","cExEg",1000,1000);
   gStyle->SetOptStat(0);
@@ -399,9 +380,7 @@ void Draw_2DParticleGamma(){
   chain->Draw("Ex:AddBack_EDC>>ExEg(5000,0,5,3000,-15,15)", gate.c_str(), "");
   TH1F* ExEg = (TH1F*) gDirectory->Get("ExEg");
   ExEg->SetTitle("");
-  //ExEg->GetXaxis()->SetTitle("Ex [MeV]");
   ExEg->GetYaxis()->SetTitle("Ex [MeV]");
-  //ExEg->GetYaxis()->SetTitle("Eg [MeV]");
   ExEg->GetXaxis()->SetTitle("E_{#gamma} [MeV]");
   ExEg->GetYaxis()->SetRangeUser(-1.0,7.0);
   ExEg->Draw();
@@ -496,10 +475,13 @@ void GateGamma_SeeParticle(double gamma, double width, double binsize){
       + to_string(gamma)
       + ")<"
       + to_string(width);
+  if(reactionName=="47K(d,t)"){
+    gating = gating + " && cutTritons && cutTime";
+  }
 
   string title = to_string(gamma-width)+" < Eg < "+to_string(gamma+width);
   string ytitle = "Counts / " + to_string(binsize) + " MeV";
-  string draw = "Ex>>ExGate(" + to_string(30.0/binsize) + ",-15,15)";
+  string draw = "Ex>>ExGate(" + to_string(10.0/binsize) + ",-2,8)";
 
   TCanvas *cEx_Gate = new TCanvas("cEx_Gate","cEx_Gate",1000,1000);
   //chain->Draw("Ex>>ExGate(60,-1,5)",gating.c_str(),"colz");
@@ -508,8 +490,8 @@ void GateGamma_SeeParticle(double gamma, double width, double binsize){
   ExGate->GetXaxis()->SetTitle("Ex [MeV]");
   ExGate->GetYaxis()->SetTitle(ytitle.c_str());
   ExGate->SetTitle(title.c_str());
-
-  DrawParticleStates(cEx_Gate);
+  
+  if(reactionName=="47K(d,p)"){DrawParticleStates(cEx_Gate);}
 }
 
 void GateGamma_SeeParticle_WithBG(double gamma, double width, double bg){
@@ -521,12 +503,16 @@ void GateGamma_SeeParticle_WithBG(double gamma, double width, double bg){
       + to_string(bg)
       + ")<"
       + to_string(width);
+  if(reactionName=="47K(d,t)"){
+    gating = gating + " && cutTritons && cutTime";
+    bggate = bggate + " && cutTritons && cutTime";
+  }
 
   string title = "Gate: "+to_string(gamma-width)+" to "+to_string(gamma+width)+"."
 	  + "  BG: "+to_string(bg-width)+" to "+to_string(bg+width)+".";
   
   TCanvas *cEx_Gate = new TCanvas("cEx_Gate","cEx_Gate",1000,1000);
-  chain->Draw("Ex>>ExGate(600,-15,15)",gating.c_str(),"");
+  chain->Draw("Ex>>ExGate(200,-2,8)",gating.c_str(),"");
   //chain->Draw("Ex>>ExGate(120,-1,5)",gating.c_str(),"");
   TH1F* ExGate = (TH1F*) gDirectory->Get("ExGate");
   ExGate->GetXaxis()->SetTitle("Ex [MeV]");
@@ -556,6 +542,10 @@ void GateGamma_SeeParticle_WithBG(double gamma, double width, double bg, double
       + to_string(bg)
       + ")<"
       + to_string(widthbg);
+  if(reactionName=="47K(d,t)"){
+    gating = gating + " && cutTritons && cutTime";
+    bggate = bggate + " && cutTritons && cutTime";
+  }
 
   double ratio = width/widthbg;
 
@@ -563,7 +553,7 @@ void GateGamma_SeeParticle_WithBG(double gamma, double width, double bg, double
 	  + "  BG: "+to_string(bg-width)+" to "+to_string(bg+width)+".";
   
   TCanvas *cEx_Gate = new TCanvas("cEx_Gate","cEx_Gate",1000,1000);
-  chain->Draw("Ex>>ExGate(600,-15,15)",gating.c_str(),"");
+  chain->Draw("Ex>>ExGate(200,-2,8)",gating.c_str(),"");
   //chain->Draw("Ex>>ExGate(120,-1,5)",gating.c_str(),"");
   TH1F* ExGate = (TH1F*) gDirectory->Get("ExGate");
   ExGate->GetXaxis()->SetTitle("Ex [MeV]");
@@ -574,7 +564,7 @@ void GateGamma_SeeParticle_WithBG(double gamma, double width, double bg, double
   ExGate->SetFillStyle(3154);
   ExGate->SetTitle(title.c_str());
 
-  chain->Draw("Ex>>ExBG(600,-15,15)",bggate.c_str(),"same");
+  chain->Draw("Ex>>ExBG(200,-2,8)",bggate.c_str(),"same");
   //chain->Draw("Ex>>ExBG(120,-1,5)",bggate.c_str(),"same");
   TH1F* ExBG = (TH1F*) gDirectory->Get("ExBG");
   ExBG->Scale(ratio);
@@ -593,6 +583,9 @@ void GateParticle_SeeGamma(double particle, double width){
       + to_string(particle)
       + ")<"
       + to_string(width);
+  if(reactionName=="47K(d,t)"){
+    gating = gating + " && cutTritons && cutTime";
+  }
 
   string title = to_string(particle-width)+" < Ex < "+to_string(particle+width);
   
@@ -625,6 +618,10 @@ void GateParticle_SeeGamma_WithBG(double particle, double width, double bg, doub
       + to_string(bg)
       + ")<"
       + to_string(width2);
+  if(reactionName=="47K(d,t)"){
+    gating = gating + " && cutTritons && cutTime";
+    bggate = bggate + " && cutTritons && cutTime";
+  }
 
   double ratio = width/width2;
 
@@ -1135,11 +1132,17 @@ void ExPhiLab_ForPoster(){
 }
 
 void ExThetaLab(){
+  string gate = timegate 
+	      + " && " + det_gate
+              + " && Ex@.size()==1";
+  if(reactionName=="47K(d,t)"){
+    gate = gate + " && cutTritons && cutTime";
+  }
+
   TCanvas *diagnoseTheta = new TCanvas("diagnoseTheta","diagnoseTheta",1000,1000);
   chain->Draw(
-    "Ex:ThetaLab>>thetaHist(120,100,160,180,-1,8)", 
-    "abs(T_MUGAST_VAMOS-2700)<400 && Mugast.TelescopeNumber>0 && Mugast.TelescopeNumber<8",
-    "colz");
+    "Ex:ThetaLab>>thetaHist(360,0,180,180,-1,8)", 
+    gate.c_str(), "colz");
   TH1F* thetaHist = (TH1F*) gDirectory->Get("thetaHist");  
   thetaHist->GetXaxis()->SetTitle("#theta_{lab} [deg]");
   thetaHist->GetYaxis()->SetTitle("Ex [MeV]");
@@ -1189,11 +1192,16 @@ void ExThetaLab(){
 
 void ExThetaLab(double gamma, double width){
   TCanvas *diagnoseTheta = new TCanvas("diagnoseTheta","diagnoseTheta",1000,1000);
+  string gate = timegate 
+	      + " && " + det_gate
+              + " && Ex@.size()==1";
+  if(reactionName=="47K(d,t)"){
+    gate = gate + " && cutTritons && cutTime";
+  }
+  gate = gate + "&& abs(AddBack_EDC-"
+	      + to_string(gamma) + ") < " + to_string(width); 
 
-  string gating = "abs(T_MUGAST_VAMOS-2700)<400 && Mugast.TelescopeNumber>0 && Mugast.TelescopeNumber<8 && abs(AddBack_EDC-"
-	        + to_string(gamma) + ") < " + to_string(width); 
-
-  chain->Draw("Ex:ThetaLab>>thetaHist(60,100,160,100,-1,9)", gating.c_str(), "colz");
+  chain->Draw("Ex:ThetaLab>>thetaHist(360,0,180,100,-1,9)", gate.c_str(), "colz");
   TH1F* thetaHist = (TH1F*) gDirectory->Get("thetaHist");  
   thetaHist->GetXaxis()->SetTitle("Theta (degrees)");
   thetaHist->GetYaxis()->SetTitle("Ex [MeV]");
@@ -1240,53 +1248,54 @@ void ExThetaLab(double gamma, double width){
 }
 
 void ELabThetaLab(){
-  TCanvas *cELabTLaab = new TCanvas("cELabTLab","cELabTLab",1000,1000);
+  TCanvas *cELabTLab = new TCanvas("cELabTLab","cELabTLab",1000,1000);
   gStyle->SetOptStat(0);
 
   string gate = timegate 
 	      + " && " + det_gate;
   if(reactionName=="47K(d,t)"){
-    gate = gate + " && cutTritons";
+    gate = gate + " && cutTritons && cutTime";
   }
 
 
-cout << "test" << endl;
   chain->Draw("ELab:ThetaLab>>hKine(360,0,180,500,0,10)",gate.c_str(),"col");
-cout << "test2" << endl;
   TH2F* hKine = (TH2F*) gDirectory->Get("hKine");
-cout << "test3" << endl;
   hKine->SetTitle("");
   hKine->GetXaxis()->SetTitle("#theta_{lab} [deg]");
   hKine->GetYaxis()->SetTitle("E_{lab} [MeV]");
-  plot_kine(Kdt, 0.000, kBlack, 2, 1);
+
+  plot_kine(K12C12C, 0.000, kRed, 2, 1);
+
+  if(reactionName=="47K(d,t)"){
+    cout << "  Trying to draw lines for " << reactionName << endl;
+    plot_kine(Kdt, 0.000, kBlack, 2, 1);
+    plot_kine(Kdt, 1.944, kBlack, 2, 1);
+    plot_kine(Kdt, 3.340, kBlack, 2, 1);
+    plot_kine(Kdt, 4.3  , kBlack, 2, 1);
+    plot_kine(Kdt, 5.8  , kBlack, 2, 1);
+  }
   
-  plot_kine(Kdd, 0.000, kRed, 2, 1);
-  plot_kine(Kpp, 0.000, kRed, 2, 1);
+  if(reactionName=="47K(d,d)"){
+    cout << "  Trying to draw lines for " << reactionName << endl;
+    plot_kine(Kdd, 0.000, kBlack, 2, 1);
+    plot_kine(Kpp, 0.000, kBlack, 2, 6);
+  }
   
-  plot_kine(Kdp, 0.000, kBlack, 2, 1);
-  plot_kine(Kdp, 4.644, kBlack, 2, 1);
-
-  /**
-  plot_kine(Kdp, 0.143, kRed, 1, 2);
-  plot_kine(Kdp, 0.968, kRed, 1, 2);
-  plot_kine(Kdp, 1.410, kRed, 1, 2);
-  plot_kine(Kdp, 1.981, kRed, 1, 2);
-  plot_kine(Kdp, 2.410, kRed, 1, 2);
-  plot_kine(Kdp, 2.907, kRed, 1, 2);
-  plot_kine(Kdp, 3.600, kRed, 1, 2);
-  plot_kine(Kdp, 3.8  , kRed, 1, 2);
-  plot_kine(Kdp, 4.3  , kRed, 1, 2);
-  plot_kine(Kdp, 4.507, kRed, 1, 2);
-  **/
-
-  plot_kine(Kdd, 0.000, kBlack, 2, 9);
-  plot_kine(Kpp, 0.000, kBlack, 2, 9);
-
-  plot_kine(Cadp, 0.000, kRed, 2, 1);
-  plot_kine(Tidp, 0.000, kBlue, 2, 1);
-  plot_kine(Scdp, 0.000, kGreen, 2, 1);
-  plot_kine(K46dp, 0.000, kViolet, 2, 1);
-  //plot_kine(Tidp, 5.652, kBlack, 2, 6); //strongest populated state according to PDBarnes(1965)
+  if(reactionName=="47K(p,p)"){
+    cout << "  Trying to draw lines for " << reactionName << endl;
+    plot_kine(Kdd, 0.000, kBlack, 2, 6);
+    plot_kine(Kpp, 0.000, kBlack, 2, 1);
+  }
+
+  if(reactionName=="47K(d,p)"){
+    cout << "  Trying to draw lines for " << reactionName << endl;
+    plot_kine(Kdp, 0.000, kBlack, 2, 1);
+    plot_kine(Kdp, 4.644, kBlack, 2, 1);
+    plot_kine(Cadp, 0.000, kRed, 2, 1);
+    plot_kine(Tidp, 0.000, kBlue, 2, 1);
+    plot_kine(Scdp, 0.000, kGreen, 2, 1);
+    plot_kine(K46dp, 0.000, kViolet, 2, 1);
+  }
 }
 
 void XYMust2(){
@@ -1747,8 +1756,11 @@ void ExTheta_Analysis(double gamma, double width){
               + " && Ex@.size()==1"
               + " && abs(AddBack_EDC-"
 	      + to_string(gamma) + ")<"
-	      + to_string(width)
-	      ;
+	      + to_string(width);
+  if(reactionName=="47K(d,t)"){
+    gate = gate + " && cutTritons && cutTime";
+  }
+
   string gateLow = gate + " && abs(ThetaLab-117.5)<12.5";
   string gateHigh = gate + " && abs(ThetaLab-142.5)<12.5";
 
@@ -1884,7 +1896,7 @@ void ElasticsGate(double EMin, double EMax){
 	       + ")< " 
 	       + to_string(width);
 
-  chain->Draw("ThetaLab>>hist(160,50,90)", gate.c_str(), "");
+  chain->Draw("ThetaLab>>hist(80,50,90)", gate.c_str(), "");
 }
 
 void GateThetaCM(double minTheta, double maxTheta, double binsize){
@@ -1960,8 +1972,89 @@ void GateThetaLab_AllOverlaid(){
 }
 
 void GateThetaLab_MultiWrite(double startTheta, double finishTheta, int numGates, double binsize){
+  string core = timegate 
+	      + " && " + det_gate;
+  if(reactionName=="47K(d,t)"){
+    core = core + " && cutTritons && cutTime";
+  }
+  core = core + " && Ex@.size()==1 && ThetaLab > ";
+
+  string ytitle = "Counts / " + to_string(binsize) + " MeV";
+  double gatesize = (finishTheta-startTheta)/numGates;
+  TList* list = new TList();
+
+  for (int i=0; i<numGates; i++){
+    cout << GREEN << "Writing gate " << i+1 << "/" << numGates << RESET << endl;
+    double minTheta = startTheta + (i * gatesize);
+    string title = to_string((int) minTheta)+" < ThetaLab < "+to_string((int) (minTheta+gatesize));
+    string gating = core
+        + to_string(minTheta)
+        + " && ThetaLab < "
+        + to_string(minTheta+gatesize);
+    string histname = "cThetaLabGate_" + to_string((int) minTheta) + "-" + to_string((int) (minTheta+gatesize));
+    string draw = "Ex>>" + histname + "(" + to_string(30.0/binsize) + ",-15,15)";
+
+    TCanvas *cEx_ThetaLabGate = new TCanvas(histname.c_str(),histname.c_str(),1000,1000);
+    chain->Draw(draw.c_str(),gating.c_str(),"colz");
+    TH1F* Ex_ThetaLabGate = (TH1F*) gDirectory->Get(histname.c_str());
+    Ex_ThetaLabGate->GetXaxis()->SetTitle("Ex [MeV]");
+    Ex_ThetaLabGate->GetYaxis()->SetTitle(ytitle.c_str());
+    Ex_ThetaLabGate->Sumw2();
+    Ex_ThetaLabGate->SetTitle(title.c_str());
+    list->Add(Ex_ThetaLabGate);
+    delete cEx_ThetaLabGate;
+  }
+
+  TFile* file = new TFile("GateThetaLabHistograms.root","RECREATE");
+  list->Write("GateThetaLabHistograms",TObject::kSingleKey);
+  file->ls();
+}
+
+void GateThetaCM_MultiWrite(double startTheta, double finishTheta, int numGates, double binsize){
+  string core = timegate 
+	      + " && " + det_gate;
+  if(reactionName=="47K(d,t)"){
+    core = core + " && cutTritons && cutTime";
+  }
+  core = core + " && Ex@.size()==1 && ThetaCM > ";
+
+  string ytitle = "Counts / " + to_string(binsize) + " MeV";
+  double gatesize = (finishTheta-startTheta)/numGates;
+  TList* list = new TList();
+
+  for (int i=0; i<numGates; i++){
+    cout << GREEN << "Writing gate " << i+1 << "/" << numGates << RESET << endl;
+    double minTheta = startTheta + (i * gatesize);
+    string title = to_string((int) minTheta)+" < ThetaCM < "+to_string((int) (minTheta+gatesize));
+    string gating = core
+        + to_string(minTheta)
+        + " && ThetaCM < "
+        + to_string(minTheta+gatesize);
+    string histname = "cThetaCMGate_" + to_string((int) minTheta) + "-" + to_string((int) (minTheta+gatesize));
+    string draw = "Ex>>" + histname + "(" + to_string(30.0/binsize) + ",-15,15)";
+
+    TCanvas *cEx_ThetaCMGate = new TCanvas(histname.c_str(),histname.c_str(),1000,1000);
+    chain->Draw(draw.c_str(),gating.c_str(),"colz");
+    TH1F* Ex_ThetaCMGate = (TH1F*) gDirectory->Get(histname.c_str());
+    Ex_ThetaCMGate->GetXaxis()->SetTitle("Ex [MeV]");
+    Ex_ThetaCMGate->GetYaxis()->SetTitle(ytitle.c_str());
+    Ex_ThetaCMGate->Sumw2();
+    Ex_ThetaCMGate->SetTitle(title.c_str());
+    list->Add(Ex_ThetaCMGate);
+    delete cEx_ThetaCMGate;
+  }
+
+  TFile* file = new TFile("GateThetaCMHistograms.root","RECREATE");
+  list->Write("GateThetaCMHistograms",TObject::kSingleKey);
+  file->ls();
+}
+
+
+
+void GateThetaLab_MultiWrite(double startTheta, double finishTheta, int numGates, double binsize, int MGX){
    string core = timegate 
 	      + " && " + det_gate
+	      + " && Mugast.TelescopeNumber==" + to_string(MGX)
               + " && Ex@.size()==1 && ThetaLab > ";
 // string core = "abs(T_MUGAST_VAMOS-2700)<400 && Mugast.TelescopeNumber>0 && Mugast.TelescopeNumber<8 && ThetaLab > ";
   string ytitle = "Counts / " + to_string(binsize) + " MeV";
@@ -1989,8 +2082,8 @@ void GateThetaLab_MultiWrite(double startTheta, double finishTheta, int numGates
     delete cEx_ThetaLabGate;
   }
 
-  TFile* file = new TFile("GateThetaLabHistograms.root","RECREATE");
-  list->Write("GateThetaLabHistograms",TObject::kSingleKey);
+  TFile* file = new TFile("GateThetaLabHistograms_MGX.root","RECREATE");
+  list->Write("GateThetaLabHistograms_MGX",TObject::kSingleKey);
   file->ls();
 }
 
@@ -2031,10 +2124,16 @@ void GateThetaLab_MultiWrite(double startTheta, double finishTheta, int numGates
 }
 
 void CompareThetaLabGatesFromFile(){
-  TFile* oldF = new TFile("GateThetaLabHistograms_11Apr22_20angles.root","READ");
+  //TFile* oldF = new TFile("GateThetaLabHistograms_11Apr22_20angles.root","READ");
+  //TFile* oldF = new TFile("GateThetaLabHistograms_11Jul22.root","READ");
+  //TFile* oldF = new TFile("GateThetaLabHistograms_29Aug22_TrueStripRemoval_0p05.root","READ");
+  TFile* oldF = new TFile("GateThetaLabHistograms_14Oct22_bin0p05.root","READ");
   TList* oldL = (TList*) oldF->FindObjectAny("GateThetaLabHistograms");
   
-  TFile* newF = new TFile("GateThetaLabHistograms_11Jul22.root","READ");
+  //TFile* newF = new TFile("GateThetaLabHistograms_11Jul22.root","READ");
+  //TFile* newF = new TFile("GateThetaLabHistograms_Test2um.root","READ");
+  //TFile* newF = new TFile("GateThetaLabHistograms_30Aug22_2p06um.root","READ");
+  TFile* newF = new TFile("GateThetaLabHistograms_14Oct22_2_bin0p05.root","READ");
   TList* newL = (TList*) newF->FindObjectAny("GateThetaLabHistograms");
 
   double minTheta=105.;
@@ -2066,11 +2165,13 @@ void CompareThetaLabGatesFromFile(){
     //would be faster to set some of these on just the last one but speed not issue here
     cOldNew->cd(1);
     oldH->SetLineColor(30+i);
-    oldH->Rebin(2);
+    //oldH->Rebin(2);
     oldH->GetYaxis()->SetTitle("Counts / 0.100000 MeV");
     oldH->GetXaxis()->SetRangeUser(-1,7);
     oldH->GetYaxis()->SetRangeUser(0,400);
-    oldH->SetTitle("08Nov22: 1.3008 um CD2");
+    //oldH->SetTitle("08Nov22: 1.3008 um CD2");
+    //oldH->SetTitle("11Jul22: 2.8798 um CD2");
+    oldH->SetTitle("14Oct22: 2.8798 um CD2");
     oldH->Draw("HIST SAME");
 
     cOldNew->cd(2);
@@ -2092,7 +2193,9 @@ void CompareThetaLabGatesFromFile(){
     newH->GetXaxis()->SetRangeUser(-1,7);
     newH->GetYaxis()->SetRangeUser(0,400);
     newH->SetLineColor(30+i);
-    newH->SetTitle("11Jul22: 2.8798 um CD2");
+    //newH->SetTitle("11Jul22: 2.8798 um CD2");
+    //newH->SetTitle("AugTest: 2.000 um CD2");
+    newH->SetTitle("14Oct22_2: 2.9992 um CD2");
     newH->Draw("HIST SAME");
 
     cOldNew->cd(5);
@@ -2113,6 +2216,77 @@ void CompareThetaLabGatesFromFile(){
   }
 
 
+}
+
+void CompareTritonsFomFile(){
+  string gate = timegate 
+	      + " && " + det_gate
+              + " && cutTritons && cutTime";
+  string gate2 = gate + " && Ex@.size()==1 && abs(AddBack_EDC-1.94)<0.05";
+
+  /* Push MM1-4 +190mm in Z */
+  vector<string> f190;
+  f190.push_back("../../../Outputs/Analysis/47Kdt_17Aug22_MM+190mm_PartI.root");
+  f190.push_back("../../../Outputs/Analysis/47Kdt_17Aug22_MM+190mm_PartII.root");
+  TChain* c190 = Chain("PhysicsTree",f190,true);
+
+  /* Push MM1-4 +200mm in Z */
+  vector<string> f200;
+  f200.push_back("../../../Outputs/Analysis/47Kdt_17Aug22_MM+200mm_PartI.root");
+  f200.push_back("../../../Outputs/Analysis/47Kdt_17Aug22_MM+200mm_PartII.root");
+  TChain* c200 = Chain("PhysicsTree",f200,true);
+
+  /* Push MM1-4 +210mm in Z */
+  vector<string> f210;
+  f210.push_back("../../../Outputs/Analysis/47Kdt_17Aug22_MM+210mm_PartI.root");
+  f210.push_back("../../../Outputs/Analysis/47Kdt_17Aug22_MM+210mm_PartII.root");
+  TChain* c210 = Chain("PhysicsTree",f210,true);
+
+  auto cTritons = new TCanvas("cTritons","cTritons",1000,1000);
+  
+  c190->Draw("Ex>>t190(200,-2,8)", gate2.c_str(),"");
+  TH1F* t190 = (TH1F*) gDirectory->Get("t190");
+  t190->GetXaxis()->SetTitle("Ex [MeV]");
+  t190->GetYaxis()->SetTitle("Counts / 0.05 MeV");
+  t190->SetLineColor(kRed); 
+
+  c200->Draw("Ex>>t200(200,-2,8)", gate2.c_str(),"");
+  TH1F* t200 = (TH1F*) gDirectory->Get("t200");
+  t200->SetLineColor(kBlue); 
+
+  c210->Draw("Ex>>t210(200,-2,8)", gate2.c_str(),"");
+  TH1F* t210 = (TH1F*) gDirectory->Get("t210");
+  t210->SetLineColor(kGreen);
+
+  t190->Draw();
+  t200->Draw("same");
+  t210->Draw("same");
+
+  auto cTest = new TCanvas("cTest","cTest",1000,1000);
+  cTest->Divide(3);
+
+  cTest->cd(1);
+  c190->Draw("ELab:ThetaLab>>h190(90,0,45,500,0,10)",gate.c_str(),"colz");
+  TH2F* h190 = (TH2F*) gDirectory->Get("h190");
+  plot_kine(Kdt, 0.000, kBlack, 2, 1);
+  plot_kine(Kdt, 1.944, kBlack, 2, 5);
+  plot_kine(Kdt, 3.290, kBlack, 2, 5);
+
+  cTest->cd(2);
+  c200->Draw("ELab:ThetaLab>>h200(90,0,45,500,0,10)",gate.c_str(),"colz");
+  TH2F* h200 = (TH2F*) gDirectory->Get("h200");
+  plot_kine(Kdt, 0.000, kBlack, 2, 1);
+  plot_kine(Kdt, 1.944, kBlack, 2, 5);
+  plot_kine(Kdt, 3.290, kBlack, 2, 5);
+
+  cTest->cd(3);
+  c210->Draw("ELab:ThetaLab>>h210(90,0,45,500,0,10)",gate.c_str(),"colz");
+  TH2F* h210 = (TH2F*) gDirectory->Get("h210");
+  plot_kine(Kdt, 0.000, kBlack, 2, 1);
+  plot_kine(Kdt, 1.944, kBlack, 2, 5);
+  plot_kine(Kdt, 3.290, kBlack, 2, 5);
+
+
 }
 
 void GatePhaseSpaceByThetaLab_MultiWrite(double startTheta, double finishTheta, int numGates, double binsize){
@@ -2283,7 +2457,6 @@ void ggLoad(TTree* chain, TH2F* h){
    }//for i
 }
 
-//void gggLoad(TTree* chain, TH3F* h){
 void gggLoad(TTree* chain, THnSparseF* h){
 
 cout << "THIS IS OLD!!!! UPDATE WITH THE BEAM EXCLUSION!!!" << endl;
@@ -2611,16 +2784,6 @@ void Figure_GateGamma_SeeParticle(double gamma, double width, double bg, double
 
 }
 
-
-
-
-
-
-
-
-
-
-
 void Figure_TopGamma_BottomParticle(double gammaBinWidth, double particleBinWidth){
   string gating = timegate + "&&" + det_gate + " && Ex@.size()==1";
   string gammagate = timegate 
diff --git a/Projects/e793s/macro/Plots_47Kdd.C b/Projects/e793s/macro/Plots_47Kdd.C
new file mode 100644
index 000000000..1e7e13c2e
--- /dev/null
+++ b/Projects/e793s/macro/Plots_47Kdd.C
@@ -0,0 +1,52 @@
+#include "DefineColours.h"
+#include "GausFit.h"
+#include "KnownPeakFitter.h"
+#include "DrawPlots.h"
+#include "ElasticsFitELabGates.h"
+
+//#include "CS2.h"
+//#include "ThreeBodyBreakup.h"
+//#include "ThreeBodyBreakup_FitPhaseSpace.h"
+
+void AddGammaLines(TH1F* hist, double particle, double ymax){
+//  string base = "sub ";
+//
+//  for(int i=1; i<means.size();i++){
+//    string name = base + to_string(means.at(i));
+//    TLine *line = new TLine(particle-means.at(i), 0.0, particle-means.at(i), ymax);
+//    line->SetLineColor(kBlack); line->SetLineStyle(kDotted);
+//    line->Draw();
+//    TText *text = new TText((1.-(means.at(i)/particle))*particle,0.8*ymax,name.c_str());
+//    text->SetTextAngle(90);
+//    //text->SetTextSize(40);
+//    text->Draw();
+//  }
+}
+
+void AddPlacedGammas(TH1F* hist, double ymax){
+//  hist->Draw();
+//  for(int i=0; i<knowngammas.size();i++){
+//    TLine *line = new TLine(knowngammas.at(i), 0.0, knowngammas.at(i), ymax);
+//    line->SetLineColor(kBlack); line->SetLineStyle(kDotted);
+//    line->Draw();
+//  }
+}
+
+
+/* MAIN FUNCTION */
+
+void Plots_47Kdd(){
+
+  LoadChain47Kdd();
+  gStyle->SetOptStat("nemMrRi");
+
+  tCentre = 2750;  tRange = 200;
+  timegate = "abs(T_MUGAST_VAMOS-" + to_string(tCentre) + ")<" + to_string(tRange);
+  det_gate = "MUST2.TelescopeNumber==5";
+  reactionName = "47K(d,d)";
+  
+  cout << "==============================================" << endl;
+  cout << "=============== (d,d) reaction ===============" << endl;
+  cout << "==============================================" << endl;
+
+}
diff --git a/Projects/e793s/macro/Plots_47Kdp.C b/Projects/e793s/macro/Plots_47Kdp.C
index e1d130830..ac9f2d4dc 100644
--- a/Projects/e793s/macro/Plots_47Kdp.C
+++ b/Projects/e793s/macro/Plots_47Kdp.C
@@ -4,8 +4,10 @@
 #include "DrawPlots.h"
 
 #include "CS2.h"
+//#include "CS2_MGX.h"
 #include "ThreeBodyBreakup.h"
 #include "ThreeBodyBreakup_FitPhaseSpace.h"
+#include "20Oct22_CompareYield.h"
 
 
 void AddGammaLines(TH1F* hist, double particle, double ymax){
@@ -32,6 +34,69 @@ void AddPlacedGammas(TH1F* hist, double ymax){
   }
 }
 
+void CompareCountsInThetaLab(){
+  auto canv = new TCanvas("cCompareExpSim","cCompareExpSim",1500,1500);
+  auto file = new TFile("../../../Outputs/Analysis/Sim_47Kdp_10Aug22_TrueStripRemoval.root");  
+  auto tree = (TTree*) file->FindObjectAny("PhysicsTree");
+
+  canv->Divide(2,3);
+  canv->cd(1);
+    chain->Draw("ThetaLab>>exp1(120,100,160)","Mugast.TelescopeNumber==1","");
+    tree->Draw("ThetaLab>>sim1(120,100,160)","Mugast.TelescopeNumber==1","same hist");
+    auto exp1 = (TH1F*) gDirectory->Get("exp1");
+    auto sim1 = (TH1F*) gDirectory->Get("sim1");
+    exp1->SetLineColor(kRed);
+    exp1->GetYaxis()->SetRangeUser(0.,700.);
+    sim1->SetLineColor(kBlue);
+    sim1->Scale(0.05);
+  canv->cd(2);
+    chain->Draw("ThetaLab>>exp2(120,100,160)","Mugast.TelescopeNumber==2","");
+    tree->Draw("ThetaLab>>sim2(120,100,160)","Mugast.TelescopeNumber==2","same hist");
+    auto exp2 = (TH1F*) gDirectory->Get("exp2");
+    auto sim2 = (TH1F*) gDirectory->Get("sim2");
+    exp2->SetLineColor(kRed);
+    exp2->GetYaxis()->SetRangeUser(0.,700.);
+    sim2->SetLineColor(kBlue);
+    sim2->Scale(0.05);
+  canv->cd(3);
+    chain->Draw("ThetaLab>>exp3(120,100,160)","Mugast.TelescopeNumber==3","");
+    tree->Draw("ThetaLab>>sim3(120,100,160)","Mugast.TelescopeNumber==3","same hist");
+    auto exp3 = (TH1F*) gDirectory->Get("exp3");
+    auto sim3 = (TH1F*) gDirectory->Get("sim3");
+    exp3->SetLineColor(kRed);
+    exp3->GetYaxis()->SetRangeUser(0.,700.);
+    sim3->SetLineColor(kBlue);
+    sim3->Scale(0.05);
+  canv->cd(4);
+    chain->Draw("ThetaLab>>exp4(120,100,160)","Mugast.TelescopeNumber==4","");
+    tree->Draw("ThetaLab>>sim4(120,100,160)","Mugast.TelescopeNumber==4","same hist");
+    auto exp4 = (TH1F*) gDirectory->Get("exp4");
+    auto sim4 = (TH1F*) gDirectory->Get("sim4");
+    exp4->SetLineColor(kRed);
+    exp4->GetYaxis()->SetRangeUser(0.,700.);
+    sim4->SetLineColor(kBlue);
+    sim4->Scale(0.05);
+  canv->cd(5);
+    chain->Draw("ThetaLab>>exp5(120,100,160)","Mugast.TelescopeNumber==5","");
+    tree->Draw("ThetaLab>>sim5(120,100,160)","Mugast.TelescopeNumber==5","same hist");
+    auto exp5 = (TH1F*) gDirectory->Get("exp5");
+    auto sim5 = (TH1F*) gDirectory->Get("sim5");
+    exp5->SetLineColor(kRed);
+    exp5->GetYaxis()->SetRangeUser(0.,700.);
+    sim5->SetLineColor(kBlue);
+    sim5->Scale(0.05);
+  canv->cd(6);
+    chain->Draw("ThetaLab>>exp7(120,100,160)","Mugast.TelescopeNumber==7","");
+    tree->Draw("ThetaLab>>sim7(120,100,160)","Mugast.TelescopeNumber==7","same hist");
+    auto exp7 = (TH1F*) gDirectory->Get("exp7");
+    auto sim7 = (TH1F*) gDirectory->Get("sim7");
+    exp7->SetLineColor(kRed);
+    exp7->GetYaxis()->SetRangeUser(0.,700.);
+    sim7->SetLineColor(kBlue);
+    sim7->Scale(0.05);
+
+}
+
 /* MAIN FUNCTION */
 
 void Plots_47Kdp(){
diff --git a/Projects/e793s/macro/Plots_47Kdt.C b/Projects/e793s/macro/Plots_47Kdt.C
index 872ca63e4..289d7de22 100644
--- a/Projects/e793s/macro/Plots_47Kdt.C
+++ b/Projects/e793s/macro/Plots_47Kdt.C
@@ -3,7 +3,7 @@
 #include "KnownPeakFitter.h"
 #include "DrawPlots.h"
 
-//#include "CS2.h"
+#include "CS2_dt.h"
 //#include "ThreeBodyBreakup.h"
 //#include "ThreeBodyBreakup_FitPhaseSpace.h"
 
@@ -69,13 +69,45 @@ void MM_Timing_Comparison(){
 void Plots_47Kdt(){
 
   /* Load graphical cut */
-  TFile gcIn("GraphicalCut_22Jun22.root");
+  //TFile gcIn("GraphicalCut_22Jun22.root");
+  //TCutG* cutTritons = (TCutG*) gcIn.FindObjectAny("cutTritons");
+  
+  //TFile gcIn("cutTritonsWide.root");
+  TFile gcIn("cutTritons_26Aug22Long.root");
+  //TCutG* cutTritons = (TCutG*) gcIn.FindObjectAny("cutTritonsWide");
   TCutG* cutTritons = (TCutG*) gcIn.FindObjectAny("cutTritons");
+  cutTritons->SetName("cutTritons");
+
+  TFile gcIn2("cutTime.root");
+  TCutG* cutTime = (TCutG*) gcIn2.FindObjectAny("cutTime");
+  cutTime->SetName("cutTime");
+
+  TFile gcIn3("cutDoublePeakGarbage.root");
+  TCutG* cutGarbage = (TCutG*) gcIn3.FindObjectAny("cutDoublePeakGarbage");
+  cutGarbage->SetName("cutGarbage");
+
+
+  /**************/
+  TFile gcInA("cutTritons_HighTLowE.root");
+  TCutG* cutHighTLowE = (TCutG*) gcInA.FindObjectAny("cutTritons");
+  cutHighTLowE->SetName("cutHighTLowE");
+
+  TFile gcInB("cutTritons_SlimGate.root");
+  TCutG* cutSlim = (TCutG*) gcInB.FindObjectAny("cutTritons");
+  cutSlim->SetName("cutSlim");
+
+  TFile gcInC("cutTritons_HighELowT.root");
+  TCutG* cutHighELowT = (TCutG*) gcInC.FindObjectAny("cutTritons");
+  cutHighELowT->SetName("cutHighELowT");
+
+
+  /**************/
 
   LoadChain47Kdt();
   gStyle->SetOptStat("nemMrRi");
 
-  tCentre = 2750;  tRange = 350;
+  tCentre = 2750;  tRange = 350; //Wide is fine because I use the 2D time gate
+  //tCentre = 2550;  tRange = 150;
   timegate = "abs(T_MUGAST_VAMOS-" + to_string(tCentre) + ")<" + to_string(tRange);
   det_gate = "MUST2.TelescopeNumber>0 && MUST2.TelescopeNumber<5";
   reactionName = "47K(d,t)";
diff --git a/Projects/e793s/sim.sh b/Projects/e793s/sim.sh
index 674af7ba4..a3f089c2a 100755
--- a/Projects/e793s/sim.sh
+++ b/Projects/e793s/sim.sh
@@ -1,42 +1,64 @@
 #!/bin/bash
 
-rfile='./Reaction/47Kdp_Sim_0143MeV.reaction'
-#rfile='./Reaction/47Kdp_Sim_0968MeV.reaction'
-#rfile='./Reaction/47Kdp_Sim_3605MeV.reaction'
+rm RunToTreat_AutoGenerated.txt
 
-#rfile='./Reaction/47Kdp_Sim_3605MeV_Flat.reaction'
-#rfile='./Reaction/47Kdp_Sim.reaction'
-#rfile='./Reaction/IsotropicProtons.reaction'
-#rfile='./Reaction/47Kdp_Sim_Flat3500MeV.reaction'
+#====================================================
+#rfile='./Reaction/47Kdp_11Jul22_Sim0p000.reaction'
+#rfile='./Reaction/47Kdp_11Jul22_Sim1p981.reaction'
+#rfile='./Reaction/47Kdp_11Jul22_Sim4p045.reaction'
+#rfile='./Reaction/47Kdp_11Jul22_Sim4p393.reaction'
+#------
+#rfile='./Reaction/47Kdd_11Jul22.reaction'
+#rfile='./Reaction/47Kdd_11Jul22_Sim.reaction'
+#------
+#rfile='./Reaction/47Kpp_11Jul22.reaction'
+#----------------------------------------------------
+#rfile='./Reaction/47Kdp_18Oct22.reaction'
+rfile='./Reaction/47Kdt_18Oct22.reaction'
+#====================================================
+#====================================================
+#dfile='Detector/mugast_08Nov.detector'
+#----------------------------------------------------
+#dfile='Detector/mugast_11Jul22.detector'
+#dfile='Detector/mugast_testingMG1dip.detector'
+#----------------------------------------------------
+#dfile='Detector/mugast_01Sep22.detector'
+#----------------------------------------------------
+dfile='Detector/mugast_18Oct22.detector'
+#dfile='Detector/mugast_18Oct22_Tx2.detector'
+#dfile='Detector/mugast_18Oct22_Tx0p5.detector'
+#====================================================
 
 cd ~/Programs/nptool/Projects/e793s;
 cmake ./;
 make -j6;
 
-directory=' /home/charlottepaxman/Programs/nptool/Outputs/Simulation/'
+directory='/home/charlottepaxman/Programs/nptool/Outputs/Simulation/'
 dotroot='.root'
 dash='-'
 
-for x in 1 2 3 4 5
+for x in 1 #2 3 4 5 6 7 8 9 10
 do
         outname=$1$dash$x
-	npsimulation -D ./Detector/mugast_08Nov.detector -E $rfile -B ./runsimulation.mac -O $outname;
-
+	#npsimulation -D $dfile -E $rfile -B ./runsimulation.mac -O $outname;
+	npsimulation -D $dfile -E $rfile -B ./runsimulation_small.mac -O $outname;
 	filename=$directory$1$dash$x$dotroot
-
 done
 
+space=" "
 sim='Sim_'
 outfile=$sim$1
 
-echo "TTreeName" > RunToTreat_AutoGenerated.txt
+echo "TTreeName" >> RunToTreat_AutoGenerated.txt
 echo " SimulatedTree" >> RunToTreat_AutoGenerated.txt
 echo "RootFileName" >> RunToTreat_AutoGenerated.txt
 
-for x in 1 2 3 4 5
+for x in 1 #2 3 4 5 6 7 8 9 10
 do
-	filename=$directory$1$dash$x$dotroot
-	echo $filename >> RunToTreat_AutoGenerated.txt
+	echo "$space""$directory""$1""$dash""$x""$dotroot" >> RunToTreat_AutoGenerated.txt
 done
 
-npanalysis --definition Sim -R RunToTreat_AutoGenerated.txt -E $rfile -D Detector/mugast_08Nov.detector -O $outfile;
+npanalysis --definition Sim -R RunToTreat_AutoGenerated.txt -E $rfile -D $dfile -O $outfile;
+#npanalysis --definition Sim --definition ExcludeThePoor -R RunToTreat_AutoGenerated.txt -E $rfile -D $dfile -O $outfile;
+
+
-- 
GitLab