diff --git a/NPLib/Core/NPInputParser.cxx b/NPLib/Core/NPInputParser.cxx
index 9680ce502e2a091692278f26df6e8e892d3148df..87f6f348ec3f1f17c2c879dd1338876969d3a3fa 100644
--- a/NPLib/Core/NPInputParser.cxx
+++ b/NPLib/Core/NPInputParser.cxx
@@ -1,346 +1,348 @@
-#include"NPInputParser.h"
-#include"NPSystemOfUnits.h"
-#include"NPOptionManager.h"
-#include"NPCore.h"
-#include<sstream>
-#include<iostream>
-#include<fstream>
-#include<algorithm>
+#include "NPInputParser.h"
+#include "NPCore.h"
+#include "NPOptionManager.h"
+#include "NPSystemOfUnits.h"
+#include <algorithm>
+#include <fstream>
+#include <iostream>
+#include <sstream>
 
 ////////////////////////////////////////////////////////////////////////////////
-NPL::InputBlock* NPL::InputBlock::Copy(){
+NPL::InputBlock* NPL::InputBlock::Copy() {
   NPL::InputBlock* res = new NPL::InputBlock();
   res->m_Level = this->m_Level;
   res->m_MainToken = this->m_MainToken;
   res->m_MainValue = this->m_MainValue;
   res->m_Token = this->m_Token;
-  res->m_Value = this->m_Value; 
+  res->m_Value = this->m_Value;
   return res;
 }
 
-
 ////////////////////////////////////////////////////////////////////////////////
-std::string NPL::StripSpaces(std::string line){
+std::string NPL::StripSpaces(std::string line) {
   // Remove preceding spaces
-  while(*line.begin()==' ')
-    line = line.substr(1,line.length());
+  while (*line.begin() == ' ')
+    line = line.substr(1, line.length());
 
   // Remove trailing spaces
-  if(line.length()>0)
-    while(*line.rbegin()==' ')
-      line = line.substr(0,line.length()-1);
+  if (line.length() > 0)
+    while (*line.rbegin() == ' ')
+      line = line.substr(0, line.length() - 1);
 
   // Remove preceding tabs
-  while(*line.begin()=='\t')
-    line = line.substr(1,line.length());
+  while (*line.begin() == '\t')
+    line = line.substr(1, line.length());
 
   // Remove trailing tabs
-  if(line.length()>0)
-    while(*line.rbegin()=='\t')
-      line = line.substr(0,line.length()-1);
+  if (line.length() > 0)
+    while (*line.rbegin() == '\t')
+      line = line.substr(0, line.length() - 1);
 
   return line;
-
 }
 ////////////////////////////////////////////////////////////////////////////////
-unsigned int NPL::GetLevel(std::string line){
-  unsigned int level = 0 ;
-  if(line.length()==0)
+unsigned int NPL::GetLevel(std::string line) {
+  unsigned int level = 0;
+  if (line.length() == 0)
     return 1000;
 
-  for(unsigned int i = 0 ; i < line.length() ; i++){
-    if(line.compare(i,1," ")==0)
+  for (unsigned int i = 0; i < line.length(); i++) {
+    if (line.compare(i, 1, " ") == 0)
       level++;
-    else 
+    else
       break;
   }
 
-  return level; 
+  return level;
 }
 
 ////////////////////////////////////////////////////////////////////////////////
-std::string NPL::ToLower(std::string line){
+std::string NPL::ToLower(std::string line) {
   std::transform(line.begin(), line.end(), line.begin(), ::tolower);
   return line;
 }
 
 ////////////////////////////////////////////////////////////////////////////////
-NPL::InputBlock::InputBlock(std::string line){
-  m_Level     = GetLevel(line);
-  m_MainToken = StripSpaces(ExtractToken(line," "));     
-  m_MainValue = StripSpaces(ExtractValue(line," "));
+NPL::InputBlock::InputBlock(std::string line) {
+  m_Level = GetLevel(line);
+  m_MainToken = StripSpaces(ExtractToken(line, " "));
+  m_MainValue = StripSpaces(ExtractValue(line, " "));
 }
 
 ////////////////////////////////////////////////////////////////////////////////
-std::string NPL::InputBlock::ExtractToken(std::string line,std::string separator){
+std::string NPL::InputBlock::ExtractToken(std::string line, std::string separator) {
   // Find the separator
-  if(separator=="")
+  if (separator == "")
     separator = NPL::token_separator;
   std::size_t pos = line.find(separator.c_str());
-  return line.substr (0,pos);
+  return line.substr(0, pos);
 }
 
 ////////////////////////////////////////////////////////////////////////////////
-std::string NPL::InputBlock::ExtractValue(std::string line,std::string separator){
+std::string NPL::InputBlock::ExtractValue(std::string line, std::string separator) {
   // Find the separator
-  if(separator=="")
+  if (separator == "")
     separator = NPL::token_separator;
   std::size_t pos = line.find(separator.c_str());
-  if(pos!=std::string::npos)
-    return line.substr (pos+1);
+  if (pos != std::string::npos)
+    return line.substr(pos + 1);
   else
     return "";
 }
 
 ////////////////////////////////////////////////////////////////////////////////
-void NPL::InputBlock::AddLine(std::string line){
+void NPL::InputBlock::AddLine(std::string line) {
   m_Token.push_back(ToLower(StripSpaces(ExtractToken(line))));
   m_Value.push_back(StripSpaces(ExtractValue(line)));
-  m_Lines.push_back(StripSpaces(line)); 
+  m_Lines.push_back(StripSpaces(line));
 }
 ////////////////////////////////////////////////////////////////////////////////
-void NPL::InputBlock::Dump(){
+void NPL::InputBlock::Dump() {
   std::cout << "//////////// Block ////////////" << std::endl;
-  std::cout << " * Main Token: " << m_MainToken << std::endl ;
-  std::cout << " * Main Value: "  << m_MainValue << std::endl;
+  std::cout << " * Main Token: " << m_MainToken << std::endl;
+  std::cout << " * Main Value: " << m_MainValue << std::endl;
   std::cout << " * Number of Line: " << GetSize() << std::endl;
-  for(unsigned int i = 0 ; i < GetSize() ; i++)
-    std::cout << "  - " << i+1 << " " << m_Token[i] << ": " << m_Value[i] << std::endl; 
+  for (unsigned int i = 0; i < GetSize(); i++)
+    std::cout << "  - " << i + 1 << " " << m_Token[i] << ": " << m_Value[i] << std::endl;
 }
 ////////////////////////////////////////////////////////////////////////////////
-bool NPL::InputBlock::HasTokenList(std::vector<std::string> Token){
-  if(m_Token.size()==0)
+bool NPL::InputBlock::HasTokenList(std::vector<std::string> Token) {
+  if (m_Token.size() == 0)
     return false;
 
   bool res = true;
-  for(unsigned int i = 0 ; i < Token.size() ; i++)
+  for (unsigned int i = 0; i < Token.size(); i++)
     res = res && HasToken(Token[i]);
 
   return res;
 }
 
 ////////////////////////////////////////////////////////////////////////////////
-bool NPL::InputBlock::HasToken(std::string Token){
-  for(unsigned int i = 0 ; i < m_Token.size() ; i++){
-    if(m_Token[i] == ToLower(Token)){
+std::vector<std::string> NPL::InputBlock::GetMissingToken(std::vector<std::string> Token) {
+  std::vector<std::string> missing;
+  for (unsigned int i = 0; i < Token.size(); i++) {
+    if (!HasToken(Token[i]))
+      missing.push_back(Token[i]);
+  }
+  return missing;
+}
+
+////////////////////////////////////////////////////////////////////////////////
+bool NPL::InputBlock::HasToken(std::string Token) {
+  for (unsigned int i = 0; i < m_Token.size(); i++) {
+    if (m_Token[i] == ToLower(Token)) {
       return true;
     }
   }
   return false;
 }
 ////////////////////////////////////////////////////////////////////////////////
-std::string NPL::InputBlock::GetValue(std::string Token){
-  for(unsigned int i = 0 ; i < m_Token.size() ; i++){
-    if(m_Token[i]==ToLower(Token))
+std::string NPL::InputBlock::GetValue(std::string Token) {
+  for (unsigned int i = 0; i < m_Token.size(); i++) {
+    if (m_Token[i] == ToLower(Token))
       return m_Value[i];
   }
   return "";
-
 }
 ////////////////////////////////////////////////////////////////////////////////
-double NPL::InputBlock::GetDouble(std::string Token,std::string default_unit){
-  int verbose = 1; //NPOptionManager::getInstance()->GetVerboseLevel();
+double NPL::InputBlock::GetDouble(std::string Token, std::string default_unit) {
+  int verbose = 1; // NPOptionManager::getInstance()->GetVerboseLevel();
   std::stringstream iss(GetValue(Token));
   double val;
   std::string unit;
-  iss >> val >> unit ;
-  if(unit==""){
-    if(default_unit!="void")
-      std::cout <<"WARNING: Using default units for token " << Token << std::endl;
-    val = ApplyUnit(val,default_unit); 
+  iss >> val >> unit;
+  if (unit == "") {
+    if (default_unit != "void")
+      std::cout << "WARNING: Using default units for token " << Token << std::endl;
+    val = ApplyUnit(val, default_unit);
   }
-  else{
-    val = ApplyUnit(val,unit);
+  else {
+    val = ApplyUnit(val, unit);
   }
 
-  if(verbose)
-    printf(" %s (%s): %.4f\n",Token.c_str(),default_unit.c_str(), val/ApplyUnit(1,default_unit));
-//    std::cout << " " << Token << " (" <<default_unit << "): " << val/ApplyUnit(1,default_unit) <<std::endl; 
+  if (verbose)
+    printf(" %s (%s): %.4f\n", Token.c_str(), default_unit.c_str(), val / ApplyUnit(1, default_unit));
+  //    std::cout << " " << Token << " (" <<default_unit << "): " << val/ApplyUnit(1,default_unit) <<std::endl;
 
-  return val;        
+  return val;
 }
 ////////////////////////////////////////////////////////////////////////////////
-int NPL::InputBlock::GetInt(std::string Token){
-  int verbose = 1;//NPOptionManager::getInstance()->GetVerboseLevel();
+int NPL::InputBlock::GetInt(std::string Token) {
+  int verbose = 1; // NPOptionManager::getInstance()->GetVerboseLevel();
   std::stringstream iss(GetValue(Token));
   int val;
-  iss >> val ;
-
-  if(verbose)
-    printf(" %s: %d\n",Token.c_str(),val);
-   // std::cout << " " << Token << ": " << val <<std::endl;
+  iss >> val;
 
+  if (verbose)
+    printf(" %s: %d\n", Token.c_str(), val);
+  // std::cout << " " << Token << ": " << val <<std::endl;
 
-  return val;        
+  return val;
 }
 ////////////////////////////////////////////////////////////////////////////////
-std::string NPL::InputBlock::GetString(std::string Token){
-  int verbose = 1;//NPOptionManager::getInstance()->GetVerboseLevel();
-  if(verbose)
-    printf(" %s: %s\n",Token.c_str(),GetValue(Token).c_str());
-//    std::cout << " " << Token << ": " << GetValue(Token) << std::endl; 
+std::string NPL::InputBlock::GetString(std::string Token) {
+  int verbose = 1; // NPOptionManager::getInstance()->GetVerboseLevel();
+  if (verbose)
+    printf(" %s: %s\n", Token.c_str(), GetValue(Token).c_str());
+  //    std::cout << " " << Token << ": " << GetValue(Token) << std::endl;
 
   return GetValue(Token);
 }
 ////////////////////////////////////////////////////////////////////////////////
-TVector3 NPL::InputBlock::GetTVector3(std::string Token,std::string  default_unit){
-  int verbose = 1; //NPOptionManager::getInstance()->GetVerboseLevel();
+TVector3 NPL::InputBlock::GetTVector3(std::string Token, std::string default_unit) {
+  int verbose = 1; // NPOptionManager::getInstance()->GetVerboseLevel();
   std::stringstream iss(GetValue(Token));
 
-  double x,y,z;
+  double x, y, z;
   std::string unit;
-  iss >> x >> y >> z >> unit ;
-  if(unit==""){
-    if(default_unit!="void")
-      std::cout <<"WARNING: Using default units for token " << Token << std::endl;
-    x = ApplyUnit(x,default_unit); 
-    y = ApplyUnit(y,default_unit); 
-    z = ApplyUnit(z,default_unit); 
-  }
-  else{
-    x = ApplyUnit(x,unit);
-    y = ApplyUnit(y,unit);
-    z = ApplyUnit(z,unit);
-  }
-
-  if(verbose)
-
-    printf(" %s (%s): (%.4f;%.4f;%.4f)\n",Token.c_str(),default_unit.c_str(), x/ApplyUnit(1,default_unit),y/ApplyUnit(1,default_unit),z/ApplyUnit(1,default_unit));
-//    std::cout << " " << Token << " (" <<default_unit << "): (" 
-//      << x/ApplyUnit(1,default_unit) << " ; " 
-//      << y/ApplyUnit(1,default_unit) << " ; " 
-//      << z/ApplyUnit(1,default_unit) << ")" << std::endl; 
-
-
-  return TVector3(x,y,z);        
+  iss >> x >> y >> z >> unit;
+  if (unit == "") {
+    if (default_unit != "void")
+      std::cout << "WARNING: Using default units for token " << Token << std::endl;
+    x = ApplyUnit(x, default_unit);
+    y = ApplyUnit(y, default_unit);
+    z = ApplyUnit(z, default_unit);
+  }
+  else {
+    x = ApplyUnit(x, unit);
+    y = ApplyUnit(y, unit);
+    z = ApplyUnit(z, unit);
+  }
+
+  if (verbose)
+
+    printf(" %s (%s): (%.4f;%.4f;%.4f)\n", Token.c_str(), default_unit.c_str(), x / ApplyUnit(1, default_unit),
+           y / ApplyUnit(1, default_unit), z / ApplyUnit(1, default_unit));
+  //    std::cout << " " << Token << " (" <<default_unit << "): ("
+  //      << x/ApplyUnit(1,default_unit) << " ; "
+  //      << y/ApplyUnit(1,default_unit) << " ; "
+  //      << z/ApplyUnit(1,default_unit) << ")" << std::endl;
+
+  return TVector3(x, y, z);
 }
 ////////////////////////////////////////////////////////////////////////////////
-std::vector<std::string> NPL::InputBlock::GetVectorString(std::string Token){
-  int verbose = 1 ; //NPOptionManager::getInstance()->GetVerboseLevel();
+std::vector<std::string> NPL::InputBlock::GetVectorString(std::string Token) {
+  int verbose = 1; // NPOptionManager::getInstance()->GetVerboseLevel();
 
   std::stringstream iss(GetValue(Token));
 
   std::vector<std::string> val;
   std::string buffer;
-  while(iss>>buffer)
+  while (iss >> buffer)
     val.push_back(buffer);
 
+  if (verbose) {
+    printf(" %s: ", Token.c_str());
+    // std::cout << " " << Token << ": ";
+    for (unsigned int i = 0; i < val.size(); i++)
+      printf("%s ", val[i].c_str());
+    // std::cout << val[i] << " " ;
 
-  if(verbose){
-    printf(" %s: ",Token.c_str());
-    //std::cout << " " << Token << ": ";
-    for(unsigned int i = 0 ; i < val.size() ; i++)
-      printf("%s ",val[i].c_str());
-      //std::cout << val[i] << " " ;
-    
     printf("\n");
-    //std::cout << std::endl; 
-    
+    // std::cout << std::endl;
   }
-  return val;        
+  return val;
 }
 
 ////////////////////////////////////////////////////////////////////////////////
-std::vector<double> NPL::InputBlock::GetVectorDouble(std::string Token,std::string  default_unit){
-  int verbose = 1 ; // NPOptionManager::getInstance()->GetVerboseLevel();
+std::vector<double> NPL::InputBlock::GetVectorDouble(std::string Token, std::string default_unit) {
+  int verbose = 1; // NPOptionManager::getInstance()->GetVerboseLevel();
 
   std::stringstream iss(GetValue(Token));
 
   std::vector<double> val;
   double buffer;
-  while(iss>>buffer)
+  while (iss >> buffer)
     val.push_back(buffer);
 
-  // Try to read the unit  
+  // Try to read the unit
   iss.clear();
   std::string unit;
-  iss>>unit;
+  iss >> unit;
 
-  if(unit==""){
-    if(default_unit!="void")
-      std::cout <<"WARNING: Using default units for token " << Token << std::endl;
-    for(unsigned int i = 0 ; i < val.size() ; i++)
-      val[i]=ApplyUnit(val[i],default_unit);
+  if (unit == "") {
+    if (default_unit != "void")
+      std::cout << "WARNING: Using default units for token " << Token << std::endl;
+    for (unsigned int i = 0; i < val.size(); i++)
+      val[i] = ApplyUnit(val[i], default_unit);
   }
-  else{
-    for(unsigned int i = 0 ; i < val.size() ; i++)
-      val[i]=ApplyUnit(val[i],unit);
+  else {
+    for (unsigned int i = 0; i < val.size(); i++)
+      val[i] = ApplyUnit(val[i], unit);
   }
 
-  if(verbose){
-    printf(" %s (%s): ",Token.c_str(),default_unit.c_str());
-    //std::cout << " " << Token << " (" << default_unit << "): ";
-    for(unsigned int i = 0 ; i < val.size() ; i++)
-      printf("%f ",val[i]/ApplyUnit(1,default_unit) );
-      //std::cout << val[i]/ApplyUnit(1,default_unit) << " " ;
+  if (verbose) {
+    printf(" %s (%s): ", Token.c_str(), default_unit.c_str());
+    // std::cout << " " << Token << " (" << default_unit << "): ";
+    for (unsigned int i = 0; i < val.size(); i++)
+      printf("%f ", val[i] / ApplyUnit(1, default_unit));
+    // std::cout << val[i]/ApplyUnit(1,default_unit) << " " ;
     printf("\n");
-    //std::cout << std::endl; 
+    // std::cout << std::endl;
   }
 
-  return val;        
+  return val;
 }
 
 ////////////////////////////////////////////////////////////////////////////////
-std::vector<int> NPL::InputBlock::GetVectorInt(std::string Token){
-  int verbose = 1;// NPOptionManager::getInstance()->GetVerboseLevel();
+std::vector<int> NPL::InputBlock::GetVectorInt(std::string Token) {
+  int verbose = 1; // NPOptionManager::getInstance()->GetVerboseLevel();
 
   std::stringstream iss(GetValue(Token));
   std::vector<int> val;
   int buffer;
-  while(iss>>buffer)
+  while (iss >> buffer)
     val.push_back(buffer);
 
-  if(verbose){
-    printf(" %s: ",Token.c_str());
-    //std::cout << " " << Token << ": ";
-    for(unsigned int i = 0 ; i < val.size() ; i++)
-        printf(" %d: ",val[i]);
+  if (verbose) {
+    printf(" %s: ", Token.c_str());
+    // std::cout << " " << Token << ": ";
+    for (unsigned int i = 0; i < val.size(); i++)
+      printf(" %d: ", val[i]);
     //  std::cout << val[i] << " " ;
-    std::cout << std::endl; 
+    std::cout << std::endl;
   }
 
-
-  return val;        
+  return val;
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////////////////
-void NPL::InputParser::Dump(){
-  for(unsigned int i = 0 ; i < m_Block.size() ; i++)
+void NPL::InputParser::Dump() {
+  for (unsigned int i = 0; i < m_Block.size(); i++)
     m_Block[i]->Dump();
 }
 ////////////////////////////////////////////////////////////////////////////////
-bool NPL::InputParser::IsNotComment(std::string line){
+bool NPL::InputParser::IsNotComment(std::string line) {
   line = StripSpaces(line);
-  if(line.length()==0)
+  if (line.length() == 0)
     return false;
 
   std::size_t pos = line.find("%");
-  if(pos==std::string::npos)
+  if (pos == std::string::npos)
     return true;
   else
     return false;
 }
 
 ////////////////////////////////////////////////////////////////////////////////
-std::vector<NPL::InputBlock*> NPL::InputParser::GetAllBlocksWithToken(std::string Token){
+std::vector<NPL::InputBlock*> NPL::InputParser::GetAllBlocksWithToken(std::string Token) {
   std::vector<NPL::InputBlock*> res;
-  for(unsigned int i = 0 ; i < m_Block.size(); i++){
-    if(m_Block[i]->GetMainToken() == Token){
+  for (unsigned int i = 0; i < m_Block.size(); i++) {
+    if (m_Block[i]->GetMainToken() == Token) {
       res.push_back(m_Block[i]);
     }
   }
 
   return res;
-
 }
 ////////////////////////////////////////////////////////////////////////////////
-std::vector<NPL::InputBlock*> NPL::InputParser::GetAllBlocksWithTokenAndValue(std::string Token,std::string Value){
+std::vector<NPL::InputBlock*> NPL::InputParser::GetAllBlocksWithTokenAndValue(std::string Token, std::string Value) {
   std::vector<NPL::InputBlock*> res;
-  for(unsigned int i = 0 ; i < m_Block.size(); i++){
-    if(m_Block[i]->GetMainToken() == Token){
-      if(m_Block[i]->GetMainValue() == Value)
+  for (unsigned int i = 0; i < m_Block.size(); i++) {
+    if (m_Block[i]->GetMainToken() == Token) {
+      if (m_Block[i]->GetMainValue() == Value)
         res.push_back(m_Block[i]);
     }
   }
@@ -349,20 +351,20 @@ std::vector<NPL::InputBlock*> NPL::InputParser::GetAllBlocksWithTokenAndValue(st
 }
 
 ////////////////////////////////////////////////////////////////////////////////
-std::vector<std::string> NPL::InputParser::GetAllBlocksToken(){
+std::vector<std::string> NPL::InputParser::GetAllBlocksToken() {
   std::vector<std::string> token;
-  for(unsigned int i = 0 ; i < m_Block.size() ; i++){
+  for (unsigned int i = 0; i < m_Block.size(); i++) {
     token.push_back(m_Block[i]->GetMainToken());
   }
 
   return token;
 }
 ////////////////////////////////////////////////////////////////////////////////
-std::vector<std::string> NPL::InputParser::GetAllBlocksValues(std::string token){
+std::vector<std::string> NPL::InputParser::GetAllBlocksValues(std::string token) {
   std::vector<std::string> value;
   std::vector<NPL::InputBlock*> blocks = GetAllBlocksWithToken(token);
   unsigned int size = blocks.size();
-  for(unsigned int i = 0 ; i < size ; i++){
+  for (unsigned int i = 0; i < size; i++) {
     value.push_back(blocks[i]->GetMainValue());
   }
 
@@ -370,74 +372,73 @@ std::vector<std::string> NPL::InputParser::GetAllBlocksValues(std::string token)
 }
 
 ////////////////////////////////////////////////////////////////////////////////
-void NPL::InputParser::TreatAliases(){
+void NPL::InputParser::TreatAliases() {
 
   // Call the alias block
   std::vector<NPL::InputBlock*> alias = GetAllBlocksWithToken("Alias");
-  // List of token:                      
+  // List of token:
 
-  // - Action 
+  // - Action
   //    -> Split : create new block for each value
   //    -> Inplace : Replace the value in existing alias
   // - Value -> The list of value to be used
-  std::vector<std::string> token = {"Action","Value"};
-  for(unsigned int i = 0 ; i < alias.size() ; i++){
-    if(!alias[i]->HasTokenList(token)){
+  std::vector<std::string> token = {"Action", "Value"};
+  for (unsigned int i = 0; i < alias.size(); i++) {
+    if (!alias[i]->HasTokenList(token)) {
       NPL::SendErrorAndExit("NPL::InputParser", "Alias block syntax incorrect");
     }
-    
-    int verbose = 1; //NPOptionManager::getInstance()->GetVerboseLevel();
 
-    if(verbose)
+    int verbose = 1; // NPOptionManager::getInstance()->GetVerboseLevel();
+
+    if (verbose)
       std::cout << "Using Alias : @" << alias[i]->GetMainValue() << std::endl;
-    
-    std::string name="@";
-    name += alias[i]->GetMainValue(); 
+
+    std::string name = "@";
+    name += alias[i]->GetMainValue();
     std::string action = alias[i]->GetString("Action");
-    std::vector<std::string> value  = alias[i]->GetVectorString("Value"); 
-    if(action=="Replace" && value.size()!=1)
-      NPL::SendErrorAndExit("NPL::InputParser", "Inplace alias can only take one value"); 
+    std::vector<std::string> value = alias[i]->GetVectorString("Value");
+    if (action == "Replace" && value.size() != 1)
+      NPL::SendErrorAndExit("NPL::InputParser", "Inplace alias can only take one value");
 
     // Scan all blocks for aliases
-    for(unsigned int b = 0 ; b < m_Block.size() ; b++){
+    for (unsigned int b = 0; b < m_Block.size(); b++) {
       unsigned int size = m_Block[b]->GetSize();
-      size_t pos;  
+      size_t pos;
       // In place case loop over each value and replace them
-      if(action=="Replace"){
-        for(unsigned int v = 0 ; v < size ; v++){
-          while((pos=m_Block[b]->GetValue(v).find(name))!=std::string::npos){
+      if (action == "Replace") {
+        for (unsigned int v = 0; v < size; v++) {
+          while ((pos = m_Block[b]->GetValue(v).find(name)) != std::string::npos) {
             std::string val = m_Block[b]->GetValue(v);
-            val.replace(pos,name.length(),value[0]);
-            m_Block[b]->SetValue(v,val);
+            val.replace(pos, name.length(), value[0]);
+            m_Block[b]->SetValue(v, val);
           }
         }
       }
 
-      else if (action=="Copy"){
+      else if (action == "Copy") {
         bool check = false;
         // first pass identify if the block use an alias
-        for(unsigned int v = 0 ; v < size ; v++){
-          if(m_Block[b]->GetValue(v).find(name)!=std::string::npos)
-            check = true; 
+        for (unsigned int v = 0; v < size; v++) {
+          if (m_Block[b]->GetValue(v).find(name) != std::string::npos)
+            check = true;
         }
-        if(check){ 
+        if (check) {
           NPL::InputBlock* originalBlock = m_Block[b]->Copy();
-          for(unsigned int a = 0 ; a < value.size() ; a++){
+          for (unsigned int a = 0; a < value.size(); a++) {
             NPL::InputBlock* newBlock = originalBlock->Copy();
-            for(unsigned int v = 0 ; v < size ; v++){
-              while((pos=newBlock->GetValue(v).find(name))!=std::string::npos){
+            for (unsigned int v = 0; v < size; v++) {
+              while ((pos = newBlock->GetValue(v).find(name)) != std::string::npos) {
                 std::string val = newBlock->GetValue(v);
-                val.replace(pos,name.length(),value[a]);
-                newBlock->SetValue(v,val);
+                val.replace(pos, name.length(), value[a]);
+                newBlock->SetValue(v, val);
               }
-
             }
-            if(a==0){
+            if (a == 0) {
               m_Block[b] = newBlock;
             }
-            else{
+            else {
               std::vector<NPL::InputBlock*>::iterator it = m_Block.begin();
-              m_Block.insert(it+b+a,newBlock);
+              m_Block.insert(it + b + a, newBlock);
             }
           }
         }
@@ -446,16 +447,16 @@ void NPL::InputParser::TreatAliases(){
   }
 }
 ////////////////////////////////////////////////////////////////////////////////
-void NPL::InputParser::ReadFile(std::string filename,bool ExitOnError){
+void NPL::InputParser::ReadFile(std::string filename, bool ExitOnError) {
   Clear();
   std::ifstream file(filename.c_str());
-  if(!file.is_open()){
+  if (!file.is_open()) {
     std::ostringstream message;
     message << "file " << filename << " not found " << std::endl;
 
-    if(ExitOnError)
+    if (ExitOnError)
       NPL::SendErrorAndExit("NPL::InputParser", message.str());
-    else{
+    else {
       NPL::SendWarning("NPL::InputParser", message.str());
       return;
     }
@@ -463,28 +464,28 @@ void NPL::InputParser::ReadFile(std::string filename,bool ExitOnError){
 
   std::string line;
   NPL::InputBlock* block = 0;
-  while(!file.eof()){
-    getline(file,line);
-    if(IsNotComment(line) && GetLevel(line)==0) {
-      if(block)
+  while (!file.eof()) {
+    getline(file, line);
+    if (IsNotComment(line) && GetLevel(line) == 0) {
+      if (block)
         m_Block.push_back(block);
 
       block = new NPL::InputBlock(line);
-      if(!file.eof())
-        getline(file,line);
+      if (!file.eof())
+        getline(file, line);
     }
-    if(block && IsNotComment(line)){
+    if (block && IsNotComment(line)) {
       block->AddLine(line);
     }
   }
   // Add the last block
-  if(block)
+  if (block)
     m_Block.push_back(block);
   TreatAliases();
 }
 ////////////////////////////////////////////////////////////////////////////////
-void NPL::InputParser::Clear(){
-  for(unsigned int i = 0 ; m_Block.size() ; i++)
+void NPL::InputParser::Clear() {
+  for (unsigned int i = 0; m_Block.size(); i++)
     delete m_Block[i];
 
   m_Block.clear();
@@ -492,479 +493,479 @@ void NPL::InputParser::Clear(){
 }
 
 ////////////////////////////////////////////////////////////////////////////////
-double NPL::ApplyUnit(double value, std::string unit){
-  if(unit=="void") // apply no unit
+double NPL::ApplyUnit(double value, std::string unit) {
+  if (unit == "void") // apply no unit
     return value;
 
-  else if(unit=="g/cm3"){
-  return value*NPUNITS::g/NPUNITS::cm3; 
+  else if (unit == "g/cm3") {
+    return value * NPUNITS::g / NPUNITS::cm3;
   }
 
-  else if(unit=="kg/cm3"){
-  return value*NPUNITS::kg/NPUNITS::cm3;  
+  else if (unit == "kg/cm3") {
+    return value * NPUNITS::kg / NPUNITS::cm3;
   }
-  
-  else if(unit=="millimeter"){
-    return value*NPUNITS::millimeter;
+
+  else if (unit == "millimeter") {
+    return value * NPUNITS::millimeter;
   }
 
-  else if(unit=="millimeter2"){
-    return value*NPUNITS::millimeter2;
+  else if (unit == "millimeter2") {
+    return value * NPUNITS::millimeter2;
   }
 
-  else if(unit=="millimeter3"){
-    return value*NPUNITS::millimeter3;
+  else if (unit == "millimeter3") {
+    return value * NPUNITS::millimeter3;
   }
 
-  else if(unit=="centimeter"){
-    return value*NPUNITS::centimeter;
+  else if (unit == "centimeter") {
+    return value * NPUNITS::centimeter;
   }
 
-  else if(unit=="centimeter2"){
-    return value*NPUNITS::centimeter2;
+  else if (unit == "centimeter2") {
+    return value * NPUNITS::centimeter2;
   }
 
-  else if(unit=="centimeter3"){
-    return value*NPUNITS::centimeter3;
+  else if (unit == "centimeter3") {
+    return value * NPUNITS::centimeter3;
   }
 
-  else if(unit=="meter"){
-    return value*NPUNITS::meter;
+  else if (unit == "meter") {
+    return value * NPUNITS::meter;
   }
 
-  else if(unit=="meter2"){
-    return value*NPUNITS::meter2;
+  else if (unit == "meter2") {
+    return value * NPUNITS::meter2;
   }
 
-  else if(unit=="meter3"){
-    return value*NPUNITS::meter3;
+  else if (unit == "meter3") {
+    return value * NPUNITS::meter3;
   }
 
-  else if(unit=="kilometer"){
-    return value*NPUNITS::kilometer;
+  else if (unit == "kilometer") {
+    return value * NPUNITS::kilometer;
   }
 
-  else if(unit=="kilometer2"){
-    return value*NPUNITS::kilometer2;
+  else if (unit == "kilometer2") {
+    return value * NPUNITS::kilometer2;
   }
 
-  else if(unit=="kilometer3"){
-    return value*NPUNITS::kilometer3;
+  else if (unit == "kilometer3") {
+    return value * NPUNITS::kilometer3;
   }
 
-  else if(unit=="parsec"){
-    return value*NPUNITS::parsec;
+  else if (unit == "parsec") {
+    return value * NPUNITS::parsec;
   }
 
-  else if(unit=="micrometer"){
-    return value*NPUNITS::micrometer;
+  else if (unit == "micrometer") {
+    return value * NPUNITS::micrometer;
   }
 
-  else if(unit=="nanometer"){
-    return value*NPUNITS::nanometer;
+  else if (unit == "nanometer") {
+    return value * NPUNITS::nanometer;
   }
 
-  else if(unit=="angstrom"){
-    return value*NPUNITS::angstrom;
+  else if (unit == "angstrom") {
+    return value * NPUNITS::angstrom;
   }
 
-  else if(unit=="fermi"){
-    return value*NPUNITS::fermi;
+  else if (unit == "fermi") {
+    return value * NPUNITS::fermi;
   }
 
-  else if(unit=="barn"){
-    return value*NPUNITS::barn;
+  else if (unit == "barn") {
+    return value * NPUNITS::barn;
   }
 
-  else if(unit=="millibarn"){
-    return value*NPUNITS::millibarn;
+  else if (unit == "millibarn") {
+    return value * NPUNITS::millibarn;
   }
 
-  else if(unit=="microbarn"){
-    return value*NPUNITS::microbarn;
+  else if (unit == "microbarn") {
+    return value * NPUNITS::microbarn;
   }
 
-  else if(unit=="nanobarn"){
-    return value*NPUNITS::nanobarn;
+  else if (unit == "nanobarn") {
+    return value * NPUNITS::nanobarn;
   }
 
-  else if(unit=="picobarn"){
-    return value*NPUNITS::picobarn;
+  else if (unit == "picobarn") {
+    return value * NPUNITS::picobarn;
   }
 
-  else if(unit=="mm"){
-    return value*NPUNITS::mm;
+  else if (unit == "mm") {
+    return value * NPUNITS::mm;
   }
 
-  else if(unit=="um"){
-    return value*NPUNITS::um;
+  else if (unit == "um") {
+    return value * NPUNITS::um;
   }
 
-  else if(unit=="nm"){
-    return value*NPUNITS::nm;
+  else if (unit == "nm") {
+    return value * NPUNITS::nm;
   }
 
-  else if(unit=="mm2"){
-    return value*NPUNITS::mm2;
+  else if (unit == "mm2") {
+    return value * NPUNITS::mm2;
   }
 
-  else if(unit=="mm3"){
-    return value*NPUNITS::mm3;
+  else if (unit == "mm3") {
+    return value * NPUNITS::mm3;
   }
 
-  else if(unit=="cm"){
-    return value*NPUNITS::cm;
+  else if (unit == "cm") {
+    return value * NPUNITS::cm;
   }
 
-  else if(unit=="cm2"){
-    return value*NPUNITS::cm2;
+  else if (unit == "cm2") {
+    return value * NPUNITS::cm2;
   }
 
-  else if(unit=="cm3"){
-    return value*NPUNITS::cm3;
+  else if (unit == "cm3") {
+    return value * NPUNITS::cm3;
   }
 
-  else if(unit=="m"){
-    return value*NPUNITS::m;
+  else if (unit == "m") {
+    return value * NPUNITS::m;
   }
 
-  else if(unit=="m2"){
-    return value*NPUNITS::m2;
+  else if (unit == "m2") {
+    return value * NPUNITS::m2;
   }
 
-  else if(unit=="m3"){
-    return value*NPUNITS::m3;
+  else if (unit == "m3") {
+    return value * NPUNITS::m3;
   }
 
-  else if(unit=="km"){
-    return value*NPUNITS::km;
+  else if (unit == "km") {
+    return value * NPUNITS::km;
   }
 
-  else if(unit=="km2"){
-    return value*NPUNITS::km2;
+  else if (unit == "km2") {
+    return value * NPUNITS::km2;
   }
 
-  else if(unit=="km3"){
-    return value*NPUNITS::km3;
+  else if (unit == "km3") {
+    return value * NPUNITS::km3;
   }
 
-  else if(unit=="pc"){
-    return value*NPUNITS::pc;
+  else if (unit == "pc") {
+    return value * NPUNITS::pc;
   }
 
-  else if(unit=="radian"){
-    return value*NPUNITS::radian;
+  else if (unit == "radian") {
+    return value * NPUNITS::radian;
   }
 
-  else if(unit=="milliradian"){
-    return value*NPUNITS::milliradian;
+  else if (unit == "milliradian") {
+    return value * NPUNITS::milliradian;
   }
 
-  else if(unit=="degree"){
-    return value*NPUNITS::degree;
+  else if (unit == "degree") {
+    return value * NPUNITS::degree;
   }
 
-  else if(unit=="steradian"){
-    return value*NPUNITS::steradian;
+  else if (unit == "steradian") {
+    return value * NPUNITS::steradian;
   }
 
-  else if(unit=="rad"){
-    return value*NPUNITS::rad;
+  else if (unit == "rad") {
+    return value * NPUNITS::rad;
   }
 
-  else if(unit=="mrad"){
-    return value*NPUNITS::mrad;
+  else if (unit == "mrad") {
+    return value * NPUNITS::mrad;
   }
 
-  else if(unit=="sr"){
-    return value*NPUNITS::sr;
+  else if (unit == "sr") {
+    return value * NPUNITS::sr;
   }
 
-  else if(unit=="deg"){
-    return value*NPUNITS::deg;
+  else if (unit == "deg") {
+    return value * NPUNITS::deg;
   }
 
-  else if(unit=="nanosecond"){
-    return value*NPUNITS::nanosecond;
+  else if (unit == "nanosecond") {
+    return value * NPUNITS::nanosecond;
   }
 
-  else if(unit=="second"){
-    return value*NPUNITS::second;
+  else if (unit == "second") {
+    return value * NPUNITS::second;
   }
 
-  else if(unit=="millisecond"){
-    return value*NPUNITS::millisecond;
+  else if (unit == "millisecond") {
+    return value * NPUNITS::millisecond;
   }
 
-  else if(unit=="microsecond"){
-    return value*NPUNITS::microsecond;
+  else if (unit == "microsecond") {
+    return value * NPUNITS::microsecond;
   }
 
-  else if(unit=="picosecond"){
-    return value*NPUNITS::picosecond;
+  else if (unit == "picosecond") {
+    return value * NPUNITS::picosecond;
   }
 
-  else if(unit=="hertz"){
-    return value*NPUNITS::hertz;
+  else if (unit == "hertz") {
+    return value * NPUNITS::hertz;
   }
 
-  else if(unit=="kilohertz"){
-    return value*NPUNITS::kilohertz;
+  else if (unit == "kilohertz") {
+    return value * NPUNITS::kilohertz;
   }
 
-  else if(unit=="megahertz"){
-    return value*NPUNITS::megahertz;
+  else if (unit == "megahertz") {
+    return value * NPUNITS::megahertz;
   }
 
-  else if(unit=="ns"){
-    return value*NPUNITS::ns;
+  else if (unit == "ns") {
+    return value * NPUNITS::ns;
   }
 
-  else if(unit=="us"){
-    return value*NPUNITS::us;
+  else if (unit == "us") {
+    return value * NPUNITS::us;
   }
 
-  else if(unit=="ms"){
-    return value*NPUNITS::ms;
+  else if (unit == "ms") {
+    return value * NPUNITS::ms;
   }
 
-  else if(unit=="eplus"){
-    return value*NPUNITS::eplus;
+  else if (unit == "eplus") {
+    return value * NPUNITS::eplus;
   }
 
-  else if(unit=="e_SI"){
-    return value*NPUNITS::e_SI;
+  else if (unit == "e_SI") {
+    return value * NPUNITS::e_SI;
   }
 
-  else if(unit=="coulomb"){
-    return value*NPUNITS::coulomb;
+  else if (unit == "coulomb") {
+    return value * NPUNITS::coulomb;
   }
 
-  else if(unit=="megaelectron"){
-    return value*NPUNITS::megaelectronvolt;
+  else if (unit == "megaelectron") {
+    return value * NPUNITS::megaelectronvolt;
   }
 
-  else if(unit=="electronvolt"){
-    return value*NPUNITS::electronvolt;
+  else if (unit == "electronvolt") {
+    return value * NPUNITS::electronvolt;
   }
 
-  else if(unit=="kiloelectron"){
-    return value*NPUNITS::kiloelectronvolt;
+  else if (unit == "kiloelectron") {
+    return value * NPUNITS::kiloelectronvolt;
   }
 
-  else if(unit=="gigaelectron"){
-    return value*NPUNITS::gigaelectronvolt;
+  else if (unit == "gigaelectron") {
+    return value * NPUNITS::gigaelectronvolt;
   }
 
-  else if(unit=="teraelectron"){
-    return value*NPUNITS::teraelectronvolt;
+  else if (unit == "teraelectron") {
+    return value * NPUNITS::teraelectronvolt;
   }
 
-  else if(unit=="petaelectron"){
-    return value*NPUNITS::petaelectronvolt;
+  else if (unit == "petaelectron") {
+    return value * NPUNITS::petaelectronvolt;
   }
 
-  else if(unit=="joule"){
-    return value*NPUNITS::joule;
+  else if (unit == "joule") {
+    return value * NPUNITS::joule;
   }
 
-  else if(unit=="MeV"){
-    return value*NPUNITS::MeV;
+  else if (unit == "MeV") {
+    return value * NPUNITS::MeV;
   }
 
-  else if(unit=="eV"){
-    return value*NPUNITS::eV;
+  else if (unit == "eV") {
+    return value * NPUNITS::eV;
   }
 
-  else if(unit=="keV"){
-    return value*NPUNITS::keV;
+  else if (unit == "keV") {
+    return value * NPUNITS::keV;
   }
 
-  else if(unit=="GeV"){
-    return value*NPUNITS::GeV;
+  else if (unit == "GeV") {
+    return value * NPUNITS::GeV;
   }
 
-  else if(unit=="TeV"){
-    return value*NPUNITS::TeV;
+  else if (unit == "TeV") {
+    return value * NPUNITS::TeV;
   }
 
-  else if(unit=="PeV"){
-    return value*NPUNITS::PeV;
+  else if (unit == "PeV") {
+    return value * NPUNITS::PeV;
   }
 
-  else if(unit=="kilogram"){
-    return value*NPUNITS::kilogram;
+  else if (unit == "kilogram") {
+    return value * NPUNITS::kilogram;
   }
 
-  else if(unit=="gram"){
-    return value*NPUNITS::gram;
+  else if (unit == "gram") {
+    return value * NPUNITS::gram;
   }
 
-  else if(unit=="milligram"){
-    return value*NPUNITS::milligram;
+  else if (unit == "milligram") {
+    return value * NPUNITS::milligram;
   }
 
-  else if(unit=="kg"){
-    return value*NPUNITS::kg;
+  else if (unit == "kg") {
+    return value * NPUNITS::kg;
   }
 
-  else if(unit=="g"){
-    return value*NPUNITS::g;
+  else if (unit == "g") {
+    return value * NPUNITS::g;
   }
 
-  else if(unit=="mg"){
-    return value*NPUNITS::mg;
+  else if (unit == "mg") {
+    return value * NPUNITS::mg;
   }
 
-  else if(unit=="watt"){
-    return value*NPUNITS::watt;
+  else if (unit == "watt") {
+    return value * NPUNITS::watt;
   }
 
-  else if(unit=="newton"){
-    return value*NPUNITS::newton;
+  else if (unit == "newton") {
+    return value * NPUNITS::newton;
   }
 
-  else if(unit=="hep_pascal"){
-    return value*NPUNITS::hep_pascal;
+  else if (unit == "hep_pascal") {
+    return value * NPUNITS::hep_pascal;
   }
 
-  else if(unit=="bar"){
-    return value*NPUNITS::bar;
+  else if (unit == "bar") {
+    return value * NPUNITS::bar;
   }
 
-  else if(unit=="atmosphere"){
-    return value*NPUNITS::atmosphere;
+  else if (unit == "atmosphere") {
+    return value * NPUNITS::atmosphere;
   }
 
-  else if(unit=="ampere"){
-    return value*NPUNITS::ampere;
+  else if (unit == "ampere") {
+    return value * NPUNITS::ampere;
   }
 
-  else if(unit=="milliampere"){
-    return value*NPUNITS::milliampere;
+  else if (unit == "milliampere") {
+    return value * NPUNITS::milliampere;
   }
 
-  else if(unit=="microampere"){
-    return value*NPUNITS::microampere;
+  else if (unit == "microampere") {
+    return value * NPUNITS::microampere;
   }
 
-  else if(unit=="nanoampere"){
-    return value*NPUNITS::nanoampere;
+  else if (unit == "nanoampere") {
+    return value * NPUNITS::nanoampere;
   }
 
-  else if(unit=="megavolt"){
-    return value*NPUNITS::megavolt;
+  else if (unit == "megavolt") {
+    return value * NPUNITS::megavolt;
   }
 
-  else if(unit=="kilovolt"){
-    return value*NPUNITS::kilovolt;
+  else if (unit == "kilovolt") {
+    return value * NPUNITS::kilovolt;
   }
 
-  else if(unit=="volt"){
-    return value*NPUNITS::volt;
+  else if (unit == "volt") {
+    return value * NPUNITS::volt;
   }
 
-  else if(unit=="ohm"){
-    return value*NPUNITS::ohm;
+  else if (unit == "ohm") {
+    return value * NPUNITS::ohm;
   }
 
-  else if(unit=="farad"){
-    return value*NPUNITS::farad;
+  else if (unit == "farad") {
+    return value * NPUNITS::farad;
   }
 
-  else if(unit=="millifarad"){
-    return value*NPUNITS::millifarad;
+  else if (unit == "millifarad") {
+    return value * NPUNITS::millifarad;
   }
 
-  else if(unit=="microfarad"){
-    return value*NPUNITS::microfarad;
+  else if (unit == "microfarad") {
+    return value * NPUNITS::microfarad;
   }
 
-  else if(unit=="nanofarad"){
-    return value*NPUNITS::nanofarad;
+  else if (unit == "nanofarad") {
+    return value * NPUNITS::nanofarad;
   }
 
-  else if(unit=="picofarad"){
-    return value*NPUNITS::picofarad;
+  else if (unit == "picofarad") {
+    return value * NPUNITS::picofarad;
   }
 
-  else if(unit=="weber"){
-    return value*NPUNITS::weber;
+  else if (unit == "weber") {
+    return value * NPUNITS::weber;
   }
 
-  else if(unit=="tesla" || unit=="T"){
-    return value*NPUNITS::tesla;
+  else if (unit == "tesla" || unit == "T") {
+    return value * NPUNITS::tesla;
   }
 
-  else if(unit=="gauss"){
-    return value*NPUNITS::gauss;
+  else if (unit == "gauss") {
+    return value * NPUNITS::gauss;
   }
 
-  else if(unit=="kilogauss"){
-    return value*NPUNITS::kilogauss;
+  else if (unit == "kilogauss") {
+    return value * NPUNITS::kilogauss;
   }
 
-  else if(unit=="henry"){
-    return value*NPUNITS::henry;
+  else if (unit == "henry") {
+    return value * NPUNITS::henry;
   }
 
-  else if(unit=="kelvin"){
-    return value*NPUNITS::kelvin;
+  else if (unit == "kelvin") {
+    return value * NPUNITS::kelvin;
   }
 
-  else if(unit=="mole"){
-    return value*NPUNITS::mole;
+  else if (unit == "mole") {
+    return value * NPUNITS::mole;
   }
 
-  else if(unit=="becquerel"){
-    return value*NPUNITS::becquerel;
+  else if (unit == "becquerel") {
+    return value * NPUNITS::becquerel;
   }
 
-  else if(unit=="curie"){
-    return value*NPUNITS::curie;
+  else if (unit == "curie") {
+    return value * NPUNITS::curie;
   }
 
-  else if(unit=="gray"){
-    return value*NPUNITS::gray;
+  else if (unit == "gray") {
+    return value * NPUNITS::gray;
   }
 
-  else if(unit=="kilogray"){
-    return value*NPUNITS::kilogray;
+  else if (unit == "kilogray") {
+    return value * NPUNITS::kilogray;
   }
 
-  else if(unit=="milligray"){
-    return value*NPUNITS::milligray;
+  else if (unit == "milligray") {
+    return value * NPUNITS::milligray;
   }
 
-  else if(unit=="microgray"){
-    return value*NPUNITS::microgray;
+  else if (unit == "microgray") {
+    return value * NPUNITS::microgray;
   }
 
-  else if(unit=="candela"){
-    return value*NPUNITS::candela;
+  else if (unit == "candela") {
+    return value * NPUNITS::candela;
   }
 
-  else if(unit=="lumen"){
-    return value*NPUNITS::lumen;
+  else if (unit == "lumen") {
+    return value * NPUNITS::lumen;
   }
 
-  else if(unit=="lux"){
-    return value*NPUNITS::lux;
+  else if (unit == "lux") {
+    return value * NPUNITS::lux;
   }
 
-  else if(unit=="perCent"){
-    return value*NPUNITS::perCent;
+  else if (unit == "perCent") {
+    return value * NPUNITS::perCent;
   }
 
-  else if(unit=="perThousand"){
-    return value*NPUNITS::perThousand;
+  else if (unit == "perThousand") {
+    return value * NPUNITS::perThousand;
   }
 
-  else if(unit=="perMillion"){
-    return value*NPUNITS::perMillion;
+  else if (unit == "perMillion") {
+    return value * NPUNITS::perMillion;
   }
 
-  else{
+  else {
     std::cout << "WARNING: Unknown unit " << unit << std::endl;
     return value;
   }
diff --git a/NPLib/Core/NPInputParser.h b/NPLib/Core/NPInputParser.h
index 2c58e7d482bb318eb13d3e9fc7d5345c0f5ea96e..788dd3ec763a624b90065ba95db48d959bb223e7 100644
--- a/NPLib/Core/NPInputParser.h
+++ b/NPLib/Core/NPInputParser.h
@@ -22,17 +22,15 @@
  *                                                                           *
  *****************************************************************************/
 
-
 // STL
-#include<string>
-#include<vector>
-#include<map>
+#include <map>
+#include <string>
+#include <vector>
 
 // ROOT
-#include"TVector3.h"
-
+#include "TVector3.h"
 
-namespace NPL{
+namespace NPL {
 
   static std::string token_separator = "=";
   std::string StripSpaces(std::string line);
@@ -40,85 +38,84 @@ namespace NPL{
   double ApplyUnit(double value, std::string unit);
   unsigned int GetLevel(std::string line);
 
-  class InputBlock{
-    public:
-      InputBlock(){};
-      InputBlock(std::string line);
-      ~InputBlock(){};
-      NPL::InputBlock* Copy();
-
-    private:
-      unsigned int m_Level;
-      std::string m_MainToken;
-      std::string m_MainValue;
-      std::vector<std::string> m_Token;
-      std::vector<std::string> m_Value; 
-      std::vector<std::string> m_Lines; 
-
-    public:
-      void AddLine(std::string line);  
-      std::string ExtractToken(std::string line,std::string separator="");
-      std::string ExtractValue(std::string line,std::string separator="");
-
-    public:
-      std::string GetToken(unsigned int i){return m_Token[i];};
-      std::string GetValue(unsigned int i){return m_Value[i];};
-      std::string GetValue(std::string Token);
-      void SetValue(unsigned int i, std::string val){m_Value[i]=val;};
-
-
-    public:  
-      bool HasTokenList(std::vector<std::string> TokenList);
-      bool HasToken(std::string Token);
-
-    public:
-      std::string GetMainToken(){return m_MainToken;};
-      std::string GetMainValue(){return m_MainValue;};
-
-      unsigned int GetSize(){return m_Token.size();};
-      double GetDouble(std::string Token,std::string default_unit);
-      int GetInt(std::string Token);
-      std::string GetString(std::string Token);
-      TVector3 GetTVector3(std::string Token,std::string default_unit);
-      std::vector<double> GetVectorDouble(std::string Token,std::string default_unit);
-      std::vector<int> GetVectorInt(std::string Token);
-      std::vector<std::string> GetVectorString(std::string Token);
-      std::vector<NPL::InputBlock*> GetSubBlock(std::string Token);
-      std::vector<std::string> GetLines(){return m_Lines;};
-
-    public:
-      void Dump();
+  class InputBlock {
+   public:
+    InputBlock(){};
+    InputBlock(std::string line);
+    ~InputBlock(){};
+    NPL::InputBlock* Copy();
+
+   private:
+    unsigned int m_Level;
+    std::string m_MainToken;
+    std::string m_MainValue;
+    std::vector<std::string> m_Token;
+    std::vector<std::string> m_Value;
+    std::vector<std::string> m_Lines;
+
+   public:
+    void AddLine(std::string line);
+    std::string ExtractToken(std::string line, std::string separator = "");
+    std::string ExtractValue(std::string line, std::string separator = "");
+
+   public:
+    std::string GetToken(unsigned int i) { return m_Token[i]; };
+    std::string GetValue(unsigned int i) { return m_Value[i]; };
+    std::string GetValue(std::string Token);
+    void SetValue(unsigned int i, std::string val) { m_Value[i] = val; };
+
+   public:
+    bool HasTokenList(std::vector<std::string> TokenList);
+    std::vector<std::string> GetMissingToken(std::vector<std::string> TokenList);
+    bool HasToken(std::string Token);
+
+   public:
+    std::string GetMainToken() { return m_MainToken; };
+    std::string GetMainValue() { return m_MainValue; };
+
+    unsigned int GetSize() { return m_Token.size(); };
+    double GetDouble(std::string Token, std::string default_unit);
+    int GetInt(std::string Token);
+    std::string GetString(std::string Token);
+    TVector3 GetTVector3(std::string Token, std::string default_unit);
+    std::vector<double> GetVectorDouble(std::string Token, std::string default_unit);
+    std::vector<int> GetVectorInt(std::string Token);
+    std::vector<std::string> GetVectorString(std::string Token);
+    std::vector<NPL::InputBlock*> GetSubBlock(std::string Token);
+    std::vector<std::string> GetLines() { return m_Lines; };
+
+   public:
+    void Dump();
   };
   ////////////////////////////////////////////////////////////////////////////////
-  class InputParser{
-    public:
-      InputParser(){};
-      InputParser(std::string filename,bool ExitOnError=true) {ReadFile(filename,ExitOnError);}
-      ~InputParser(){};
-
-    private:
-      std::vector<InputBlock*> m_Block;
-      std::map<std::string, std::vector<std::string> > m_Aliases;
-
-    private:
-      int m_verbose;
-
-    public:
-      void ReadFile(std::string filename,bool ExitOnError=true);
-      void TreatAliases();
-      void TreatOneAlias(){};
-      void Dump();
-      void Print() {Dump();}
-      void Clear();
-      std::vector<InputBlock*> GetAllBlocksWithToken(std::string Token);
-      std::vector<InputBlock*> GetAllBlocksWithTokenAndValue(std::string Token,std::string Value);
-      std::vector<std::string> GetAllBlocksValues(std::string);
-      std::vector<std::string> GetAllBlocksToken();
-
-
-    private:
-      bool IsNotComment(std::string line);
+  class InputParser {
+   public:
+    InputParser(){};
+    InputParser(std::string filename, bool ExitOnError = true) { ReadFile(filename, ExitOnError); }
+    ~InputParser(){};
+
+   private:
+    std::vector<InputBlock*> m_Block;
+    std::map<std::string, std::vector<std::string>> m_Aliases;
+
+   private:
+    int m_verbose;
+
+   public:
+    void ReadFile(std::string filename, bool ExitOnError = true);
+    void TreatAliases();
+    void TreatOneAlias(){};
+    void Dump();
+    void Print() { Dump(); }
+    void Clear();
+    std::vector<InputBlock*> GetAllBlocksWithToken(std::string Token);
+    std::vector<InputBlock*> GetAllBlocksWithTokenAndValue(std::string Token, std::string Value);
+    std::vector<std::string> GetAllBlocksValues(std::string);
+    std::vector<std::string> GetAllBlocksToken();
+
+   private:
+    bool IsNotComment(std::string line);
   };
-}
+} // namespace NPL
 
 #endif
diff --git a/NPSimulation/Detectors/Minos/Minos.cc b/NPSimulation/Detectors/Minos/Minos.cc
index 88a18ed5cfae669704d05299c7f060d9558ada3a..ea4ac5d1c96bd5973945fde1e96236420a995aa3 100644
--- a/NPSimulation/Detectors/Minos/Minos.cc
+++ b/NPSimulation/Detectors/Minos/Minos.cc
@@ -323,6 +323,12 @@ void Minos::ReadConfiguration(NPL::InputParser parser) {
     }
     else {
       cout << "ERROR: check your input file formatting " << endl;
+      cout << " missing token : ";
+      auto missing = blocks[i]->GetMissingToken(token);
+      for (unsigned int i = 0; i < missing.size(); i++) {
+        std::cout << missing[i] << " ";
+      }
+      std::cout << endl;
       exit(1);
     }
   }
@@ -333,7 +339,7 @@ void Minos::ReadConfiguration(NPL::InputParser parser) {
 // Called After DetecorConstruction::AddDetector Method
 void Minos::ConstructDetector(G4LogicalVolume* world) {
   for (unsigned short i = 0; i < m_POS.size(); i++) {
-    bool TPCOnly = m_TPCOnly[i];
+    TPCOnly = m_TPCOnly[i];
 
     /* TargetMaterial = MaterialManager::getInstance()->GetMaterialFromLibrary("Vacuum"); */
     TargetMaterial = MaterialManager::getInstance()->GetMaterialFromLibrary("LH2");
diff --git a/Projects/S034/minos_dali.detector b/Projects/S034/minos_dali.detector
index 2ee456685797fc3455bc9423970269121490652f..facf9c4bf9b2214d7b5d8f632d1581143b53ee3d 100644
--- a/Projects/S034/minos_dali.detector
+++ b/Projects/S034/minos_dali.detector
@@ -2,6 +2,7 @@
 Minos
  Position= 0 0 0  mm
  ZRotation= 40.6 deg
+ TargetZOffset= 0 mm
  ZOffset= -4650
  TargetLength= 151.72 mm
  TargetMaterial= LH2 
diff --git a/Projects/S034/s034.detector b/Projects/S034/s034.detector
index 197967682cc07f903a5271da68bb1c96cbef8468..32f48fb1764ff6af96f69d69ecddcab1b233a7e9 100644
--- a/Projects/S034/s034.detector
+++ b/Projects/S034/s034.detector
@@ -27,12 +27,14 @@ Minos
  Position= 0.345399 1.02061 -4650 mm
  ZRotation= 40.6 deg
  TargetLength= 151.72 mm
+ TargetZOffset= 0 mm 
+ ZOffset= 0 mm 
  TargetMaterial= LH2 
  CellMaterial= Mylar 
  TPCOnly= 0 
  TimeBin= 30 ns
  ShapingTime= 333.9 ns
- BaseLine= 250
+ Baseline= 250
  Sampling= 10
  XML= db/MINOS.xml
 
diff --git a/Projects/e793s/Analysis.cxx b/Projects/e793s/Analysis.cxx
index 646433aa6522c3e35dba24f969132881d5715e9c..c04cbfdd958e03e3fbb5f0552925b3f42c6cb1d5 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 3a4ad387239dcee1c7c97e2b288ebb1b8712894f..071c320aaa57eb6023ed4aa93f71ad0d8533c6e8 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 0000000000000000000000000000000000000000..cd1429b5205fc300eaa6bf27ee943463348b5460
--- /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 0000000000000000000000000000000000000000..a96c9ff1341366c39aa8582a4fecb1bf1228cdf1
--- /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 0000000000000000000000000000000000000000..d69b6d9f5e0ffad17f1d782cb06b0b1658563541
--- /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 0000000000000000000000000000000000000000..1139443711540fec19a22fc12793fd782efc93bf
--- /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 0000000000000000000000000000000000000000..22e511841bc122592cf177a7820b4fa242b7e34e
--- /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 0000000000000000000000000000000000000000..2adca07ada0de444732eaf4a69b62a2df1e511c8
--- /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 0000000000000000000000000000000000000000..3d93e3146f9347e6c265864458d79ed18a0afea1
--- /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 0000000000000000000000000000000000000000..9ff981b42b2de9f4ce5f5ff5a6dbd8fc43311c9a
--- /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 0000000000000000000000000000000000000000..485eedd9882f9bfa06a22158ad691c66e2300b2c
--- /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 0000000000000000000000000000000000000000..6b7cfd43ebc12c287b27867d240c4dcf68915319
--- /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 0000000000000000000000000000000000000000..fb58360e3615e32bbfb3bdc6c08c1ba87bb1f10e
--- /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 0000000000000000000000000000000000000000..1c40b685419bb54daabe764df37fc28819997df4
--- /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 0000000000000000000000000000000000000000..1cb2c275f2129662df0e2c732b54c99c45d3b30c
--- /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 0000000000000000000000000000000000000000..f09631e0064909c62621e7e37a6d508b0f2c0a93
--- /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 0000000000000000000000000000000000000000..1b82b119f8da40399ad162de03a47b89eb6367a9
--- /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 abe498fe3ce9a992b1d93fce34c6be819366e848..8c8d11f5723ca20c2c7bb86ca1ddf7585bdcf40f 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 0000000000000000000000000000000000000000..7840f00a3acd69228977f107aea110b25f674091
--- /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 0000000000000000000000000000000000000000..ed236d7e0670977b840499ca40d265044c61bd76
--- /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 0000000000000000000000000000000000000000..04064d0cd573449f3aca30051d20eb0f97f467a8
--- /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 0000000000000000000000000000000000000000..c8e79822ca782b269c7c417fc4b371c81970cf71
--- /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 0000000000000000000000000000000000000000..4105db6701daad73e72bba0eb2cb9d452336a676
--- /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 0000000000000000000000000000000000000000..aef8ef931c6cc32b1788e5e212f6bf4ded622a3a
--- /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 0000000000000000000000000000000000000000..59d24ea9e72e0aca98a7ec11a1ac27e167c38032
--- /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 0000000000000000000000000000000000000000..da8c18197944261ab60462d9223bbb7958350f33
--- /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 0000000000000000000000000000000000000000..bdabca147d53f75ccdc5f9bdc57169263b37fbd0
--- /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 0000000000000000000000000000000000000000..30ad7b733e3ea1e5b19915cb3ab0591be7158d2f
--- /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 4d78921e4c30fc4245971f171cf26ac3d907b17c..e60f417cb1bb417a13fa7dd466d5f9373902d4e7 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 d35f3ebe395fcefd3a76537f03d1de09283ab42f..4853419b10b71e32517e5980618e36aa6e0ea0b1 100644
--- a/Projects/e793s/macro/CS2.h
+++ b/Projects/e793s/macro/CS2.h
@@ -21,10 +21,14 @@ bool loud = 1;
 /* Scale method toggle */
 bool scaleTogether = 1;
 
-/* String for image */
+/* Strings for image */
 string orbitalname;
 string orbital;
 
+/* Strings for SolidAngle input file */
+string statename;
+string inputdate;
+
 
 ////////////////////////////////////////////////////////////////////////////////
 void canclone(TCanvas* major, int padNum, string name){
@@ -84,22 +88,6 @@ void CS_Diagnosis(){
 ////////////////////////////////////////////////////////////////////////////////
 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;
@@ -113,8 +101,6 @@ void CS(){
   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;
-
-
 }
 
 ////////////////////////////////////////////////////////////////////////////////
@@ -125,7 +111,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
+  inputdate = "18Oct22";
 
   orbitalname.clear();
   orbital.clear();
@@ -157,10 +147,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){
@@ -191,6 +181,9 @@ void CS(double Energy, double Spin, double spdf, double angmom){
       cout << "Identified as state #" << i << ", E = " << means[i] << endl;
       indexE = i;
       found = 1;
+      stringstream ss;
+      ss << setfill('0') << setw(4) << (int)(means[i]*1000.);
+      statename = ss.str();
     }
   }
   if(!found){
@@ -205,10 +198,40 @@ 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_HistFiles/SolidAngle_HistFile_10Aug22_TrueStripRemoval.root");
+
+  string backupFileName = "SolidAngle_HistFiles/SolidAngle_HistFile_10Aug22_TrueStripRemoval.root";
+
+  string saFileName = "SolidAngle_HistFiles/SAHF_";
+    saFileName.append(inputdate);
+    saFileName.append("_47Kdp_");
+    saFileName.append(statename);
+    saFileName.append(".root");
+
+  TFile* file;
+  ifstream infile(saFileName);
+  ifstream backup(backupFileName);
+  if(infile.good()){
+    cout << "Opening file " << saFileName << endl;
+      file = TFile::Open(saFileName.c_str());
+  } else if (backup.good()){
+    cout << BOLDRED << "FAILED TO OPEN " << saFileName << endl;
+    cout << "Open standard backup file " << backupFileName << endl;
+    cout << RESET;
+      file = TFile::Open(backupFileName.c_str());
+  } else {
+    cout << BOLDRED << "FAILED TO OPEN MAIN OR BACKUP SOLID ANGLE FILE" << endl;
+    cout << RED << "Check SolidAngle file exists..." << RESET << endl;
+  }
+  //cout << "MADE IT OUT" << endl;
+
+
+
   //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");
+  //cout << BLUE << "MADE IT HERE" << endl;
   TCanvas* c_SolidAngle = new TCanvas("c_SolidAngle","c_SolidAngle",1000,1000);
   SolidAngle->Draw("HIST");
   SolidAngle->GetXaxis()->SetRangeUser(100.,160.);
@@ -329,6 +352,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 +602,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 +643,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 +663,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 +925,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 0000000000000000000000000000000000000000..cf4e0ae2346b0c7b337576aea965891508c03190
--- /dev/null
+++ b/Projects/e793s/macro/CS2_dt.h
@@ -0,0 +1,901 @@
+/* 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;
+
+/* Strings for SolidAngle input file */
+string statename;
+string inputdate;
+
+////////////////////////////////////////////////////////////////////////////////
+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 << "- CS(stateE, stateSp, orb_l, orb_j, nodes) "<< 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 = 0.000220, ElasticNormErr = 0.000; //14Oct22
+  inputdate = "18Oct22";
+
+  // Extract spin orbit name
+  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="???";
+  }
+
+  // Number of nodes
+  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;
+      stringstream ss;
+      ss << setfill('0') << setw(4) << (int)(means[i]*1000.);
+      statename = ss.str();
+    }
+  }
+  if(!found){
+    cout << "========================================================" << endl;
+    cout << "NO STATE AT THAT ENERGY INDENTIFIED!! CHECK KNOWN PEAKS!!" << endl;
+    return;
+  }
+
+  /* Solid Angle (from simulation) */
+  //auto file = new TFile("../SolidAngle_HistFile_18Oct22_47Kdt.root");
+  string backupFileName = "SolidAngle_HistFiles/SolidAngle_HistFile_18Oct22_47Kdt.root";
+  string saFileName = "SolidAngle_HistFiles/SAHF_";
+    saFileName.append(inputdate);
+    saFileName.append("_47Kdt_");
+    saFileName.append(statename);
+    saFileName.append(".root");
+
+  TFile* file;
+  ifstream infile(saFileName);
+  ifstream backup(backupFileName);
+  if(infile.good()){
+    cout << "Opening file " << saFileName << endl;
+      file = TFile::Open(saFileName.c_str());
+  } else if (backup.good()){
+    cout << BOLDRED << "FAILED TO OPEN " << saFileName << endl;
+    cout << "Open standard backup file " << backupFileName << endl;
+    cout << RESET;
+      file = TFile::Open(backupFileName.c_str());
+  } else {
+    cout << BOLDRED << "FAILED TO OPEN MAIN OR BACKUP SOLID ANGLE FILE" << endl;
+    cout << RED << "Check SolidAngle file exists..." << RESET << endl;
+  }
+
+  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 559e798365138c3479ee7cadc7e112d6c8229331..4456c7e58f5d4cd6ac88822052ea0ede20f41593 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);
 }
 
@@ -123,8 +115,15 @@ void LoadChain47Kpp(){
   //files.push_back("../../../Outputs/Analysis/47Kpp_08Nov_PartI.root");
   //files.push_back("../../../Outputs/Analysis/47Kpp_08Nov_PartII.root");
 
-  files.push_back("../../../Outputs/Analysis/47Kpp_11Jul22_PartI.root");
-  files.push_back("../../../Outputs/Analysis/47Kpp_11Jul22_PartII.root");
+  //files.push_back("../../../Outputs/Analysis/47Kpp_11Jul22_PartI.root");
+  //files.push_back("../../../Outputs/Analysis/47Kpp_11Jul22_PartII.root");
+
+  //files.push_back("../../../Outputs/Analysis/24Oct22_47Kpp_PartI.root");
+  //files.push_back("../../../Outputs/Analysis/24Oct22_47Kpp_PartII.root");
+
+  files.push_back("../../../Outputs/Analysis/25Oct22_47Kpp_PartI.root");
+  files.push_back("../../../Outputs/Analysis/25Oct22_47Kpp_PartII.root");
+  
 
   chain = Chain("PhysicsTree",files,true);
 }
@@ -152,65 +151,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 +192,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 +240,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 +342,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");
 
-  DrawParticleStates(cEx);
+  if(reactionName=="47K(d,t)"){
+    Ep->Rebin(2); 
+    Ep->GetYaxis()->SetTitle("Counts / 0.05 MeV");
+  }
+
+  if(reactionName=="47K(d,p)"){DrawParticleStates(cEx);}
 }
 
 void Load_2DParticleGamma(){
@@ -392,6 +377,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,24 +387,24 @@ 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();
+  if(reactionName=="47K(d,p)"){
+    TLine *Sn = new TLine(0,4.644,4.644,4.644);
+      Sn->SetLineColor(kRed);Sn->SetLineStyle(2);
+      Sn->Draw("same");
+    TLatex *TSn = new TLatex(.5,.5,"S_{n}");
+      TSn->SetTextColor(kRed);
+      TSn->SetTextSize(0.05);
+      TSn->SetX(2.50);
+      TSn->SetY(4.90);
+      TSn->Draw("same");
+  }
   TLine *XeqY = new TLine(0,0,5,5);
     XeqY->SetLineColor(kRed);
     XeqY->Draw("same");
-  TLine *Sn = new TLine(0,4.644,4.644,4.644);
-    Sn->SetLineColor(kRed);Sn->SetLineStyle(2);
-    Sn->Draw("same");
-  TLatex *TSn = new TLatex(.5,.5,"S_{n}");
-    TSn->SetTextColor(kRed);
-    TSn->SetTextSize(0.05);
-    TSn->SetX(2.50);
-    TSn->SetY(4.90);
-    TSn->Draw("same");
   TLatex *Texeg = new TLatex(.5,.5,"Ex = E_{#gamma}");
     Texeg->SetTextColor(kRed);
     Texeg->SetTextSize(0.05);
@@ -496,10 +484,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 +499,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 +512,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 +551,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 +562,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 +573,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 +592,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 +627,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 +1141,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 +1201,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 +1257,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 +1765,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 +1905,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 +1981,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 +2091,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 +2133,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 +2174,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 +2202,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 +2225,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 +2466,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 +2793,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/GausFit.h b/Projects/e793s/macro/GausFit.h
index 700b1c6d471754f82fd49425dc2b73540e23226c..8289acffb9a086430addb5492a36ecfc6e2d34dd 100755
--- a/Projects/e793s/macro/GausFit.h
+++ b/Projects/e793s/macro/GausFit.h
@@ -94,6 +94,8 @@ vector<double> DoubleGausNumbs(TH1F* hist, double minFit, double maxFit, double
       //g2->SetParLimits(2, 0.05, 0.20);
       g2->SetParLimits(2, 0.4, 1.0);//FOR ELASTICS
 
+    bg->SetParameter(0, 5.0);//FOR ELASTICS
+      bg->SetParLimits(0, 0.0, 20.0);//FOR ELASTICS
 
     hist->Fit(g1, "WWR", "", minFit, mean1+5);//maxFit);
     hist->Fit(g2, "WWR", "", mean2-5, maxFit);//minFit, maxFit);
diff --git a/Projects/e793s/macro/Plots_47Kdd.C b/Projects/e793s/macro/Plots_47Kdd.C
new file mode 100644
index 0000000000000000000000000000000000000000..1e7e13c2ef312582629c522002942f20962db092
--- /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 e1d13083041c6b3ae464a3082b15c53c679a7e4f..ac9f2d4dc0a0afcce02ada0ffe8c5b173fdfed6f 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 872ca63e4dcc6bbddcf1074b48438f8c718bd489..289d7de22c6c689d120d2d06070769a3b78369e6 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 674af7ba43cafb3443018d05100fa34a62a25ff8..a3f089c2a778137055ad6fafac30a350d031fcac 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;
+
+