From aad4ea8d8f6e092b1bf3b705d69d6e9362399797 Mon Sep 17 00:00:00 2001
From: adrien-matta <a.matta@surrey.ac.uk>
Date: Wed, 30 Apr 2014 11:47:19 +0100
Subject: [PATCH] * Reorganising DetectorManager * Detector are now put in
 alphabetical order

---
 NPLib/VDetector/DetectorManager.cxx | 534 ++++++++++++++--------------
 1 file changed, 276 insertions(+), 258 deletions(-)

diff --git a/NPLib/VDetector/DetectorManager.cxx b/NPLib/VDetector/DetectorManager.cxx
index dd7f6b54d..f39ca9215 100644
--- a/NPLib/VDetector/DetectorManager.cxx
+++ b/NPLib/VDetector/DetectorManager.cxx
@@ -28,36 +28,37 @@
 
 //   Detector   
 #include "../DetectorList.inc"
+#include "GaspardTracker.h"
+#include "Hyde2Tracker.h"
+#include "Paris.h"
+#include "Shield.h"
 #include "TAnnularS1Physics.h"
+#include "TCATSPhysics.h"
+#include "TCharissaPhysics.h"
+#include "TChateauCristalPhysics.h"
+#include "TChio_anPhysics.h"
+#include "TChio_digPhysics.h"
+#include "TExlPhysics.h"
 #include "TExogamPhysics.h"
+#include "TLaBr3Physics.h"
 #include "TMust2Physics.h"
-#include "TCATSPhysics.h"
+#include "TPlasticPhysics.h"
+#include "TS2Physics.h"
 #include "TSSSDPhysics.h"
 #include "TSharcPhysics.h"
+#include "TSiLiPhysics.h"
+#include "TSiResPhysics.h"
+#include "TSpegPhysics.h"
+#include "TTacPhysics.h"
+#include "TTiaraBarrelPhysics.h"
+#include "TTiaraHyballPhysics.h"
 #include "TTigressPhysics.h"
 #include "TTrifoilPhysics.h"
-#include "TPlasticPhysics.h"
 #include "TTrifoilPhysics.h"
-#include "TTiaraHyballPhysics.h"
-#include "TTiaraBarrelPhysics.h"
-#include "TChateauCristalPhysics.h"
-#include "GaspardTracker.h"
-#include "Hyde2Tracker.h"
-#include "Paris.h"
 #include "TW1Physics.h"
-#include "TS2Physics.h"
-#include "TCharissaPhysics.h"
-#include "Shield.h"
-#include "TSpegPhysics.h"
-#include "TExlPhysics.h"
-#include "TTacPhysics.h"
-#include "TSiLiPhysics.h"
-#include "TSiResPhysics.h"
-#include "TLaBr3Physics.h"
-#include "TChio_digPhysics.h"
-#include "TChio_anPhysics.h"
-#include "NPOptionManager.h"
 #include "RootInput.h"
+#include "NPOptionManager.h"
+
 /////////////////////////////////////////////////////////////////////////////////////////////////
 //   Default Constructor
 DetectorManager::DetectorManager()   {
@@ -82,31 +83,31 @@ void DetectorManager::ReadConfigurationFile(string Path)   {
 
    /////////Boolean////////////////////
    bool AnnularS1           = false; 
-   bool MUST2               = false;
    bool CATS                = false;
-   bool SSSD                = false;
-   bool Sharc               = false;
+   bool Charissa 	          = false;
    bool ChateauCristal      = false;
+   bool EXL                 = false;
    bool Exogam              = false;
-   bool ScintillatorPlastic = false;
-   bool SiLi		      = false;
-   bool SiRes		      = false;
-   bool LaBr3		      = false;
-   bool IonisationChamber   = false;
-   bool Trifoil             = false;
-   bool Charissa 	      = false;
-   bool GeneralTarget       = false;
    bool GPDTracker          = false;
+   bool GeneralTarget       = false;
    bool HYD2Tracker         = false;
+   bool IonisationChamber   = false;
+   bool LaBr3		            = false;
+   bool MUST2               = false;
    bool ParisDet            = false;
-   bool ShieldDet           = false;
-   bool W1                  = false;
    bool S2                  = false;
    bool SPEG                = false;
-   bool EXL                 = false;
+   bool SSSD                = false;
+   bool ScintillatorPlastic = false;
+   bool Sharc               = false;
+   bool ShieldDet           = false;
+   bool SiLi		            = false;
+   bool SiRes		            = false;
    bool TAC                 = false;
-   bool TiaraHyball         = false;
    bool TiaraBarrel         = false;
+   bool TiaraHyball         = false;
+   bool Trifoil             = false;
+   bool W1                  = false;
 //////////////////////////////////////////////////////////////////////////////////////////
   ifstream ConfigFile;
   ConfigFile.open(Path.c_str());
@@ -122,6 +123,133 @@ void DetectorManager::ReadConfigurationFile(string Path)   {
     //Search for comment Symbol: %
     if (LineBuffer.compare(0, 1, "%") == 0) {   /*Do  Nothing*/ ;}
 
+    ////////////////////////////////////////////
+    //////  Search for Annular S1 Array   //////
+    ////////////////////////////////////////////
+    else if (LineBuffer.compare(0, 10, "AnnularS1") == 0 && AnnularS1 == false) {
+#ifdef INC_ANNULARS1
+      AnnularS1 = true;
+      cout << "//////// Annular S1 Array ////////" << endl << endl;
+
+      // Instantiate the new array as a VDetector Object
+      VDetector* myDetector = new TAnnularS1Physics();
+
+      // Read Position of Telescope
+      ConfigFile.close();
+      myDetector->ReadConfiguration(Path);
+      ConfigFile.open(Path.c_str());
+
+      // Add array to the VDetector Vector
+      AddDetector("AnnularS1", myDetector);
+#endif
+    }
+	  
+    ////////////////////////////////////////////
+    ////////   Search for CATS Array    ////////
+    ////////////////////////////////////////////
+    else if (LineBuffer.compare(0, 9, "CATSArray") == 0 && CATS == false) {
+#ifdef INC_CATS
+      CATS = true;
+      cout << "//////// CATS Array ////////" << endl << endl;
+
+      // Instantiate the new array as a VDetector Object
+      VDetector* myDetector = new TCATSPhysics();
+
+      // Read Position of Telescope
+      ConfigFile.close();
+      myDetector->ReadConfiguration(Path);
+      ConfigFile.open(Path.c_str());
+
+      // Add array to the VDetector Vector
+      AddDetector("CATS", myDetector);
+#endif
+    }
+
+	  ////////////////////////////////////////////
+	  ///////  Search for CHARISSA Array    //////
+	  ////////////////////////////////////////////
+    else if (LineBuffer.compare(0, 13, "CharissaArray") == 0 && Charissa == false) {
+#ifdef INC_CHARISSA
+		Charissa = true;
+		cout << "//////// Charissa Array ////////" << endl << endl;
+		
+		// Instantiate the new array as a VDetector Object
+		VDetector* myDetector = new TCharissaPhysics();
+		
+		// Read Position of Telescope
+		ConfigFile.close();
+		myDetector->ReadConfiguration(Path);
+		ConfigFile.open(Path.c_str());
+		
+		// Add array to the VDetector Vector
+		AddDetector("Charissa", myDetector);
+#endif
+    }
+
+    ////////////////////////////////////////////////////
+    ////////   Search for Chateau de Cristal    ////////
+    ////////////////////////////////////////////////////
+    else if (LineBuffer.compare(0, 9, "ChateauCristal") == 14 && ChateauCristal == false) {
+#ifdef INC_CHATEAUCRISTAL
+      ChateauCristal = true;
+      cout << "//////// Chateau de Cristal Array ////////" << endl << endl;
+
+      // Instantiate the new array as a VDetector Object
+      VDetector* myDetector = new TChateauCristalPhysics();
+
+      // Read Position of Telescope
+      ConfigFile.close();
+      myDetector->ReadConfiguration(Path);
+      ConfigFile.open(Path.c_str());
+
+      // Add array to the VDetector Vector
+      AddDetector("ChateauCristal", myDetector);
+#endif
+      }
+ 
+    /////////////////////////////////////////
+    //////////// Search for EXL  ////////////
+    /////////////////////////////////////////
+    else if (LineBuffer.compare(0, 3, "EXL") == 0 && EXL == false) {
+#ifdef INC_EXL
+      EXL = true ;
+      cout << "//////// EXL Csi gamma detector ////////" << endl;
+
+      // Instantiate the new array as a VDetector Object
+      VDetector* myDetector = new TExlPhysics();
+
+      // Read Position of Telescope
+      ConfigFile.close();
+      myDetector->ReadConfiguration(Path);
+      ConfigFile.open(Path.c_str());
+
+      // Add array to the VDetector Vector
+      AddDetector("EXL", myDetector);
+#endif
+    }
+
+    //////////////////////////////////////////////
+    //////////      Search for Exogam    /////////
+    //////////////////////////////////////////////
+    else if (LineBuffer.compare(0, 11, "EXOGAMArray") == 0 && Exogam == false) {
+#ifdef INC_EXOGAM
+      Exogam = true ;
+      cout << "//////// Exogam ////////" << endl << endl;
+
+      // Instantiate the new array as a VDetector Object
+      VDetector* myDetector = new TExogamPhysics();
+
+      // Read Position of Telescope
+      ConfigFile.close();
+      myDetector->ReadConfiguration(Path);
+      ConfigFile.open(Path.c_str());
+
+      // Add array to the VDetector Vector
+      AddDetector("EXOGAM", myDetector);
+#endif
+    }
+
+   
     ////////////////////////////////////////////
     //////////// Search for Gaspard ////////////
     ////////////////////////////////////////////
@@ -162,66 +290,60 @@ void DetectorManager::ReadConfigurationFile(string Path)   {
       AddDetector("HYDE2", myDetector);
 #endif
     }
-    ////////////////////////////////////////////
-    ///////////// Search for Paris /////////////
-    ////////////////////////////////////////////
-    else if (LineBuffer.compare(0, 5, "Paris") == 0 && ParisDet == false) {
-#ifdef INC_PARIS
-      ParisDet = true;
-      cout << "//////// Paris ////////" << endl << endl;
+    
+    ///////////////////////////////////////////////////////
+    ///////////// Search for Ionisation Chamber ///////////
+    ///////////////////////////////////////////////////////
+    else if (LineBuffer.compare(0, 17, "IonisationChamber") == 0 && IonisationChamber == false) {
+#ifdef INC_CHIO
+      IonisationChamber = true;
+      cout << "//////// Ionisation Chamger ////////" << endl << endl;
 
+      /////// Case with analog electronics
       // Instantiate the new array as a VDetector Object
-      VDetector* myDetector = new Paris();
+      VDetector* myDetector_an = new TChio_anPhysics();
       // Read Position of Telescope
       ConfigFile.close();
-      myDetector->ReadConfiguration(Path);
+      myDetector_an->ReadConfiguration(Path);
       ConfigFile.open(Path.c_str());
 
       // Add array to the VDetector Vector
-      AddDetector("PARIS", myDetector);
-#endif
-    }
-    ////////////////////////////////////////////
-    ///////////// Search for Paris' Shield /////
-    ////////////////////////////////////////////
-    else if (LineBuffer.compare(0, 6, "Shield") == 0 && ShieldDet == false) {
-#ifdef INC_SHIELD
-      ShieldDet = true;
-      cout << "//////// Shield ////////" << endl << endl;
+      AddDetector("Chio_an", myDetector_an);
 
+
+      /////// Case with digital electronics
       // Instantiate the new array as a VDetector Object
-      VDetector* myDetector = new Shield();
+      VDetector* myDetector_dig = new TChio_digPhysics();
       // Read Position of Telescope
       ConfigFile.close();
-      myDetector->ReadConfiguration(Path);
+      myDetector_dig->ReadConfiguration(Path);
       ConfigFile.open(Path.c_str());
 
       // Add array to the VDetector Vector
-      AddDetector("SHIELD", myDetector);
+      AddDetector("Chio_dig", myDetector_dig);
 #endif
     }
 
     ////////////////////////////////////////////
-    //////  Search for Annular S1 Array   //////
+    ///////////// Search for LaBr3 ///////////
     ////////////////////////////////////////////
-    else if (LineBuffer.compare(0, 10, "AnnularS1") == 0 && AnnularS1 == false) {
-#ifdef INC_ANNULARS1
-      AnnularS1 = true;
-      cout << "//////// Annular S1 Array ////////" << endl << endl;
+    else if (LineBuffer.compare(0, 5, "LaBr3") == 0 && LaBr3 == false) {
+#ifdef INC_LABR3
+      LaBr3 = true;
+      cout << "//////// Plastic ////////" << endl << endl;
 
       // Instantiate the new array as a VDetector Object
-      VDetector* myDetector = new TAnnularS1Physics();
-
+      VDetector* myDetector = new TLaBr3Physics();
       // Read Position of Telescope
       ConfigFile.close();
       myDetector->ReadConfiguration(Path);
       ConfigFile.open(Path.c_str());
 
       // Add array to the VDetector Vector
-      AddDetector("AnnularS1", myDetector);
+      AddDetector("LaBr3", myDetector);
 #endif
     }
-	
+
     ////////////////////////////////////////////
     ////////  Search for MUST2 Array    ////////
     ////////////////////////////////////////////
@@ -242,70 +364,50 @@ void DetectorManager::ReadConfigurationFile(string Path)   {
       AddDetector("MUST2", myDetector);
 #endif
     }
-	  
-	  ////////////////////////////////////////////
-	  ////////  Search for CHARISSA Array    ////////
-	  ////////////////////////////////////////////
-    else if (LineBuffer.compare(0, 13, "CharissaArray") == 0 && Charissa == false) {
-#ifdef INC_CHARISSA
-		Charissa = true;
-		cout << "//////// Charissa Array ////////" << endl << endl;
-		
-		// Instantiate the new array as a VDetector Object
-		VDetector* myDetector = new TCharissaPhysics();
-		
-		// Read Position of Telescope
-		ConfigFile.close();
-		myDetector->ReadConfiguration(Path);
-		ConfigFile.open(Path.c_str());
-		
-		// Add array to the VDetector Vector
-		AddDetector("Charissa", myDetector);
-#endif
-    }
 
     ////////////////////////////////////////////
-    ////////   Search for CATS Array    ////////
+    ///////////// Search for Paris /////////////
     ////////////////////////////////////////////
-    else if (LineBuffer.compare(0, 9, "CATSArray") == 0 && CATS == false) {
-#ifdef INC_CATS
-      CATS = true;
-      cout << "//////// CATS Array ////////" << endl << endl;
+    else if (LineBuffer.compare(0, 5, "Paris") == 0 && ParisDet == false) {
+#ifdef INC_PARIS
+      ParisDet = true;
+      cout << "//////// Paris ////////" << endl << endl;
 
       // Instantiate the new array as a VDetector Object
-      VDetector* myDetector = new TCATSPhysics();
-
+      VDetector* myDetector = new Paris();
       // Read Position of Telescope
       ConfigFile.close();
       myDetector->ReadConfiguration(Path);
       ConfigFile.open(Path.c_str());
 
       // Add array to the VDetector Vector
-      AddDetector("CATS", myDetector);
+      AddDetector("PARIS", myDetector);
 #endif
     }
-
-    ////////////////////////////////////////////////////
-    ////////   Search for Chateau de Cristal    ////////
-    ////////////////////////////////////////////////////
-    else if (LineBuffer.compare(0, 9, "ChateauCristal") == 14 && ChateauCristal == false) {
-#ifdef INC_CHATEAUCRISTAL
-      ChateauCristal = true;
-      cout << "//////// Chateau de Cristal Array ////////" << endl << endl;
+    ////////////////////////////////////////////
+    ///////////// Search for Paris' Shield /////
+    ////////////////////////////////////////////
+    else if (LineBuffer.compare(0, 6, "Shield") == 0 && ShieldDet == false) {
+#ifdef INC_SHIELD
+      ShieldDet = true;
+      cout << "//////// Shield ////////" << endl << endl;
 
       // Instantiate the new array as a VDetector Object
-      VDetector* myDetector = new TChateauCristalPhysics();
-
+      VDetector* myDetector = new Shield();
       // Read Position of Telescope
       ConfigFile.close();
       myDetector->ReadConfiguration(Path);
       ConfigFile.open(Path.c_str());
 
       // Add array to the VDetector Vector
-      AddDetector("ChateauCristal", myDetector);
+      AddDetector("SHIELD", myDetector);
 #endif
-      }
-      
+    }
+
+
+
+	  
+     
       ////////////////////////////////////////////
       ////////// Search for S2 (Micron)  /////////
       ////////////////////////////////////////////
@@ -326,17 +428,17 @@ void DetectorManager::ReadConfigurationFile(string Path)   {
          AddDetector("S2", myDetector);
 #endif
       }
-     
-      ////////////////////////////////////////////
-      ////////// Search for W1 (Micron)  /////////
-      ////////////////////////////////////////////
-      else if (LineBuffer.compare(0, 2, "W1") == 0 && W1 == false) {
-#ifdef INC_W1
-      W1 = true;
-      cout << "//////// W1 ////////" << endl;
+
+    ////////////////////////////////////////////
+    ///////////// Search for SPEG //////////////
+    ////////////////////////////////////////////
+    else if (LineBuffer.compare(0, 4, "SPEG") == 0 && SPEG == false) {
+#ifdef INC_SPEG
+      SPEG = true ;
+      cout << "//////// SPEG Spectrometer ////////" << endl;
 
       // Instantiate the new array as a VDetector Object
-      VDetector* myDetector = new TW1Physics();
+      VDetector* myDetector = new TSpegPhysics();
 
       // Read Position of Telescope
       ConfigFile.close();
@@ -344,7 +446,7 @@ void DetectorManager::ReadConfigurationFile(string Path)   {
       ConfigFile.open(Path.c_str());
 
       // Add array to the VDetector Vector
-      AddDetector("W1", myDetector);
+      AddDetector("SPEG", myDetector);
 #endif
     }
 
@@ -369,48 +471,6 @@ void DetectorManager::ReadConfigurationFile(string Path)   {
 #endif
     }
 
-    ////////////////////////////////////////////
-    /////////      Search for Sharc    /////////
-    ////////////////////////////////////////////
-    else if (LineBuffer.compare(0, 5, "Sharc") == 0 && Sharc == false) {
-#ifdef INC_SHARC
-      Sharc = true ;
-      cout << "//////// Sharc ////////" << endl << endl;
-
-      // Instantiate the new array as a VDetector Object
-      VDetector* myDetector = new TSharcPhysics();
-
-      // Read Position of Telescope
-      ConfigFile.close();
-      myDetector->ReadConfiguration(Path);
-      ConfigFile.open(Path.c_str());
-
-      // Add array to the VDetector Vector
-      AddDetector("Sharc", myDetector);
-#endif
-    }
-
-    //////////////////////////////////////////////
-    //////////      Search for Exogam    /////////
-    //////////////////////////////////////////////
-    else if (LineBuffer.compare(0, 11, "EXOGAMArray") == 0 && Exogam == false) {
-#ifdef INC_EXOGAM
-      Exogam = true ;
-      cout << "//////// Exogam ////////" << endl << endl;
-
-      // Instantiate the new array as a VDetector Object
-      VDetector* myDetector = new TExogamPhysics();
-
-      // Read Position of Telescope
-      ConfigFile.close();
-      myDetector->ReadConfiguration(Path);
-      ConfigFile.open(Path.c_str());
-
-      // Add array to the VDetector Vector
-      AddDetector("EXOGAM", myDetector);
-#endif
-    }
-
     ////////////////////////////////////////////
     ///////////// Search for Plastic ///////////
     ////////////////////////////////////////////
@@ -430,25 +490,30 @@ void DetectorManager::ReadConfigurationFile(string Path)   {
       AddDetector("Plastic", myDetector);
 #endif
     }
+
+
     ////////////////////////////////////////////
-    ///////////// Search for LaBr3 ///////////
+    /////////      Search for Sharc    /////////
     ////////////////////////////////////////////
-    else if (LineBuffer.compare(0, 5, "LaBr3") == 0 && LaBr3 == false) {
-#ifdef INC_LABR3
-      LaBr3 = true;
-      cout << "//////// Plastic ////////" << endl << endl;
+    else if (LineBuffer.compare(0, 5, "Sharc") == 0 && Sharc == false) {
+#ifdef INC_SHARC
+      Sharc = true ;
+      cout << "//////// Sharc ////////" << endl << endl;
 
       // Instantiate the new array as a VDetector Object
-      VDetector* myDetector = new TLaBr3Physics();
+      VDetector* myDetector = new TSharcPhysics();
+
       // Read Position of Telescope
       ConfigFile.close();
       myDetector->ReadConfiguration(Path);
       ConfigFile.open(Path.c_str());
 
       // Add array to the VDetector Vector
-      AddDetector("LaBr3", myDetector);
+      AddDetector("Sharc", myDetector);
 #endif
-    }    ////////////////////////////////////////////
+    }
+    
+    ////////////////////////////////////////////
     ///////////// Search for SiLi ///////////
     ////////////////////////////////////////////
     else if (LineBuffer.compare(0, 4, "SiLi") == 0 && SiLi == false) {
@@ -466,7 +531,8 @@ void DetectorManager::ReadConfigurationFile(string Path)   {
       // Add array to the VDetector Vector
       AddDetector("SiLi", myDetector);
 #endif
-    }    ////////////////////////////////////////////
+    } 
+    ////////////////////////////////////////////
     ///////////// Search for SiRes ///////////
     ////////////////////////////////////////////
     else if (LineBuffer.compare(0, 5, "SiRes") == 0 && SiRes == false) {
@@ -485,50 +551,17 @@ void DetectorManager::ReadConfigurationFile(string Path)   {
       AddDetector("SiRes", myDetector);
 #endif
     }
-    ///////////////////////////////////////////////////////
-    ///////////// Search for Ionisation Chamber ///////////
-    ///////////////////////////////////////////////////////
-    else if (LineBuffer.compare(0, 17, "IonisationChamber") == 0 && IonisationChamber == false) {
-#ifdef INC_CHIO
-      IonisationChamber = true;
-      cout << "//////// Ionisation Chamger ////////" << endl << endl;
-
-      /////// Case with analog electronics
-      // Instantiate the new array as a VDetector Object
-      VDetector* myDetector_an = new TChio_anPhysics();
-      // Read Position of Telescope
-      ConfigFile.close();
-      myDetector_an->ReadConfiguration(Path);
-      ConfigFile.open(Path.c_str());
-
-      // Add array to the VDetector Vector
-      AddDetector("Chio_an", myDetector_an);
-
-
-      /////// Case with digital electronics
-      // Instantiate the new array as a VDetector Object
-      VDetector* myDetector_dig = new TChio_digPhysics();
-      // Read Position of Telescope
-      ConfigFile.close();
-      myDetector_dig->ReadConfiguration(Path);
-      ConfigFile.open(Path.c_str());
-
-      // Add array to the VDetector Vector
-      AddDetector("Chio_dig", myDetector_dig);
-#endif
-    }
-
-
+ 
     ////////////////////////////////////////////
-    ///////////// Search for SPEG //////////////
+    ////////////// Search for TAC //////////////
     ////////////////////////////////////////////
-    else if (LineBuffer.compare(0, 4, "SPEG") == 0 && SPEG == false) {
-#ifdef INC_SPEG
-      SPEG = true ;
-      cout << "//////// SPEG Spectrometer ////////" << endl;
+    else if (LineBuffer.compare(0, 3, "TAC") == 0 && TAC == false) {
+#ifdef INC_MISC
+      TAC = true ;
+      cout << "//////// TAC ////////" << endl;
 
       // Instantiate the new array as a VDetector Object
-      VDetector* myDetector = new TSpegPhysics();
+      VDetector* myDetector = new TTacPhysics();
 
       // Read Position of Telescope
       ConfigFile.close();
@@ -536,52 +569,51 @@ void DetectorManager::ReadConfigurationFile(string Path)   {
       ConfigFile.open(Path.c_str());
 
       // Add array to the VDetector Vector
-      AddDetector("SPEG", myDetector);
+      AddDetector("TAC", myDetector);
 #endif
     }
 
-    ///////////////////////////////////////////////////////////
-    //////////// Search for EXL Csi gamma detector ////////////
-    ///////////////////////////////////////////////////////////
-    else if (LineBuffer.compare(0, 3, "EXL") == 0 && EXL == false) {
-#ifdef INC_EXL
-      EXL = true ;
-      cout << "//////// EXL Csi gamma detector ////////" << endl;
+   
+    ////////////////////////////////////////////
+    ////////// Search for Tiara Hyball /////////
+    ////////////////////////////////////////////
+    else if (LineBuffer.compare(0, 11, "TiaraHyball") == 0 && TiaraHyball == false) {
+#ifdef INC_TIARA
+      TiaraHyball = true;
+      cout << "//////// Tiara Hyball ////////" << endl << endl;
 
       // Instantiate the new array as a VDetector Object
-      VDetector* myDetector = new TExlPhysics();
-
+      VDetector* myDetector = new TTiaraHyballPhysics();
       // Read Position of Telescope
       ConfigFile.close();
       myDetector->ReadConfiguration(Path);
       ConfigFile.open(Path.c_str());
 
       // Add array to the VDetector Vector
-      AddDetector("EXL", myDetector);
+      AddDetector("TiaraHyball", myDetector);
 #endif
     }
-
+    
     ////////////////////////////////////////////
-    ////////////// Search for TAC //////////////
+    ///////// Search for Tiara Barrel //////////
     ////////////////////////////////////////////
-    else if (LineBuffer.compare(0, 3, "TAC") == 0 && TAC == false) {
-#ifdef INC_MISC
-      TAC = true ;
-      cout << "//////// TAC ////////" << endl;
+    else if (LineBuffer.compare(0, 11, "TiaraBarrel") == 0 && TiaraBarrel == false) {
+#ifdef INC_TIARA
+      TiaraBarrel = true;
+      cout << "//////// Tiara Barrel ////////" << endl << endl;
 
       // Instantiate the new array as a VDetector Object
-      VDetector* myDetector = new TTacPhysics();
-
+      VDetector* myDetector = new TTiaraBarrelPhysics();
       // Read Position of Telescope
       ConfigFile.close();
       myDetector->ReadConfiguration(Path);
       ConfigFile.open(Path.c_str());
 
       // Add array to the VDetector Vector
-      AddDetector("TAC", myDetector);
+      AddDetector("TiaraBarrel", myDetector);
 #endif
     }
-
+ 
     ////////////////////////////////////////////
     ///////////// Search for Trifoil ///////////
     ////////////////////////////////////////////
@@ -601,46 +633,32 @@ void DetectorManager::ReadConfigurationFile(string Path)   {
       AddDetector("Trifoil", myDetector);
 #endif
     }
-    
-    ////////////////////////////////////////////
-    ///////////// Search for Hyball ////////////
-    ////////////////////////////////////////////
-    else if (LineBuffer.compare(0, 11, "TiaraHyball") == 0 && TiaraHyball == false) {
-#ifdef INC_TIARA
-      TiaraHyball = true;
-      cout << "//////// Tiara Hyball ////////" << endl << endl;
+ 
+      ////////////////////////////////////////////
+      ////////// Search for W1 (Micron)  /////////
+      ////////////////////////////////////////////
+      else if (LineBuffer.compare(0, 2, "W1") == 0 && W1 == false) {
+#ifdef INC_W1
+      W1 = true;
+      cout << "//////// W1 ////////" << endl;
 
       // Instantiate the new array as a VDetector Object
-      VDetector* myDetector = new TTiaraHyballPhysics();
+      VDetector* myDetector = new TW1Physics();
+
       // Read Position of Telescope
       ConfigFile.close();
       myDetector->ReadConfiguration(Path);
       ConfigFile.open(Path.c_str());
 
       // Add array to the VDetector Vector
-      AddDetector("TiaraHyball", myDetector);
+      AddDetector("W1", myDetector);
 #endif
     }
-    
-    ////////////////////////////////////////////
-    ///////// Search for Tiara barrel //////////
-    ////////////////////////////////////////////
-    else if (LineBuffer.compare(0, 11, "TiaraBarrel") == 0 && TiaraBarrel == false) {
-#ifdef INC_TIARA
-      TiaraBarrel = true;
-      cout << "//////// Tiara Barrel ////////" << endl << endl;
 
-      // Instantiate the new array as a VDetector Object
-      VDetector* myDetector = new TTiaraBarrelPhysics();
-      // Read Position of Telescope
-      ConfigFile.close();
-      myDetector->ReadConfiguration(Path);
-      ConfigFile.open(Path.c_str());
+///////////////////////////////////////////////////////////////////////////////
+//                           END OF DETECTOR                                 //
+///////////////////////////////////////////////////////////////////////////////
 
-      // Add array to the VDetector Vector
-      AddDetector("TiaraBarrel", myDetector);
-#endif
-    } 
     ////////////////////////////////////////////
     //////////// Search for Target /////////////
     ////////////////////////////////////////////
-- 
GitLab