diff --git a/Inputs/DetectorConfiguration/Sharc.detector b/Inputs/DetectorConfiguration/Sharc.detector
index 5f4dbff2d3f6bcca31bc921d48d69a08807081fa..3bf7193ed3366e88119da2de1b785d9aba308d20 100644
--- a/Inputs/DetectorConfiguration/Sharc.detector
+++ b/Inputs/DetectorConfiguration/Sharc.detector
@@ -4,7 +4,7 @@ GeneralTarget
 
 %0.2mg/cm2
 Target
-	THICKNESS= 4.8
+	THICKNESS= 9
 	RADIUS=	5
 	MATERIAL= CD2
 	ANGLE= 0
@@ -82,4 +82,15 @@ Sharc
     R= 0
     Phi= 270
     ThicknessDector= 500
-
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+Plastic
+	X= 0
+	Y= 0
+	Z= 400
+	Thickness= 0.025
+	Shape= Square
+	Height= 40
+	Width= 40
+	Scintillator= BC400
+	LeadThickness= 0.09
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
diff --git a/Inputs/DetectorConfiguration/hira.detector b/Inputs/DetectorConfiguration/hira.detector
index 0dd0386567121029abaa54aa058270fc3a440bb7..c353a7fff3e0f0d1c1188cdecf2da78e848f689f 100755
--- a/Inputs/DetectorConfiguration/hira.detector
+++ b/Inputs/DetectorConfiguration/hira.detector
@@ -7,9 +7,9 @@ GeneralTarget
 % Radius in mm
 % Temperature in K, Pressure in bar
 Target
-	THICKNESS= 0.2
-    	ANGLE= 0
-	RADIUS=	5
+	THICKNESS= 6.26
+  ANGLE= 0
+	RADIUS=	10
 	MATERIAL= CD2
 	X= 0
 	Y= 0
diff --git a/Inputs/EventGenerator/11Be_d3He.reaction b/Inputs/EventGenerator/11Be_d3He.reaction
new file mode 100644
index 0000000000000000000000000000000000000000..474135ab865127b539b00e24f4b0f61ea8d334f8
--- /dev/null
+++ b/Inputs/EventGenerator/11Be_d3He.reaction
@@ -0,0 +1,53 @@
+Beam
+  Particle= 11Be
+  Energy= 770
+	SigmaEnergy= 4
+	SigmaThetaX= 0.
+	SigmaPhiY= 0.
+	SigmaX= 3
+	SigmaY= 3
+  MeanThetaX= 0
+  MeanPhiY= 0
+  MeanX= 0
+  MeanY= 0
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+TwoBodyReaction
+	Beam= 11Be
+	Target= 2H
+	Light= 3He
+	Heavy= 10Li
+	ExcitationEnergyLight= 0.0
+	ExcitationEnergyHeavy= 0.0
+  CrossSectionPath= 11Li(d,3He)10He.txt	CS
+	ShootLight= 1
+	ShootHeavy= 0
+  
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+    
+%ParticleDecay 10Li
+  Daughter= 9Li n
+  ExcitationEnergy= 0.1 0
+  DifferentialCrossSection= flat.txt	particle9He
+  shoot= 1 1
+    
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+%GammaDecay 9Li
+  Cascade
+    BranchingRatio= 30
+    Energies= 0.1
+    DifferentialCrossSection= 11Li(d,3He)10He.txt	Gamma9He
+  Cascade
+    BranchingRatio= 70
+    Energies= 0.05 0.5
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+%ParticleDecay 9Li
+  Daughter= 8Li n
+  DifferentialCrossSection= flat.txt
+  shoot= 1 1
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
diff --git a/Inputs/EventGenerator/34Ar_pd.reaction b/Inputs/EventGenerator/34Ar_pd.reaction
new file mode 100644
index 0000000000000000000000000000000000000000..31fecb53291a524c0bc4fcd8b10a641c0a4f27f7
--- /dev/null
+++ b/Inputs/EventGenerator/34Ar_pd.reaction
@@ -0,0 +1,28 @@
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%  Reaction file for 60Fe(d,p)61Fe reaction  %%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+Beam
+  Particle= 34Ar
+  Energy= 2380
+  SigmaEnergy= 10
+	SigmaX= 2
+	SigmaY= 2
+	SigmaThetaX= 0 
+	SigmaPhiY= 0
+  MeanThetaX= 0
+  MeanPhiY= 0
+  MeanX= 0
+  MeanY= 0
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+TwoBodyReaction
+	Beam= 34Ar
+	Target= 1H
+	Light= 2H
+	Heavy= 33Ar
+	ExcitationEnergyHeavy= 0.0
+	ExcitationEnergyLight= 0.0
+  CrossSectionPath= flat.txt CS
+	ShootLight= 1
+	ShootHeavy= 0
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
diff --git a/Inputs/EventGenerator/46Ar_pd.reaction b/Inputs/EventGenerator/46Ar_pd.reaction
new file mode 100644
index 0000000000000000000000000000000000000000..f8b655b7719e94a44acad1ebdb8fb869fd62aaf0
--- /dev/null
+++ b/Inputs/EventGenerator/46Ar_pd.reaction
@@ -0,0 +1,28 @@
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%  Reaction file for 46Ar(p,d)45Ar reaction  %%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+Beam
+  Particle= 46Ar
+  Energy= 3220
+  SigmaEnergy= 14
+	SigmaX= 2
+	SigmaY= 2
+	SigmaThetaX= 0 
+	SigmaPhiY= 0
+  MeanThetaX= 0
+  MeanPhiY= 0
+  MeanX= 0
+  MeanY= 0
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+TwoBodyReaction
+	Beam= 46Ar
+	Target= 1H
+	Light= 2H
+	Heavy= 45Ar
+	ExcitationEnergyHeavy= 0.542
+	ExcitationEnergyLight= 0.0
+  CrossSectionPath= flat.txt CS
+	ShootLight= 1
+	ShootHeavy= 0
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
diff --git a/Inputs/EventGenerator/proton.source b/Inputs/EventGenerator/proton.source
index 57b77550c40cfbf0a8ddfb723bd1aebe0c976bb9..f71dd7e45f9a83f1255d41943076d7e6dae2e507 100644
--- a/Inputs/EventGenerator/proton.source
+++ b/Inputs/EventGenerator/proton.source
@@ -4,10 +4,10 @@
 %			   Energy are given in MeV , Position in mm				  %	
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 Isotropic
-	EnergyLow=  0	
-	EnergyHigh= 201
+	EnergyLow=  20	
+	EnergyHigh= 20
 	HalfOpenAngleMin= 0
-	HalfOpenAngleMax= 1
+	HalfOpenAngleMax= 5
 	x0= 0	
 	y0= 0	
 	z0= 0	
diff --git a/NPAnalysis/Example1/Analysis.cxx b/NPAnalysis/Example1/Analysis.cxx
index febc1f59403b6a9c82320d04ffa931c7a5d09738..3581d19f045e15c2ca2252dcf050a4ae3d5f268d 100644
--- a/NPAnalysis/Example1/Analysis.cxx
+++ b/NPAnalysis/Example1/Analysis.cxx
@@ -63,7 +63,7 @@ void Analysis::Init(){
   He3CD2 = EnergyLoss("He3_CD2.G4table","G4Table",100 );
   He3Al = EnergyLoss("He3_Al.G4table","G4Table",10);
   He3Si = EnergyLoss("He3_Si.G4table","G4Table",10);
-  Li11CD2 = EnergyLoss("Li11[0.0]_CD2.G4table","G4Table",100);
+  //Li11CD2 = EnergyLoss("Li11[0.0]_CD2.G4table","G4Table",100);
 }
 
 ////////////////////////////////////////////////////////////////////////////////
@@ -79,7 +79,7 @@ void Analysis::TreatEvent(){
   TVector3 BeamDirection = Initial->GetBeamDirection();
   // Beam energy is measured using F3 and F2 plastic TOF
   double BeamEnergy = Rand.Gaus(Initial->GetIncidentInitialKineticEnergy(),4.5);
-  BeamEnergy = Li11CD2.Slow(BeamEnergy,TargetThickness/2.,0);
+  //BeamEnergy = Li11CD2.Slow(BeamEnergy,TargetThickness/2.,0);
 
   He10Reaction->SetBeamEnergy(BeamEnergy);
   //////////////////////////// LOOP on MUST2 + SSSD Hit //////////////////
diff --git a/NPAnalysis/Example1/Analysis.h b/NPAnalysis/Example1/Analysis.h
index d7f368ed30c33f0fd6b14a0d33b0aba1db929bc9..10215aa6d91645e0ed52fde8a5c213cc9c1e2b43 100644
--- a/NPAnalysis/Example1/Analysis.h
+++ b/NPAnalysis/Example1/Analysis.h
@@ -22,7 +22,7 @@
  *                                                                           *
  *****************************************************************************/
 #include"NPVAnalysis.h"
-#include"TAnnularS1Physics.h"
+#include"THiraPhysics.h"
 #include "TMust2Physics.h"
 #include "TSSSDPhysics.h"
 #include "TInitialConditions.h"
@@ -76,6 +76,5 @@ class Analysis: public NPL::VAnalysis{
     TMust2Physics* M2;
     TSSSDPhysics* SSSD;
     TInitialConditions* Initial;
-
 };
 #endif
diff --git a/NPAnalysis/Hira/Analysis.cxx b/NPAnalysis/Hira/Analysis.cxx
new file mode 100644
index 0000000000000000000000000000000000000000..c95877e97133df7a28e433a82ab171a09f116875
--- /dev/null
+++ b/NPAnalysis/Hira/Analysis.cxx
@@ -0,0 +1,196 @@
+#include "Analysis.h"
+using namespace std;
+
+int main(int argc, char** argv)
+{
+   // command line parsing
+   NPOptionManager* myOptionManager = NPOptionManager::getInstance(argc,argv);
+
+   // Instantiate RootInput
+   string runToReadfileName = myOptionManager->GetRunToReadFile();
+   RootInput:: getInstance(runToReadfileName);
+
+   // if input files are not given, use those from TAsciiFile
+   if (myOptionManager->IsDefault("DetectorConfiguration")) {
+      string name = RootInput::getInstance()->DumpAsciiFile("DetectorConfiguration");
+      myOptionManager->SetDetectorFile(name);
+   }
+
+   // get input files from NPOptionManager
+   string detectorfileName    = myOptionManager->GetDetectorFile();
+   string calibrationfileName = myOptionManager->GetCalibrationFile();
+   string OutputfileName      = myOptionManager->GetOutputFile();
+   
+   // Instantiate RootOutput
+   RootOutput::getInstance("Analysis/"+OutputfileName, "AnalysedTree");
+   
+   // Instantiate the detector using a file
+   NPL::DetectorManager* myDetector = new DetectorManager();
+   myDetector->ReadConfigurationFile(detectorfileName);
+    
+   // Get the formed Chained Tree and Treat it
+   TChain* Chain = RootInput:: getInstance() -> GetChain();
+    
+    //	Instantiate some Reaction
+    NPL::Reaction*  TransfertReaction = new Reaction								;
+    TransfertReaction	->	ReadConfigurationFile("34Ar_pd.reaction")	;
+    //TransfertReaction	->	ReadConfigurationFile("46Ar_pd.reaction")	;
+    //TransfertReaction	->	ReadConfigurationFile("11Be_d3He.reaction")	;
+    
+    //Get Detector pointer :
+    THiraPhysics* Hira 	  = (THiraPhysics*) 			myDetector -> GetDetector("HIRAArray")		;
+    
+    //TInteractionCoordinate
+    TInteractionCoordinates* InteractionCoordinates = new TInteractionCoordinates();
+    Chain->SetBranchStatus("InteractionCoordinates",true);
+    Chain->SetBranchStatus("fDetected_*",true);
+    Chain->SetBranchAddress("InteractionCoordinates",&InteractionCoordinates);
+    RootOutput::getInstance()->GetTree()->Branch("InteractionCoordinates","TInteractionCoordinates",&InteractionCoordinates);
+    
+    //TInitialConditions
+    TInitialConditions* InitialConditions = new TInitialConditions();
+    Chain->SetBranchStatus("InitialConditions",true);
+    Chain->SetBranchStatus("fIC_*",true);
+    Chain->SetBranchAddress("InitialConditions",&InitialConditions);
+    RootOutput::getInstance()->GetTree()->Branch("InitialConditions","TInitialConditions",&InitialConditions);
+    
+    RootOutput::getInstance()->GetTree()->Branch( "ThetaLab" , &ThetaLab , "ThetaLab/D" );
+    RootOutput::getInstance()->GetTree()->Branch( "PhiLab" , &PhiLab , "PhiLab/D" )  ;
+    RootOutput::getInstance()->GetTree()->Branch("ThetaCM", &ThetaCM,"ThetaCM/D") 	;
+    RootOutput::getInstance()->GetTree()->Branch( "E_ThinSi" , &E_ThinSi , "E_ThinSi/D" )  ;
+    RootOutput::getInstance()->GetTree()->Branch( "E_ThickSi" , &E_ThickSi , "E_ThickSi/D" )  ;
+    RootOutput::getInstance()->GetTree()->Branch( "E_CsI" , &E_CsI , "E_CsI/D" )  ;
+    RootOutput::getInstance()->GetTree()->Branch( "ELab" , &ELab , "ELab/D" )  ;
+    RootOutput::getInstance()->GetTree()->Branch("ExcitationEnergy", &ExcitationEnergy,"ExcitationEnergy/D") ;
+    RootOutput::getInstance()->GetTree()->Branch( "X" , &X , "X/D" )  ;
+    RootOutput::getInstance()->GetTree()->Branch( "Y" , &Y , "Y/D" )  ;
+    RootOutput::getInstance()->GetTree()->Branch( "Z" , &Z , "Z/D" )  ;
+    RootOutput::getInstance()->GetTree()->Branch( "TelescopeNumber" , &TelescopeNumber , "TelescopeNumber/D" )  ;
+
+   // Get number of events to treat
+   cout << endl << "///////// Starting Analysis ///////// "<< endl;
+   int nentries = Chain->GetEntries();
+   cout << " Number of Event to be treated : " << nentries << endl;
+   clock_t begin = clock();
+   clock_t end = begin;
+    
+    double EnergyThreshold = 0.;
+
+   // main loop on entries
+   for (int i = 0; i < nentries; i++) {
+       if (i%10000 == 0 && i!=0)  {
+           cout.precision(5);
+           end = clock();
+           double TimeElapsed = (end-begin) / CLOCKS_PER_SEC;
+           double percent = (double)i/nentries;
+           double TimeToWait = (TimeElapsed/percent) - TimeElapsed;
+           cout  << "                                                                                                "<< flush;
+           cout  << "\r Progression:" << percent*100 << " % \t | \t Remaining time : ~" <<  TimeToWait <<"s"<< flush;
+       }
+       else if (i == nentries-1)  cout << "\r Progression:" << " 100% " <<endl;
+
+       // get data
+       Chain -> GetEntry(i);
+       ReInitOuputValue();
+
+       myDetector->ClearEventPhysics();
+       myDetector->BuildPhysicalEvent();
+       
+       if(Hira -> ThickSi_E.size() == 1){
+           for(int countHira = 0 ; countHira < Hira->ThickSi_E.size() ; countHira++){
+               
+               TelescopeNumber      = Hira->TelescopeNumber[countHira];
+               
+               TargetThickness      = myDetector->GetTargetThickness();
+               
+               X = Hira->GetPositionOfInteraction(0).X();
+               Y = Hira->GetPositionOfInteraction(0).Y();
+               Z = Hira->GetPositionOfInteraction(0).Z();
+               
+               TVector3 PositionOnHira         = TVector3(X,Y,Z);
+               TVector3 ZUnit                  = TVector3(0,0,1);
+               //TVector3 TelescopeNormal      = -Hira->GetTelescopeNormal(countHira);
+               TVector3 TargetNormal            = TVector3(0,0,1);//TVector3(-sin(TargetAngle*deg),0,cos(TargetAngle*deg));
+               
+               double X_target					= InitialConditions->GetIncidentPositionX();
+               double Y_target					= InitialConditions->GetIncidentPositionY();
+               double Z_target					= InitialConditions->GetIncidentPositionZ();
+               
+               TVector3 PositionOnTarget		= TVector3(X_target,Y_target,Z_target);
+               //TVector3 PositionOnTarget		= TVector3(0,0,0);
+               TVector3 HitDirection			= PositionOnHira - PositionOnTarget;
+               TVector3 HitDirectionUnit		= HitDirection.Unit();
+               
+               //double ThetaNormalHira			= HitDirection.Angle(TelescopeNormal);
+               double ThetaNormalTarget         = HitDirection.Angle(TargetNormal);
+               
+               //double ThetaBeam				= InitialConditions->GetICIncidentAngleTheta(countHira);
+               //double PhiBeam					= InitialConditions->GetICIncidentAnglePhi(countHira);
+               
+               TVector3 BeamDirection			= InitialConditions->GetBeamDirection();
+               
+               //TVector3(sin(ThetaBeam*deg)*cos(PhiBeam*deg),sin(ThetaBeam*deg)*sin(PhiBeam*deg),cos(ThetaBeam*deg));
+               
+               double XBeam					= BeamDirection.X();
+               double YBeam					= BeamDirection.Y();
+               double ZBeam					= BeamDirection.Z();
+               
+               ThetaLab						= BeamDirection.Angle(HitDirection);
+               ThetaLab						= ThetaLab/deg;
+               
+               PhiLab                       = HitDirection.Phi()/deg;
+               
+               E_ThickSi                    = Hira->ThickSi_E[countHira];
+               E_ThinSi                     = Hira->ThinSi_E[countHira];
+               ELab = E_ThinSi + E_ThickSi;
+               if(Hira->CsI_E.size() == 1){
+                   for(int countCsI =0; countCsI<Hira->CsI_E.size(); countCsI++){
+                       E_CsI = Hira->CsI_E[countCsI];
+                       if(E_CsI>EnergyThreshold)ELab += E_CsI;
+                   }
+               }
+               else E_CsI = -1000;
+               
+               ELab	= EL_deuteron_CH2.EvaluateInitialEnergy(ELab,
+                                                            (TargetThickness/2)*micrometer,
+                                                            ThetaNormalTarget);
+
+            
+               // ********************** Angle in the CM frame *****************************
+               TransfertReaction -> SetNuclei3(ELab, ThetaLab*deg);
+               ThetaCM          = TransfertReaction->GetThetaCM()/deg;
+               ExcitationEnergy	= TransfertReaction->GetExcitation4();
+               
+               RootOutput::getInstance()->GetTree()->Fill();
+           }
+       }
+    }
+
+   cout << "A total of " << nentries << " event has been annalysed " << endl ;
+
+   RootOutput::getInstance()->Destroy();
+   RootInput::getInstance()->Destroy();
+   NPOptionManager::getInstance()->Destroy();
+
+   return 0 ;
+}
+
+
+/////////////////////////////////////////////////////////////////////////////////////////
+// On reinitialise les valeurs des branches de sorties à chaque entrée dans la boucle :
+void ReInitOuputValue()
+{
+    E_ThinSi    = -1000;
+    E_ThickSi   = -1000;
+    E_CsI       = -1000;
+    ELab        = -1000;
+    ThetaLab    = -1000;
+    PhiLab      = -1000;
+    ThetaCM     = -1000;
+    ExcitationEnergy = -1000;
+    X           = -1000;
+    Y           = -1000;
+    Z           = -1000;
+    TelescopeNumber = -1;
+}
+
diff --git a/NPAnalysis/Hira/Analysis.h b/NPAnalysis/Hira/Analysis.h
new file mode 100644
index 0000000000000000000000000000000000000000..af98dbbc412459fe3b6bd80519057e649d4a900b
--- /dev/null
+++ b/NPAnalysis/Hira/Analysis.h
@@ -0,0 +1,141 @@
+// You can use this file to declare your spectra, file, energy loss , ... and whatever you want.
+// This way you can remove all unnecessary declaration in the main programm.
+// In order to help debugging and organizing we use Name Space.
+
+/////////////////////////////////////////////////////////////////////////////////////////////////
+// -------------------------------------- VARIOUS INCLUDE ---------------------------------------
+
+// NPA
+#include "NPDetectorManager.h"
+#include "NPOptionManager.h"
+
+// STL C++
+#include <iostream>
+#include <fstream>
+#include <sstream>
+#include <string>
+#include <cmath>
+#include <cstdlib>
+
+// ROOT
+#include <TROOT.h>
+#include <TChain.h>
+#include <TFile.h>
+#include <TLeaf.h>
+#include <TVector3.h>
+#include <TRandom.h>
+
+// NPL
+#include "RootInput.h"
+#include "RootOutput.h"
+#include "NPReaction.h"
+#include "TInitialConditions.h"
+#include "TInteractionCoordinates.h"
+#include "THiraData.h"
+#include "THiraPhysics.h"
+
+
+// Use CLHEP System of unit and Physical Constant
+#include "NPGlobalSystemOfUnits.h"
+#include "NPPhysicalConstants.h"
+
+Double_t TargetThickness;
+Double_t E_ThinSi = 0;
+Double_t E_ThickSi = 0;
+Double_t E_CsI = 0;
+Double_t ELab = 0;
+Double_t ThetaLab = 0;
+Double_t PhiLab = 0;
+Double_t ThetaLab_simu = 0;
+Double_t ThetaCM = 0;
+Double_t ExcitationEnergy = 0;
+Double_t X = 0;
+Double_t Y = 0;
+Double_t Z = 0;
+Double_t TelescopeNumber = 0;
+
+Double_t BeamEnergy = 0;
+
+void ReInitOuputValue();
+
+// ----------------------------------------------------------------------------------------------
+double ThetaCalculation (TVector3 A , TVector3 B) ;
+/////////////////////////////////////////////////////////////////////////////////////////////////
+// ----------------------------------- DOUBLE, INT, BOOL AND MORE -------------------------------
+namespace VARIABLE
+	{
+		//	Declare your Variable here:
+		
+			double X1,Y1,Z1				;
+			int N1,N2 = 0				;
+			bool check= false			;
+	
+		//	A Usefull Simple Random Generator
+			TRandom Rand;
+	}
+	 
+using namespace VARIABLE ;
+// ----------------------------------------------------------------------------------------------
+
+
+
+/////////////////////////////////////////////////////////////////////////////////////////////////
+// -----------------------------------GRAPH------------------------------------------------------
+#include <TObject.h>
+#include <TH1.h>
+#include <TH1F.h>
+#include <TH2.h>
+#include <TH2F.h>
+#include <TGraph2D.h>
+
+namespace GRAPH
+	{
+		//	Declare your Spectra here:
+	
+			TH1F *myHist1D = new TH1F("Hist1D","Histogramm 1D ; x ; count", 1000 , -5 , 5 )					;
+	
+			TH2F *myHist2D = new TH2F("Hist2D","Histogramm 2D ; x ; y ", 128 , 1 , 128 , 128 , 1 , 128 )	;
+
+	}
+
+using namespace GRAPH ;
+// --------------------------------------------------------------------------------------------
+
+
+
+///////////////////////////////////////////////////////////////////////////////////////////////
+// -----------------------------------CUT------------------------------------------------------
+#include <TCutG.h>
+namespace CUT
+	{
+		//	Declare your Cut here:
+
+	}
+
+using namespace CUT ;
+// --------------------------------------------------------------------------------------------
+
+
+
+////////////////////////////////////////////////////////////////////////////////////////////////
+// -----------------------------------ENERGY LOSS----------------------------------------------
+#include "NPEnergyLoss.h"
+using namespace NPL ;
+namespace ENERGYLOSS
+	{
+	
+            //EnergyLoss EL_deuteron_CH2 =  EnergyLoss("deuteron_CH2.G4table","G4Table",100 );
+         EnergyLoss EL_deuteron_CH2 =  EnergyLoss("He3_CD2.G4table","G4Table",100 );
+		//	Declare your Energy loss here	:
+	/*		EnergyLoss DeuerontTarget = EnergyLoss 	(	"CD2.txt" 	,
+														100 		,
+														1,
+														1			);
+	*/
+	}
+	
+using namespace ENERGYLOSS ;
+// ----------------------------------------------------------------------------------------------
+/////////////////////////////////////////////////////////////////////////////////////////////////
+
+
diff --git a/NPAnalysis/Hira/Makefile b/NPAnalysis/Hira/Makefile
new file mode 100644
index 0000000000000000000000000000000000000000..bdfccb1e4ff94a2d3dfe6398de9f70c90b206d31
--- /dev/null
+++ b/NPAnalysis/Hira/Makefile
@@ -0,0 +1,30 @@
+# include same architecture file than for NPLib
+# so that consistency is ensured
+include $(NPTOOL)/NPLib/Makefile.arch
+
+# additional libraries
+LIBRARY  = `$(NPTOOL)/NPLib/liblist`
+
+PROGRAMS	= Analysis
+
+all:	$(PROGRAMS)
+
+Analysis:	Analysis.o
+	$(LD) $(LDFLAGS) $^ $(LIBS) $(LIBRARY) $(OutPutOpt) $@
+	@echo "$@ done"
+	
+
+# rule for creating .o from .cxx
+.SUFFIXES: .$(SrcSuf)
+.$(SrcSuf).$(ObjSuf):
+	$(CXX) $(CXXFLAGS) $(INCLUDE) -c $<
+
+# some cleaning
+clean:
+	rm -rf *.o
+
+distclean:
+	make clean; rm $(PROGRAMS)
+
+# dependences
+Analysis.o:	Analysis.cxx	Analysis.h
diff --git a/NPAnalysis/Hira/RunToTreat.txt b/NPAnalysis/Hira/RunToTreat.txt
new file mode 100644
index 0000000000000000000000000000000000000000..3a48e00e5e11c3504a43a2c7a5a18b4ae360e136
--- /dev/null
+++ b/NPAnalysis/Hira/RunToTreat.txt
@@ -0,0 +1,10 @@
+TTreeName 
+	SimulatedTree
+RootFileName 
+	%/Users/pierremorfouace/Physics/NPTool/nptool/Outputs/Simulation/46Ar_pd_gs.root
+ 	%/Users/pierremorfouace/Physics/NPTool/nptool/Outputs/Simulation/46Ar_pd_1st.root
+
+	/Users/pierremorfouace/Physics/NPTool/nptool/Outputs/Simulation/test.root
+
+	
+	
diff --git a/NPAnalysis/Hira/Show.C b/NPAnalysis/Hira/Show.C
new file mode 100644
index 0000000000000000000000000000000000000000..1eac6b7b60eac3ab868e452e24cdbe556433abd3
--- /dev/null
+++ b/NPAnalysis/Hira/Show.C
@@ -0,0 +1,151 @@
+void InitChain();
+void LoadCut();
+
+TChain *chain;
+TGraph *kin;
+
+int nentries;
+
+TCutG *cut_kine;
+
+
+void Show()
+{
+    gStyle->SetOptStat(0);
+    InitChain();
+    LoadCut();
+    
+    nentries = chain->GetEntries();
+    
+    //**************** Condition ****************//
+    TString CondCut = "cut_kine";
+    TString CondTot = CondCut;//+"&&"+
+    //*******************************************//
+    
+    TCanvas* mainC0  = new TCanvas("Hira XY", "Hira XY" , 800,600);
+    TCanvas* mainC1  = new TCanvas("PID", "PID" , 1200,600);
+    TCanvas* mainC2  = new TCanvas("Kinematics", "Kinematics" , 800,600);
+    TCanvas* mainC3  = new TCanvas("Phi-Theta", "Phi-Theta" , 800,600);
+    TCanvas* mainC4  = new TCanvas("BeamSpot", "BeamSpot" , 800,600);
+    TCanvas* mainC5  = new TCanvas("ThetaCM", "ThetaCM" , 800,600);
+    TCanvas* mainC6  = new TCanvas("Efficiency", "Efficiency" , 800,600);
+    TCanvas* mainC7  = new TCanvas("CrossSection","CrossSection",800,600);
+    mainC1->Divide(2,1);
+
+    mainC0->cd();
+    chain->Draw("Y:X>>h0(300,-300,300,200,-200,200)","","colz");
+    TH2F* h0 = (TH2F*)gDirectory->FindObjectAny("h0");
+    h0->GetXaxis()->SetTitle("X (mm)");
+    h0->GetYaxis()->SetTitle("Y (mm)");
+    h0->SetTitle("");
+    
+    
+    mainC1->cd(1);
+    chain->Draw("E_ThickSi:E_CsI>>h1(1000,0,600,1000,0,30)","","colz");
+    TH2F* h1 = (TH2F*)gDirectory->FindObjectAny("h1");
+    h1->GetXaxis()->SetTitle("E_{CsI} (MeV)");
+    h1->GetYaxis()->SetTitle("E_{Si} (MeV)");
+    h1->SetTitle("");
+
+    mainC1->cd(2);
+    chain->Draw("E_ThinSi:E_ThickSi>>h12(1000,0,30,1000,0,10)","","colz");
+    TH2F* h12 = (TH2F*)gDirectory->FindObjectAny("h12");
+    h12->GetXaxis()->SetTitle("E_{Si} (MeV)");
+    h12->GetYaxis()->SetTitle("#Delta E (MeV)");
+    h12->SetTitle("");
+
+    
+    mainC2->cd();
+    chain->Draw("ELab:ThetaLab>>h2(1000,0,50,1000,0,50)","","colz");
+    h2->SetMinimum(1);
+    TH2F* h2 = (TH2F*)gDirectory->FindObjectAny("h2");
+    h2->GetXaxis()->SetTitle("#theta_{lab} (deg)");
+    h2->GetYaxis()->SetTitle("E (MeV)");
+    h2->SetTitle("");
+    
+    NPL::Reaction *r = new NPL::Reaction("11Be(d,3He)10Li@770");
+    //NPL::Reaction *r = new NPL::Reaction("34Ar(p,d)33Ar@2380");
+    //NPL::Reaction *r = new NPL::Reaction("46Ar(p,d)45Ar@3220");
+    kin = r->GetKinematicLine3();
+    
+    kin->SetLineColor(2);
+    kin->Draw("plsame");
+    
+    mainC3->cd();
+    chain->Draw("PhiLab:ThetaLab>>h3(100,0,50,720,-180,180)","","colz");
+    TH2F* h3 = (TH2F*)gDirectory->FindObjectAny("h3");
+    h3->GetXaxis()->SetTitle("#theta_{lab} (deg)");
+    h3->GetYaxis()->SetTitle("#phi_{lab} (MeV)");
+    h3->SetTitle("");
+    
+    mainC4->cd();
+    chain->Draw("fIC_Incident_Position_Y:fIC_Incident_Position_X>>h4(1000,-10,10,100,-10,10)","","colz");
+    TH2F* h4 = (TH2F*)gDirectory->FindObjectAny("h4");
+    h4->GetXaxis()->SetTitle("X_{beam} (mm)");
+    h4->GetYaxis()->SetTitle("Y_{beam} (mm)");
+    h4->SetTitle("");
+    
+    mainC5->cd();
+    chain->Draw("ThetaCM>>h5(25,0,100)",CondTot,"E1");
+    TH1F* h5 = (TH1F*)gDirectory->FindObjectAny("h5");
+    h5->GetXaxis()->SetTitle("#theta_{CM} (deg)");
+    h5->SetTitle("");
+    
+    
+    //Efficiency calculation
+    mainC6->cd();
+    TH1F *Efficiency = new TH1F("Efficiency", "Efficiency", 25, 0, 100);
+    Efficiency->SetXTitle("#theta_{CM}");
+    Efficiency->SetTitle("Efficiency");
+    Efficiency->Add(h5,4*TMath::Pi()/nentries);
+    Efficiency->Draw();
+    
+    // Cross-Section
+    mainC7->cd();
+    mainC7->SetLogy();
+    TH1F *h7 = new TH1F("h7", "h7", 25, 0, 100);
+    h7->SetXTitle("#theta_{CM}");
+    h7->SetYTitle("d#sigma/d#Omega (mb/sr)");
+    h7->SetTitle("");
+    h7->Divide(h5,Efficiency,1,nentries/(4*TMath::Pi()));//262000
+    h7->Draw();
+
+
+    return;
+}
+
+
+//////////////////////////////////////////////////
+void InitChain()
+{
+    if(chain!=NULL){delete chain;}
+    chain = new TChain("AnalysedTree","");
+    
+    //chain->Add("/Users/pierremorfouace/Physics/NPTool/nptool/Outputs/Analysis/34Ar_pd.root");
+    //chain->Add("/Users/pierremorfouace/Physics/NPTool/nptool/Outputs/Analysis/46Ar_pd.root");
+    chain->Add("/Users/pierremorfouace/Physics/NPTool/nptool/Outputs/Analysis/11Be_d3He_1mg.root");
+    
+    return;
+}
+
+
+
+///////////////////////////////////////////////////////////////////////////////
+void LoadCut()
+{
+    TString Cut_Name = "CUT/cut_kine.root";
+    TString Object_Name = "cut_kine";
+    TFile* f_cut_kine = new TFile(Cut_Name,"read");
+    cut_kine = (TCutG*) f_cut_kine->FindObjectAny(Object_Name);
+    
+    return;
+}
+
+
+
+
+
+
+
+
+
diff --git a/NPAnalysis/MakePhysicalTree/Analysis.cxx b/NPAnalysis/MakePhysicalTree/Analysis.cxx
index f9c15e965e9005777e855e8af8ec2e70543c954f..875164ab8669f8021fa22d825b85310fdf6d318c 100644
--- a/NPAnalysis/MakePhysicalTree/Analysis.cxx
+++ b/NPAnalysis/MakePhysicalTree/Analysis.cxx
@@ -25,7 +25,7 @@ int main(int argc, char** argv)
    RootOutput::getInstance("Analysis/"+OutputfileName, "AnalysedTree");
    
    // Instantiate the detector using a file
-   NPA::DetectorManager* myDetector = new DetectorManager();
+   NPL::DetectorManager* myDetector = new DetectorManager();
    myDetector->ReadConfigurationFile(detectorfileName);
     
    // Get the formed Chained Tree and Treat it
diff --git a/NPAnalysis/MakePhysicalTree/Analysis.h b/NPAnalysis/MakePhysicalTree/Analysis.h
index d5ca8c305a8f3b7d788651234860e30edb569327..087f8f74c12c601c8455efcc5b206dddd75fee7b 100644
--- a/NPAnalysis/MakePhysicalTree/Analysis.h
+++ b/NPAnalysis/MakePhysicalTree/Analysis.h
@@ -6,7 +6,7 @@
 // -------------------------------------- VARIOUS INCLUDE ---------------------------------------
 
 // NPA
-#include "DetectorManager.h"
+#include "NPDetectorManager.h"
 #include "NPOptionManager.h"
 
 // STL C++
@@ -30,13 +30,9 @@
 #include "RootOutput.h"
 #include "NPReaction.h"
 #include "TInitialConditions.h"
-#include "TPlasticData.h"
-#include "TMust2Data.h"
-#include "TMust2Physics.h"
-#include "TExogamPhysics.h"
-#include "TSSSDPhysics.h"
-#include "TPlasticPhysics.h"
-#include "GaspardTracker.h"
+#include "THiraData.h"
+#include "THiraPhysics.h"
+
 
 // Use CLHEP System of unit and Physical Constant
 #include "NPGlobalSystemOfUnits.h"
diff --git a/NPAnalysis/MakePhysicalTree/RunToTreat.txt b/NPAnalysis/MakePhysicalTree/RunToTreat.txt
index 6643bcf68f7eed6405f0cccc5d7e9b65db1eab6a..f98dbfca5b1ba7fafe5ef2f8705a58a6d79aca39 100644
--- a/NPAnalysis/MakePhysicalTree/RunToTreat.txt
+++ b/NPAnalysis/MakePhysicalTree/RunToTreat.txt
@@ -1,14 +1,8 @@
 TTreeName 
-	AutoTree
-RootFileName
-  /Users/pierremorfouace/Desktop/NPDoc/cats/run_2003.root
-%	/data/e628X/e628/acquisition/run_root/run_1352.1.root
-%	/data/e628X/e628/acquisition/run_root/run_1353.0.root
-% /data/e628X/e628/acquisition/run_root/run_1354.0.root
-%	/data/e628X/e628/acquisition/run_root/run_1354.1.root
-%	/data/e628X/e628/acquisition/run_root/run_1355.0.root
-%	/data/e628X/e628/acquisition/run_root/run_1356.0.root
-%	/data/e628X/e628/acquisition/run_root/run_1357.0.root
-%	/data/e628X/e628/acquisition/run_root/run_1357.1.root
-%	/data/e628X/e628/acquisition/run_root/run_1358.0.root
-%	/data/e628X/e628/acquisition/run_root/run_1358.1.root
+	SimulatedTree
+RootFileName 
+  /Users/pierremorfouace/Physics/NPTool/nptool/Outputs/Simulation/simu.root
+
+
+	
+	
diff --git a/NPAnalysis/S1554/22.si b/NPAnalysis/S1554/22.si
new file mode 100644
index 0000000000000000000000000000000000000000..6d9163232ef53b3d24e4ea05a7de3d449bfd5c33
--- /dev/null
+++ b/NPAnalysis/S1554/22.si
@@ -0,0 +1,181 @@
+   0.00   8.082999E+01
+   0.96   8.013461E+01
+   1.92   7.807824E+01
+   2.88   7.474845E+01
+   3.84   7.028513E+01
+   4.80   6.487207E+01
+   5.76   5.872597E+01
+   6.72   5.208399E+01
+   7.68   4.519057E+01
+   8.64   3.828463E+01
+   9.60   3.158781E+01
+  10.56   2.529468E+01
+  11.52   1.956526E+01
+  12.48   1.452010E+01
+  13.44   1.023819E+01
+  14.41   6.757372E+00
+  15.37   4.076943E+00
+  16.33   2.162190E+00
+  17.29   9.501766E-01
+  18.25   3.563639E-01
+  19.21   2.815332E-01
+  20.18   6.185614E-01
+  21.14   1.258682E+00
+  22.10   2.096945E+00
+  23.06   3.036686E+00
+  24.03   3.992911E+00
+  24.99   4.894570E+00
+  25.95   5.685780E+00
+  26.92   6.326100E+00
+  27.88   6.789981E+00
+  28.85   7.065583E+00
+  29.81   7.153095E+00
+  30.78   7.062749E+00
+  31.74   6.812668E+00
+  32.71   6.426687E+00
+  33.68   5.932258E+00
+  34.64   5.358531E+00
+  35.61   4.734672E+00
+  36.58   4.088454E+00
+  37.54   3.445147E+00
+  38.51   2.826715E+00
+  39.48   2.251286E+00
+  40.45   1.732889E+00
+  41.42   1.281428E+00
+  42.39   9.028334E-01
+  43.36   5.993811E-01
+  44.33   3.701125E-01
+  45.30   2.113377E-01
+  46.27   1.171760E-01
+  47.25   8.010797E-02
+  48.22   9.151219E-02
+  49.19   1.421664E-01
+  50.17   2.226974E-01
+  51.14   3.239696E-01
+  52.12   4.374054E-01
+  53.09   5.552348E-01
+  54.07   6.706767E-01
+  55.04   7.780529E-01
+  56.02   8.728439E-01
+  57.00   9.516905E-01
+  57.98   1.012351E+00
+  58.95   1.053624E+00
+  59.93   1.075241E+00
+  60.91   1.077740E+00
+  61.89   1.062333E+00
+  62.87   1.030760E+00
+  63.86   9.851529E-01
+  64.84   9.279005E-01
+  65.82   8.615252E-01
+  66.80   7.885734E-01
+  67.79   7.115213E-01
+  68.77   6.326960E-01
+  69.76   5.542144E-01
+  70.75   4.779374E-01
+  71.73   4.054407E-01
+  72.72   3.379991E-01
+  73.71   2.765836E-01
+  74.70   2.218697E-01
+  75.69   1.742540E-01
+  76.68   1.338789E-01
+  77.67   1.006615E-01
+  78.66   7.432630E-02
+  79.65   5.443989E-02
+  80.64   4.044575E-02
+  81.64   3.169825E-02
+  82.63   2.749481E-02
+  83.63   2.710534E-02
+  84.62   2.979840E-02
+  85.62   3.486372E-02
+  86.62   4.163078E-02
+  87.61   4.948352E-02
+  88.61   5.787110E-02
+  89.61   6.631512E-02
+  90.61   7.441344E-02
+  91.61   8.184095E-02
+  92.61   8.834787E-02
+  93.62   9.375581E-02
+  94.62   9.795218E-02
+  95.62   1.008834E-01
+  96.63   1.025469E-01
+  97.63   1.029835E-01
+  98.64   1.022685E-01
+  99.65   1.005040E-01
+ 100.65   9.781104E-02
+ 101.66   9.432246E-02
+ 102.67   9.017676E-02
+ 103.68   8.551262E-02
+ 104.69   8.046432E-02
+ 105.70   7.515820E-02
+ 106.71   6.971000E-02
+ 107.73   6.422301E-02
+ 108.74   5.878703E-02
+ 109.75   5.347803E-02
+ 110.77   4.835837E-02
+ 111.78   4.347747E-02
+ 112.80   3.887291E-02
+ 113.82   3.457166E-02
+ 114.83   3.059159E-02
+ 115.85   2.694294E-02
+ 116.87   2.362977E-02
+ 117.89   2.065139E-02
+ 118.91   1.800357E-02
+ 119.93   1.567961E-02
+ 120.95   1.367119E-02
+ 121.97   1.196908E-02
+ 123.00   1.056353E-02
+ 124.02   9.444573E-03
+ 125.04   8.602090E-03
+ 126.07   8.025798E-03
+ 127.10   7.705073E-03
+ 128.12   7.628729E-03
+ 129.15   7.784749E-03
+ 130.18   8.160007E-03
+ 131.20   8.740017E-03
+ 132.23   9.508727E-03
+ 133.26   1.044837E-02
+ 134.29   1.153943E-02
+ 135.32   1.276065E-02
+ 136.35   1.408918E-02
+ 137.38   1.550076E-02
+ 138.42   1.697010E-02
+ 139.45   1.847118E-02
+ 140.48   1.997771E-02
+ 141.51   2.146364E-02
+ 142.55   2.290360E-02
+ 143.58   2.427345E-02
+ 144.62   2.555071E-02
+ 145.65   2.671506E-02
+ 146.69   2.774869E-02
+ 147.72   2.863666E-02
+ 148.76   2.936713E-02
+ 149.80   2.993156E-02
+ 150.84   3.032475E-02
+ 151.87   3.054490E-02
+ 152.91   3.059347E-02
+ 153.95   3.047504E-02
+ 154.99   3.019707E-02
+ 156.03   2.976962E-02
+ 157.07   2.920499E-02
+ 158.11   2.851733E-02
+ 159.15   2.772229E-02
+ 160.19   2.683658E-02
+ 161.23   2.587755E-02
+ 162.27   2.486286E-02
+ 163.31   2.381009E-02
+ 164.36   2.273641E-02
+ 165.40   2.165836E-02
+ 166.44   2.059152E-02
+ 167.48   1.955044E-02
+ 168.53   1.854842E-02
+ 169.57   1.759748E-02
+ 170.61   1.670831E-02
+ 171.65   1.589026E-02
+ 172.70   1.515139E-02
+ 173.74   1.449850E-02
+ 174.78   1.393724E-02
+ 175.83   1.347220E-02
+ 176.87   1.310696E-02
+ 177.91   1.284422E-02
+ 178.96   1.268585E-02
+ 180.00   1.263293E-02
diff --git a/NPAnalysis/S1554/22.sie b/NPAnalysis/S1554/22.sie
new file mode 100644
index 0000000000000000000000000000000000000000..213132212ab0ce67c947ccb12eab41b83d4be8db
--- /dev/null
+++ b/NPAnalysis/S1554/22.sie
@@ -0,0 +1,181 @@
+   0.00   1.108964E+02
+   0.95   1.110523E+02
+   1.91   1.114927E+02
+   2.86   1.121379E+02
+   3.82   1.128632E+02
+   4.77   1.135110E+02
+   5.73   1.139048E+02
+   6.68   1.138653E+02
+   7.64   1.132258E+02
+   8.59   1.118459E+02
+   9.55   1.096229E+02
+  10.50   1.064992E+02
+  11.46   1.024653E+02
+  12.41   9.755997E+01
+  13.37   9.186575E+01
+  14.32   8.550242E+01
+  15.28   7.861815E+01
+  16.24   7.137960E+01
+  17.19   6.396181E+01
+  18.15   5.653859E+01
+  19.11   4.927403E+01
+  20.06   4.231555E+01
+  21.02   3.578859E+01
+  21.98   2.979331E+01
+  22.94   2.440281E+01
+  23.89   1.966312E+01
+  24.85   1.559439E+01
+  25.81   1.219322E+01
+  26.77   9.435687E+00
+  27.73   7.280947E+00
+  28.69   5.675011E+00
+  29.65   4.554579E+00
+  30.61   3.850707E+00
+  31.57   3.492168E+00
+  32.53   3.408406E+00
+  33.49   3.532023E+00
+  34.45   3.800745E+00
+  35.42   4.158881E+00
+  36.38   4.558288E+00
+  37.34   4.958884E+00
+  38.31   5.328754E+00
+  39.27   5.643927E+00
+  40.24   5.887884E+00
+  41.20   6.050856E+00
+  42.17   6.128991E+00
+  43.13   6.123433E+00
+  44.10   6.039375E+00
+  45.07   5.885112E+00
+  46.03   5.671148E+00
+  47.00   5.409363E+00
+  47.97   5.112272E+00
+  48.94   4.792380E+00
+  49.91   4.461646E+00
+  50.88   4.131056E+00
+  51.85   3.810298E+00
+  52.82   3.507552E+00
+  53.80   3.229356E+00
+  54.77   2.980570E+00
+  55.74   2.764411E+00
+  56.72   2.582539E+00
+  57.69   2.435203E+00
+  58.67   2.321405E+00
+  59.64   2.239105E+00
+  60.62   2.185416E+00
+  61.60   2.156815E+00
+  62.57   2.149341E+00
+  63.55   2.158783E+00
+  64.53   2.180848E+00
+  65.51   2.211315E+00
+  66.49   2.246159E+00
+  67.48   2.281662E+00
+  68.46   2.314493E+00
+  69.44   2.341775E+00
+  70.43   2.361118E+00
+  71.41   2.370647E+00
+  72.40   2.369000E+00
+  73.38   2.355315E+00
+  74.37   2.329203E+00
+  75.36   2.290707E+00
+  76.34   2.240255E+00
+  77.33   2.178606E+00
+  78.32   2.106789E+00
+  79.31   2.026050E+00
+  80.31   1.937788E+00
+  81.30   1.843508E+00
+  82.29   1.744760E+00
+  83.29   1.643104E+00
+  84.28   1.540061E+00
+  85.28   1.437087E+00
+  86.27   1.335536E+00
+  87.27   1.236642E+00
+  88.27   1.141505E+00
+  89.27   1.051069E+00
+  90.27   9.661266E-01
+  91.27   8.873059E-01
+  92.27   8.150780E-01
+  93.27   7.497588E-01
+  94.27   6.915178E-01
+  95.28   6.403877E-01
+  96.28   5.962774E-01
+  97.29   5.589851E-01
+  98.30   5.282139E-01
+  99.30   5.035865E-01
+ 100.31   4.846610E-01
+ 101.32   4.709457E-01
+ 102.33   4.619132E-01
+ 103.34   4.570140E-01
+ 104.35   4.556883E-01
+ 105.37   4.573767E-01
+ 106.38   4.615300E-01
+ 107.39   4.676168E-01
+ 108.41   4.751303E-01
+ 109.42   4.835938E-01
+ 110.44   4.925649E-01
+ 111.46   5.016383E-01
+ 112.48   5.104484E-01
+ 113.49   5.186702E-01
+ 114.51   5.260203E-01
+ 115.53   5.322562E-01
+ 116.56   5.371761E-01
+ 117.58   5.406175E-01
+ 118.60   5.424558E-01
+ 119.62   5.426026E-01
+ 120.65   5.410034E-01
+ 121.67   5.376358E-01
+ 122.70   5.325068E-01
+ 123.73   5.256507E-01
+ 124.76   5.171268E-01
+ 125.78   5.070166E-01
+ 126.81   4.954218E-01
+ 127.84   4.824615E-01
+ 128.87   4.682707E-01
+ 129.90   4.529970E-01
+ 130.94   4.367990E-01
+ 131.97   4.198441E-01
+ 133.00   4.023061E-01
+ 134.04   3.843630E-01
+ 135.07   3.661953E-01
+ 136.11   3.479834E-01
+ 137.14   3.299062E-01
+ 138.18   3.121384E-01
+ 139.22   2.948494E-01
+ 140.25   2.782006E-01
+ 141.29   2.623445E-01
+ 142.33   2.474222E-01
+ 143.37   2.335628E-01
+ 144.41   2.208811E-01
+ 145.45   2.094772E-01
+ 146.49   1.994351E-01
+ 147.53   1.908216E-01
+ 148.58   1.836864E-01
+ 149.62   1.780610E-01
+ 150.66   1.739592E-01
+ 151.71   1.713764E-01
+ 152.75   1.702908E-01
+ 153.79   1.706629E-01
+ 154.84   1.724373E-01
+ 155.88   1.755426E-01
+ 156.93   1.798933E-01
+ 157.98   1.853908E-01
+ 159.02   1.919246E-01
+ 160.07   1.993742E-01
+ 161.12   2.076104E-01
+ 162.16   2.164973E-01
+ 163.21   2.258939E-01
+ 164.26   2.356557E-01
+ 165.31   2.456370E-01
+ 166.36   2.556920E-01
+ 167.40   2.656768E-01
+ 168.45   2.754513E-01
+ 169.50   2.848803E-01
+ 170.55   2.938353E-01
+ 171.60   3.021957E-01
+ 172.65   3.098502E-01
+ 173.70   3.166977E-01
+ 174.75   3.226486E-01
+ 175.80   3.276257E-01
+ 176.85   3.315647E-01
+ 177.90   3.344148E-01
+ 178.95   3.361396E-01
+ 180.00   3.367169E-01
diff --git a/NPAnalysis/S1554/Analysis.cxx b/NPAnalysis/S1554/Analysis.cxx
new file mode 100644
index 0000000000000000000000000000000000000000..014f58c8f6768d402451f670608ae520a149bea5
--- /dev/null
+++ b/NPAnalysis/S1554/Analysis.cxx
@@ -0,0 +1,161 @@
+/*****************************************************************************
+ * Copyright (C) 2009-2014    this file is part of the NPTool Project        *
+ *                                                                           *
+ * For the licensing terms see $NPTOOL/Licence/NPTool_Licence                *
+ * For the list of contributors see $NPTOOL/Licence/Contributors             *
+ *****************************************************************************/
+
+/*****************************************************************************
+ * Original Author: Adrien MATTA  contact address: a.matta@surrey.ac.uk      *
+ *                                                                           *
+ * Creation Date  : march 2015                                               *
+ * Last update    :                                                          *
+ *---------------------------------------------------------------------------*
+ * Decription:                                                               *
+ * Class describing the property of an Analysis object                       *
+ *                                                                           *
+ *---------------------------------------------------------------------------*
+ * Comment:                                                                  *
+ *                                                                           *
+ *                                                                           *
+ *****************************************************************************/
+#include<iostream>
+using namespace std;
+#include"Analysis.h"
+#include"NPAnalysisFactory.h"
+#include"NPDetectorManager.h"
+#include"NPOptionManager.h"
+////////////////////////////////////////////////////////////////////////////////
+Analysis::Analysis(){
+}
+////////////////////////////////////////////////////////////////////////////////
+Analysis::~Analysis(){
+}
+
+////////////////////////////////////////////////////////////////////////////////
+void Analysis::Init(){
+  InitOutputBranch();
+  InitInputBranch();
+
+  Sharc = (TSharcPhysics*)  m_DetectorManager -> GetDetector("Sharc");
+  LightCD2 = EnergyLoss("proton_CD2.G4table","G4Table",100 );
+  LightSi = EnergyLoss("proton_Si.G4table","G4Table",100);
+  BeamCD2 = EnergyLoss("Si28[0.0]_CD2.G4table","G4Table",100);
+  myReaction = new NPL::Reaction();
+  myReaction->ReadConfigurationFile(NPOptionManager::getInstance()->GetReactionFile());
+  TargetThickness = m_DetectorManager->GetTargetThickness()*micrometer;
+  OriginalBeamEnergy = myReaction->GetBeamEnergy();
+  Rand = TRandom3();
+  DetectorNumber = 0 ;
+  ThetaNormalTarget = 0 ;
+  ThetaM2Surface = 0;
+  Si_E_M2 = 0 ;
+  CsI_E_M2 = 0 ;
+  Energy = 0;
+  E_M2 = 0;
+
+  ThetaSharcSurface = 0;
+  X_Sharc = 0 ;
+  Y_Sharc = 0 ;
+  Z_Sharc = 0 ;
+  Si_E_Sharc = 0 ;
+  E_Sharc = 0;
+  Si_X_Sharc = 0;
+  Si_Y_Sharc = 0;
+}
+
+////////////////////////////////////////////////////////////////////////////////
+void Analysis::TreatEvent(){
+  // Reinitiate calculated variable
+  ReInitValue();
+  double XTarget = 0;
+  double YTarget = 0;
+  TVector3 BeamDirection = TVector3(0,0,1);
+  double BeamEnergy = BeamCD2.Slow(OriginalBeamEnergy,TargetThickness*0.5,0);
+  myReaction->SetBeamEnergy(BeamEnergy);
+  ////////////////////////////////////////////////////////////////////////////
+  ////////////////////////////////////////////////////////////////////////////
+  //////////////////////////// LOOP on Sharc//////////////////
+  if(Sharc->Strip_E.size()>0){
+    /************************************************/
+    // Part 1 : Impact Angle
+    ThetaSharcSurface = 0;
+    ThetaNormalTarget = 0;
+    TVector3 HitDirection = Sharc -> GetPositionOfInteraction(0);
+    ThetaLab = HitDirection.Angle( BeamDirection );
+    ThetaNormalTarget = HitDirection.Angle( TVector3(0,0,1) ) ;
+
+    /************************************************/
+
+    /************************************************/
+    // Part 2 : Impact Energy
+
+    Energy = ELab = 0;
+    if(Sharc->PAD_E[0]>0){
+      Energy = Sharc->PAD_E[0];
+    }
+
+    Energy += Sharc->Strip_E[0];
+    // Target Correction
+    ELab = LightCD2.EvaluateInitialEnergy( Energy ,TargetThickness*0.5, ThetaNormalTarget);
+    /************************************************/
+
+    /************************************************/
+    // Part 3 : Excitation Energy Calculation
+    Ex = myReaction -> ReconstructRelativistic( ELab , ThetaLab );
+    /************************************************/
+
+    /************************************************/
+    // Part 4 : Theta CM Calculation
+    ThetaCM  = myReaction -> EnergyLabToThetaCM( ELab , ThetaLab)/deg;
+    ThetaLab=ThetaLab/deg;
+    ThetaLab=Rand.Uniform(ThetaLab-0.5,ThetaLab+0.5);
+    /************************************************/
+  }//end loop Sharc 
+
+}
+
+////////////////////////////////////////////////////////////////////////////////
+void Analysis::End(){
+}
+////////////////////////////////////////////////////////////////////////////////
+void Analysis::InitOutputBranch() {
+  RootOutput::getInstance()->GetTree()->Branch("Ex",&Ex,"Ex/D");
+  RootOutput::getInstance()->GetTree()->Branch("ELab",&ELab,"ELab/D");
+  RootOutput::getInstance()->GetTree()->Branch("ThetaLab",&ThetaLab,"ThetaLab/D");
+  RootOutput::getInstance()->GetTree()->Branch("ThetaCM",&ThetaCM,"ThetaCM/D");
+}
+
+////////////////////////////////////////////////////////////////////////////////
+void Analysis::InitInputBranch(){
+}
+////////////////////////////////////////////////////////////////////////////////
+void Analysis::ReInitValue(){
+  Ex = -1000 ;
+  ELab = -1000;
+  ThetaLab = -1000;
+  ThetaCM = -1000;
+}
+
+
+////////////////////////////////////////////////////////////////////////////////
+//            Construct Method to be pass to the AnalysisFactory              //
+////////////////////////////////////////////////////////////////////////////////
+NPL::VAnalysis* Analysis::Construct(){
+  return (NPL::VAnalysis*) new Analysis();
+}
+
+////////////////////////////////////////////////////////////////////////////////
+//            Registering the construct method to the factory                 //
+////////////////////////////////////////////////////////////////////////////////
+extern "C"{
+class proxy{
+  public:
+    proxy(){
+      NPL::AnalysisFactory::getInstance()->SetConstructor(Analysis::Construct);
+    }
+};
+
+proxy p;
+}
+
diff --git a/NPAnalysis/S1554/Analysis.h b/NPAnalysis/S1554/Analysis.h
new file mode 100644
index 0000000000000000000000000000000000000000..5b9ce24e5556efcaeae359bb30b716735a7b6330
--- /dev/null
+++ b/NPAnalysis/S1554/Analysis.h
@@ -0,0 +1,87 @@
+#ifndef Analysis_h 
+#define Analysis_h
+/*****************************************************************************
+ * Copyright (C) 2009-2014    this file is part of the NPTool Project        *
+ *                                                                           *
+ * For the licensing terms see $NPTOOL/Licence/NPTool_Licence                *
+ * For the list of contributors see $NPTOOL/Licence/Contributors             *
+ *****************************************************************************/
+
+/*****************************************************************************
+ * Original Author: Adrien MATTA  contact address: a.matta@surrey.ac.uk      *
+ *                                                                           *
+ * Creation Date  : march 2025                                               *
+ * Last update    :                                                          *
+ *---------------------------------------------------------------------------*
+ * Decription:                                                               *
+ * Class describing the property of an Analysis object                       *
+ *                                                                           *
+ *---------------------------------------------------------------------------*
+ * Comment:                                                                  *
+ *                                                                           *
+ *                                                                           *
+ *****************************************************************************/
+#include"NPVAnalysis.h"
+#include"NPEnergyLoss.h"
+#include"NPReaction.h"
+#include"RootOutput.h"
+#include"RootInput.h"
+#include "TSharcPhysics.h"
+#include "TInitialConditions.h"
+#include <TRandom3.h>
+#include <TVector3.h>
+#include <TMath.h>
+
+class Analysis: public NPL::VAnalysis{
+  public:
+    Analysis();
+    ~Analysis();
+
+  public: 
+    void Init();
+    void TreatEvent();
+    void End();
+
+  void InitOutputBranch();
+  void InitInputBranch();
+  void ReInitValue();
+  static NPL::VAnalysis* Construct();
+ 
+  private:
+  double Ex;
+  double ELab;
+  double ThetaLab;
+  double ThetaCM;
+  NPL::Reaction* myReaction;
+TInitialConditions* myInit ;
+  //	Energy loss table: the G4Table are generated by the simulation
+  EnergyLoss LightCD2;
+  EnergyLoss LightAl;
+  EnergyLoss LightSi;
+  EnergyLoss BeamCD2;
+  TVector3 BeamImpact;
+  
+  double TargetThickness ;
+  // Beam Energy
+  double OriginalBeamEnergy ; // AMEV
+                                                           // intermediate variable
+  TRandom3 Rand ;
+  int DetectorNumber  ;
+  double ThetaNormalTarget;
+  double ThetaM2Surface ;
+  double Si_E_M2 ;
+  double CsI_E_M2  ;
+  double Energy ;
+  double E_M2 ;
+  
+  double ThetaSharcSurface ;
+  double X_Sharc ;
+  double Y_Sharc ;
+  double Z_Sharc  ;
+  double Si_E_Sharc ;
+  double E_Sharc ;
+  double Si_X_Sharc ;
+  double Si_Y_Sharc ;
+  TSharcPhysics* Sharc;
+};
+#endif
diff --git a/NPAnalysis/S1554/CMakeLists.txt b/NPAnalysis/S1554/CMakeLists.txt
new file mode 100644
index 0000000000000000000000000000000000000000..1d6a34417c73bce95f165aa644967bd249e9b521
--- /dev/null
+++ b/NPAnalysis/S1554/CMakeLists.txt
@@ -0,0 +1,31 @@
+cmake_minimum_required (VERSION 2.8) 
+#Finding NPTool
+set(NPTOOL "$ENV{NPTOOL}")
+set(NPLIB "${NPTOOL}/NPLib")
+set(NPTOOL_INCLUDE_DIR "${NPLIB}/include")
+set(NPTOOL_LIB_DIR "${NPLIB}/lib")
+  
+include("${NPLIB}/FindROOT.cmake")  
+
+project (NPAnalysis)
+set(CMAKE_BUILD_TYPE Release)  
+# Add root to the link and include directories
+include_directories( ${ROOT_INCLUDE_DIR})
+link_directories( ${ROOT_LIBRARY_DIR})
+include_directories( ${NPTOOL_INCLUDE_DIR})
+link_directories( ${NPTOOL_LIB_DIR})
+
+# Get the compilator flag from root to assure consistancy
+EXEC_PROGRAM(${ROOT_CONFIG_EXECUTABLE}
+     ARGS "--cflags"
+     OUTPUT_VARIABLE root_cflags )
+
+set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${root_cflags}")
+
+# If the compiler is Clang, silence the unrecognised flags
+if(${CMAKE_CXX_COMPILER_ID} MATCHES ".*Clang.*")
+  set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Qunused-arguments -undefined dynamic_lookup")
+endif()
+
+add_library(NPAnalysis SHARED Analysis.cxx)
+target_link_libraries(NPAnalysis ${ROOT_LIBRARIES} -L${NPLIB}/lib -lNPCore -lNPPhysics)
diff --git a/NPAnalysis/S1554/Calibration.txt b/NPAnalysis/S1554/Calibration.txt
new file mode 100644
index 0000000000000000000000000000000000000000..64850c017dff78052f7ee3b70905103336fbae10
--- /dev/null
+++ b/NPAnalysis/S1554/Calibration.txt
@@ -0,0 +1,3 @@
+CalibrationFilePath
+  SharcCalibration.txt
+  TigressCalibration.txt
diff --git a/NPAnalysis/S1554/RunToTreat.txt b/NPAnalysis/S1554/RunToTreat.txt
new file mode 100644
index 0000000000000000000000000000000000000000..cd169430bda8c05446427889a1f7dc854af7a212
--- /dev/null
+++ b/NPAnalysis/S1554/RunToTreat.txt
@@ -0,0 +1,6 @@
+TTreeName
+  DataS1554
+RootFileName
+  ~/Desktop/Unpacker/data3507*
+
+
diff --git a/NPAnalysis/S1554/SharcCalibration.txt b/NPAnalysis/S1554/SharcCalibration.txt
new file mode 100644
index 0000000000000000000000000000000000000000..da9e75e84290acf2ea2a3d6447da210ed3e7a1a2
--- /dev/null
+++ b/NPAnalysis/S1554/SharcCalibration.txt
@@ -0,0 +1,496 @@
+SHARC_D1_STRIP_FRONT1_E 1 9.71809e-05
+SHARC_D1_STRIP_FRONT2_E 0.164687 2.26585e-05
+SHARC_D1_STRIP_FRONT3_E 0.174147 2.28104e-05
+SHARC_D1_STRIP_FRONT4_E 0.162916 2.26244e-05
+SHARC_D1_STRIP_FRONT5_E 0.163951 2.18268e-05
+SHARC_D1_STRIP_FRONT6_E 0.166109 2.20008e-05
+SHARC_D1_STRIP_FRONT8_E 0.160454 2.15271e-05
+SHARC_D1_STRIP_FRONT9_E 0.165885 2.19531e-05
+SHARC_D1_STRIP_FRONT10_E 0.162686 2.20978e-05
+SHARC_D1_STRIP_FRONT11_E 0.174349 2.19763e-05
+SHARC_D1_STRIP_FRONT12_E 0.160229 2.2092e-05
+SHARC_D1_STRIP_FRONT14_E 0.168189 2.17203e-05
+SHARC_D1_STRIP_FRONT15_E 0.158883 2.13092e-05
+SHARC_D1_STRIP_FRONT16_E 0.145459 2.17219e-05
+SHARC_D1_STRIP_BACK1_E 0.153838 2.60365e-05
+SHARC_D1_STRIP_BACK2_E 0.151547 2.25412e-05
+SHARC_D1_STRIP_BACK3_E 0.159238 2.24302e-05
+SHARC_D1_STRIP_BACK4_E 0.155658 2.24398e-05
+SHARC_D1_STRIP_BACK5_E 0.15404 2.23263e-05
+SHARC_D1_STRIP_BACK6_E 0.161111 2.23206e-05
+SHARC_D1_STRIP_BACK7_E 0.158584 2.24573e-05
+SHARC_D1_STRIP_BACK8_E 0.160069 2.21756e-05
+SHARC_D1_STRIP_BACK9_E 0.154648 2.2053e-05
+SHARC_D1_STRIP_BACK10_E 0.152995 2.22484e-05
+SHARC_D1_STRIP_BACK11_E 0.15407 2.23135e-05
+SHARC_D1_STRIP_BACK12_E 0.150986 2.24622e-05
+SHARC_D1_STRIP_BACK13_E 0.164412 2.23237e-05
+SHARC_D1_STRIP_BACK14_E 0.157589 2.17609e-05
+SHARC_D1_STRIP_BACK15_E 0.154085 2.22351e-05
+SHARC_D1_STRIP_BACK16_E 0.152418 2.2914e-05
+SHARC_D1_STRIP_BACK17_E 0.145236 2.24632e-05
+SHARC_D1_STRIP_BACK18_E 0.149564 2.1789e-05
+SHARC_D1_STRIP_BACK19_E 0.160901 2.21543e-05
+SHARC_D1_STRIP_BACK20_E 0.161678 2.20323e-05
+SHARC_D1_STRIP_BACK21_E 0.159755 2.24461e-05
+SHARC_D1_STRIP_BACK22_E 0.149375 2.22273e-05
+SHARC_D1_STRIP_BACK23_E 0.158633 2.27563e-05
+SHARC_D1_STRIP_BACK24_E 0.146264 2.61009e-05
+SHARC_D2_STRIP_FRONT2_E 0.181992 2.15866e-05
+SHARC_D2_STRIP_FRONT3_E 0.173214 2.14823e-05
+SHARC_D2_STRIP_FRONT4_E 0.174668 2.14928e-05
+SHARC_D2_STRIP_FRONT5_E 0.166655 2.15335e-05
+SHARC_D2_STRIP_FRONT6_E 0.15884 2.16476e-05
+SHARC_D2_STRIP_FRONT7_E 0.168056 2.15086e-05
+SHARC_D2_STRIP_FRONT8_E 0.162027 2.13847e-05
+SHARC_D2_STRIP_FRONT9_E 0.157742 2.12032e-05
+SHARC_D2_STRIP_FRONT10_E 0.153569 2.09853e-05
+SHARC_D2_STRIP_FRONT11_E 0.153675 2.06502e-05
+SHARC_D2_STRIP_FRONT12_E 0.154205 2.1239e-05
+SHARC_D2_STRIP_FRONT13_E 0.147765 2.12137e-05
+SHARC_D2_STRIP_FRONT14_E 0.141683 2.10439e-05
+SHARC_D2_STRIP_FRONT15_E 0.153863 2.12348e-05
+SHARC_D2_STRIP_FRONT16_E 0.154194 2.11789e-05
+SHARC_D2_STRIP_BACK2_E 0.161791 2.16439e-05
+SHARC_D2_STRIP_BACK3_E 0.158998 2.13021e-05
+SHARC_D2_STRIP_BACK4_E 0.155088 2.12472e-05
+SHARC_D2_STRIP_BACK5_E 0.151944 2.14828e-05
+SHARC_D2_STRIP_BACK6_E 0.155744 2.11617e-05
+SHARC_D2_STRIP_BACK7_E 0.159097 2.12061e-05
+SHARC_D2_STRIP_BACK8_E 0.156703 2.11961e-05
+SHARC_D2_STRIP_BACK9_E 0.167073 2.14596e-05
+SHARC_D2_STRIP_BACK10_E 0.15311 2.14144e-05
+SHARC_D2_STRIP_BACK11_E 0.150879 2.17228e-05
+SHARC_D2_STRIP_BACK12_E 0.148134 2.13678e-05
+SHARC_D2_STRIP_BACK13_E 0.150769 2.09629e-05
+SHARC_D2_STRIP_BACK14_E 0.158156 2.15112e-05
+SHARC_D2_STRIP_BACK15_E 0.166186 2.15378e-05
+SHARC_D2_STRIP_BACK16_E 0.164185 2.19222e-05
+SHARC_D2_STRIP_BACK17_E 0.149017 2.15916e-05
+SHARC_D2_STRIP_BACK18_E 0.15531 2.14079e-05
+SHARC_D2_STRIP_BACK19_E 0.158552 2.1928e-05
+SHARC_D2_STRIP_BACK20_E 0.156214 2.16906e-05
+SHARC_D2_STRIP_BACK21_E 0.156121 2.18188e-05
+SHARC_D2_STRIP_BACK22_E 0.161442 2.16562e-05
+SHARC_D2_STRIP_BACK23_E 0.159057 2.10402e-05
+SHARC_D2_STRIP_BACK24_E 0.133271 2.23707e-05
+SHARC_D3_STRIP_FRONT1_E 0.170498 2.17833e-05
+SHARC_D3_STRIP_FRONT2_E 0.177864 2.16078e-05
+SHARC_D3_STRIP_FRONT3_E 0.166926 2.13756e-05
+SHARC_D3_STRIP_FRONT4_E 0.161308 2.14367e-05
+SHARC_D3_STRIP_FRONT5_E 0.165043 2.12113e-05
+SHARC_D3_STRIP_FRONT6_E 0.152747 2.14685e-05
+SHARC_D3_STRIP_FRONT7_E 0.148567 2.15193e-05
+SHARC_D3_STRIP_FRONT8_E 0.146428 2.15751e-05
+SHARC_D3_STRIP_FRONT9_E 0.157735 2.19116e-05
+SHARC_D3_STRIP_FRONT10_E 0.148186 2.1768e-05
+SHARC_D3_STRIP_FRONT11_E 0.143739 2.15243e-05
+SHARC_D3_STRIP_FRONT12_E 0.141352 2.15329e-05
+SHARC_D3_STRIP_FRONT13_E 0.137131 2.10355e-05
+SHARC_D3_STRIP_FRONT14_E 0.131506 2.09502e-05
+SHARC_D3_STRIP_FRONT15_E 0.146444 2.13021e-05
+SHARC_D3_STRIP_FRONT16_E 0.15261 2.10132e-05
+SHARC_D3_STRIP_BACK1_E 0.141785 2.24297e-05
+SHARC_D3_STRIP_BACK2_E 0.169104 2.15242e-05
+SHARC_D3_STRIP_BACK3_E 0.169554 2.12474e-05
+SHARC_D3_STRIP_BACK4_E 0.165779 2.13588e-05
+SHARC_D3_STRIP_BACK5_E 0.169948 2.16378e-05
+SHARC_D3_STRIP_BACK6_E 0.173751 2.09587e-05
+SHARC_D3_STRIP_BACK7_E 0.171863 2.13399e-05
+SHARC_D3_STRIP_BACK8_E 0.168346 2.15308e-05
+SHARC_D3_STRIP_BACK9_E 0.163165 2.11919e-05
+SHARC_D3_STRIP_BACK10_E 0.176397 2.04944e-05
+SHARC_D3_STRIP_BACK11_E 0.174951 2.09201e-05
+SHARC_D3_STRIP_BACK12_E 0.167448 2.0926e-05
+SHARC_D3_STRIP_BACK13_E 0.168121 2.103e-05
+SHARC_D3_STRIP_BACK14_E 0.168596 2.09978e-05
+SHARC_D3_STRIP_BACK15_E 0.175062 2.10524e-05
+SHARC_D3_STRIP_BACK16_E 0.166321 2.13564e-05
+SHARC_D3_STRIP_BACK17_E 0.162009 2.11844e-05
+SHARC_D3_STRIP_BACK18_E 0.171647 2.13428e-05
+SHARC_D3_STRIP_BACK19_E 0.165273 2.09417e-05
+SHARC_D3_STRIP_BACK20_E 0.178293 2.08393e-05
+SHARC_D3_STRIP_BACK21_E 0.16557 2.10342e-05
+SHARC_D3_STRIP_BACK22_E 0.166472 2.13356e-05
+SHARC_D3_STRIP_BACK23_E 0.178184 2.11782e-05
+SHARC_D4_STRIP_FRONT1_E 0.143893 2.15775e-05
+SHARC_D4_STRIP_FRONT2_E 0.151215 2.19168e-05
+SHARC_D4_STRIP_FRONT3_E 0.13701 2.16589e-05
+SHARC_D4_STRIP_FRONT4_E 0.150528 2.19227e-05
+SHARC_D4_STRIP_FRONT5_E 0.139879 2.20799e-05
+SHARC_D4_STRIP_FRONT6_E 0.132977 2.12784e-05
+SHARC_D4_STRIP_FRONT7_E 0.125682 2.16596e-05
+SHARC_D4_STRIP_FRONT12_E 0.117107 2.16223e-05
+SHARC_D4_STRIP_FRONT13_E 0.115119 2.11676e-05
+SHARC_D4_STRIP_FRONT14_E 0.11296 2.16328e-05
+SHARC_D4_STRIP_FRONT15_E 0.113554 2.12594e-05
+SHARC_D4_STRIP_FRONT16_E 0.120279 2.13435e-05
+SHARC_D4_STRIP_BACK1_E 0.116399 2.21512e-05
+SHARC_D4_STRIP_BACK2_E 0.153885 2.28043e-05
+SHARC_D4_STRIP_BACK3_E 0.116021 2.25722e-05
+SHARC_D4_STRIP_BACK4_E 0.11138 2.22597e-05
+SHARC_D4_STRIP_BACK6_E 0.12692 2.28943e-05
+SHARC_D4_STRIP_BACK7_E 0.090648 2.32e-05
+SHARC_D4_STRIP_BACK8_E 0.110853 2.26683e-05
+SHARC_D4_STRIP_BACK9_E 0.106239 2.33143e-05
+SHARC_D4_STRIP_BACK10_E 0.12392 2.30434e-05
+SHARC_D4_STRIP_BACK11_E 0.116171 2.19613e-05
+SHARC_D4_STRIP_BACK12_E 0.115817 2.19587e-05
+SHARC_D4_STRIP_BACK13_E 0.116895 2.20284e-05
+SHARC_D4_STRIP_BACK14_E 0.11774 2.21507e-05
+SHARC_D4_STRIP_BACK15_E 0.108548 2.24632e-05
+SHARC_D4_STRIP_BACK16_E 0.126504 2.24063e-05
+SHARC_D4_STRIP_BACK18_E 0.13103 2.26364e-05
+SHARC_D4_STRIP_BACK21_E 0.116827 2.23377e-05
+SHARC_D4_STRIP_BACK22_E 0.120895 2.24211e-05
+SHARC_D4_STRIP_BACK23_E 0.103585 2.26749e-05
+SHARC_D4_STRIP_BACK24_E 0.128199 2.23913e-05
+SHARC_D5_STRIP_FRONT1_E 0.0184746 2.19244e-05
+SHARC_D5_STRIP_FRONT2_E 0.0220658 2.18118e-05
+SHARC_D5_STRIP_FRONT3_E 0.0258988 2.20747e-05
+SHARC_D5_STRIP_FRONT4_E 0.012098 2.21849e-05
+SHARC_D5_STRIP_FRONT5_E 0.0132119 2.187e-05
+SHARC_D5_STRIP_FRONT6_E 0.0231413 2.2357e-05
+SHARC_D5_STRIP_FRONT8_E 0.0971659 2.16172e-05
+SHARC_D5_STRIP_FRONT9_E 0.04333 2.12817e-05
+SHARC_D5_STRIP_FRONT10_E 0.0507796 2.15983e-05
+SHARC_D5_STRIP_FRONT11_E 0.0243644 2.19276e-05
+SHARC_D5_STRIP_FRONT12_E 0.0259251 2.17859e-05
+SHARC_D5_STRIP_FRONT13_E 0.0335124 2.19481e-05
+SHARC_D5_STRIP_FRONT14_E 0.0399368 2.17655e-05
+SHARC_D5_STRIP_FRONT15_E 0.0184578 2.12683e-05
+SHARC_D5_STRIP_FRONT16_E 0.022659 2.21454e-05
+SHARC_D5_STRIP_BACK11_E 0.0568813 2.07567e-05
+SHARC_D5_STRIP_BACK12_E 0.0585774 2.08176e-05
+SHARC_D5_STRIP_BACK13_E 0.0653997 2.08075e-05
+SHARC_D5_STRIP_BACK14_E 0.0678985 2.10715e-05
+SHARC_D5_STRIP_BACK15_E 0.0595765 2.09586e-05
+SHARC_D5_STRIP_BACK16_E 0.0626579 2.09575e-05
+SHARC_D5_STRIP_BACK17_E 0.0598144 2.08644e-05
+SHARC_D5_STRIP_BACK18_E 0.0615517 2.06992e-05
+SHARC_D5_STRIP_BACK19_E 0.0617771 2.1087e-05
+SHARC_D5_STRIP_BACK20_E 0.0616774 2.11152e-05
+SHARC_D5_STRIP_BACK21_E 0.0536845 2.0387e-05
+SHARC_D5_STRIP_BACK22_E 0.050151 2.09927e-05
+SHARC_D5_STRIP_BACK23_E 0.04769 2.10759e-05
+SHARC_D5_STRIP_BACK24_E -0.0798476 2.1628e-05
+SHARC_D5_STRIP_BACK25_E 0.0446056 2.15827e-05
+SHARC_D5_STRIP_BACK27_E 0.0474283 2.1244e-05
+SHARC_D5_STRIP_BACK28_E 0.0517215 2.14623e-05
+SHARC_D5_STRIP_BACK29_E 0.042902 2.11875e-05
+SHARC_D5_STRIP_BACK30_E 0.0439854 2.14907e-05
+SHARC_D5_STRIP_BACK31_E 0.0498488 2.11159e-05
+SHARC_D5_STRIP_BACK32_E 0.0418072 2.15367e-05
+SHARC_D5_STRIP_BACK33_E 0.0401053 2.12155e-05
+SHARC_D5_STRIP_BACK34_E 0.0405886 2.1192e-05
+SHARC_D5_STRIP_BACK38_E 0.0436775 2.17032e-05
+SHARC_D5_STRIP_BACK39_E 0.0434241 2.12179e-05
+SHARC_D5_STRIP_BACK40_E 0.0491315 2.16629e-05
+SHARC_D5_STRIP_BACK43_E 0.058932 2.0904e-05
+SHARC_D5_STRIP_BACK44_E 0.0541304 2.0784e-05
+SHARC_D6_STRIP_FRONT3_E 0.0267244 2.14665e-05
+SHARC_D6_STRIP_FRONT4_E 0.0194191 2.16453e-05
+SHARC_D6_STRIP_FRONT5_E 0.0214514 2.1681e-05
+SHARC_D6_STRIP_FRONT6_E 0.0185885 2.14626e-05
+SHARC_D6_STRIP_FRONT7_E 0.0107993 2.16074e-05
+SHARC_D6_STRIP_FRONT8_E 0.0220856 2.17046e-05
+SHARC_D6_STRIP_FRONT9_E 3.53799 0.000324051
+SHARC_D6_STRIP_FRONT10_E 0.0147158 2.17499e-05
+SHARC_D6_STRIP_FRONT11_E 0.0180041 2.11129e-05
+SHARC_D6_STRIP_FRONT12_E 0.00928292 2.1948e-05
+SHARC_D6_STRIP_FRONT13_E 0.0130352 2.14338e-05
+SHARC_D6_STRIP_FRONT14_E 0.0126762 2.13344e-05
+SHARC_D6_STRIP_FRONT15_E 0.0130653 2.18171e-05
+SHARC_D6_STRIP_FRONT16_E 0.011682 2.17847e-05
+SHARC_D6_STRIP_FRONT17_E 0.0155902 2.20876e-05
+SHARC_D6_STRIP_FRONT18_E 0.0108346 2.18593e-05
+SHARC_D6_STRIP_FRONT19_E 0.0145107 2.20757e-05
+SHARC_D6_STRIP_FRONT20_E 0.0107507 2.2692e-05
+SHARC_D6_STRIP_FRONT21_E 0.0140636 2.25682e-05
+SHARC_D6_STRIP_FRONT22_E 0.0172886 2.2133e-05
+SHARC_D6_STRIP_FRONT23_E -0.0252202 2.20485e-05
+SHARC_D6_STRIP_BACK1_E -0.169393 2.38599e-05
+SHARC_D6_STRIP_BACK2_E 0.0275962 2.29444e-05
+SHARC_D6_STRIP_BACK3_E 0.075551 2.30798e-05
+SHARC_D6_STRIP_BACK4_E 0.0514595 2.28556e-05
+SHARC_D6_STRIP_BACK5_E 0.0581235 2.25471e-05
+SHARC_D6_STRIP_BACK6_E 0.0435178 2.26392e-05
+SHARC_D6_STRIP_BACK7_E 0.0463227 2.24721e-05
+SHARC_D6_STRIP_BACK8_E 0.0464039 2.26593e-05
+SHARC_D6_STRIP_BACK9_E 0.0464575 2.23355e-05
+SHARC_D6_STRIP_BACK10_E 0.0440967 2.27238e-05
+SHARC_D6_STRIP_BACK11_E 0.0395257 2.25909e-05
+SHARC_D6_STRIP_BACK12_E 0.0222998 2.22406e-05
+SHARC_D6_STRIP_BACK13_E 0.0178924 2.23953e-05
+SHARC_D6_STRIP_BACK14_E 0.0338867 2.26127e-05
+SHARC_D6_STRIP_BACK15_E 0.0373955 2.33028e-05
+SHARC_D6_STRIP_BACK16_E 0.0276929 2.31612e-05
+SHARC_D6_STRIP_BACK17_E 0.0162478 2.29907e-05
+SHARC_D6_STRIP_BACK18_E 0.0220379 2.29427e-05
+SHARC_D6_STRIP_BACK19_E 0.022612 2.36231e-05
+SHARC_D6_STRIP_BACK20_E 0.0186129 2.32864e-05
+SHARC_D6_STRIP_BACK21_E 0.0151438 2.33919e-05
+SHARC_D6_STRIP_BACK23_E 0.0158743 2.27083e-05
+SHARC_D6_STRIP_BACK25_E 0.0381616 2.27827e-05
+SHARC_D6_STRIP_BACK26_E 0.0248942 2.29145e-05
+SHARC_D6_STRIP_BACK27_E 0.0356308 2.26366e-05
+SHARC_D6_STRIP_BACK29_E 0.0233163 2.29887e-05
+SHARC_D6_STRIP_BACK30_E 0.041849 2.30691e-05
+SHARC_D6_STRIP_BACK31_E 0.0369897 2.27207e-05
+SHARC_D6_STRIP_BACK33_E 0.0441671 2.30209e-05
+SHARC_D6_STRIP_BACK34_E 0.0360893 2.23514e-05
+SHARC_D6_STRIP_BACK35_E 0.0339634 2.24387e-05
+SHARC_D6_STRIP_BACK36_E 0.060896 2.26085e-05
+SHARC_D6_STRIP_BACK37_E 0.00208911 3.18512e-05
+SHARC_D6_STRIP_BACK38_E 0.0168685 2.51637e-05
+SHARC_D6_STRIP_BACK39_E 0.0434731 2.29497e-05
+SHARC_D6_STRIP_BACK40_E 0.0385564 2.24943e-05
+SHARC_D6_STRIP_BACK41_E 3.53799 0.000324051
+SHARC_D6_STRIP_BACK42_E 0.0385198 2.24836e-05
+SHARC_D6_STRIP_BACK43_E 0.0285279 2.29171e-05
+SHARC_D6_STRIP_BACK44_E 0.0265627 2.25233e-05
+SHARC_D6_STRIP_BACK45_E 0.0333433 2.2531e-05
+SHARC_D6_STRIP_BACK46_E 0.0200449 2.29807e-05
+SHARC_D6_STRIP_BACK47_E 0.0293445 2.24907e-05
+SHARC_D7_STRIP_FRONT1_E 0.0111471 2.14709e-05
+SHARC_D7_STRIP_FRONT2_E 0.0109067 2.19744e-05
+SHARC_D7_STRIP_FRONT3_E -0.0144983 2.12644e-05
+SHARC_D7_STRIP_FRONT4_E 0.00958447 2.21958e-05
+SHARC_D7_STRIP_FRONT5_E 0.00809943 2.21e-05
+SHARC_D7_STRIP_FRONT6_E 0.0110324 2.22059e-05
+SHARC_D7_STRIP_FRONT7_E 0.016297 2.17193e-05
+SHARC_D7_STRIP_FRONT8_E 0.0133115 2.20289e-05
+SHARC_D7_STRIP_FRONT9_E 0.00415246 2.08826e-05
+SHARC_D7_STRIP_FRONT10_E 0.00902517 2.13638e-05
+SHARC_D7_STRIP_FRONT11_E 0.00770633 2.15624e-05
+SHARC_D7_STRIP_FRONT12_E -0.00164026 2.13971e-05
+SHARC_D7_STRIP_FRONT13_E 0.00403168 2.16003e-05
+SHARC_D7_STRIP_FRONT14_E 0.00881677 2.22311e-05
+SHARC_D7_STRIP_FRONT15_E -0.0334207 2.20094e-05
+SHARC_D7_STRIP_FRONT16_E 0.00373577 2.20422e-05
+SHARC_D7_STRIP_FRONT17_E 0.00897941 2.21518e-05
+SHARC_D7_STRIP_FRONT18_E -0.000181608 2.2362e-05
+SHARC_D7_STRIP_FRONT19_E 0.00775456 2.20313e-05
+SHARC_D7_STRIP_FRONT20_E 0.0155661 2.19076e-05
+SHARC_D7_STRIP_FRONT21_E 0.0168267 2.21411e-05
+SHARC_D7_STRIP_FRONT22_E 0.00881832 2.23677e-05
+SHARC_D7_STRIP_FRONT23_E 0.00365454 2.21892e-05
+SHARC_D7_STRIP_BACK12_E 0.0490787 2.28767e-05
+SHARC_D7_STRIP_BACK13_E 0.0543162 2.27022e-05
+SHARC_D7_STRIP_BACK14_E 0.0422382 2.26245e-05
+SHARC_D7_STRIP_BACK15_E 0.0255048 2.30319e-05
+SHARC_D7_STRIP_BACK16_E -0.0418349 2.28575e-05
+SHARC_D7_STRIP_BACK17_E 0.0449648 2.30128e-05
+SHARC_D7_STRIP_BACK18_E 0.0311507 2.31352e-05
+SHARC_D7_STRIP_BACK19_E 0.0424563 2.29341e-05
+SHARC_D7_STRIP_BACK20_E 0.0417637 2.28612e-05
+SHARC_D7_STRIP_BACK21_E 0.0373395 2.289e-05
+SHARC_D7_STRIP_BACK22_E 0.0326856 2.28419e-05
+SHARC_D7_STRIP_BACK23_E 0.0357087 2.25265e-05
+SHARC_D7_STRIP_BACK24_E 0.0280085 2.29681e-05
+SHARC_D7_STRIP_BACK25_E 0.0342112 2.34278e-05
+SHARC_D7_STRIP_BACK26_E 0.0367721 2.29647e-05
+SHARC_D7_STRIP_BACK27_E 0.0388958 2.35108e-05
+SHARC_D7_STRIP_BACK29_E 0.0297903 2.32002e-05
+SHARC_D7_STRIP_BACK31_E 0.0247006 2.24339e-05
+SHARC_D7_STRIP_BACK32_E 0.0378452 2.2825e-05
+SHARC_D7_STRIP_BACK33_E 0.0397023 2.32915e-05
+SHARC_D7_STRIP_BACK34_E 0.0288076 2.30423e-05
+SHARC_D7_STRIP_BACK36_E 0.0404461 2.2752e-05
+SHARC_D7_STRIP_BACK38_E 0.0233955 2.34949e-05
+SHARC_D7_STRIP_BACK39_E 0.0298339 2.2881e-05
+SHARC_D7_STRIP_BACK40_E 0.0280095 2.32431e-05
+SHARC_D7_STRIP_BACK41_E 0.0241983 2.29269e-05
+SHARC_D7_STRIP_BACK42_E 0.0218632 2.29931e-05
+SHARC_D7_STRIP_BACK43_E 0.0206106 2.30039e-05
+SHARC_D7_STRIP_BACK44_E 0.0136246 2.25895e-05
+SHARC_D7_STRIP_BACK45_E 0.0337216 2.34113e-05
+SHARC_D7_STRIP_BACK46_E 0.0251993 2.32068e-05
+SHARC_D7_STRIP_BACK47_E 0.0306201 2.27172e-05
+SHARC_D8_STRIP_FRONT1_E -0.00938955 2.13663e-05
+SHARC_D8_STRIP_FRONT2_E -0.000148791 2.14337e-05
+SHARC_D8_STRIP_FRONT3_E -0.00615021 2.16178e-05
+SHARC_D8_STRIP_FRONT4_E 0.0023255 2.13416e-05
+SHARC_D8_STRIP_FRONT5_E 0.00514757 2.17759e-05
+SHARC_D8_STRIP_FRONT11_E -0.00672231 2.14599e-05
+SHARC_D8_STRIP_FRONT12_E -0.00684039 2.14697e-05
+SHARC_D8_STRIP_FRONT13_E -0.00810409 2.207e-05
+SHARC_D8_STRIP_FRONT16_E -0.00685472 2.20266e-05
+SHARC_D8_STRIP_FRONT17_E -0.0131768 2.2297e-05
+SHARC_D8_STRIP_FRONT18_E -0.0029741 2.19304e-05
+SHARC_D8_STRIP_FRONT19_E -0.00693736 2.22931e-05
+SHARC_D8_STRIP_FRONT20_E -0.00171549 2.22701e-05
+SHARC_D8_STRIP_FRONT21_E -0.00929376 2.21767e-05
+SHARC_D8_STRIP_FRONT22_E -0.0278538 2.21839e-05
+SHARC_D8_STRIP_FRONT23_E -0.0022602 2.20649e-05
+SHARC_D8_STRIP_BACK2_E 3.53799 0.000324051
+SHARC_D8_STRIP_BACK3_E 0.0980749 2.72316e-05
+SHARC_D8_STRIP_BACK4_E 0.0567821 2.32254e-05
+SHARC_D8_STRIP_BACK5_E 0.0721435 2.81065e-05
+SHARC_D8_STRIP_BACK6_E 0.0426144 2.28552e-05
+SHARC_D8_STRIP_BACK7_E 0.0413196 2.27331e-05
+SHARC_D8_STRIP_BACK8_E 0.0409884 2.2848e-05
+SHARC_D8_STRIP_BACK9_E 0.0418038 2.32477e-05
+SHARC_D8_STRIP_BACK10_E 0.0316771 2.31747e-05
+SHARC_D8_STRIP_BACK11_E 0.0372514 2.26756e-05
+SHARC_D8_STRIP_BACK12_E 0.0370299 2.27828e-05
+SHARC_D8_STRIP_BACK13_E 0.0301217 2.25029e-05
+SHARC_D8_STRIP_BACK14_E 0.0286195 2.25003e-05
+SHARC_D8_STRIP_BACK15_E 0.0299568 2.29574e-05
+SHARC_D8_STRIP_BACK17_E 3.53799 0.000324051
+SHARC_D8_STRIP_BACK18_E 0.000891401 2.39545e-05
+SHARC_D8_STRIP_BACK19_E 0.00753597 2.40669e-05
+SHARC_D8_STRIP_BACK20_E 0.00554838 2.34512e-05
+SHARC_D8_STRIP_BACK21_E 0.0156689 2.32156e-05
+SHARC_D8_STRIP_BACK22_E 0.0160044 2.27685e-05
+SHARC_D8_STRIP_BACK23_E 0.00154922 2.35261e-05
+SHARC_D8_STRIP_BACK24_E 0.00941722 2.3384e-05
+SHARC_D8_STRIP_BACK25_E 0.00684016 2.32117e-05
+SHARC_D8_STRIP_BACK26_E -0.00548732 2.34809e-05
+SHARC_D8_STRIP_BACK27_E 0.0201157 2.34148e-05
+SHARC_D8_STRIP_BACK28_E 0.018198 2.36256e-05
+SHARC_D8_STRIP_BACK29_E 0.0190719 2.33848e-05
+SHARC_D8_STRIP_BACK30_E 0.0292787 2.29745e-05
+SHARC_D8_STRIP_BACK31_E 0.0285674 2.25822e-05
+SHARC_D8_STRIP_BACK32_E 0.0231226 2.28624e-05
+SHARC_D8_STRIP_BACK33_E 0.0386775 2.27137e-05
+SHARC_D8_STRIP_BACK34_E 0.0290607 2.29847e-05
+SHARC_D8_STRIP_BACK35_E 0.0341422 2.28036e-05
+SHARC_D8_STRIP_BACK36_E 3.53799 0.000324051
+SHARC_D8_STRIP_BACK37_E 0.0188344 2.32843e-05
+SHARC_D8_STRIP_BACK38_E 0.0349254 2.26834e-05
+SHARC_D8_STRIP_BACK39_E 0.0352429 2.33297e-05
+SHARC_D8_STRIP_BACK40_E 0.0323803 2.15357e-05
+SHARC_D8_STRIP_BACK41_E 0.0250631 2.35277e-05
+SHARC_D8_STRIP_BACK43_E 0.0255274 2.2294e-05
+SHARC_D8_STRIP_BACK44_E 0.0234287 2.32661e-05
+SHARC_D8_STRIP_BACK45_E 0.0270765 2.30607e-05
+SHARC_D8_STRIP_BACK46_E 0.0161063 2.26809e-05
+SHARC_D8_STRIP_BACK47_E 0.0176102 2.31787e-05
+SHARC_D10_STRIP_FRONT1_E -0.0246137 2.40276e-05
+SHARC_D10_STRIP_FRONT2_E -0.0247509 2.36702e-05
+SHARC_D10_STRIP_FRONT3_E -0.0223287 2.35191e-05
+SHARC_D10_STRIP_FRONT4_E -0.0231089 2.41774e-05
+SHARC_D10_STRIP_FRONT5_E -0.02485 2.39843e-05
+SHARC_D10_STRIP_FRONT6_E -0.0287019 2.39263e-05
+SHARC_D10_STRIP_FRONT7_E -0.0188632 2.28559e-05
+SHARC_D10_STRIP_FRONT8_E -0.0156374 2.30957e-05
+SHARC_D10_STRIP_FRONT9_E -0.0159356 2.30804e-05
+SHARC_D10_STRIP_FRONT10_E -0.0227716 2.33393e-05
+SHARC_D10_STRIP_FRONT11_E -0.0162527 2.31961e-05
+SHARC_D10_STRIP_FRONT12_E -0.0213478 2.37989e-05
+SHARC_D10_STRIP_FRONT13_E -0.0136014 2.36708e-05
+SHARC_D10_STRIP_FRONT14_E -0.0126604 2.43061e-05
+SHARC_D10_STRIP_FRONT15_E -0.00918633 2.43673e-05
+SHARC_D10_STRIP_FRONT16_E -0.023791 2.35819e-05
+SHARC_D10_STRIP_FRONT17_E -0.0294735 2.42918e-05
+SHARC_D10_STRIP_FRONT18_E -0.0162182 2.39197e-05
+SHARC_D10_STRIP_FRONT19_E -0.0223356 2.45194e-05
+SHARC_D10_STRIP_FRONT20_E -0.0177009 2.39589e-05
+SHARC_D10_STRIP_FRONT21_E -0.0227187 2.43008e-05
+SHARC_D10_STRIP_FRONT22_E -0.0134246 2.37881e-05
+SHARC_D10_STRIP_FRONT23_E -0.0226326 2.38859e-05
+SHARC_D10_STRIP_BACK11_E 0.0584119 2.55133e-05
+SHARC_D10_STRIP_BACK12_E 0.0699967 2.23195e-05
+SHARC_D10_STRIP_BACK13_E 0.0682196 2.45787e-05
+SHARC_D10_STRIP_BACK14_E 0.0503693 2.26041e-05
+SHARC_D10_STRIP_BACK15_E 0.0502025 2.27367e-05
+SHARC_D10_STRIP_BACK16_E 0.0586348 2.2878e-05
+SHARC_D10_STRIP_BACK17_E 0.0603656 2.28189e-05
+SHARC_D10_STRIP_BACK18_E 0.0591394 2.27393e-05
+SHARC_D10_STRIP_BACK19_E 0.0549039 2.2804e-05
+SHARC_D10_STRIP_BACK20_E 0.0494821 2.32013e-05
+SHARC_D10_STRIP_BACK21_E 0.0487158 2.20511e-05
+SHARC_D10_STRIP_BACK22_E 0.0405202 2.2122e-05
+SHARC_D10_STRIP_BACK23_E 0.0319081 2.21269e-05
+SHARC_D10_STRIP_BACK24_E 0.0235831 2.25546e-05
+SHARC_D10_STRIP_BACK25_E 0.0264097 2.24409e-05
+SHARC_D10_STRIP_BACK26_E 0.0318306 2.27382e-05
+SHARC_D10_STRIP_BACK27_E 0.0362605 2.25108e-05
+SHARC_D10_STRIP_BACK28_E 0.0275711 2.30077e-05
+SHARC_D10_STRIP_BACK29_E 0.0337957 2.28222e-05
+SHARC_D10_STRIP_BACK30_E 0.0270704 2.33736e-05
+SHARC_D10_STRIP_BACK31_E 0.0360256 2.22405e-05
+SHARC_D10_STRIP_BACK32_E 0.0481137 2.27023e-05
+SHARC_D10_STRIP_BACK33_E 0.0441632 2.26257e-05
+SHARC_D10_STRIP_BACK34_E 0.0344984 2.28046e-05
+SHARC_D10_STRIP_BACK35_E 0.0407187 2.25085e-05
+SHARC_D10_STRIP_BACK36_E 0.0446098 2.28614e-05
+SHARC_D10_STRIP_BACK37_E 0.0369654 2.24067e-05
+SHARC_D10_STRIP_BACK38_E 0.0426523 2.32392e-05
+SHARC_D10_STRIP_BACK39_E 0.042786 2.29164e-05
+SHARC_D10_STRIP_BACK40_E 0.057569 2.23818e-05
+SHARC_D10_STRIP_BACK41_E 0.0505517 2.22661e-05
+SHARC_D10_STRIP_BACK42_E 0.0427701 2.31198e-05
+SHARC_D10_STRIP_BACK43_E 0.0325823 2.28741e-05
+SHARC_D10_STRIP_BACK44_E 0.0382447 2.2782e-05
+SHARC_D10_STRIP_BACK45_E 0.041409 2.28557e-05
+SHARC_D10_STRIP_BACK46_E 0.0428671 2.32039e-05
+SHARC_D10_STRIP_BACK47_E 0.0471655 2.3262e-05
+SHARC_D12_STRIP_FRONT1_E -0.00484915 2.33405e-05
+SHARC_D12_STRIP_FRONT2_E -0.0014674 2.34682e-05
+SHARC_D12_STRIP_FRONT3_E -0.0130518 2.33915e-05
+SHARC_D12_STRIP_FRONT5_E -0.0190662 2.37877e-05
+SHARC_D12_STRIP_FRONT6_E -0.0207672 2.43109e-05
+SHARC_D12_STRIP_FRONT8_E -0.00795163 2.36519e-05
+SHARC_D12_STRIP_FRONT9_E -0.0137762 2.36385e-05
+SHARC_D12_STRIP_FRONT10_E -0.0179864 2.36641e-05
+SHARC_D12_STRIP_FRONT11_E -0.0171115 2.34168e-05
+SHARC_D12_STRIP_FRONT12_E -0.0156885 2.28764e-05
+SHARC_D12_STRIP_FRONT13_E -0.0107117 2.35969e-05
+SHARC_D12_STRIP_FRONT14_E -0.0229854 2.37416e-05
+SHARC_D12_STRIP_FRONT15_E -0.0137189 2.38798e-05
+SHARC_D12_STRIP_FRONT16_E -0.0140456 2.40203e-05
+SHARC_D12_STRIP_FRONT17_E -0.0200381 2.36551e-05
+SHARC_D12_STRIP_FRONT18_E -0.00805789 2.35912e-05
+SHARC_D12_STRIP_FRONT19_E -0.0186952 2.43875e-05
+SHARC_D12_STRIP_FRONT20_E -0.0144919 2.45319e-05
+SHARC_D12_STRIP_FRONT21_E -0.0163102 2.33092e-05
+SHARC_D12_STRIP_FRONT22_E -0.0137205 2.36079e-05
+SHARC_D12_STRIP_FRONT23_E -0.0228041 2.40822e-05
+SHARC_D12_STRIP_BACK1_E 3.53799 0.000324051
+SHARC_D12_STRIP_BACK2_E -0.168899 2.64359e-05
+SHARC_D12_STRIP_BACK3_E 0.0255178 2.53173e-05
+SHARC_D12_STRIP_BACK4_E 0.00579596 2.50901e-05
+SHARC_D12_STRIP_BACK5_E 0.0135761 2.5215e-05
+SHARC_D12_STRIP_BACK6_E 0.00734285 2.55434e-05
+SHARC_D12_STRIP_BACK7_E 0.0193437 2.46671e-05
+SHARC_D12_STRIP_BACK8_E 0.00600789 2.50851e-05
+SHARC_D12_STRIP_BACK9_E 0.00144002 2.51709e-05
+SHARC_D12_STRIP_BACK10_E -0.0122236 2.49197e-05
+SHARC_D12_STRIP_BACK11_E -0.00690914 2.49627e-05
+SHARC_D12_STRIP_BACK12_E -0.0190408 2.50708e-05
+SHARC_D12_STRIP_BACK13_E -0.0136739 2.52216e-05
+SHARC_D12_STRIP_BACK14_E -0.000614762 2.48763e-05
+SHARC_D12_STRIP_BACK15_E -0.0115212 2.50992e-05
+SHARC_D12_STRIP_BACK16_E -0.0113651 2.48327e-05
+SHARC_D12_STRIP_BACK17_E -0.00670837 2.55571e-05
+SHARC_D12_STRIP_BACK18_E 0.013741 2.57646e-05
+SHARC_D12_STRIP_BACK19_E -0.000419331 2.51958e-05
+SHARC_D12_STRIP_BACK20_E -0.00456227 2.91852e-05
+SHARC_D12_STRIP_BACK21_E -0.0226305 2.50211e-05
+SHARC_D12_STRIP_BACK22_E -0.0111732 2.56048e-05
+SHARC_D12_STRIP_BACK23_E -0.00691075 2.51414e-05
+SHARC_D12_STRIP_BACK24_E -0.00912395 2.51848e-05
+SHARC_D12_STRIP_BACK25_E -0.0104703 2.52789e-05
+SHARC_D12_STRIP_BACK26_E 0.00903197 2.41685e-05
+SHARC_D12_STRIP_BACK27_E -0.00597004 2.5631e-05
+SHARC_D12_STRIP_BACK28_E -0.00411177 2.51907e-05
+SHARC_D12_STRIP_BACK29_E -0.00238402 2.55322e-05
+SHARC_D12_STRIP_BACK30_E -0.0019266 2.56927e-05
+SHARC_D12_STRIP_BACK32_E 0.00903099 2.46706e-05
+SHARC_D12_STRIP_BACK33_E -0.000226763 2.46582e-05
+SHARC_D12_STRIP_BACK34_E 0.0165983 2.48672e-05
+SHARC_D12_STRIP_BACK35_E 0.00202338 2.48451e-05
+SHARC_D12_STRIP_BACK36_E 0.0028113 2.47164e-05
+SHARC_D12_STRIP_BACK37_E 0.00321136 2.50483e-05
+SHARC_D12_STRIP_BACK38_E 0.00273738 2.49378e-05
+SHARC_D12_STRIP_BACK39_E 0.00942349 2.46461e-05
+SHARC_D12_STRIP_BACK40_E -0.00127344 2.51202e-05
+SHARC_D12_STRIP_BACK41_E -0.0502734 2.51267e-05
+SHARC_D12_STRIP_BACK42_E -0.00239558 2.45522e-05
+SHARC_D12_STRIP_BACK43_E -0.00143522 2.4463e-05
+SHARC_D12_STRIP_BACK44_E -0.00154555 2.54788e-05
+SHARC_D12_STRIP_BACK45_E -0.00260741 2.50383e-05
+SHARC_D12_STRIP_BACK46_E -0.00107954 2.52285e-05
+SHARC_D12_STRIP_BACK47_E 0.0096826 2.5544e-05
diff --git a/NPAnalysis/S1554/SharcEff.root b/NPAnalysis/S1554/SharcEff.root
new file mode 100644
index 0000000000000000000000000000000000000000..7a23fa69e60c04c900074535a14ae2c71c13133d
Binary files /dev/null and b/NPAnalysis/S1554/SharcEff.root differ
diff --git a/NPAnalysis/S1554/Show.C b/NPAnalysis/S1554/Show.C
new file mode 100644
index 0000000000000000000000000000000000000000..74b2446eb248c52cd8511932e6ac2ef4bafdb3d3
--- /dev/null
+++ b/NPAnalysis/S1554/Show.C
@@ -0,0 +1,59 @@
+void Show(){
+  
+  TFile* file = new TFile("../../Outputs/Analysis/BeamTest.root");
+  TTree* tree = (TTree*) file->FindObjectAny("PhysicsTree");
+
+  TCanvas* c = new TCanvas("Result","Result",600,600);
+  c->Divide(2,2);
+
+  c->cd(1);
+  tree->Draw("Ex:AddBack_DC/1000.>>h(500,0,10,500,-5,10)","ELab>0 && ThetaLab>90","colz");
+ 
+  c->cd(2);
+  tree->Draw("Ex>>hE(150,-5,10)","ELab>0 && ThetaLab>90");
+  tree->Draw("Ex>>hE2(150,-5,10)","ELab>0 && ThetaLab>90&&Trifoil.Time>50 && Trifoil.Time<65","same");
+  TH1F* hEx2 =  (TH1F*) gDirectory->FindObjectAny("hE2");    
+  hEx2->SetFillColor(kOrange+7);
+  hEx2->SetLineColor(kOrange+7); 
+  c->cd(3);
+  tree->Draw("ThetaCM>>hCM(36,0,180)","ThetaLab>90 && Trifoil.Time>50 && Trifoil.Time<65 && Ex>-0.8 && Ex< 0.2","");
+  //tree->Draw("ThetaCM>>hCMb(36,0,180)","ThetaLab>90 && Ex>-0.8 && Ex< 0.2","same");
+
+  TH1F* hCM = (TH1F*) gDirectory->FindObjectAny("hCM");
+  //TH1F* hCMb = (TH1F*) gDirectory->FindObjectAny("hCMb");
+ // hCMb->SetMarkerColor(kGreen-3);
+//  hCMb->Sumw2();
+
+  TFile* effFile = new TFile("SharcEff.root");
+  hCM->Sumw2();
+  TH1F* eff = (TH1F*) effFile->FindObjectAny("hDetecThetaCM");
+  eff->Sumw2();
+  eff->Rebin(5);
+  hCM->Divide(eff);
+  hCM->GetXaxis()->SetRangeUser(0,60);
+  gPad->SetLogy();
+
+  TGraph* g = new TGraph("22.si");
+  g->Draw("c"); 
+  double normal = hCM->GetBinContent(hCM->FindBin(8))/g->Eval(8);
+  TF1* f = new TF1("f",Form("%f",normal),0,180);
+   hCM->Divide(f);
+  /*double normalb = hCM->GetBinContent(hCM->FindBin(8))/hCMb->GetBinContent(hCMb->FindBin(8));
+  TF1* fb = new TF1("fb",Form("%f",1./normalb),0,180);
+  hCMb->Divide(fb); 
+*/
+  c->cd(4);
+  tree->Draw("ThetaCM>>hCM2(36,0,180)","ThetaLab>90 && Trifoil.Time>50 && Trifoil.Time<65 && Ex>4 && Ex< 5","");
+  TH1F* hCM2 = (TH1F*) gDirectory->FindObjectAny("hCM2"); 
+  hCM2->Sumw2();
+  hCM2->Divide(eff);              
+  hCM2->GetXaxis()->SetRangeUser(0,60);  
+  gPad->SetLogy();  
+
+  TGraph* g2 = new TGraph("22.sie");
+  g2->Draw("c"); 
+  normal = hCM2->GetBinContent(hCM->FindBin(8))/g2->Eval(8);
+  TF1* f2 = new TF1("f2",Form("%f",normal),0,180);
+  hCM2->Divide(f2);
+
+}
diff --git a/NPAnalysis/S1554/TigressCalibration.txt b/NPAnalysis/S1554/TigressCalibration.txt
new file mode 100644
index 0000000000000000000000000000000000000000..2c3fc300dcb244d7994d48ba9dafe14a03d3c8bb
--- /dev/null
+++ b/NPAnalysis/S1554/TigressCalibration.txt
@@ -0,0 +1,48 @@
+TIGRESS_D5_CRY1_SEG0_E -0.771891 0.00123357
+TIGRESS_D5_CRY2_SEG0_E -0.260452 0.00126496
+TIGRESS_D5_CRY3_SEG0_E 0.0512326 0.00129933
+TIGRESS_D5_CRY4_SEG0_E -0.0404476 0.00128342
+TIGRESS_D6_CRY1_SEG0_E -0.0738317 0.00130117
+TIGRESS_D6_CRY2_SEG0_E -0.0218315 0.00131135
+TIGRESS_D6_CRY3_SEG0_E -0.475758 0.00104663
+TIGRESS_D6_CRY4_SEG0_E 0.00667737 0.00127443
+TIGRESS_D7_CRY1_SEG0_E 0.0772489 0.00132636
+TIGRESS_D7_CRY2_SEG0_E -0.431499 0.00129204
+TIGRESS_D7_CRY3_SEG0_E -0.232263 0.00129774
+TIGRESS_D7_CRY4_SEG0_E 0.00755919 0.00131869
+TIGRESS_D8_CRY1_SEG0_E 0.110836 0.00126591
+TIGRESS_D8_CRY2_SEG0_E 0.210256 0.00125411
+TIGRESS_D8_CRY3_SEG0_E -0.105597 0.00126849
+TIGRESS_D8_CRY4_SEG0_E -0.60881 0.00128748
+TIGRESS_D9_CRY1_SEG0_E -0.369976 0.0013191
+TIGRESS_D9_CRY2_SEG0_E -0.857263 0.00124882
+TIGRESS_D9_CRY3_SEG0_E -0.272451 0.00138852
+TIGRESS_D9_CRY4_SEG0_E -0.192207 0.00122637
+TIGRESS_D10_CRY1_SEG0_E 0.169917 0.00127444
+TIGRESS_D10_CRY2_SEG0_E 0.276966 0.00124415
+TIGRESS_D10_CRY3_SEG0_E -0.310557 0.00131662
+TIGRESS_D10_CRY4_SEG0_E 0.715662 0.00125387
+TIGRESS_D11_CRY1_SEG0_E -0.059879 0.0012897
+TIGRESS_D11_CRY2_SEG0_E -0.231845 0.00132258
+TIGRESS_D11_CRY3_SEG0_E -0.0413033 0.00123055
+TIGRESS_D11_CRY4_SEG0_E -0.28909 0.00122752
+TIGRESS_D12_CRY1_SEG0_E -0.364146 0.00126993
+TIGRESS_D12_CRY2_SEG0_E 0.191165 0.00128822
+TIGRESS_D12_CRY3_SEG0_E -0.666555 0.00131427
+TIGRESS_D12_CRY4_SEG0_E 0.0413247 0.00130442
+TIGRESS_D13_CRY1_SEG0_E 0.123573 0.00125444
+TIGRESS_D13_CRY2_SEG0_E -0.0301719 0.00123952
+TIGRESS_D13_CRY3_SEG0_E -0.0415504 0.00127214
+TIGRESS_D13_CRY4_SEG0_E 0.0409325 0.00124429
+TIGRESS_D14_CRY1_SEG0_E -0.0612007 0.00125159
+TIGRESS_D14_CRY2_SEG0_E -0.0504007 0.00129919
+TIGRESS_D14_CRY3_SEG0_E -0.241456 0.00128343
+TIGRESS_D14_CRY4_SEG0_E -0.744806 0.00127653
+TIGRESS_D15_CRY1_SEG0_E -0.091431 0.00127068
+TIGRESS_D15_CRY2_SEG0_E 0.120978 0.00127709
+TIGRESS_D15_CRY3_SEG0_E -0.464926 0.00129037
+TIGRESS_D15_CRY4_SEG0_E 0.17606 0.00125192
+TIGRESS_D16_CRY1_SEG0_E -0.0548401 0.0013308
+TIGRESS_D16_CRY2_SEG0_E -0.149941 0.0012316
+TIGRESS_D16_CRY3_SEG0_E -0.195287 0.00134661
+TIGRESS_D16_CRY4_SEG0_E -0.120961 0.00133271
diff --git a/NPAnalysis/S1554/macro/Energy/EnergyCalibrator.cxx b/NPAnalysis/S1554/macro/Energy/EnergyCalibrator.cxx
new file mode 100644
index 0000000000000000000000000000000000000000..483efc6181b1e0518870022af03a15b882ee5ba8
--- /dev/null
+++ b/NPAnalysis/S1554/macro/Energy/EnergyCalibrator.cxx
@@ -0,0 +1,64 @@
+void EnergyCalibrator(){
+  TFile* file = new TFile("~/Desktop/nptool/Outputs/Analysis/Sharc_Calib.root");
+  NPL::CalibrationSource* cs1 = new NPL::CalibrationSource();
+  NPL::EnergyLoss* el = new NPL::EnergyLoss("EnergyLossTable/alpha_Al.G4table","G4Table",10);
+
+  ofstream calfile("SharcCalibration.txt");
+  ofstream deadfile("DeadLayer.txt");
+
+  if(!deadfile.is_open() || !calfile.is_open())
+    exit(1);
+
+  vector<double> coeff;
+
+  for(unsigned int det = 0 ; det < 12 ; det++){
+    TH2* h2d = (TH2*) file->FindObjectAny(Form("SHARC%i_STR_FRONT_E_RAW",det+1));
+    if(h2d){
+      for(unsigned int i = 1 ; i < h2d->GetNbinsX() ; i++){
+        TH1D* h = h2d->ProjectionY("px",i,i);
+
+        NPL::CalibrationSource* cs = new NPL::CalibrationSource();
+        cs->Set_ThreeAlphaSource();
+
+        NPL::SiliconCalibrator* mycal = new NPL::SiliconCalibrator();
+      //  double dist = mycal->ZeroExtrapolation(h,cs,el,coeff,0,5000,150000,300000);
+         double dist = mycal->SimpleCalibration(h,cs,el,coeff,150000,300000);
+
+        gPad->Update();
+        if(dist>=0){
+          deadfile << Form("SHARC_D%i_STRIP_FRONT%i_DEADLAYER ",det+1,i) << dist <<endl;
+          calfile << Form("SHARC_D%i_STRIP_FRONT%i_E ",det+1,i) << coeff[0] << " " << coeff[1] << endl; 
+        }
+
+        delete h;
+        delete mycal;
+        delete cs;
+      }
+    
+    h2d = (TH2*) file->FindObjectAny(Form("SHARC%i_STR_BACK_E_RAW",det+1));
+    if(h2d){
+      for(unsigned int i = 1 ; i < h2d->GetNbinsX() ; i++){
+        TH1D* h = h2d->ProjectionY("px",i,i);
+
+        NPL::CalibrationSource* cs = new NPL::CalibrationSource();
+        cs->Set_ThreeAlphaSource();
+
+        NPL::SiliconCalibrator* mycal = new NPL::SiliconCalibrator();
+       // double dist = mycal->ZeroExtrapolation(h,cs,el,coeff,0,5000,150000,300000);
+         double dist = mycal->SimpleCalibration(h,cs,el,coeff,150000,300000);
+
+        gPad->Update();
+        if(dist>=0){
+          deadfile << Form("SHARC_D%i_STRIP_BACK%i_DEADLAYER ",det+1,i) << dist <<endl;
+          calfile << Form("SHARC_D%i_STRIP_BACK%i_E ",det+1,i) << coeff[0] << " " << coeff[1] << endl; 
+        }
+
+        delete h;
+        delete mycal;
+        delete cs;
+      }
+    } 
+    }
+  }
+
+}
diff --git a/NPAnalysis/Sharc/Analysis.cxx b/NPAnalysis/Sharc/Analysis.cxx
new file mode 100644
index 0000000000000000000000000000000000000000..746ee20af14f3135d570d532341ff590acc32218
--- /dev/null
+++ b/NPAnalysis/Sharc/Analysis.cxx
@@ -0,0 +1,173 @@
+/*****************************************************************************
+ * Copyright (C) 2009-2014    this file is part of the NPTool Project        *
+ *                                                                           *
+ * For the licensing terms see $NPTOOL/Licence/NPTool_Licence                *
+ * For the list of contributors see $NPTOOL/Licence/Contributors             *
+ *****************************************************************************/
+
+/*****************************************************************************
+ * Original Author: Adrien MATTA  contact address: a.matta@surrey.ac.uk      *
+ *                                                                           *
+ * Creation Date  : march 2025                                               *
+ * Last update    :                                                          *
+ *---------------------------------------------------------------------------*
+ * Decription:                                                               *
+ * Class describing the property of an Analysis object                       *
+ *                                                                           *
+ *---------------------------------------------------------------------------*
+ * Comment:                                                                  *
+ *                                                                           *
+ *                                                                           *
+ *****************************************************************************/
+#include<iostream>
+using namespace std;
+#include"Analysis.h"
+#include"NPAnalysisFactory.h"
+#include"NPDetectorManager.h"
+#include"NPOptionManager.h"
+////////////////////////////////////////////////////////////////////////////////
+Analysis::Analysis(){
+}
+////////////////////////////////////////////////////////////////////////////////
+Analysis::~Analysis(){
+}
+
+////////////////////////////////////////////////////////////////////////////////
+void Analysis::Init(){
+  InitOutputBranch();
+  InitInputBranch();
+  
+  Sharc = (TSharcPhysics*)  m_DetectorManager -> GetDetector("Sharc");
+  LightCD2 = EnergyLoss("proton_CD2.G4table","G4Table",100 );
+  LightSi = EnergyLoss("proton_Si.G4table","G4Table",100);
+  BeamCD2 = EnergyLoss("Mg28[0.0]_CD2.G4table","G4Table",100);
+  myReaction = new NPL::Reaction();
+  myReaction->ReadConfigurationFile(NPOptionManager::getInstance()->GetReactionFile());
+   TargetThickness = m_DetectorManager->GetTargetThickness()*micrometer;
+  OriginalBeamEnergy = myReaction->GetBeamEnergy();
+   Rand = TRandom3();
+   DetectorNumber = 0 ;
+   ThetaNormalTarget = 0 ;
+   ThetaM2Surface = 0;
+   Si_E_M2 = 0 ;
+   CsI_E_M2 = 0 ;
+   Energy = 0;
+   E_M2 = 0;
+  
+   ThetaSharcSurface = 0;
+   X_Sharc = 0 ;
+   Y_Sharc = 0 ;
+   Z_Sharc = 0 ;
+   Si_E_Sharc = 0 ;
+   E_Sharc = 0;
+   Si_X_Sharc = 0;
+   Si_Y_Sharc = 0;
+}
+
+////////////////////////////////////////////////////////////////////////////////
+void Analysis::TreatEvent(){
+  // Reinitiate calculated variable
+  ReInitValue();
+  double XTarget = 0;
+  double YTarget = 0;
+  TVector3 BeamDirection = TVector3(0,0,1);
+  double BeamEnergy = BeamCD2.Slow(OriginalBeamEnergy,TargetThickness*0.5,0);
+  myReaction->SetBeamEnergy(BeamEnergy);
+  ////////////////////////////////////////////////////////////////////////////
+  ////////////////////////////////////////////////////////////////////////////
+  //////////////////////////// LOOP on Sharc//////////////////
+  if(Sharc->Strip_E.size()>0){
+    /************************************************/
+    // Part 1 : Impact Angle
+    ThetaSharcSurface = 0;
+    ThetaNormalTarget = 0;
+    if(XTarget>-1000 && YTarget>-1000){
+      TVector3 HitDirection = Sharc -> GetPositionOfInteraction(0) - BeamImpact ;
+      ThetaLab = HitDirection.Angle( BeamDirection );
+      
+      ThetaSharcSurface = HitDirection.Angle( TVector3(0,0,1) ) ;
+      ThetaNormalTarget = HitDirection.Angle( TVector3(0,0,1) ) ;
+    }
+    
+    else{
+      BeamDirection = TVector3(-1000,-1000,-1000);
+      ThetaSharcSurface    = -1000  ;
+      ThetaNormalTarget = -1000  ;
+    }
+    
+    /************************************************/
+    
+    /************************************************/
+    // Part 2 : Impact Energy
+
+    Energy = ELab = 0;
+    if(Sharc->PAD_E[0]>0){
+      Energy = Sharc->PAD_E[0];
+    }
+
+    Energy += Sharc->Strip_E[0];
+    // Target Correction
+    
+   ELab   = LightCD2.EvaluateInitialEnergy( Energy ,TargetThickness*0.5, ThetaNormalTarget);
+   /************************************************/
+    
+    /************************************************/
+    // Part 3 : Excitation Energy Calculation
+    Ex = myReaction -> ReconstructRelativistic( ELab , ThetaLab );
+    
+    /************************************************/
+    
+    /************************************************/
+    // Part 4 : Theta CM Calculation
+    ThetaCM  = myReaction -> EnergyLabToThetaCM( ELab , ThetaLab)/deg;
+    ThetaLab=ThetaLab/deg;
+    ThetaLab=Rand.Uniform(ThetaLab-0.5,ThetaLab+0.5);
+    /************************************************/
+  }//end loop GASPARD
+
+}
+
+////////////////////////////////////////////////////////////////////////////////
+void Analysis::End(){
+}
+////////////////////////////////////////////////////////////////////////////////
+void Analysis::InitOutputBranch() {
+  RootOutput::getInstance()->GetTree()->Branch("Ex",&Ex,"Ex/D");
+  RootOutput::getInstance()->GetTree()->Branch("ELab",&ELab,"ELab/D");
+  RootOutput::getInstance()->GetTree()->Branch("ThetaLab",&ThetaLab,"ThetaLab/D");
+  RootOutput::getInstance()->GetTree()->Branch("ThetaCM",&ThetaCM,"ThetaCM/D");
+}
+
+////////////////////////////////////////////////////////////////////////////////
+void Analysis::InitInputBranch(){
+}
+////////////////////////////////////////////////////////////////////////////////
+void Analysis::ReInitValue(){
+  Ex = -1000 ;
+  ELab = -1000;
+  ThetaLab = -1000;
+  ThetaCM = -1000;
+}
+
+
+////////////////////////////////////////////////////////////////////////////////
+//            Construct Method to be pass to the AnalysisFactory              //
+////////////////////////////////////////////////////////////////////////////////
+NPL::VAnalysis* Analysis::Construct(){
+  return (NPL::VAnalysis*) new Analysis();
+}
+
+////////////////////////////////////////////////////////////////////////////////
+//            Registering the construct method to the factory                 //
+////////////////////////////////////////////////////////////////////////////////
+extern "C"{
+class proxy{
+  public:
+    proxy(){
+      NPL::AnalysisFactory::getInstance()->SetConstructor(Analysis::Construct);
+    }
+};
+
+proxy p;
+}
+
diff --git a/NPAnalysis/Sharc/Analysis.h b/NPAnalysis/Sharc/Analysis.h
new file mode 100644
index 0000000000000000000000000000000000000000..5b9ce24e5556efcaeae359bb30b716735a7b6330
--- /dev/null
+++ b/NPAnalysis/Sharc/Analysis.h
@@ -0,0 +1,87 @@
+#ifndef Analysis_h 
+#define Analysis_h
+/*****************************************************************************
+ * Copyright (C) 2009-2014    this file is part of the NPTool Project        *
+ *                                                                           *
+ * For the licensing terms see $NPTOOL/Licence/NPTool_Licence                *
+ * For the list of contributors see $NPTOOL/Licence/Contributors             *
+ *****************************************************************************/
+
+/*****************************************************************************
+ * Original Author: Adrien MATTA  contact address: a.matta@surrey.ac.uk      *
+ *                                                                           *
+ * Creation Date  : march 2025                                               *
+ * Last update    :                                                          *
+ *---------------------------------------------------------------------------*
+ * Decription:                                                               *
+ * Class describing the property of an Analysis object                       *
+ *                                                                           *
+ *---------------------------------------------------------------------------*
+ * Comment:                                                                  *
+ *                                                                           *
+ *                                                                           *
+ *****************************************************************************/
+#include"NPVAnalysis.h"
+#include"NPEnergyLoss.h"
+#include"NPReaction.h"
+#include"RootOutput.h"
+#include"RootInput.h"
+#include "TSharcPhysics.h"
+#include "TInitialConditions.h"
+#include <TRandom3.h>
+#include <TVector3.h>
+#include <TMath.h>
+
+class Analysis: public NPL::VAnalysis{
+  public:
+    Analysis();
+    ~Analysis();
+
+  public: 
+    void Init();
+    void TreatEvent();
+    void End();
+
+  void InitOutputBranch();
+  void InitInputBranch();
+  void ReInitValue();
+  static NPL::VAnalysis* Construct();
+ 
+  private:
+  double Ex;
+  double ELab;
+  double ThetaLab;
+  double ThetaCM;
+  NPL::Reaction* myReaction;
+TInitialConditions* myInit ;
+  //	Energy loss table: the G4Table are generated by the simulation
+  EnergyLoss LightCD2;
+  EnergyLoss LightAl;
+  EnergyLoss LightSi;
+  EnergyLoss BeamCD2;
+  TVector3 BeamImpact;
+  
+  double TargetThickness ;
+  // Beam Energy
+  double OriginalBeamEnergy ; // AMEV
+                                                           // intermediate variable
+  TRandom3 Rand ;
+  int DetectorNumber  ;
+  double ThetaNormalTarget;
+  double ThetaM2Surface ;
+  double Si_E_M2 ;
+  double CsI_E_M2  ;
+  double Energy ;
+  double E_M2 ;
+  
+  double ThetaSharcSurface ;
+  double X_Sharc ;
+  double Y_Sharc ;
+  double Z_Sharc  ;
+  double Si_E_Sharc ;
+  double E_Sharc ;
+  double Si_X_Sharc ;
+  double Si_Y_Sharc ;
+  TSharcPhysics* Sharc;
+};
+#endif
diff --git a/NPAnalysis/Sharc/CMakeLists.txt b/NPAnalysis/Sharc/CMakeLists.txt
new file mode 100644
index 0000000000000000000000000000000000000000..1d6a34417c73bce95f165aa644967bd249e9b521
--- /dev/null
+++ b/NPAnalysis/Sharc/CMakeLists.txt
@@ -0,0 +1,31 @@
+cmake_minimum_required (VERSION 2.8) 
+#Finding NPTool
+set(NPTOOL "$ENV{NPTOOL}")
+set(NPLIB "${NPTOOL}/NPLib")
+set(NPTOOL_INCLUDE_DIR "${NPLIB}/include")
+set(NPTOOL_LIB_DIR "${NPLIB}/lib")
+  
+include("${NPLIB}/FindROOT.cmake")  
+
+project (NPAnalysis)
+set(CMAKE_BUILD_TYPE Release)  
+# Add root to the link and include directories
+include_directories( ${ROOT_INCLUDE_DIR})
+link_directories( ${ROOT_LIBRARY_DIR})
+include_directories( ${NPTOOL_INCLUDE_DIR})
+link_directories( ${NPTOOL_LIB_DIR})
+
+# Get the compilator flag from root to assure consistancy
+EXEC_PROGRAM(${ROOT_CONFIG_EXECUTABLE}
+     ARGS "--cflags"
+     OUTPUT_VARIABLE root_cflags )
+
+set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${root_cflags}")
+
+# If the compiler is Clang, silence the unrecognised flags
+if(${CMAKE_CXX_COMPILER_ID} MATCHES ".*Clang.*")
+  set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Qunused-arguments -undefined dynamic_lookup")
+endif()
+
+add_library(NPAnalysis SHARED Analysis.cxx)
+target_link_libraries(NPAnalysis ${ROOT_LIBRARIES} -L${NPLIB}/lib -lNPCore -lNPPhysics)
diff --git a/NPAnalysis/Sharc/configs/ConfigSharc.dat b/NPAnalysis/Sharc/configs/ConfigSharc.dat
new file mode 100644
index 0000000000000000000000000000000000000000..d8b051af5a332c9da1b32b78b12f565d66f723e1
--- /dev/null
+++ b/NPAnalysis/Sharc/configs/ConfigSharc.dat
@@ -0,0 +1,5 @@
+ConfigSharc
+%  DISABLE_ALL SH1
+  DISABLE_CHANNEL SH2STRF1
+%  DISABLE_CHANNEL SH2STRB1   
+
diff --git a/NPAnalysis/newHira/Analysis.cxx b/NPAnalysis/newHira/Analysis.cxx
new file mode 100644
index 0000000000000000000000000000000000000000..3581d19f045e15c2ca2252dcf050a4ae3d5f268d
--- /dev/null
+++ b/NPAnalysis/newHira/Analysis.cxx
@@ -0,0 +1,223 @@
+/*****************************************************************************
+ * Copyright (C) 2009-2014    this file is part of the NPTool Project        *
+ *                                                                           *
+ * For the licensing terms see $NPTOOL/Licence/NPTool_Licence                *
+ * For the list of contributors see $NPTOOL/Licence/Contributors             *
+ *****************************************************************************/
+
+/*****************************************************************************
+ * Original Author: Adrien MATTA  contact address: a.matta@surrey.ac.uk      *
+ *                                                                           *
+ * Creation Date  : march 2025                                               *
+ * Last update    :                                                          *
+ *---------------------------------------------------------------------------*
+ * Decription:                                                               *
+ * Class describing the property of an Analysis object                       *
+ *                                                                           *
+ *---------------------------------------------------------------------------*
+ * Comment:                                                                  *
+ *                                                                           *
+ *                                                                           *
+ *****************************************************************************/
+#include<iostream>
+using namespace std;
+#include"Analysis.h"
+#include"NPAnalysisFactory.h"
+#include"NPDetectorManager.h"
+#include"NPOptionManager.h"
+#include"RootOutput.h"
+#include"RootInput.h"
+////////////////////////////////////////////////////////////////////////////////
+Analysis::Analysis(){
+}
+////////////////////////////////////////////////////////////////////////////////
+Analysis::~Analysis(){
+}
+
+////////////////////////////////////////////////////////////////////////////////
+void Analysis::Init(){
+  M2= (TMust2Physics*) m_DetectorManager->GetDetector("MUST2Array");
+  SSSD= (TSSSDPhysics*) m_DetectorManager->GetDetector("SSSD");
+  Initial=new TInitialConditions();
+  InitOutputBranch();
+  InitInputBranch();
+  Rand = TRandom3();
+  He10Reaction= new NPL::Reaction();
+  He10Reaction->ReadConfigurationFile(NPOptionManager::getInstance()->GetReactionFile());
+  DetectorNumber = 0 ;
+  ThetaNormalTarget = 0 ;
+  ThetaM2Surface = 0; 
+  X_M2 = 0 ;
+  Y_M2 = 0 ;
+  Z_M2 = 0 ;
+  Si_E_M2 = 0 ;
+  CsI_E_M2 = 0 ; 
+  E_SSSD = 0 ;
+  Energy = 0;
+  E_M2 = 0;
+  Si_X_M2 = 0;
+  Si_Y_M2 = 0;
+  ZTarget = 0;
+  TargetThickness = m_DetectorManager->GetTargetThickness()*micrometer;
+  //	Energy loss table: the G4Table are generated by the simulation
+  He3CD2 = EnergyLoss("He3_CD2.G4table","G4Table",100 );
+  He3Al = EnergyLoss("He3_Al.G4table","G4Table",10);
+  He3Si = EnergyLoss("He3_Si.G4table","G4Table",10);
+  //Li11CD2 = EnergyLoss("Li11[0.0]_CD2.G4table","G4Table",100);
+}
+
+////////////////////////////////////////////////////////////////////////////////
+void Analysis::TreatEvent(){
+  // Reinitiate calculated variable
+  ReInitValue();
+  // Get the Init information on beam position and energy
+  // and apply by hand the experimental resolution
+  // This is because the beam diagnosis are not simulated
+  // PPAC position resolution on target is assumed to be 1mm
+  double XTarget = Rand.Gaus(Initial->GetIncidentPositionX(),1);
+  double YTarget = Rand.Gaus(Initial->GetIncidentPositionY(),1);
+  TVector3 BeamDirection = Initial->GetBeamDirection();
+  // Beam energy is measured using F3 and F2 plastic TOF
+  double BeamEnergy = Rand.Gaus(Initial->GetIncidentInitialKineticEnergy(),4.5);
+  //BeamEnergy = Li11CD2.Slow(BeamEnergy,TargetThickness/2.,0);
+
+  He10Reaction->SetBeamEnergy(BeamEnergy);
+  //////////////////////////// LOOP on MUST2 + SSSD Hit //////////////////
+  for(unsigned int countSSSD = 0 ; countSSSD < SSSD->Energy.size() ; countSSSD++){
+    for(unsigned int countMust2 = 0 ; countMust2 < M2->Si_E.size() ; countMust2++){
+      /************************************************/
+      //Part 0 : Get the usefull Data
+      // MUST2
+      int X = M2->Si_X[countMust2];
+      int Y = M2->Si_Y[countMust2];
+      int TelescopeNumber = M2->TelescopeNumber[countMust2];
+      Si_X_M2 = X ;
+      Si_Y_M2 = Y ;
+      //SSSD
+      int SiNumber = SSSD->DetectorNumber[countSSSD];
+
+      /************************************************/
+      // Matching between Thin Si and MUST2, and Forward Telescope Only
+      if(TelescopeNumber==SiNumber && TelescopeNumber<5){
+        DetectorNumber = TelescopeNumber ;
+        /************************************************/
+        // Part 1 : Impact Angle
+        ThetaM2Surface = 0;
+        ThetaNormalTarget = 0;
+        if(XTarget>-1000 && YTarget>-1000){
+          TVector3 BeamImpact(XTarget,YTarget,0);
+          TVector3 HitDirection = M2 -> GetPositionOfInteraction(countMust2) - BeamImpact ;
+          ThetaLab = HitDirection.Angle( BeamDirection );
+
+          ThetaM2Surface = HitDirection.Angle(- M2 -> GetTelescopeNormal(countMust2) );
+          ThetaNormalTarget = HitDirection.Angle( TVector3(0,0,1) ) ;
+          X_M2 = M2 -> GetPositionOfInteraction(countMust2).X() ;
+          Y_M2 = M2 -> GetPositionOfInteraction(countMust2).Y() ;
+          Z_M2 = M2 -> GetPositionOfInteraction(countMust2).Z() ;
+        }
+
+        else{
+          BeamDirection = TVector3(-1000,-1000,-1000);
+          ThetaM2Surface    = -1000  ;
+          ThetaNormalTarget = -1000  ;
+        }
+
+        /************************************************/
+
+        /************************************************/
+
+        // Part 2 : Impact Energy
+        Energy = ELab = 0;
+        Si_E_M2 = M2->Si_E[countMust2];
+        CsI_E_M2= M2->CsI_E[countMust2];
+        E_SSSD = SSSD->Energy[countSSSD];
+
+        // if CsI
+        if(CsI_E_M2>0 ){
+          // The energy in CsI is calculate form dE/dx Table because 
+          // 20um resolution is poor
+          Energy = 
+            He3Si.EvaluateEnergyFromDeltaE(Si_E_M2,300*micrometer,
+                ThetaM2Surface, 0.01*MeV, 
+                450.*MeV,0.001*MeV ,1000);
+          E_M2=CsI_E_M2;
+        }
+
+        else
+          Energy = Si_E_M2;
+
+        E_M2 += Si_E_M2;
+
+        // Evaluate energy using the thickness 
+        ELab = He3Al.EvaluateInitialEnergy( Energy ,2*0.4*micrometer , ThetaM2Surface); 
+        ELab = He3Si.EvaluateInitialEnergy( ELab ,20*micrometer , ThetaM2Surface);
+        ELab = He3Al.EvaluateInitialEnergy( ELab ,0.4*micrometer , ThetaM2Surface);
+        // Target Correction
+        ELab   = He3CD2.EvaluateInitialEnergy( ELab ,TargetThickness/2., ThetaNormalTarget);
+        /************************************************/
+
+        /************************************************/
+        // Part 3 : Excitation Energy Calculation
+        Ex = He10Reaction -> ReconstructRelativistic( ELab , ThetaLab );
+        /************************************************/
+
+
+        /************************************************/
+        // Part 4 : Theta CM Calculation
+        ThetaCM  = He10Reaction -> EnergyLabToThetaCM( ELab , ThetaLab)/deg;
+        ThetaLab=ThetaLab/deg;
+        /************************************************/
+      
+      }
+    } //end loop SSSD
+  }//end loop MUST2
+}
+
+////////////////////////////////////////////////////////////////////////////////
+void Analysis::End(){
+}
+
+////////////////////////////////////////////////////////////////////////////////
+void Analysis::InitOutputBranch() {
+  RootOutput::getInstance()->GetTree()->Branch("Ex",&Ex,"Ex/D");
+  RootOutput::getInstance()->GetTree()->Branch("ELab",&ELab,"ELab/D");
+  RootOutput::getInstance()->GetTree()->Branch("ThetaLab",&ThetaLab,"ThetaLab/D");
+  RootOutput::getInstance()->GetTree()->Branch("ThetaCM",&ThetaCM,"ThetaCM/D");
+}
+
+////////////////////////////////////////////////////////////////////////////////
+void Analysis::InitInputBranch(){
+  RootInput:: getInstance()->GetChain()->SetBranchStatus("InitialConditions",true );
+  RootInput:: getInstance()->GetChain()->SetBranchStatus("fIC_*",true );
+  RootInput:: getInstance()->GetChain()->SetBranchAddress("InitialConditions",&Initial);
+}
+
+////////////////////////////////////////////////////////////////////////////////     
+void Analysis::ReInitValue(){
+  Ex = -1000 ;
+  ELab = -1000;
+  ThetaLab = -1000;
+  ThetaCM = -1000;
+}
+
+////////////////////////////////////////////////////////////////////////////////
+//            Construct Method to be pass to the DetectorFactory              //
+////////////////////////////////////////////////////////////////////////////////
+NPL::VAnalysis* Analysis::Construct(){
+  return (NPL::VAnalysis*) new Analysis();
+}
+
+////////////////////////////////////////////////////////////////////////////////
+//            Registering the construct method to the factory                 //
+////////////////////////////////////////////////////////////////////////////////
+extern "C"{
+class proxy{
+  public:
+    proxy(){
+      NPL::AnalysisFactory::getInstance()->SetConstructor(Analysis::Construct);
+    }
+};
+
+proxy p;
+}
+
diff --git a/NPAnalysis/newHira/Analysis.h b/NPAnalysis/newHira/Analysis.h
new file mode 100644
index 0000000000000000000000000000000000000000..10215aa6d91645e0ed52fde8a5c213cc9c1e2b43
--- /dev/null
+++ b/NPAnalysis/newHira/Analysis.h
@@ -0,0 +1,80 @@
+#ifndef Analysis_h 
+#define Analysis_h
+/*****************************************************************************
+ * Copyright (C) 2009-2014    this file is part of the NPTool Project        *
+ *                                                                           *
+ * For the licensing terms see $NPTOOL/Licence/NPTool_Licence                *
+ * For the list of contributors see $NPTOOL/Licence/Contributors             *
+ *****************************************************************************/
+
+/*****************************************************************************
+ * Original Author: Adrien MATTA  contact address: a.matta@surrey.ac.uk      *
+ *                                                                           *
+ * Creation Date  : march 2025                                               *
+ * Last update    :                                                          *
+ *---------------------------------------------------------------------------*
+ * Decription:                                                               *
+ * Class describing the property of an Analysis object                       *
+ *                                                                           *
+ *---------------------------------------------------------------------------*
+ * Comment:                                                                  *
+ *                                                                           *
+ *                                                                           *
+ *****************************************************************************/
+#include"NPVAnalysis.h"
+#include"THiraPhysics.h"
+#include "TMust2Physics.h"
+#include "TSSSDPhysics.h"
+#include "TInitialConditions.h"
+#include "NPEnergyLoss.h"
+#include "NPReaction.h"
+#include "TRandom3.h"
+class Analysis: public NPL::VAnalysis{
+  public:
+    Analysis();
+    ~Analysis();
+
+  public: 
+    void Init();
+    void TreatEvent();
+    void End();
+    void InitOutputBranch();
+    void InitInputBranch();
+    void ReInitValue();
+    static NPL::VAnalysis* Construct();
+
+  private:
+    double Ex;
+    double ELab;
+    double ThetaLab;
+    double ThetaCM;
+    NPL::Reaction* He10Reaction;
+
+    // intermediate variable
+    TRandom3 Rand;
+    int DetectorNumber;
+    double ThetaNormalTarget;
+    double ThetaM2Surface; 
+    double X_M2;
+    double Y_M2;
+    double Z_M2;
+    double Si_E_M2;
+    double CsI_E_M2; 
+    double E_SSSD;
+    double Energy = 0;
+    double E_M2 = 0;
+    double Si_X_M2 = 0;
+    double Si_Y_M2 = 0;
+    double ZTarget = 0;
+    double TargetThickness;
+
+    NPL::EnergyLoss He3CD2  ;
+    NPL::EnergyLoss He3Al   ;
+    NPL::EnergyLoss He3Si   ;
+    NPL::EnergyLoss Li11CD2 ;
+
+    TMust2Physics* M2;
+    TSSSDPhysics* SSSD;
+    TInitialConditions* Initial;
+};
+#endif
diff --git a/NPAnalysis/newHira/CMakeLists.txt b/NPAnalysis/newHira/CMakeLists.txt
new file mode 100644
index 0000000000000000000000000000000000000000..08575f4c3b73a5dad06543b81172b08cec419bbe
--- /dev/null
+++ b/NPAnalysis/newHira/CMakeLists.txt
@@ -0,0 +1,31 @@
+cmake_minimum_required (VERSION 2.8) 
+#Finding NPTool
+set(NPTOOL "$ENV{NPTOOL}")
+set(NPLIB "${NPTOOL}/NPLib")
+set(NPTOOL_INCLUDE_DIR "${NPLIB}/include")
+set(NPTOOL_LIB_DIR "${NPLIB}/lib")
+  
+include("${NPLIB}/FindROOT.cmake")  
+
+project (NPAnalysis)
+set(CMAKE_BUILD_TYPE Release)  
+# Add root to the link and include directories
+include_directories( ${ROOT_INCLUDE_DIR})
+link_directories( ${ROOT_LIBRARY_DIR})
+include_directories( ${NPTOOL_INCLUDE_DIR})
+link_directories( ${NPTOOL_LIB_DIR})
+
+# Get the compilator flag from root to assure consistancy
+EXEC_PROGRAM(${ROOT_CONFIG_EXECUTABLE}
+     ARGS "--cflags"
+     OUTPUT_VARIABLE root_cflags )
+
+set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${root_cflags}")
+
+# If the compiler is Clang, silence the unrecognised flags
+if(${CMAKE_CXX_COMPILER_ID} MATCHES ".*Clang.*")
+  set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Qunused-arguments -undefined dynamic_lookup")
+endif()
+
+add_library(NPAnalysis SHARED Analysis.cxx)
+target_link_libraries(NPAnalysis ${ROOT_LIBRARIES} -L${NPLIB}/lib -lNPCore)
diff --git a/NPLib/CATS/TCATSSpectra.cxx b/NPLib/CATS/TCATSSpectra.cxx
index 99257513dd95d7c08a8fa27bea9122335a3b6024..d18c5ce99da8e336205904627ccc5074cdfe5efc 100644
--- a/NPLib/CATS/TCATSSpectra.cxx
+++ b/NPLib/CATS/TCATSSpectra.cxx
@@ -44,6 +44,7 @@ using namespace std;
 
 ////////////////////////////////////////////////////////////////////////////////
 TCATSSpectra::TCATSSpectra(){
+  SetName("CATS");
   fNumberOfCats = 0;
   fStripsNumber = 28;
 
@@ -60,7 +61,7 @@ TCATSSpectra::TCATSSpectra(unsigned int NumberOfCats){
     cout << "TCATSSpectra: Initalising control spectra for " << NumberOfCats << " detectors" << endl; 
     cout << "************************************************" << endl;
   }
-
+  SetName("CATS");
   fNumberOfCats = NumberOfCats;
   fStripsNumber = 28;
   // An histo of size fEventLoopSize is reset every fEventLoopSize to monitor the
diff --git a/NPLib/CMakeLists.txt b/NPLib/CMakeLists.txt
index abf40c026f82693a0c048da91c2dfac2868f46a4..15f9fb07d652c548e79620ac5822d9d6dcad4388 100644
--- a/NPLib/CMakeLists.txt
+++ b/NPLib/CMakeLists.txt
@@ -62,9 +62,10 @@ MACRO(subdirlist result curdir)
       string(COMPARE EQUAL "${child}" "InteractionCoordinates" r8)
       string(COMPARE EQUAL "${child}" "Utility" r9)
       string(COMPARE EQUAL "${child}" "bin" r10)
-      IF(NOT r0 AND NOT r1 AND NOT r2 AND NOT r3 AND NOT r4 AND NOT r5 AND NOT r6 AND NOT r7 AND NOT r8 AND NOT r9 AND NOT r10)
-        string(COMPARE EQUAL "${DETLIST}" "" r11)
-        IF(r11)
+      string(COMPARE EQUAL "${child}" "Calibration" r11)
+      IF(NOT r0 AND NOT r1 AND NOT r2 AND NOT r3 AND NOT r4 AND NOT r5 AND NOT r6 AND NOT r7 AND NOT r8 AND NOT r9 AND NOT r10 AND NOT r11)
+        string(COMPARE EQUAL "${DETLIST}" "" r12)
+        IF(r12)
           LIST(APPEND dirlist ${child})
         ELSEIF(${DETLIST} MATCHES ".*${child}.*" )
           LIST(APPEND dirlist ${child}) 
@@ -77,8 +78,10 @@ ENDMACRO()
 
 # Call the Macro
 subdirlist(SUB_DIRECTORY ${CMAKE_BINARY_DIR})
-set(SUB_DIRECTORY ${SUB_DIRECTORY} Core Physics InitialConditions InteractionCoordinates Utility)
+set(SUB_DIRECTORY ${SUB_DIRECTORY} Core Physics Calibration InitialConditions InteractionCoordinates Utility)
 include_directories("Core/")
+include_directories("Physics/")
+include_directories("Online/")
 
 # Add each sub folder to the project
 set(TARGET_LIST "")
diff --git a/NPLib/Calibration/CMakeLists.txt b/NPLib/Calibration/CMakeLists.txt
new file mode 100644
index 0000000000000000000000000000000000000000..bc1954b58f4176ec141d39b947898e04284a343d
--- /dev/null
+++ b/NPLib/Calibration/CMakeLists.txt
@@ -0,0 +1,5 @@
+add_custom_command(OUTPUT NPSiliconCalibratorDict.cxx NPSiliconCalibrator.rootmap NPSiliconCalibratorDict_rdict.pcm COMMAND ../scripts/build_dict.sh NPSiliconCalibrator.h NPSiliconCalibratorDict.cxx NPSiliconCalibrator.rootmap libNPCalibration.so NPCalibrationLinkDef1.h) 
+add_custom_command(OUTPUT NPCalibrationSourceDict.cxx NPCalibrationSource.rootmap NPCalibrationSourceDict_rdict.pcm COMMAND ../scripts/build_dict.sh NPCalibrationSource.h NPCalibrationSourceDict.cxx NPCalibrationSource.rootmap libNPCalibration.so NPCalibrationLinkDef2.h) 
+add_library(NPCalibration SHARED NPCalibrationSource.cxx NPSiliconCalibrator.cxx NPSiliconCalibratorDict.cxx NPCalibrationSourceDict.cxx)
+target_link_libraries(NPCalibration ${ROOT_LIBRARIES} -lSpectrum  NPCore NPPhysics)  
+install(FILES NPCalibrationSource.h NPCalibrationSource.h DESTINATION  ${CMAKE_INCLUDE_OUTPUT_DIRECTORY})
diff --git a/NPLib/Calibration/NPCalibrationLinkDef1.h b/NPLib/Calibration/NPCalibrationLinkDef1.h
new file mode 100644
index 0000000000000000000000000000000000000000..fb032828f53dbc0af2f36562cbaec262d3bbd5ad
--- /dev/null
+++ b/NPLib/Calibration/NPCalibrationLinkDef1.h
@@ -0,0 +1,3 @@
+#ifdef __CINT__
+#pragma link C++ defined_in "NPSiliconCalibrator.h";
+#endif
diff --git a/NPLib/Calibration/NPCalibrationLinkDef2.h b/NPLib/Calibration/NPCalibrationLinkDef2.h
new file mode 100644
index 0000000000000000000000000000000000000000..0b3648e6b7617da25edc7982e3eaa9b67f038b89
--- /dev/null
+++ b/NPLib/Calibration/NPCalibrationLinkDef2.h
@@ -0,0 +1,3 @@
+#ifdef __CINT__
+#pragma link C++ defined_in "NPCalibrationSource.h";
+#endif
diff --git a/NPLib/Calibration/NPCalibrationSource.cxx b/NPLib/Calibration/NPCalibrationSource.cxx
new file mode 100644
index 0000000000000000000000000000000000000000..d38ede09cc87121c472a962a7a522e7d2c96dd89
--- /dev/null
+++ b/NPLib/Calibration/NPCalibrationSource.cxx
@@ -0,0 +1,131 @@
+// NPL
+#include "NPCalibrationSource.h"
+
+// Root
+#include"TDirectory.h"
+
+////////////////////////////////////////////////////////////////////////////////
+NPL::CalibrationSource::CalibrationSource(){
+m_SourceSignal = 0 ;
+}
+
+////////////////////////////////////////////////////////////////////////////////
+NPL::CalibrationSource::~CalibrationSource(){
+}
+
+////////////////////////////////////////////////////////////////////////////////
+void NPL::CalibrationSource::ComputeSourceSignal(){
+  TString contribution;
+  unsigned int arg_number = 0;
+
+  for(unsigned int i = 0 ; i < m_Energies.size() ; i++){
+    for(unsigned int j = 0 ; j < m_Energies[i].size() ; j++){
+      contribution +=
+      Form("(%f)*[%i]*exp(-(x-[%i]*%f)*(x-[%i]*%f)/(2*[%i]*[%i]))",
+            m_BranchingRatio[i][j]/m_BranchingRatio[i][0], arg_number,
+            arg_number+1, m_Energies[i][j]/m_Energies[i][0],
+            arg_number+1, m_Energies[i][j]/m_Energies[i][0],
+            arg_number+2,arg_number+2);
+    
+      if(j!=m_Energies[i].size()-1) contribution+="+";
+    }
+
+    arg_number+=3;
+      if(i!=m_Energies.size()-1) contribution+="+";
+  }
+
+  m_SourceSignal = new TF1("np_source_signal",contribution,0,1e9);
+  m_SourceSignal->SetNpx(20000);
+  arg_number = 0;
+  for(unsigned int i = 0 ; i < m_Energies.size() ; i++){
+    m_SourceSignal->SetParameter(arg_number++,1000);
+    m_SourceSignal->SetParameter(arg_number++,5000+i*1000);
+    m_SourceSignal->SetParameter(arg_number++,20);
+  }
+
+}
+
+////////////////////////////////////////////////////////////////////////////////
+TF1* NPL::CalibrationSource::GetSourceSignal(){
+  if(!m_SourceSignal)
+    ComputeSourceSignal();
+
+  return m_SourceSignal;
+}
+
+////////////////////////////////////////////////////////////////////////////////
+void NPL::CalibrationSource::AddParticleContribution(vector<double> Energies ,  vector<double> ErrEnergies, vector<double> BranchingRatio){
+  m_Energies.push_back(Energies);
+  m_ErrEnergies.push_back(ErrEnergies);
+  m_BranchingRatio.push_back(BranchingRatio);
+}
+
+////////////////////////////////////////////////////////////////////////////////
+void NPL::CalibrationSource::Set_ThreeAlphaSource(){
+ Set_239Pu();
+ Set_241Am();
+ Set_244Cm();
+}
+
+////////////////////////////////////////////////////////////////////////////////
+void NPL::CalibrationSource::Set_239Pu(){
+  vector<double> Energies;
+  vector<double> ErrEnergies;
+  vector<double> BranchingRatio;
+  
+  Energies.push_back(5.15659);
+  Energies.push_back(5.11443);
+  Energies.push_back(5.1055);
+
+  ErrEnergies.push_back(1.4e-4);
+  ErrEnergies.push_back(8e-5);
+  ErrEnergies.push_back(8e-4);
+  
+  BranchingRatio.push_back(70.77);
+  BranchingRatio.push_back(17.11);
+  BranchingRatio.push_back(11.94);
+
+  AddParticleContribution(Energies,ErrEnergies,BranchingRatio);
+
+}
+
+////////////////////////////////////////////////////////////////////////////////
+void NPL::CalibrationSource::Set_241Am(){
+  vector<double> Energies;
+  vector<double> ErrEnergies;
+  vector<double> BranchingRatio;
+  
+  Energies.push_back(5.48556);
+  Energies.push_back(5.44280);
+  Energies.push_back(5.388);
+
+  ErrEnergies.push_back(1.2e-4);
+  ErrEnergies.push_back(1.3e-4);
+  ErrEnergies.push_back(1e-3); // to be checked
+  
+  BranchingRatio.push_back(84.8);
+  BranchingRatio.push_back(13.1);
+  BranchingRatio.push_back(1.66);
+
+  AddParticleContribution(Energies,ErrEnergies,BranchingRatio);
+}
+
+////////////////////////////////////////////////////////////////////////////////
+void NPL::CalibrationSource::Set_244Cm(){
+  vector<double> Energies;
+  vector<double> ErrEnergies;
+  vector<double> BranchingRatio;
+  
+  Energies.push_back(5.80477);
+  Energies.push_back(5.76264);
+
+  ErrEnergies.push_back(5e-5);
+  ErrEnergies.push_back(3e-5);
+  
+  BranchingRatio.push_back(76.40);
+  BranchingRatio.push_back(23.60);
+
+  AddParticleContribution(Energies,ErrEnergies,BranchingRatio);
+}
+
+
diff --git a/NPLib/Calibration/NPCalibrationSource.h b/NPLib/Calibration/NPCalibrationSource.h
new file mode 100644
index 0000000000000000000000000000000000000000..b7919854eb8b2af6798469bd02623a2e3adbbe0f
--- /dev/null
+++ b/NPLib/Calibration/NPCalibrationSource.h
@@ -0,0 +1,54 @@
+#ifndef __NPCALIBRATIONSOURCE_H__
+#define __NPCALIBRATIONSOURCE_H__
+
+// STL
+#include <iostream>
+#include <string>
+#include <cmath>
+#include <vector>
+using namespace std;
+
+// Root
+#include <TF1.h>
+
+// NPL
+#include "NPEnergyLoss.h"
+
+namespace NPL{
+  class CalibrationSource{
+    
+  public:
+    CalibrationSource();
+    ~CalibrationSource();
+    
+  private: // Basic information
+    // First Index is for main peak, second index for the relative sattellites peaks
+    vector< vector<double> > m_Energies;
+    vector< vector<double> > m_BranchingRatio;
+    vector< vector<double> > m_ErrEnergies;
+  
+  private: // Computed source signal (a TF1 ready for fit use, set up with physical value)
+    TF1* m_SourceSignal;
+    void ComputeSourceSignal();
+   
+  public: // Getter and Setter
+    TF1* GetSourceSignal();
+    
+  public: // Get and Set the energies
+    // for particle like source (one gaussian per energies)
+    void AddParticleContribution(vector<double> Energies ,  vector<double> ErrEnergies, vector<double> BranchingRatio);
+    
+    inline vector< vector<double> > GetEnergies(){return m_Energies;}
+    inline vector< vector<double> > GetEnergiesErrors(){return m_ErrEnergies;}
+    inline vector< vector<double> > GetBranchingRatio(){return m_BranchingRatio;}
+    
+ 
+  public: // Some Standard source
+    void Set_ThreeAlphaSource();
+    void Set_239Pu();
+    void Set_241Am();
+    void Set_244Cm();
+    
+  };
+}
+#endif
diff --git a/NPLib/Calibration/NPSiliconCalibrator.cxx b/NPLib/Calibration/NPSiliconCalibrator.cxx
new file mode 100644
index 0000000000000000000000000000000000000000..cb77a079043bcb9152fafbe6ff84389df7e4c1b9
--- /dev/null
+++ b/NPLib/Calibration/NPSiliconCalibrator.cxx
@@ -0,0 +1,235 @@
+// NPL
+#include "NPSiliconCalibrator.h"
+
+// Root
+#include "TSpectrum.h"
+
+NPL::SiliconCalibrator::SiliconCalibrator(){
+}
+
+//////////////////////////////////////////////
+NPL::SiliconCalibrator::~SiliconCalibrator(){
+}
+
+//////////////////////////////////////////////
+double NPL::SiliconCalibrator::ZeroExtrapolation(TH1* histo, NPL::CalibrationSource* CS, NPL::EnergyLoss* EL, vector<double>& coeff, unsigned int pedestal, unsigned int max_iteration,double rmin,double rmax){
+ if(histo->GetEntries()==0){
+    coeff.clear();
+    coeff.push_back(0);
+    coeff.push_back(-1);
+    return -1;
+  }
+  
+ int counts=0;
+  if(rmin == -1 && rmax == -1){
+    rmin = histo->GetBinCenter(1);
+    rmax = histo->GetBinCenter(histo->GetNbinsX()-1);
+  }
+
+  else{
+        for(unsigned int i = 1 ; i < histo->GetNbinsX() ; i++){ 
+      if(histo->GetBinCenter(i) < rmin || histo->GetBinCenter(i) > rmax)
+        histo->SetBinContent(i,0);
+      else
+        counts+= histo->GetBinContent(i);
+    }
+  }
+
+ if(counts == 0){
+    coeff.clear();
+    coeff.push_back(0);
+    coeff.push_back(-1);
+    return -2;
+  }
+  
+  m_CalibrationSource= CS;
+  m_EL_Al= EL;
+
+  double DistanceToPedestal = 100000;
+  double Step = 0.1*micrometer;
+  bool   LastStepIncrease = false;
+  bool   LastStepDecrease = false;
+  double my_precision = 0.1;
+  // Energy of the Source and sigma on the value (MeV)
+
+  double Assume_Thickness = 0 ; // micrometer
+  vector<double> Assume_E; // Energie calculated assuming Assume_Thickness deadlayer of Al
+
+  unsigned int k= 0;
+
+  double* Source_E = new double[CS->GetEnergies().size()];
+  double* Source_Sig = new double[CS->GetEnergies().size()];
+
+  unsigned int source_size =  CS->GetEnergies().size() ;
+  for(unsigned int i = 0 ; i < source_size ; i++){
+    Source_E[i] = CS->GetEnergies()[i][0];
+    Source_Sig[i] =  CS->GetEnergiesErrors()[i][0]; 
+  }
+  Assume_E.resize(source_size,0);
+  TGraphErrors* g = FitSpectrum(histo);
+  while(k++<max_iteration && abs(Assume_Thickness) < 100*micrometer){
+
+    // Compute the new assumed energies
+    double* x = g->GetX();
+    for(unsigned int i = 0 ; i < source_size ; i++){
+      Assume_E[i] = EL->Slow(Source_E[i] , Assume_Thickness, 0);
+      g->SetPoint(i,x[i] ,Assume_E[i]);
+    }
+
+    DistanceToPedestal = FitPoints(g,&Assume_E[0] , Source_Sig, coeff, 0 );
+    if(abs(DistanceToPedestal) < my_precision || Step < 0.01*micrometer)
+      break;
+
+    else if(DistanceToPedestal > 0 ){
+      if(LastStepIncrease)
+        Step *= 10.;
+
+      Assume_Thickness += Step;
+      LastStepIncrease = true;
+    }
+
+    else if(DistanceToPedestal < 0 ){
+      if(LastStepDecrease)
+        Step *= 10.;
+
+      Assume_Thickness -= Step;
+      LastStepDecrease = true;
+    }
+
+    // In this case the step size need to be changed
+    if(LastStepIncrease && LastStepDecrease){
+      Step *= 0.1;
+      LastStepIncrease = false ;
+      LastStepDecrease = false ;
+    }
+
+  }
+
+  if(abs(DistanceToPedestal) > my_precision && Step > 0.01*micrometer){
+    cout << "Zero extrapolation failed on : histo " << histo->GetName() << ". Final value is:" << Assume_Thickness / micrometer << "um with step "<< Step/micrometer << ", Dst to Pedestal = " << abs(DistanceToPedestal) << endl;
+    return -1000;
+  }
+
+  else if(Assume_Thickness<0){
+    DistanceToPedestal = FitPoints(g,Source_E , Source_Sig, coeff, 0 );
+    return 0;
+  }
+  delete g;
+  return Assume_Thickness/micrometer;
+}
+////////////////////////////////////////////////////////////////////////////////
+double NPL::SiliconCalibrator::SimpleCalibration(TH1* histo, NPL::CalibrationSource* CS, NPL::EnergyLoss* EL, vector<double>& coeff, double rmin,double rmax){
+ if(histo->GetEntries()==0){
+    coeff.clear();
+    coeff.push_back(0);
+    coeff.push_back(-1);
+    return -1;
+  }
+  
+ int counts=0;
+  if(rmin == -1 && rmax == -1){
+    rmin = histo->GetBinCenter(1);
+    rmax = histo->GetBinCenter(histo->GetNbinsX()-1);
+  }
+
+  else{
+        for(unsigned int i = 1 ; i < histo->GetNbinsX() ; i++){ 
+      if(histo->GetBinCenter(i) < rmin || histo->GetBinCenter(i) > rmax)
+        histo->SetBinContent(i,0);
+      else
+        counts+= histo->GetBinContent(i);
+    }
+  }
+
+ if(counts < 30){
+    coeff.clear();
+    coeff.push_back(0);
+    coeff.push_back(-1);
+    return -2;
+  }
+  
+  m_CalibrationSource= CS;
+  m_EL_Al= EL;
+
+  double* Source_E = new double[CS->GetEnergies().size()];
+  double* Source_Sig = new double[CS->GetEnergies().size()];
+
+  unsigned int source_size =  CS->GetEnergies().size() ;
+  for(unsigned int i = 0 ; i < source_size ; i++){
+    Source_E[i] = CS->GetEnergies()[i][0];
+    Source_Sig[i] = CS->GetEnergiesErrors()[i][0]; 
+  }
+  TGraphErrors* g = FitSpectrum(histo);
+  // Compute the new assumed energies
+   FitPoints(g,Source_E , Source_Sig, coeff, 0 );
+  
+  delete g;
+  return 1;
+}
+
+
+//////////////////////////////////////////////
+double NPL::SiliconCalibrator::FitPoints(TGraphErrors* Graph,double* Energies, double* ErrEnergies, vector<double>& coeff, double pedestal ){
+
+  Graph->Fit("pol1","Q");
+  coeff.clear();
+  coeff.push_back(Graph->GetFunction("pol1")->GetParameter(0));
+  coeff.push_back(Graph->GetFunction("pol1")->GetParameter(1));
+  // Compute the Distance to pedestal:
+  return (pedestal + coeff[0]/coeff[1] );
+}
+
+////////////////////////////////////////////////////////////////////////////////
+TGraphErrors* NPL::SiliconCalibrator::FitSpectrum(TH1* histo){
+  TF1* fitfunc =  m_CalibrationSource->GetSourceSignal();
+  // Perform a peak search to get a hint of where are the peaks
+  TSpectrum* sp = new TSpectrum(4,1);
+  Int_t nfound = 0;
+  nfound = sp->Search(histo,3,"",0.25);
+  float* xpeaks = sp->GetPositionX();
+
+  if(nfound>1){
+    for(Int_t p=0;p<nfound;p++){
+      for(Int_t i=0;i<nfound-1;i++){
+        if(xpeaks[i]>xpeaks[i+1]){ 
+          Float_t varia=xpeaks[i];
+          xpeaks[i]=xpeaks[i+1];
+          xpeaks[i+1]=varia;
+        }	  
+      }
+    }
+  }
+
+
+  if(nfound==3){
+    fitfunc->SetParameter(1,xpeaks[0]);
+    fitfunc->SetParameter(4,xpeaks[1]);
+    fitfunc->SetParameter(7,xpeaks[2]);
+    
+    // ballpark the sigma
+    double sigma = (xpeaks[1]-xpeaks[0])/100;
+    fitfunc->SetParameter(2,sigma);
+    fitfunc->SetParameter(5,sigma);
+    fitfunc->SetParameter(8,sigma);
+    
+    histo->GetXaxis()->SetRangeUser(xpeaks[0]-xpeaks[0]/20.,xpeaks[2]+xpeaks[2]/20.);
+  }
+  
+  histo->Fit(fitfunc,"Q");
+  TF1* fit = histo->GetFunction(fitfunc->GetName());
+  TGraphErrors* Graph = new TGraphErrors();
+  // Set the value of the TGraphError
+  vector< vector<double> > Energies = m_CalibrationSource->GetEnergies();
+  vector< vector<double> > ErrEnergies = m_CalibrationSource->GetEnergiesErrors();
+
+  unsigned int mysize = Energies.size();
+  int point = 0 ;
+
+  for(unsigned int i = 0 ; i < mysize ; i++){
+    Graph->SetPoint(point,fit->GetParameter(3*i+1) ,Energies[i][0]);
+    Graph->SetPointError(point++,fit->GetParError(3*i+1),ErrEnergies[i][0]);
+  } 
+  return Graph;
+}
+
+
diff --git a/NPLib/Calibration/NPSiliconCalibrator.h b/NPLib/Calibration/NPSiliconCalibrator.h
new file mode 100644
index 0000000000000000000000000000000000000000..280bae49aa680563ddc69f5ba357511ab927cece
--- /dev/null
+++ b/NPLib/Calibration/NPSiliconCalibrator.h
@@ -0,0 +1,38 @@
+// STL
+#include <vector>
+using namespace std;
+
+// Root
+#include "TH1.h"
+#include "TGraphErrors.h"
+#include "TGraph.h"
+// NPL
+#include "NPEnergyLoss.h"
+#include "NPCalibrationSource.h"
+
+namespace NPL{
+  class SiliconCalibrator{
+
+    public:
+      SiliconCalibrator();
+      ~SiliconCalibrator();
+
+    private:
+      NPL::EnergyLoss* m_EL_Al;
+      NPL::CalibrationSource* m_CalibrationSource;
+      TF1* m_FitFunction;
+
+    public:
+      // Use the Zero Extrapolation method to perform fit and return the dead layer thickness
+      double ZeroExtrapolation(TH1* histo, NPL::CalibrationSource* CS, NPL::EnergyLoss* EL, vector<double>& coeff, unsigned int pedestal, unsigned int max_iteration = 10000 , double rmin=-1,double rmax=-1);
+
+      double SimpleCalibration(TH1* histo, NPL::CalibrationSource* CS, NPL::EnergyLoss* EL, vector<double>& coeff, double rmin=-1,double rmax=-1);
+
+      // Return distance to pedestal. Use energies in Energies to perform fit and fill coeff with the results
+      double FitPoints(TGraphErrors* Graph, double* Energies , double* ErrEnergies, vector<double>& coeff , double pedestal = 0 );
+      // return a canvas containning the results
+      void DisplayResults();
+      // 
+      TGraphErrors* FitSpectrum(TH1* histo);
+  };
+}
diff --git a/NPLib/Charissa/TCharissaSpectra.cxx b/NPLib/Charissa/TCharissaSpectra.cxx
index 868468e3145d5d8374067509ff3ea87d7f106071..28fa2dda4644f4e2769a23bc594dd8a6d4012907 100644
--- a/NPLib/Charissa/TCharissaSpectra.cxx
+++ b/NPLib/Charissa/TCharissaSpectra.cxx
@@ -40,8 +40,8 @@ using namespace std;
 
 
 ////////////////////////////////////////////////////////////////////////////////
-TCharissaSpectra::TCharissaSpectra()
-{
+TCharissaSpectra::TCharissaSpectra(){
+  SetName("Charissa");
   fNumberOfTelescope =  0;
   fStripX            = 16;
   fStripY            = 16;
@@ -59,6 +59,7 @@ TCharissaSpectra::TCharissaSpectra(unsigned int NumberOfTelescope)
       << NumberOfTelescope << " Telescopes" << endl
       << "************************************************" << endl ;
 
+  SetName("Charissa");
   fNumberOfTelescope = NumberOfTelescope;
   fStripX            = 16;
   fStripY            = 16;
diff --git a/NPLib/ComptonTelescope/TComptonTelescopeSpectra.cxx b/NPLib/ComptonTelescope/TComptonTelescopeSpectra.cxx
index 67fafea08e586d7a723bd7d2d41a7c997c342c01..b3847c4883336a8f85022aadbae7f887d1f6d871 100644
--- a/NPLib/ComptonTelescope/TComptonTelescopeSpectra.cxx
+++ b/NPLib/ComptonTelescope/TComptonTelescopeSpectra.cxx
@@ -40,6 +40,7 @@ using namespace std;
 
 ////////////////////////////////////////////////////////////////////////////////
 TComptonTelescopeSpectra::TComptonTelescopeSpectra(){
+  SetName("ComptonTelescope");
   fNumberOfTelescope = 0;
   fStripX=32;
   fStripY=32;
@@ -57,6 +58,7 @@ TComptonTelescopeSpectra::TComptonTelescopeSpectra(unsigned int NumberOfTelescop
          << NumberOfTelescope << " Telescopes" << endl
          << "************************************************" << endl ;
 
+   SetName("ComptonTelescope");
    fNumberOfTelescope = NumberOfTelescope;
    fStripX=32;
    fStripY=32;
diff --git a/NPLib/Core/CMakeLists.txt b/NPLib/Core/CMakeLists.txt
index 0bd691207bc2114aee7bea79c8b20d76ed807809..a296ddd9313bb1037d749b0f5f102505bae21f7d 100644
--- a/NPLib/Core/CMakeLists.txt
+++ b/NPLib/Core/CMakeLists.txt
@@ -1,5 +1,6 @@
 add_custom_command(OUTPUT TAsciiFileDict.cxx TAsciiFileDict_rdict.pcm TAsciiFile.rootmap COMMAND  ../scripts/build_dict.sh TAsciiFile.h TAsciiFileDict.cxx TAsciiFile.rootmap libNPCore.so)  
 add_custom_command(OUTPUT NPVDetectorDict.cxx NPVDetectorDict_rdict.pcm NPVDetector.rootmap COMMAND  ../scripts/build_dict.sh NPVDetector.h NPVDetectorDict.cxx NPVDetector.rootmap libNPCore.so NPCoreLinkdef.h)  
-add_library(NPCore SHARED NPVAnalysis.cxx NPAnalysisFactory.cxx NPCalibrationManager.cxx NPOptionManager.cxx RootOutput.cxx RootInput.cxx TAsciiFile.cxx TAsciiFileDict.cxx NPDetectorManager.cxx NPVDetector.cxx NPVDetectorDict.cxx NPVSpectra.cxx NPDetectorFactory.cxx)
+add_custom_command(OUTPUT NPOnlineDict.cxx NPOnlineDict_rdict.pcm NPOnline.rootmap COMMAND ../scripts/build_dict.sh NPOnline.h NPOnlineDict.cxx NPOnline.rootmap libNPCore.dylib NPOnlineLinkDef.h DEPENDS NPOnline.h)
+add_library(NPCore SHARED NPVAnalysis.cxx NPAnalysisFactory.cxx NPCalibrationManager.cxx NPOptionManager.cxx RootOutput.cxx RootInput.cxx TAsciiFile.cxx TAsciiFileDict.cxx NPDetectorManager.cxx NPVDetector.cxx NPVDetectorDict.cxx NPVSpectra.cxx NPDetectorFactory.cxx NPOnline.cxx NPOnlineDict.cxx NPSpectraServer.cxx )
 target_link_libraries(NPCore ${ROOT_LIBRARIES}) 
-install(FILES NPVAnalysis.h NPAnalysisFactory.h  NPCalibrationManager.h NPOptionManager.h RootInput.h RootOutput.h TAsciiFile.h NPDetectorManager.h NPVDetector.h NPGlobalSystemOfUnits.h NPPhysicalConstants.h NPSystemOfUnits.h NPVSpectra.h NPDetectorFactory.h DESTINATION ${CMAKE_INCLUDE_OUTPUT_DIRECTORY})
+install(FILES NPVAnalysis.h NPAnalysisFactory.h  NPCalibrationManager.h NPOptionManager.h RootInput.h RootOutput.h TAsciiFile.h NPDetectorManager.h NPVDetector.h NPGlobalSystemOfUnits.h NPPhysicalConstants.h NPSystemOfUnits.h NPVSpectra.h NPDetectorFactory.h NPOnline.h NPSpectraServer.h DESTINATION ${CMAKE_INCLUDE_OUTPUT_DIRECTORY})
diff --git a/NPLib/Core/NPCalibrationManager.h b/NPLib/Core/NPCalibrationManager.h
index 7f7bdee96d9e00e23b89bd1e546b9fdee6240fe0..2fe2e02935032238b3d37ffdec20e0f70927fe8f 100644
--- a/NPLib/Core/NPCalibrationManager.h
+++ b/NPLib/Core/NPCalibrationManager.h
@@ -64,7 +64,7 @@ class CalibrationManager
          double ApplyResistivePositionCalibration(const string& ParameterPath , const double& RawValue);
          bool ApplyThreshold(const string& ParameterPath, const double& RawValue);
          double GetPedestal(const string& ParameterPath);
-      
+
       public:   //   To be called after initialisation
          //   Loop over the file list and catch the file used for calibration
          void LoadParameterFromFile();
diff --git a/NPLib/Core/NPDetectorManager.cxx b/NPLib/Core/NPDetectorManager.cxx
index a89011e79479d177cbc1fc570c203b942d212f8d..df9171164f245fcbc680abe0c3344d9ee18041f5 100644
--- a/NPLib/Core/NPDetectorManager.cxx
+++ b/NPLib/Core/NPDetectorManager.cxx
@@ -34,7 +34,8 @@
 #include "NPOptionManager.h"
 #include "NPCalibrationManager.h"
 
-
+//Root
+#include"TCanvas.h"
 /////////////////////////////////////////////////////////////////////////////////////////////////
 //   Default Constructor
 NPL::DetectorManager::DetectorManager(){
@@ -43,7 +44,7 @@ NPL::DetectorManager::DetectorManager(){
   m_ClearEventDataPtr = &NPL::VDetector::ClearEventData ;
   m_FillSpectra = NULL; 
   m_CheckSpectra = NULL;   
-  
+  m_SpectraServer = NULL;
   if(NPOptionManager::getInstance()->GetGenerateHistoOption()){
     m_FillSpectra =  &NPL::VDetector::FillSpectra ;
     if(NPOptionManager::getInstance()->GetCheckHistoOption())
@@ -58,7 +59,8 @@ NPL::DetectorManager::~DetectorManager(){
 #if __cplusplus > 199711L
   StopThread();
 #endif
-
+  if(m_SpectraServer)
+    m_SpectraServer->Destroy();
 }
 
 /////////////////////////////////////////////////////////////////////////////////////////////////
@@ -66,7 +68,7 @@ NPL::DetectorManager::~DetectorManager(){
 void NPL::DetectorManager::ReadConfigurationFile(string Path)   {
   cout << "\033[1;36m" ;
 
-   // Instantiate the Calibration Manager
+  // Instantiate the Calibration Manager
   // All The detector will then add to it their parameter (see AddDetector)
   CalibrationManager::getInstance(NPOptionManager::getInstance()->GetCalibrationFile());
 
@@ -96,7 +98,7 @@ void NPL::DetectorManager::ReadConfigurationFile(string Path)   {
     //////////// Search for Target /////////////
     ////////////////////////////////////////////
 
-  else if (LineBuffer.compare(0, 13, "GeneralTarget") == 0 && cGeneralTarget == false) {
+    else if (LineBuffer.compare(0, 13, "GeneralTarget") == 0 && cGeneralTarget == false) {
       cGeneralTarget = true ;
       cout << "////////// Target ///////////" << endl;
 
@@ -208,7 +210,7 @@ void NPL::DetectorManager::ReadConfigurationFile(string Path)   {
         delete detector;
     }
   } 
- cout << "\033[0m" ;
+  cout << "\033[0m" ;
 
   ConfigFile.close();
 
@@ -226,19 +228,19 @@ void NPL::DetectorManager::ReadConfigurationFile(string Path)   {
 
   // The calibration Manager got all the parameter added, so it can load them from the calibration file
   CalibrationManager::getInstance()->LoadParameterFromFile();
-  
+
   // Start the thread if multithreading supported
-  #if __cplusplus > 199711L
+#if __cplusplus > 199711L
   InitThreadPool();
-  #endif
-  
+#endif
+
   return;
 }
 
 /////////////////////////////////////////////////////////////////////////////////////////////////   
 void NPL::DetectorManager::BuildPhysicalEvent(){
 #if __cplusplus > 199711L
- // add new job
+  // add new job
   map<string,VDetector*>::iterator it;
   unsigned int i = 0;
   for (it = m_Detector.begin(); it != m_Detector.end(); ++it) {
@@ -246,18 +248,18 @@ void NPL::DetectorManager::BuildPhysicalEvent(){
   }
   // Wait for all job to be done
   while(!IsDone()){
-  //   this_thread::yield();
+    //   this_thread::yield();
   }
 #else 
   map<string,VDetector*>::iterator it;
-   for (it = m_Detector.begin(); it != m_Detector.end(); ++it) {
-      (it->second->*m_ClearEventPhysicsPtr)();
-      (it->second->*m_BuildPhysicalPtr)();
-      if(m_FillSpectra){
-        (it->second->*m_FillSpectra)();
-        if(m_CheckSpectra)
-          (it->second->*m_CheckSpectra)();
-      }
+  for (it = m_Detector.begin(); it != m_Detector.end(); ++it) {
+    (it->second->*m_ClearEventPhysicsPtr)();
+    (it->second->*m_BuildPhysicalPtr)();
+    if(m_FillSpectra){
+      (it->second->*m_FillSpectra)();
+      if(m_CheckSpectra)
+        (it->second->*m_CheckSpectra)();
+    }
   }
 #endif
 }
@@ -266,11 +268,11 @@ void NPL::DetectorManager::BuildPhysicalEvent(){
 void NPL::DetectorManager::BuildSimplePhysicalEvent(){
   ClearEventPhysics();
   map<string,VDetector*>::iterator it;
-  
+
   for (it = m_Detector.begin(); it != m_Detector.end(); ++it) {
     it->second->BuildSimplePhysicalEvent();
     if(NPOptionManager::getInstance()->GetGenerateHistoOption()){
-        it->second->FillSpectra();
+      it->second->FillSpectra();
       if(NPOptionManager::getInstance()->GetCheckHistoOption())
         it->second->CheckSpectra();
     }
@@ -355,14 +357,14 @@ void NPL::DetectorManager::WriteSpectra(){
 
 /////////////////////////////////////////////////////////////////////////////////////////////////   
 vector< map< vector<string>, TH1* > > NPL::DetectorManager::GetSpectra(){
-   vector< map< vector<string>, TH1* > > myVector;
-   map<string,VDetector*>::iterator it;
-   // loop on detectors
-   for (it = m_Detector.begin(); it != m_Detector.end(); ++it) {
-      myVector.push_back(it->second->GetSpectra());
-   }
-
-   return myVector;
+  vector< map< vector<string>, TH1* > > myVector;
+  map<string,VDetector*>::iterator it;
+  // loop on detectors
+  for (it = m_Detector.begin(); it != m_Detector.end(); ++it) {
+    myVector.push_back(it->second->GetSpectra());
+  }
+
+  return myVector;
 }
 
 /////////////////////////////////////////////////////////////////////////////////////////////////   
@@ -397,10 +399,10 @@ void NPL::DetectorManager::InitThreadPool(){
 
 ////////////////////////////////////////////////////////////////////////////////
 void NPL::DetectorManager::StartThread(NPL::VDetector* det,unsigned int id){ 
-this_thread::sleep_for(chrono::milliseconds(1));
-vector<bool>::iterator it = m_Ready.begin()+id;
+  this_thread::sleep_for(chrono::milliseconds(1));
+  vector<bool>::iterator it = m_Ready.begin()+id;
 
-while(!m_stop){
+  while(!m_stop){
     if(*it){
       (det->*m_ClearEventPhysicsPtr)();
       (det->*m_BuildPhysicalPtr)();
@@ -411,8 +413,8 @@ while(!m_stop){
       }
       m_Ready[id]=false;
     }
-		else
-			this_thread::yield();
+    else
+      this_thread::yield();
   }
 }
 ////////////////////////////////////////////////////////////////////////////////
@@ -428,4 +430,30 @@ bool NPL::DetectorManager::IsDone(){
   return true;
 }
 #endif
+////////////////////////////////////////////////////////////////////////////////
+void NPL::DetectorManager::SetSpectraServer(){
+  m_SpectraServer = NPL::SpectraServer::getInstance();
+
+  map<string,VDetector*>::iterator it;
+  for (it = m_Detector.begin(); it != m_Detector.end(); ++it){ 
+    vector<TCanvas*> canvas = it->second->GetCanvas();
+    size_t mysize = canvas.size();
+    for (size_t i = 0 ; i < mysize ; i++) 
+      m_SpectraServer->AddCanvas(canvas[i]);
+  }
+
+  // Avoid warning on gcc
+  int r;
+  r=system("nponline localhost 9090 & ");
+  m_SpectraServer->CheckRequest(); 
+}
+////////////////////////////////////////////////////////////////////////////////
+void NPL::DetectorManager::StopSpectraServer(){
+  m_SpectraServer->Destroy();
+}
+
+////////////////////////////////////////////////////////////////////////////////
+void NPL::DetectorManager::CheckSpectraServer(){
+  m_SpectraServer->CheckRequest();
+}
 
diff --git a/NPLib/Core/NPDetectorManager.h b/NPLib/Core/NPDetectorManager.h
index a4cbd03d85629c3cd413e21a3e6c8ce7a50e4e3d..a5d56f9b49a4ca3a02a478a5aa701611d2a755de 100644
--- a/NPLib/Core/NPDetectorManager.h
+++ b/NPLib/Core/NPDetectorManager.h
@@ -22,7 +22,7 @@
  *****************************************************************************/
 //   NPL
 #include "NPVDetector.h"
-
+#include "NPSpectraServer.h"
 // ROOT
 #include "TH1.h"
 
@@ -60,6 +60,13 @@ namespace NPL{
       vector< map< vector<string>, TH1* > > GetSpectra();  
       vector<string>                        GetDetectorList();
 
+    public: // for online spectra server
+      void SetSpectraServer();
+      void StopSpectraServer();
+      void CheckSpectraServer();
+    private :
+      NPL::SpectraServer* m_SpectraServer;
+
     private:   
       // The map containning all detectors
       // Using a Map one can access to any detector using its name
@@ -71,7 +78,7 @@ namespace NPL{
       VDetector_FuncPtr m_ClearEventDataPtr;
       VDetector_FuncPtr m_FillSpectra;
       VDetector_FuncPtr m_CheckSpectra;
-
+      
     #if __cplusplus > 199711L 
     private: // Thread Pool defined if C++11 is available
       vector<thread> m_ThreadPool;
@@ -83,7 +90,8 @@ namespace NPL{
       void StartThread(NPL::VDetector*,unsigned int);
       void InitThreadPool(); 
       bool IsDone();
-    #endif
+   
+       #endif
 
     private:
       double m_TargetThickness;
@@ -106,7 +114,7 @@ namespace NPL{
       double GetTargetX()             {return m_TargetX;}
       double GetTargetY()             {return m_TargetY;}
       double GetTargetZ()             {return m_TargetZ;}
-  };
+     };
 }
 
 #endif 
diff --git a/NPLib/Core/NPOnline.cxx b/NPLib/Core/NPOnline.cxx
new file mode 100644
index 0000000000000000000000000000000000000000..3d25c3253be709f2a0efb62096642dea35f0b5ae
--- /dev/null
+++ b/NPLib/Core/NPOnline.cxx
@@ -0,0 +1,403 @@
+// NPL
+#include "NPOnline.h"
+
+// STL
+#include <iostream>
+#include <dirent.h>
+
+// Root
+#include "TROOT.h"
+#include "TColor.h"
+#include "TSystem.h"
+#include "TString.h"
+#include "TF1.h"
+#include "TCanvas.h"
+#include "TFile.h"
+#include "TMessage.h"
+#include "TGSplitter.h"
+ClassImp(NPL::NPOnline);
+////////////////////////////////////////////////////////////////////////////////
+void NPL::ExecuteMacro(string name){
+  static DIR *dir;
+  static struct dirent *ent;
+  static string path; 
+  path = "./online_macros/";
+  name += ".C";
+  if ((dir = opendir (path.c_str())) != NULL) {
+    while ((ent = readdir (dir)) != NULL) {
+      if(ent->d_name==name)
+        gROOT->ProcessLine(Form(".x online_macros/%s",name.c_str()));
+    }
+    closedir (dir);
+  }
+}
+////////////////////////////////////////////////////////////////////////////////
+NPL::NPOnline::NPOnline(string address,int port){
+  m_Sock = 0;
+  TString NPLPath = gSystem->Getenv("NPTOOL");
+  gROOT->ProcessLine(Form(".x %s/NPLib/scripts/NPToolLogon.C+", NPLPath.Data()));
+  gROOT->SetStyle("nponline");
+
+  // Build the interface
+  MakeGui(address,port);
+
+  // Link the button slot to the function
+  m_Quit->SetCommand("gApplication->Terminate()");
+  m_Connect->Connect("Clicked()", "NPL::NPOnline", this, "Connect()");
+  m_Update->Connect("Clicked()", "NPL::NPOnline", this, "Update()");
+  m_Clock->Connect("Clicked()","NPL::NPOnline",this,"AutoUpdate()");
+
+  Connect();
+}
+
+////////////////////////////////////////////////////////////////////////////////
+void NPL::NPOnline::MakeGui(string address,int port){
+  m_BgColor = gROOT->GetColor(kGray+3)->GetPixel();
+  m_FgColor = gROOT->GetColor(kAzure+7)->GetPixel();
+  m_TabBgColor = gROOT->GetColor(kGray+3)->GetPixel();
+  m_TabFgColor = gROOT->GetColor(kAzure+7)->GetPixel();
+  m_Timer = 0;
+
+  // main frame
+  m_Main = new TGMainFrame(gClient->GetRoot(),10,10,kMainFrame | kVerticalFrame);
+  m_Main->SetName("nponline");
+  m_Main->SetBackgroundColor(m_BgColor);
+  m_Main->SetForegroundColor(m_FgColor);
+
+  // Button bar to hold the button
+  m_ButtonBar= new TGVerticalFrame(m_Main,10000,42,kFixedSize);
+  m_ButtonBar->SetBackgroundColor(m_BgColor);
+  m_ButtonBar->SetForegroundColor(m_BgColor);
+  m_ButtonBar->SetLayoutBroken(kTRUE);
+  m_Main->AddFrame(m_ButtonBar,new TGLayoutHints(kLHintsLeft|kLHintsTop));
+
+  string NPLPath = gSystem->Getenv("NPTOOL");  
+  string path_quit = NPLPath+"/NPLib/Core/icons/power.xpm";
+  m_Quit = new TGPictureButton(m_ButtonBar,gClient->GetPicture(path_quit.c_str()),-1,TGPictureButton::GetDefaultGC()(),kChildFrame);
+  m_Quit->SetBackgroundColor(m_BgColor);
+  m_Quit->SetToolTipText("Quit");
+
+  m_ButtonBar->AddFrame(m_Quit, new TGLayoutHints(kLHintsLeft | kLHintsTop,2,2,2,2));
+  m_Quit->MoveResize(10,5,32,32);
+
+  string path_connect = NPLPath+"/NPLib/Core/icons/plugin.xpm";
+  m_Connect = new TGPictureButton(m_ButtonBar,gClient->GetPicture(path_connect.c_str()),-1,TGPictureButton::GetDefaultGC()(),kChildFrame);
+  string path_connected = NPLPath+"/NPLib/Core/icons/brightness.xpm"; 
+  m_Connect->SetDisabledPicture(gClient->GetPicture(path_connected.c_str()));
+  m_Connect->SetBackgroundColor(m_BgColor);
+  m_Connect->SetBackgroundColor(m_BgColor);
+
+  m_Connect->SetToolTipText("Connect to server");
+  m_ButtonBar->AddFrame(m_Connect, new TGLayoutHints(kLHintsLeft | kLHintsTop,2,2,2,2));
+  m_Connect->MoveResize(52,5,32,32);
+
+  string path_update = NPLPath+"/NPLib/Core/icons/download.xpm";
+  m_Update = new TGPictureButton(m_ButtonBar,gClient->GetPicture(path_update.c_str()),-1,TGPictureButton::GetDefaultGC()(),kChildFrame);
+  m_Update->SetBackgroundColor(m_BgColor);
+  m_Update->SetForegroundColor(m_BgColor);
+  m_Update->SetToolTipText("Update spectra");
+  m_ButtonBar->AddFrame(m_Update, new TGLayoutHints(kLHintsLeft | kLHintsTop,2,2,2,2));
+  m_Update->MoveResize(400,5,32,32);
+
+  string path_clock= NPLPath+"/NPLib/Core/icons/clock.xpm";
+  m_Clock = new TGPictureButton(m_ButtonBar,gClient->GetPicture(path_clock.c_str()),-1,TGPictureButton::GetDefaultGC()(),kChildFrame);
+  m_Clock->SetBackgroundColor(m_BgColor);
+  m_Clock->SetForegroundColor(m_BgColor);
+
+  m_Clock->SetToolTipText("AutoUpdate");
+  m_ButtonBar->AddFrame(m_Clock, new TGLayoutHints(kLHintsLeft | kLHintsTop,2,2,2,2));
+  m_Clock->MoveResize(442,5,32,32);
+
+  TGFont* ufont;         // will reflect user font changes
+  ufont = gClient->GetFont("-*-helvetica-medium-r-*-*-12-*-*-*-*-*-iso8859-1");
+
+  TGGC  * uGC;           // will reflect user GC changes
+  // graphics context changes
+  GCValues_t valress;
+  valress.fMask = kGCForeground | kGCBackground | kGCFillStyle | kGCFont | kGCGraphicsExposures;
+  gClient->GetColorByName("#000000",valress.fForeground);
+  gClient->GetColorByName("#e7e7e7",valress.fBackground);
+  valress.fFillStyle = kFillSolid;
+  valress.fFont = ufont->GetFontHandle();
+  valress.fGraphicsExposures = kFALSE;
+  uGC = gClient->GetGC(&valress, kTRUE);
+  m_Address = new TGTextEntry(m_ButtonBar, new TGTextBuffer(14),-1,uGC->GetGC(),ufont->GetFontStruct(),kChildFrame | kOwnBackground);
+  m_Address->SetMaxLength(4096);
+  m_Address->SetAlignment(kTextLeft);
+  m_Address->SetText(address.c_str());
+  m_Address->Resize(200,m_Address->GetDefaultHeight());
+  m_ButtonBar->AddFrame(m_Address, new TGLayoutHints(kLHintsLeft | kLHintsTop,2,2,2,2));
+  m_Address->MoveResize(90,10,200,20);
+
+  m_Port = new TGNumberEntry(m_ButtonBar, (Double_t) port,9,-1,(TGNumberFormat::EStyle) 5);
+  m_Port->SetName("m_Port");
+  m_Port->GetButtonUp()->SetStyle(1);
+  m_Port->GetButtonDown()->SetStyle(1);
+  m_ButtonBar->AddFrame(m_Port, new TGLayoutHints(kLHintsLeft));
+  m_Port->MoveResize(300,10,80,20);
+
+  m_TimerEntry = new TGNumberEntry(m_ButtonBar, (Double_t) 1,9,-1,(TGNumberFormat::EStyle) 5);
+  m_TimerEntry->SetName("m_TimerEntry");
+  m_TimerEntry->GetButtonUp()->SetStyle(1);
+  m_TimerEntry->GetButtonDown()->SetStyle(1);
+  m_ButtonBar->AddFrame(m_TimerEntry, new TGLayoutHints(kLHintsLeft));
+  m_TimerEntry->MoveResize(484,10,40,20);
+
+
+  // Create the splitted frame
+  m_Split = new TGHorizontalFrame(m_Main, 50, 50);
+  TGVerticalFrame* fV1 = new TGVerticalFrame(m_Split, 10, 10, kFixedWidth);
+  TGVerticalFrame* fV2 = new TGVerticalFrame(m_Split, 10, 10);
+  m_Left = new TGCompositeFrame(fV1, 10, 10, kChildFrame);
+  m_Right = new TGCompositeFrame(fV2, 10, 10, kChildFrame);
+  fV1->AddFrame(m_Left, new TGLayoutHints(kLHintsExpandX | kLHintsExpandY,0, 0, 5, 10));
+  fV2->AddFrame(m_Right, new TGLayoutHints(kLHintsExpandX | kLHintsExpandY,0, 0, 5, 10));
+
+  fV1->Resize(m_Left->GetDefaultWidth()+200, fV1->GetDefaultHeight());
+  fV2->Resize(m_Right->GetDefaultWidth(), fV1->GetDefaultHeight());
+  m_Split->AddFrame(fV1, new TGLayoutHints(kLHintsLeft | kLHintsExpandY ));
+
+  TGVSplitter* splitter = new TGVSplitter(m_Split,5,5);
+  splitter->SetFrame(fV1, kTRUE);
+  m_Split->AddFrame(splitter, new TGLayoutHints(kLHintsLeft| kLHintsTop |  kLHintsExpandY));
+  m_Split->SetBackgroundColor(m_BgColor); 
+  splitter->SetBackgroundColor(m_BgColor);    
+  m_Split->SetForegroundColor(m_BgColor); 
+  splitter->SetForegroundColor(m_BgColor);    
+  m_Left->SetBackgroundColor(m_BgColor); 
+  m_Right->SetBackgroundColor(m_BgColor);    
+  m_Left->SetForegroundColor(m_BgColor); 
+  m_Right->SetForegroundColor(m_BgColor);    
+  fV1->SetBackgroundColor(m_BgColor); 
+  fV2->SetBackgroundColor(m_BgColor);    
+  fV1 ->SetForegroundColor(m_BgColor); 
+  fV2->SetForegroundColor(m_BgColor);    
+
+  m_Split->AddFrame(fV2, new TGLayoutHints(kLHintsRight | kLHintsExpandX | kLHintsExpandY));
+  m_Main->AddFrame(m_Split, new TGLayoutHints(kLHintsRight | kLHintsExpandX |kLHintsExpandY));
+
+  // canvas widget
+  TGCanvas* m_ListCanvas = new TGCanvas(m_Left,120,500);
+  m_ListCanvas->SetName("m_ListCanvas");
+
+  m_ListCanvas ->SetForegroundColor(m_BgColor); 
+  m_ListCanvas->SetForegroundColor(m_BgColor);    
+
+
+  // canvas viewport
+  TGViewPort* fViewPort669 = m_ListCanvas->GetViewPort();
+
+  // list tree
+  m_CanvasListTree = new CanvasList(m_Main,m_ListCanvas);
+  m_ListTree = m_CanvasListTree->GetListTree();
+
+  fViewPort669->AddFrame(m_ListTree,new TGLayoutHints(kLHintsRight | kLHintsBottom | kLHintsExpandY | kLHintsExpandX));
+  m_ListTree->SetLayoutManager(new TGHorizontalLayout(m_ListTree));
+  m_ListTree->MapSubwindows();
+
+  m_ListCanvas->SetContainer(m_ListTree);
+  m_ListCanvas->MapSubwindows();
+  m_Left->AddFrame(m_ListCanvas, new TGLayoutHints(kLHintsLeft | kLHintsBottom | kLHintsExpandY | kLHintsExpandX));
+  m_ListCanvas->MoveResize(10,50,120,500);
+
+  // tab widget
+  m_Tab = new TGTab(m_Right,700,500);
+
+  m_Tab->Resize(m_Tab->GetDefaultSize());
+  m_Tab->SetBackgroundColor(m_TabBgColor);
+  m_Tab->SetForegroundColor(m_TabFgColor);
+  m_Tab->ChangeSubframesBackground(m_BgColor);
+
+  m_Right->AddFrame(m_Tab,new TGLayoutHints(kLHintsRight | kLHintsBottom | kLHintsExpandX | kLHintsExpandY));
+  m_CanvasListTree->SetTab(m_Tab);
+
+  m_Main->SetMWMHints(kMWMDecorAll,kMWMFuncAll,kMWMInputModeless);
+  m_Main->MapSubwindows();
+
+  m_Main->Resize(m_Main->GetDefaultSize());
+  m_Main->MapWindow();
+  m_Main->MoveResize(0,0,1000,500);
+
+}
+
+////////////////////////////////////////////////////////////////////////////////
+NPL::NPOnline::~NPOnline(){
+  delete m_Main; 
+  delete m_ListCanvas;
+  delete m_ListTree;
+  delete m_Tab;
+  delete m_Quit;
+  delete m_Connect;
+  delete m_Update;
+  delete m_Sock;
+  delete m_Port;
+  delete m_Address;
+}
+
+////////////////////////////////////////////////////////////////////////////////
+void NPL::NPOnline::Connect(){
+  // Connect to SpectraServer
+  if(m_Sock){
+    m_Sock->Close("force");
+    delete m_Sock;
+    m_Sock = NULL;
+  }
+
+  m_Sock = new TSocket(m_Address->GetDisplayText(),(Int_t) m_Port->GetNumber());
+  if(m_Sock->IsValid()){
+    m_Connect->SetState(kButtonDisabled);
+    Update();
+  }
+  else{
+    cout << "Connection to " << m_Address->GetDisplayText() << " " <<(Int_t) m_Port->GetNumber() << " Failed" << endl;
+  }
+}
+
+////////////////////////////////////////////////////////////////////////////////
+void NPL::NPOnline::Update(){
+  if(!m_Sock || !(m_Sock->IsValid())){
+    if(m_Sock){
+      m_Sock->Close("force");
+      delete m_Sock;
+      m_Sock = NULL;
+    }
+    m_Connect->SetState(kButtonUp);
+    return;
+  }
+
+  TMessage* message;
+  m_Sock->Send("RequestSpectra");
+
+  if(m_Sock->Recv(message)<=0){
+    if(m_Sock){
+      m_Sock->Close("force");
+      delete m_Sock;
+      m_Sock = NULL;
+    }
+    m_Connect->SetState(kButtonUp);
+    return;
+  }
+
+  m_CanvasListTree->Clear();
+  m_CanvasList = (TList*) message->ReadObject(message->GetClass());
+
+  TGCompositeFrame* tf; 
+  TRootEmbeddedCanvas* canvas;
+  for(TCanvas* c = (TCanvas*) m_CanvasList->First() ; c !=0 ; c = (TCanvas*) m_CanvasList->After(c)){
+    m_CanvasListTree->AddItem(c);
+
+    TGCompositeFrame*  tab =  m_Tab->GetTabContainer(c->GetName());
+    if(tab){
+      tab->RemoveAll();
+      TRootEmbeddedCanvas* canvas = new TRootEmbeddedCanvas(c->GetName(),tab,700,500,!kSunkenFrame); 
+
+      c->UseCurrentStyle();
+      c->SetMargin(0,0,0,0);
+      canvas->AdoptCanvas(c);
+      tab->SetLayoutManager(new TGHorizontalLayout(tab));
+      tab->AddFrame(canvas,new TGLayoutHints(kLHintsLeft | kLHintsBottom | kLHintsExpandX | kLHintsExpandY));
+      ExecuteMacro(c->GetName());
+    }
+  }
+
+  m_Main->MapSubwindows();
+  m_Main->Layout();
+}
+
+////////////////////////////////////////////////////////////////////////////////
+void NPL::NPOnline::AutoUpdate(){
+
+  if(m_Timer){
+    delete m_Timer;
+    m_Timer = 0 ;
+    return;
+  }
+
+  else if(m_TimerEntry->GetNumber()>0){
+    m_Timer = new TTimer(m_TimerEntry->GetNumber()*1000);
+    m_Timer->Connect("Timeout()", "NPL::NPOnline", this, "Update()");
+    m_Timer->TurnOn();
+  }
+}
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+
+/* CanvasList Class */
+
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+
+NPL::CanvasList::CanvasList(TGMainFrame* main, TGCanvas* parent){
+  string NPLPath = gSystem->Getenv("NPTOOL");  
+  string path_icon = NPLPath+"/NPLib/Core/icons/polaroid.xpm";
+
+  m_popen = gClient->GetPicture(path_icon.c_str());
+  m_pclose = gClient->GetPicture(path_icon.c_str());
+
+  m_BgColor = gROOT->GetColor(kGray+3)->GetPixel();
+  m_FgColor = gROOT->GetColor(kWhite)->GetPixel();
+
+  m_ListTree = new TGListTree(parent,kHorizontalFrame);
+  m_ListTree->Connect("DoubleClicked(TGListTreeItem*,Int_t)","NPL::CanvasList",this,"OnDoubleClick(TGListTreeItem*,Int_t)");
+  m_Main = main;
+}
+////////////////////////////////////////////////////////////////////////////////
+NPL::CanvasList::~CanvasList(){
+}
+////////////////////////////////////////////////////////////////////////////////
+void NPL::CanvasList::OnDoubleClick(TGListTreeItem* item, Int_t btn){
+  AddTab(item->GetText(),m_Canvas[item->GetText()]);
+}
+////////////////////////////////////////////////////////////////////////////////
+void NPL::CanvasList::AddItem(TCanvas* c){
+  TGListTreeItem*  item  = m_ListTree->AddItem(NULL,c->GetName());
+  item->SetPictures(m_popen, m_pclose);
+  m_Canvas[c->GetName()]=c;
+}
+////////////////////////////////////////////////////////////////////////////////
+void NPL::CanvasList::Clear(){
+  m_Canvas.clear();
+  TGListTreeItem* item =  m_ListTree->GetFirstItem() ;
+  while(item){
+    m_ListTree->DeleteItem(item);
+    item = m_ListTree->GetFirstItem() ;
+  }
+}
+////////////////////////////////////////////////////////////////////////////////
+TGListTree* NPL::CanvasList::GetListTree(){
+  return m_ListTree;
+}
+////////////////////////////////////////////////////////////////////////////////
+void NPL::CanvasList::AddTab(std::string name,TCanvas* c){
+  // If the tab exist, activate
+  if(m_Tab->GetTabTab(name.c_str())){
+    m_Tab->SetTab(name.c_str());
+    return;
+  }
+
+  TGCompositeFrame* tf = m_Tab->AddTab(name.c_str());
+  TRootEmbeddedCanvas* canvas = new TRootEmbeddedCanvas("Canvas",tf,700,490,!kSunkenFrame); 
+
+  if(c){
+    c->UseCurrentStyle();
+    c->SetMargin(0,0,0,0);
+    canvas->AdoptCanvas(c);
+    ExecuteMacro(c->GetName());
+  }
+
+  tf->SetBackgroundColor(m_BgColor);
+  tf->SetForegroundColor(m_FgColor);
+  tf->SetLayoutManager(new TGVerticalLayout(tf));
+  tf->AddFrame(canvas,new TGLayoutHints(kLHintsTop | kLHintsLeft |kLHintsExpandX | kLHintsExpandY));
+  m_Tab->Resize(m_Tab->GetDefaultSize());
+  m_Tab->MoveResize(144,50,700,500);
+  m_Tab->SetTab(name.c_str());
+  m_Main->MapSubwindows();
+  m_Main->MapWindow();
+  m_Main->Layout();
+}
+////////////////////////////////////////////////////////////////////////////////
+void NPL::CanvasList::SetTab(TGTab* tab){
+  m_Tab=tab;
+}
+
diff --git a/NPLib/Core/NPOnline.h b/NPLib/Core/NPOnline.h
new file mode 100644
index 0000000000000000000000000000000000000000..ddb108cb2162f3d718be1831fbcf6da69dfc49b1
--- /dev/null
+++ b/NPLib/Core/NPOnline.h
@@ -0,0 +1,107 @@
+#ifndef NPONLINE_H
+#define NPONLINE_H
+#include "TGLayout.h"
+#include "TGButton.h"
+#include "TGTab.h"
+#include "TRootEmbeddedCanvas.h"
+#include "TH1.h"
+#include "TSocket.h"
+#include "TGListTree.h"
+#include "TGTextEntry.h"
+#include "TGNumberEntry.h"
+#include "TTimer.h"
+//#include "TGCanvasContainer.h"
+#include "RQ_OBJECT.h"
+#include<map>
+using namespace std;
+
+namespace NPL{
+   void ExecuteMacro(string name);
+  
+  class CanvasList {
+    RQ_OBJECT("CanvasList")
+    protected:
+      TGMainFrame* m_Main;
+      TGListTree* m_ListTree;
+      TGTab* m_Tab;
+      map<string,TCanvas*> m_Canvas;
+      const TGPicture* m_popen;     
+      const TGPicture* m_pclose;   
+      Pixel_t m_BgColor;
+      Pixel_t m_FgColor;
+
+   
+    public:
+      CanvasList(TGMainFrame* main, TGCanvas* parent);
+      virtual ~CanvasList();
+
+      // slots
+      void OnDoubleClick(TGListTreeItem* item, Int_t btn);
+
+      // Interface with NPOnline
+      void SetTab(TGTab* tab);
+      void AddItem(TCanvas* c);
+      void Clear();
+      TGListTree* GetListTree();
+      // Add a new Tab to the interface
+      void AddTab(std::string name="default",TCanvas* c=0);
+  };
+
+  class NPOnline{
+    RQ_OBJECT("NPOnline")
+
+    public:
+      NPOnline(string address="localhost", int port=9090);
+      ~NPOnline();
+
+      void MakeGui(string address="localhost", int port=9090);
+      void Connect();
+      void Update();
+      void AutoUpdate();
+    
+    private: // Server client
+      TSocket* m_Sock;
+      TList* m_CanvasList;
+
+    private: // GUI stuff
+      // Main window
+      TGMainFrame* m_Main;
+      // Menu bar
+      TGVerticalFrame* m_ButtonBar;
+      // Splitted frame for Tree (l) and Tab (r)
+      TGHorizontalFrame* m_Split; 
+
+      // left view port
+      TGCompositeFrame* m_Left;
+      // right view port
+      TGCompositeFrame* m_Right;
+
+      TGTab* m_Tab;
+      TGPictureButton* m_Quit;
+      TGPictureButton* m_Connect;
+      TGPictureButton* m_Update;
+      TGPictureButton* m_Clock;
+      TGNumberEntry* m_TimerEntry;
+      TTimer* m_Timer;
+      
+
+      TGTextEntry* m_Address; 
+      TGNumberEntry* m_Port; 
+      TGListTree* m_ListTree;
+      CanvasList* m_CanvasListTree;
+
+      TGCanvas* m_ListCanvas;
+    
+    private: // Style
+      Pixel_t m_BgColor;
+      Pixel_t m_FgColor;
+      Pixel_t m_TabBgColor;
+      Pixel_t m_TabFgColor;
+
+      TH1* m_hist; 
+
+      ClassDef(NPOnline,1);
+  };
+
+}
+#endif
diff --git a/NPLib/Core/NPOnlineLinkDef.h b/NPLib/Core/NPOnlineLinkDef.h
new file mode 100644
index 0000000000000000000000000000000000000000..aa1093aae8c8c792b9cb807e9826c1486f00b9c9
--- /dev/null
+++ b/NPLib/Core/NPOnlineLinkDef.h
@@ -0,0 +1,3 @@
+#ifdef __CINT__
+#pragma link C++ defined_in "./NPOnline.h";
+#endif
diff --git a/NPLib/Core/NPOptionManager.cxx b/NPLib/Core/NPOptionManager.cxx
index 1b41946d4efe91e7232a20d3a296d886b39f3c98..cfdd9b14c4ce927c7d3e8da76d75e096520e8f0c 100644
--- a/NPLib/Core/NPOptionManager.cxx
+++ b/NPLib/Core/NPOptionManager.cxx
@@ -65,6 +65,7 @@ void NPOptionManager::ReadTheInputArgument(int argc, char** argv){
   fInputPhysicalTreeOption = false;
   fGenerateHistoOption = false ;
   fPROOFMode = false;
+  fOnline = false;
 
   for (int i = 0; i < argc; i++) {
     string argument = argv[i];
@@ -121,6 +122,9 @@ void NPOptionManager::ReadTheInputArgument(int argc, char** argv){
     else if (argument == "--last-res")                            fLastResFile = true ;
 
     else if (argument == "--last-any")                            fLastAnyFile = true ;
+    
+    else if (argument == "--online")                              {fOnline = true ;fGenerateHistoOption=true;}
+
 
     //else ;
   }
@@ -281,7 +285,7 @@ void NPOptionManager::SendErrorAndExit(const char* type) const{
   else if (stype == "DetectorConfiguration") {
     cout << endl;
     cout << "***********************************       Error       ***********************************" << endl;
-    cout << "* No detector geometry file found in $NPTool/Inputs/EventGenerator or local directories *" << endl;
+    cout << "* No detector geometry file found in $NPTool/Inputs/DetectorConfiguration or local directories *" << endl;
     cout << "*****************************************************************************************" << endl;
     cout << endl;
     exit(1);
@@ -319,6 +323,7 @@ void NPOptionManager::DisplayHelp(){
   cout << "\t --last-phy\t \t \t \tIgnore the list of Run to treat if any and analysed the last Physics file" << endl ;
   cout << "\t --last-res\t \t \t \tIgnore the list of Run to treat if any and analysed the last Result file" << endl ;
   cout << "\t --last-any\t \t \t \tIgnore the list of Run to treat if any and analysed the last root file with a non standard Tree name" << endl ;
+  cout << "\t --online  \t \t \t \tStart the spectra server" << endl ;
   cout << endl << endl ;
 
   // exit current program
diff --git a/NPLib/Core/NPOptionManager.h b/NPLib/Core/NPOptionManager.h
index 599fae3e2d53045c9adead830db51332dad95dd3..dea38d73be9aee41e83d113fbd1b334116c24440 100644
--- a/NPLib/Core/NPOptionManager.h
+++ b/NPLib/Core/NPOptionManager.h
@@ -95,6 +95,7 @@ class NPOptionManager{
       bool   GetInputPhysicalTreeOption()  {return fInputPhysicalTreeOption;}
       bool   GetGenerateHistoOption()      {return fGenerateHistoOption;}
       bool   GetCheckHistoOption()         {return fCheckHistoOption;}
+      bool   GetOnline()                   {return fOnline;}
       bool   GetPROOF()                    {return fPROOFMode;}
       int    GetVerboseLevel()             {return fVerboseLevel;}
       int    GetNumberOfEntryToAnalyse()   {return fNumberOfEntryToAnalyse;} 
@@ -125,6 +126,7 @@ class NPOptionManager{
       bool   fInputPhysicalTreeOption;
       bool   fGenerateHistoOption;
       bool   fCheckHistoOption;
+      bool   fOnline; // true if spectra server is started
       bool   fPROOFMode; // if true, the system run in a pROOF environment
       bool   fLastSimFile;
       bool   fLastPhyFile;
diff --git a/NPLib/Core/NPSpectraServer.cxx b/NPLib/Core/NPSpectraServer.cxx
new file mode 100644
index 0000000000000000000000000000000000000000..907233aa34d96864cf868d844069d2ad3b503522
--- /dev/null
+++ b/NPLib/Core/NPSpectraServer.cxx
@@ -0,0 +1,85 @@
+#include "NPSpectraServer.h"
+#include<cstdlib>
+#include<unistd.h>
+#include<iostream>
+NPL::SpectraServer* NPL::SpectraServer::instance = 0 ;
+////////////////////////////////////////////////////////////////////////////////
+NPL::SpectraServer* NPL::SpectraServer::getInstance(){
+  if(!instance) 
+    instance = new NPL::SpectraServer();
+
+  return instance;
+}
+////////////////////////////////////////////////////////////////////////////////
+void NPL::SpectraServer::Destroy(){  
+  delete instance ;
+  instance = 0 ;
+}
+////////////////////////////////////////////////////////////////////////////////
+NPL::SpectraServer::SpectraServer(){
+  m_Server= new TServerSocket(9090,true);
+  if(!m_Server->IsValid())
+    exit(1);
+  
+  m_Server->SetCompressionSettings(1);
+  // Add server socket to monitor so we are notified when a client needs to be
+  // accepted
+  m_Monitor  = new TMonitor;
+  m_Monitor->Add(m_Server);
+
+  // Create a list to contain all client connections
+  m_Sockets = new TList;
+
+  // Create the list of Canvas
+  m_Canvas = new TList;
+}
+////////////////////////////////////////////////////////////////////////////////
+void NPL::SpectraServer::AddCanvas(TCanvas* c){
+  m_Canvas->Add(c);
+}
+
+////////////////////////////////////////////////////////////////////////////////
+void NPL::SpectraServer::CheckRequest(){
+  if(m_Server){
+      TSocket* s ;
+      if((s=m_Monitor->Select(1))!=(TSocket*)-1)
+        HandleSocket(s);
+  }
+}
+
+////////////////////////////////////////////////////////////////////////////////
+NPL::SpectraServer::~SpectraServer(){
+  // tell the socket to stop
+  m_Server->Close("force");
+  delete m_Server;
+  m_Server=0;
+  delete m_Monitor;
+  m_Monitor = 0;
+  instance = 0 ;
+}
+////////////////////////////////////////////////////////////////////////////////
+void NPL::SpectraServer::HandleSocket(TSocket* s){
+  if (s->IsA() == TServerSocket::Class()) {
+    // accept new connection from spy
+    TSocket* socket = ((TServerSocket*)s)->Accept();
+    m_Monitor->Add(socket);
+    m_Sockets->Add(socket);
+  }
+  else {
+    // we only get string based requests from the spy
+    char request[64];
+    if (s->Recv(request, sizeof(request)) <= 0) {
+      m_Monitor->Remove(s);
+      m_Sockets->Remove(s);
+      delete s;
+      return;
+    }
+
+    // send requested object back
+    TMessage answer(kMESS_OBJECT);
+    if (!strcmp(request, "RequestSpectra"))
+      answer.WriteObject(m_Canvas);
+
+    s->Send(answer);
+  }
+}
diff --git a/NPLib/Core/NPSpectraServer.h b/NPLib/Core/NPSpectraServer.h
new file mode 100644
index 0000000000000000000000000000000000000000..c79d0ae7bc2740f3eb12020cc869b391e5a7fbb1
--- /dev/null
+++ b/NPLib/Core/NPSpectraServer.h
@@ -0,0 +1,34 @@
+#ifndef NPSPECTRASERVER_H
+#define NPSPECTRASERVER_H
+
+#include "TSocket.h"
+#include "TServerSocket.h"
+#include "TMonitor.h"
+#include "TMessage.h"
+#include "TList.h"
+#include "TCanvas.h"
+namespace NPL{
+  class SpectraServer{
+    public:
+      static SpectraServer* getInstance();
+      void Destroy(); 
+    private:
+      SpectraServer();
+      ~SpectraServer();
+
+    private:
+      static SpectraServer* instance;
+   
+    public:
+      void HandleSocket(TSocket* s);
+      void AddCanvas(TCanvas* c);
+      void CheckRequest();
+   private:
+    bool m_stop;
+    TServerSocket* m_Server;     
+    TMonitor* m_Monitor;     
+    TList* m_Sockets;
+    TList* m_Canvas;
+  };
+}
+#endif
diff --git a/NPLib/Core/NPVDetector.h b/NPLib/Core/NPVDetector.h
index a8b806bf652911d07be473bafbf9754b3a02a65a..b163d6bbdd3897524f707fba00ddaeffacf8573e 100644
--- a/NPLib/Core/NPVDetector.h
+++ b/NPLib/Core/NPVDetector.h
@@ -28,7 +28,7 @@
 
 // ROOT headers
 #include "TH1.h"
-
+#include "TCanvas.h"
 //   STL header
 #include <string>
 #include <vector>
@@ -87,6 +87,8 @@ namespace NPL {
       virtual void ClearSpectra() {};
       // Used for Online only, get all the spectra hold by the Spectra class
       virtual  map< vector<string> , TH1*> GetSpectra() {map< vector<string>, TH1* > x; return x;};
+      // Used for Online only, get all the canvases
+      virtual vector<TCanvas*> GetCanvas(){vector<TCanvas*> x ; return x;};
 
     private:   //   The list below is here to help you building your own detector
       /*
diff --git a/NPLib/Core/NPVSpectra.cxx b/NPLib/Core/NPVSpectra.cxx
index 2d460973dec7e9c15e2ea94797088a36da16c19f..7819243a1589594426632b5d92939cb528f28413 100644
--- a/NPLib/Core/NPVSpectra.cxx
+++ b/NPLib/Core/NPVSpectra.cxx
@@ -5,7 +5,7 @@
  * For the list of contributors see $NPTOOL/Licence/Contributors             *
  *****************************************************************************/
 
-/*****************************************************************************
+/****************************************************************************
  * Original Author: N. de Sereville  contact address: deserevi@ipno.in2p3.fr *
  *                                                                           *
  * Creation Date  : dec 2013                                                 *
@@ -36,19 +36,15 @@
 #include <cstdlib>
 using namespace std;
 
-
-VSpectra::VSpectra()
-{
+////////////////////////////////////////////////////////////////////////////////
+VSpectra::VSpectra(){
+  m_name="no_name";
 }
 
-
-
-VSpectra::~VSpectra()
-{
+////////////////////////////////////////////////////////////////////////////////
+VSpectra::~VSpectra(){
 }
 
-
-
 ////////////////////////////////////////////////////////////////////////////////
 TH1* VSpectra::AddHisto1D(string name, string title, Int_t nbinsx, Double_t xlow, Double_t xup, string family){
   // create histo
@@ -79,6 +75,15 @@ TH1* VSpectra::AddHisto2D(string name, string title, Int_t nbinsx, Double_t xlow
   return hist;
 }
 
+////////////////////////////////////////////////////////////////////////////////
+void VSpectra::AddCanvas(TCanvas* c){
+  m_Canvas.push_back(c);
+}
+
+////////////////////////////////////////////////////////////////////////////////
+vector<TCanvas*> VSpectra::GetCanvas(){
+  return m_Canvas;
+}
 ////////////////////////////////////////////////////////////////////////////////
 TH1* VSpectra::GetHisto(string& family, string& name){
   vector<string> index;
@@ -102,8 +107,7 @@ TH1* VSpectra::GetHisto(string& family, string& name){
 }
 
 ////////////////////////////////////////////////////////////////////////////////
-void VSpectra::WriteSpectra(string filename)
-{
+void VSpectra::WriteSpectra(string filename){
    TFile* f = NULL; 
    if (filename != "VOID") {
       f = new TFile(filename.c_str(), "RECREATE");
@@ -114,11 +118,12 @@ void VSpectra::WriteSpectra(string filename)
    }
 
    // created dedicated directory for spectra
-   TDirectory *dir = (TDirectory*) f->Get("ControlSpectra");
+    string dirname = "ControlSpectra/"+m_name;
+   TDirectory *dir = (TDirectory*) f->Get(dirname.c_str());
    if (!dir) {
-      f->mkdir("ControlSpectra");
-      f->cd("ControlSpectra");
+      f->mkdir(dirname.c_str());
    }
+   f->cd(dirname.c_str());
 
    // write all histos
    map< vector<string>, TH1* >::iterator it;
@@ -126,9 +131,12 @@ void VSpectra::WriteSpectra(string filename)
       it->second->Write();
    }
 
+   // Go back to root directory
+   f->cd();
+
    // close file and delete associate pointer only in case
    // of filename.
-   if (filename != "VOID") {
+       if (filename != "VOID") {
       f->Close();
       delete f;
    }
diff --git a/NPLib/Core/NPVSpectra.h b/NPLib/Core/NPVSpectra.h
index b0ce819cf6864127257b97e29976fc9ffa845a11..36fadc9dabc99a8de03cc3a0f52f22cc5c9d7083 100644
--- a/NPLib/Core/NPVSpectra.h
+++ b/NPLib/Core/NPVSpectra.h
@@ -25,7 +25,7 @@
 // ROOT headers
 #include "TObject.h"
 #include "TH1.h"
-
+#include "TCanvas.h"
 // C++ STL headers
 #include <map>
 #include <vector>
@@ -38,12 +38,13 @@ class VSpectra {
     VSpectra();
     virtual ~VSpectra();
 
-//  private:
   public:
     // Instantiate and register histo to maps
     TH1* AddHisto1D(string name, string title, Int_t nbinsx, Double_t xlow, Double_t xup, string family);
     TH1* AddHisto2D(string name, string title, Int_t nbinsx, Double_t xlow, Double_t xup, 
         Int_t nbinsy, Double_t ylow, Double_t yup, string family);
+    // Add a Canvas to the online
+    void AddCanvas(TCanvas* c );
 
   public:
     // Initialization methods
@@ -63,10 +64,20 @@ class VSpectra {
     map< vector<string>, TH1* > GetMapHisto() const {return fMapHisto;}
     TH1* GetHisto(string& family, string& name);    
     void WriteSpectra(string filename = "VOID");      
-
+    // Return the canvases created for online display
+    vector<TCanvas*> GetCanvas();
+     
   private:
     // map holding histo pointers and their family names
     map< vector<string>, TH1* > fMapHisto;
+    vector<TCanvas*> m_Canvas;
+    
+  private: // Name of the Detector
+   string m_name;
+
+  public:
+   inline void SetName(string name) {m_name=name;}
+   inline string GetName() {return m_name;}
 };
 
 #endif
diff --git a/NPLib/Core/RootInput.cxx b/NPLib/Core/RootInput.cxx
index 3e2de07837a8000cdf8c3d6a5c399526f28ea484..e694478ccd0d20ea7d963c3a199de7f95a95d148 100644
--- a/NPLib/Core/RootInput.cxx
+++ b/NPLib/Core/RootInput.cxx
@@ -105,14 +105,14 @@ RootInput::RootInput(string configFileName){
           std::string SHARED_LIB_EXTENSION = ".dylib";
 #endif
 
-          string path = getenv("NPTOOL");
+            string path = getenv("NPTOOL");
           path+="/NPLib/lib/";
-          string libName="libNPInteractionCoordinates"+SHARED_LIB_EXTENSION;
-          libName=path+libName;
-          dlopen(libName.c_str(),RTLD_NOW);
-          libName="libNPInitialConditions"+SHARED_LIB_EXTENSION;
-          libName=path+libName;
-          dlopen(libName.c_str(),RTLD_NOW);
+            string libName="libNPInteractionCoordinates"+SHARED_LIB_EXTENSION;
+            libName=path+libName;
+            dlopen(libName.c_str(),RTLD_NOW);
+            libName="libNPInitialConditions"+SHARED_LIB_EXTENSION;
+            libName=path+libName;
+            dlopen(libName.c_str(),RTLD_NOW);
         }
       }
 
@@ -170,7 +170,7 @@ void RootInput::AddFriendChain(string RunToAdd){
   TChain* localChain = new TChain();
 
   cout << "/////////////////////////////////" << endl;
-  cout << "Adding frien to current TChain" << endl;
+  cout << "Adding friend to current TChain" << endl;
 
   if (!inputConfigFile) {
     cout << "Run to Add file :" << RunToAdd << " not found " << endl; 
diff --git a/NPLib/Core/RootInput.h b/NPLib/Core/RootInput.h
index f08fd789a6b427d566540652afc513abbef9396e..6872906575bddb01c8b230dc305809f82191dcc8 100644
--- a/NPLib/Core/RootInput.h
+++ b/NPLib/Core/RootInput.h
@@ -70,7 +70,8 @@ public:
    // Return the private chain and file
    TChain*  GetChain()  {return pRootChain;}
    TFile*   GetFile()   {return pRootFile;}
-   
+   void     SetChain(TChain* c)  {pRootChain = c;} 
+
    // Add a Friend chain to the input chain
    void     AddFriendChain(string RunToAdd);
 
diff --git a/NPLib/Core/RootOutput.cxx b/NPLib/Core/RootOutput.cxx
index eb75feaea6f63dc103a0930e999c6834e42f77cf..29d55ea636aa2860ef39de3a8dd1aa0905c7a4ee 100644
--- a/NPLib/Core/RootOutput.cxx
+++ b/NPLib/Core/RootOutput.cxx
@@ -124,10 +124,11 @@ RootOutput::RootOutput(TString fileNameBase, TString treeNameBase){
   // Init TAsciiFile objects
   InitAsciiFiles();
   gDirectory->cd(currentPath->GetPath()); 
-  long int inter= -3000000000; 
-  pRootTree->SetAutoFlush(inter);
-  pRootTree->SetAutoSave(-inter);
-
+//  long int inter= -3000000000; 
+//  pRootTree->SetAutoFlush(inter);
+//  pRootTree->SetAutoSave(-inter);
+  pRootTree->SetAutoFlush(0);
+  pRootTree->SetAutoSave(0);
 }
 
 
@@ -142,13 +143,15 @@ void RootOutput::InitAsciiFiles(){
   pEventGenerator = new TAsciiFile();
   pEventGenerator->SetNameTitle("EventGenerator", fileNameEG.Data());
   pEventGenerator->Append(fileNameEG.Data());
-
+  pEventGenerator->Write();
+  
   // Detector configuration 
   // Get file name from NPOptionManager
   TString fileNameDC = OptionManager->GetDetectorFile();
   pDetectorConfiguration = new TAsciiFile();
   pDetectorConfiguration->SetNameTitle("DetectorConfiguration", fileNameDC.Data());
   pDetectorConfiguration->Append(fileNameDC.Data());
+  pDetectorConfiguration->Write();
 
   // Run to treat file
   // Get file name from NPOptionManager
@@ -157,6 +160,7 @@ void RootOutput::InitAsciiFiles(){
     TString fileNameRT = OptionManager->GetRunToReadFile();
     pRunToTreatFile->SetNameTitle("RunToTreat", fileNameRT.Data());
     pRunToTreatFile->Append(fileNameRT.Data());
+    pRunToTreatFile->Write();
   }
 
   // Calibration files
@@ -164,14 +168,17 @@ void RootOutput::InitAsciiFiles(){
   if (!OptionManager->IsDefault("Calibration")) {
     TString fileNameCal = OptionManager->GetCalibrationFile();
     pCalibrationFile->SetNameTitle("Calibration", fileNameCal.Data());
+    pCalibrationFile->Write();
   }
 
   // Analysis configuration files
   pAnalysisConfigFile = new TAsciiFile();
   pAnalysisConfigFile->SetNameTitle("AnalysisConfig", "AnalysisConfig");
+  pAnalysisConfigFile->Write();
 }
 
 
+
 ////////////////////////////////////////////////////////////////////////////////
 RootOutput::~RootOutput(){ 
   // The data is written to the file and the tree is closed:
diff --git a/NPLib/Core/icons/arrow-down.xpm b/NPLib/Core/icons/arrow-down.xpm
new file mode 100644
index 0000000000000000000000000000000000000000..3a5dff8a9d69b7236db51537f0d20969b6dcf17c
--- /dev/null
+++ b/NPLib/Core/icons/arrow-down.xpm
@@ -0,0 +1,37 @@
+/* XPM */
+static char *arrow_down[] = {
+/* columns rows colors chars-per-pixel */
+"10 10 21 1 ",
+"  c #373636",
+". c #393C3C",
+"X c #52726A",
+"o c #598378",
+"O c #6BAA9B",
+"+ c #74BEAC",
+"@ c #74C2AE",
+"# c #78C1AF",
+"$ c #77C3B0",
+"% c #7BC5B3",
+"& c #80C4B3",
+"* c #8ECDBD",
+"= c #98D1C3",
+"- c #9DD3C6",
+"; c #AFD7CD",
+": c #B5DED3",
+"> c #C3E0D9",
+", c #D6E9E4",
+"< c #DAEFEA",
+"1 c #F2F9F8",
+"2 c #FBFCFC",
+/* pixels */
+" .XO++OX. ",
+".o+%**%+o.",
+"X+@-11=@+X",
+"O$@-22-@@O",
+"+%:<22<:%+",
+"@@;2222:@+",
+"O@#>22>@%O",
+"X+%&,,&@+X",
+".o+@&&@+o.",
+" .XO+@OX. "
+};
diff --git a/NPLib/Core/icons/arrow-up.xpm b/NPLib/Core/icons/arrow-up.xpm
new file mode 100644
index 0000000000000000000000000000000000000000..67ea42810685c6ed3733815381a971f63b743278
--- /dev/null
+++ b/NPLib/Core/icons/arrow-up.xpm
@@ -0,0 +1,37 @@
+/* XPM */
+static char *arrow_up[] = {
+/* columns rows colors chars-per-pixel */
+"10 10 21 1 ",
+"  c #373636",
+". c #393C3D",
+"X c #526C7A",
+"o c #5A7A8C",
+"O c #6C9EB9",
+"+ c #73AFD1",
+"@ c #75B0D0",
+"# c #77B3D4",
+"$ c #77B4D5",
+"% c #8BB9D3",
+"& c #83BAD8",
+"* c #98C5DD",
+"= c #9CC7DE",
+"- c #B3D0E1",
+"; c #B2D4E7",
+": c #C6DFED",
+"> c #D8E6ED",
+", c #D9E9F3",
+"< c #F1F6F8",
+"1 c #FCFDFE",
+"2 c #FEFEFE",
+/* pixels */
+" .XO@$OX. ",
+".o@$&&$@o.",
+"X$$&,,&$@X",
+"O$$:22:$$O",
+"$$-2222;$@",
+"@$->22>;$$",
+"O$@=22=@$O",
+"X@$*<<=@@X",
+".o@$%%$@o.",
+" .XO@$OX. "
+};
diff --git a/NPLib/Core/icons/brightness.xpm b/NPLib/Core/icons/brightness.xpm
new file mode 100644
index 0000000000000000000000000000000000000000..31ff3031836d25a24b12c9ac28894097132ad656
--- /dev/null
+++ b/NPLib/Core/icons/brightness.xpm
@@ -0,0 +1,126 @@
+/* XPM */
+static char *brightness[] = {
+/* columns rows colors chars-per-pixel */
+"32 32 88 1 ",
+"  c #353636",
+". c #353737",
+"X c #373737",
+"o c #393838",
+"O c #3A3838",
+"+ c #493C3C",
+"@ c #533E3E",
+"# c #5A4040",
+"$ c #5B4040",
+"% c #614242",
+"& c #7A4848",
+"* c #8B4D4D",
+"= c #914E4E",
+"- c #9E5151",
+"; c #A95454",
+": c #B05656",
+"> c #BB5656",
+", c #B15958",
+"< c #B05A5A",
+"1 c #B65858",
+"2 c #B65E5D",
+"3 c #B85858",
+"4 c #BC5858",
+"5 c #BE5A5A",
+"6 c #BB5F5F",
+"7 c #B26361",
+"8 c #B66363",
+"9 c #B86261",
+"0 c #BF7A76",
+"q c #BF7C77",
+"w c #C15858",
+"e c #C75C5C",
+"r c #C85C5C",
+"t c #C85F5F",
+"y c #C76160",
+"u c #C76362",
+"i c #C86160",
+"p c #C66866",
+"a c #C06D6A",
+"s c #CC6C6C",
+"d c #C07A76",
+"f c #CE7878",
+"g c #D17979",
+"h c #BB837E",
+"j c #CE817D",
+"k c #CE827D",
+"l c #BD8B85",
+"z c #C78580",
+"x c #CC8383",
+"c c #CF8984",
+"v c #D68787",
+"b c #CD958E",
+"n c #CE9595",
+"m c #D39790",
+"M c #D19A93",
+"N c #D99999",
+"B c #DC9A9A",
+"V c #CBA89F",
+"C c #CCABA8",
+"Z c #CCABA9",
+"A c #D6AAA1",
+"S c #CDB2A8",
+"D c #CEB8AD",
+"F c #CFB9AE",
+"G c #D7BBB0",
+"H c #DABDB2",
+"J c #DEBFBF",
+"K c #C1C2B7",
+"L c #C6C6BD",
+"P c #CCCCBE",
+"I c #CCCBC3",
+"U c #D7CDC0",
+"Y c #DDCFC2",
+"T c #D1D0C3",
+"R c #DDD0C3",
+"E c #DADCCD",
+"W c #DFDCCE",
+"Q c #EAC3C3",
+"! c #EAD2D2",
+"~ c #F1D5D5",
+"^ c #E1E2D3",
+"/ c #EDEEEB",
+"( c #F8F0F0",
+") c #FAF1F1",
+"_ c #F9F9F8",
+"` c #FDFAFA",
+"' c #FDFDFD",
+"] c white",
+/* pixels */
+"XXXXXXXXoo@&-;eeee:-&@oXXoXXXXXX",
+"XXXXXXXo@=eerreeeeeee3=$XXXXXXXX",
+"XXXXXX+*5reereeeeeeeerr5*+XXXXXX",
+"XXXXX#;reeeeeeeeeeeeeeeee;$XXXXX",
+"XXXX#1rreeeeeeerueeeeeeerr3%XXoX",
+"XXX#1rrreeeeeeeAAeeeeeeerrr:@XXX",
+"XX+;rereeeMceeeHHeeecneerree;+XX",
+"XX*rreeeeuGRseeddeesRGueeeeee*XX",
+"X#5reeeeee0VurgkxguuV0eeeeeer5@o",
+"X=reeeeiee51N!]_](~B:>eeyreeer=o",
+"@1rreeMGkesQ]]]]]]]]QsekHMrerr3@",
+"&eeeeezUAiQ]]]]]]]]]]QiAPcrrrrr&",
+"-reeee>77B]]]]]]]]]]]_B97>eerer-",
+"1reeeeeei~]]]]]]]]]]]]~teeeeeer:",
+"eeeeeeeeg(]]]]]]]]]]]](feeeeeerr",
+"eeeeuAHkv]]]]]]]]]]]]]]vkHAueerr",
+"eeeetCFfv_]]]]]]]]]]]]]v0DVrreee",
+"eeeee:;4g(]]]]]]]]]]]](f>::eeeee",
+"3eeeeeeee!]]]]]]]]]]]]~ieeeeere:",
+"-eeeeeespn_]]]]]]]]]]]n8seeeerr-",
+"&eeeeexYA1I]]]]]]]]]]J5ARceeeee&",
+"+3eeeenD0eeP]]]]]]]]J7e0Dbeeer:@",
+"o=eeee434ew3C/_]]]/C;>e>11eeee=o",
+"X#5reeeereewlKLILLDleeeeeeeeee#X",
+"Xo*rreeeeeeeMETIPUEMeeeeeeeer*oX",
+"Xo+;rreeeeee7SEE^EDaeeeeeeer;+Xo",
+"XXX@3eeeeeeer3hPP015eeeeeer1#XXX",
+"XXXX#3reeeeerr51::eeeeeeee1%XXXX",
+"XXXXX#;errreeeeerrrreeeee;@XXXXX",
+"XXXXoo+*rreeeeeerrrrere5*+XXXXXX",
+"XXXXXXXo@=:eeeeerrrrr5*#oXXXXXXX",
+"XXXXXXXXXo+&;:rrrr:-&@oXXXXXXXXX"
+};
diff --git a/NPLib/Core/icons/clock.xpm b/NPLib/Core/icons/clock.xpm
new file mode 100644
index 0000000000000000000000000000000000000000..921d2fc46ccaa5730776a1a1d54a65944de45cf6
--- /dev/null
+++ b/NPLib/Core/icons/clock.xpm
@@ -0,0 +1,138 @@
+/* XPM */
+static char *clock[] = {
+/* columns rows colors chars-per-pixel */
+"32 32 100 2 ",
+"   c #353535",
+".  c #373737",
+"X  c #3D3D3D",
+"o  c #3E3E3E",
+"O  c #525250",
+"+  c #5D5D59",
+"@  c #4B5A71",
+"#  c #576478",
+"$  c #5D6A7C",
+"%  c #676763",
+"&  c #686863",
+"*  c #6B6B66",
+"=  c #6E6E69",
+"-  c #70706B",
+";  c #C65959",
+":  c #C75A5A",
+">  c #C75B5B",
+",  c #C66060",
+"<  c #C66261",
+"1  c #C86262",
+"2  c #C96564",
+"3  c #C56867",
+"4  c #C46C6A",
+"5  c #CA6968",
+"6  c #CB6E6C",
+"7  c #C57572",
+"8  c #CB7370",
+"9  c #C87B77",
+"0  c #CD7B78",
+"q  c #CD7E7A",
+"w  c #C1817D",
+"e  c #CE817D",
+"r  c #677280",
+"t  c #687483",
+"y  c #6A7583",
+"u  c #77818D",
+"i  c #8A8A83",
+"p  c #808993",
+"a  c #9F9F96",
+"s  c #A6A69C",
+"d  c #BFA99F",
+"f  c #A7AAA6",
+"g  c #A9ACA8",
+"h  c #B2B2A7",
+"j  c #BCBCB2",
+"k  c #B9BDB8",
+"l  c #C08984",
+"z  c #C08A84",
+"x  c #C08E88",
+"c  c #CB948E",
+"v  c #D1928C",
+"b  c #C09790",
+"n  c #C59D95",
+"m  c #CA9891",
+"M  c #D39D96",
+"N  c #C0A299",
+"B  c #D4A29A",
+"V  c #D4A39B",
+"C  c #C0A9A0",
+"Z  c #C3AEA5",
+"A  c #D7AEA5",
+"S  c #D7AFA5",
+"D  c #C6B1A7",
+"F  c #C3B2A8",
+"G  c #CCBAAF",
+"H  c #D1B5AB",
+"J  c #D0B8AE",
+"K  c #D7BAAF",
+"L  c #C5BFB4",
+"P  c #D9BAB0",
+"I  c #D9BCB1",
+"U  c #BEC1BB",
+"Y  c #C1C1B5",
+"T  c #C3C3B8",
+"R  c #CAC7BA",
+"E  c #CDCCBF",
+"W  c #D6C0B5",
+"Q  c #DBC5B9",
+"!  c #DCCBBE",
+"~  c #CDCCC0",
+"^  c #CDCDC0",
+"/  c #CECEC1",
+"(  c #CECFC2",
+")  c #D0D0C2",
+"_  c #D0D2C7",
+"`  c #DDD0C3",
+"'  c #DDD3C5",
+"]  c #DED3C5",
+"[  c #D5D7C8",
+"{  c #D6D7CA",
+"}  c #D9DACB",
+"|  c #DFD9CB",
+" . c #DADBCD",
+".. c #DBDBCE",
+"X. c #DEDED0",
+"o. c #DEDFD0",
+"O. c #DFE0D1",
+"+. c #E1E0D1",
+"@. c #E1E1D1",
+"#. c #E0E2D3",
+/* pixels */
+". . . . . . . . . X + i h ^ X.+.+.X.^ h i + X . . . . . . . . . ",
+". . . . . . . X = g ^ X.+.X.X.+.+.+.+.+.X._ g % X . . . . . . . ",
+". . . . . . O a ] +.@.@.+.+.X.+.+.+.+.+.+.+.+.[ a O . . . . . . ",
+". . . . . % Y +.+.X.@.@.@.+.+.+.+.+.+.+.+.+.+.+.+.L % . . . . . ",
+". . . . = ^ +.+.@.@.X.@.@.| ] ] ] ] ] X.+.+.O.+.+.+.^ = . . . . ",
+". . . & E +.+.+.@.@.@.P M l 5 3 5 5 q M Q X.+.+.+.+.+.^ % . . . ",
+". . O Y +.+.+.+.@.` v 2 : : > , < , > ; 5 v ` +.+.+.+.+.j O . . ",
+". X a +.+.+.O.+.P 8 : , 8 x d d Z d x 7 < > 5 P +.+.+.X.X.a X . ",
+". & [ +.+.+.+.P 5 > 3 b T ^ [ X.| [ E Y b 4 > 5 P +.+.O.+.| = . ",
+"X s +.+.+.+.] 8 > 7 D ^ O.O.+.+.+.+.+.X.E D 7 > 8 ] +.O.+.+.f X ",
+"+ ) +.+.O.X.v > 5 h | O.O.O.O.X.[ X.O.O.+.| D 5 > v ] +.O.O.^ + ",
+"i X.+.+.O.Q 5 > m | O.O.O.O.[ r u [ O.+.X.+.| N > 5 Q O.O.O.X.i ",
+"h +.O.+.O.M > 7 _ +.+.+.O.O.[ # $ ) +.O.+.O.+.E 7 > M +.O.+.+.h ",
+"^ +.+.+.| e > m O.+.+.+.+.+.) r $ [ O.O.+.O.+.X.m > e | O.O.X._ ",
+"+.+.X.+.] 5 < H O.+.+.O.+.+.[ # r [ +.O.O.+.+.O.H < 5 ] +.+.+.O.",
+"+.+.+.+.] 5 < W +.+.+.+.+.+.^ r # k +.+.+.+.O.+.W < 5 ] +.O.+.O.",
+"+.+.X.+.] 5 5 W +.+.X.+.X.O.[ r @ r k X.| O.O.#.W 3 < ] O.O.+.+.",
+"X.+.+.+.] 5 , P +.+.+.+.+.X.X.h r @ t U O.O.O.#.I 2 8 ] O.O.O.O.",
+"E +.+.X.] 0 ; M O.+.X.+.+.+.+.[ f r @ t ^ O.+.+.V > 9 ] +.+.+._ ",
+"h +.X.+.+.c > 0 | +.+.+.+.X.+.+.) f r @ u O.+.] e > c | +.O.O.h ",
+"i +.+.+.O.G 4 < H +.+.+.+.+.+.+.O.[ g r u +.| S , < G +.+.+.O.i ",
+"+ ) +.X.O.] l > 8 W +.+.+.X.X.+.O.O.] j T O.] 8 > z ] +.X.+._ + ",
+"X h +.+.O.X.W 4 > e ! +.+.+.+.+.O.O.+.O.O.Q e > 3 G O.O.X.O.f X ",
+"  & | +.O.X.| N < > 8 S | +.+.+.O.O.O.O.H 8 > < Z O.+.+.+.] &   ",
+". X a O.O.+.+._ d 4 ; < 0 B P Q Q K V 0 < > 4 d ) +.+.+.+.s X . ",
+". . O j O.O.+.O.| D w < ; ; < 1 < < > ; < w D | +.+.+.+.Y O . . ",
+". . . & E X.+.+.+.| R h l 4 4 < 4 4 9 l d T | O.+.+.+.E % . . . ",
+". . . . - _ +.+.+.+.| X.E Y U Z j D Y E | X.O.+.+.+._ = . . . . ",
+". . . .   & Y +.X.X.O.+.O.O.| X.| | X.X.+.+.+.X.| j % . . . . . ",
+". . . . X   O a | X.+.+.O.O.+.X.X.X.+.X.+.X.+.| s O . . . . . . ",
+". . . . X     X % s E X.+.+.+.+.+.+.+.+.] E f % X . . . . . . . ",
+". . . . .   X   X X + i h _ X.+.+.+.E h i + X . . . . . . . . . "
+};
diff --git a/NPLib/Core/icons/download.png b/NPLib/Core/icons/download.png
new file mode 100644
index 0000000000000000000000000000000000000000..8a467867e011c0a07f8f25d1954409a7f520212e
Binary files /dev/null and b/NPLib/Core/icons/download.png differ
diff --git a/NPLib/Core/icons/download.xpm b/NPLib/Core/icons/download.xpm
new file mode 100644
index 0000000000000000000000000000000000000000..e1fa315419eae97f7ac3bf7f40af3775d632d988
--- /dev/null
+++ b/NPLib/Core/icons/download.xpm
@@ -0,0 +1,110 @@
+/* XPM */
+static char *download[] = {
+/* columns rows colors chars-per-pixel */
+"32 32 72 1 ",
+"  c #373635",
+". c #373737",
+"X c #37383A",
+"o c #37393B",
+"O c #354350",
+"+ c #33495D",
+"@ c #324E68",
+"# c #315271",
+"$ c #2E6293",
+"% c #2E6294",
+"& c #2C6EAB",
+"* c #2B72B4",
+"= c #297AC6",
+"- c #2882D5",
+"; c #1786EE",
+": c #1C8AF2",
+"> c #1E8EF7",
+", c #2689E5",
+"< c #2689E6",
+"1 c #268AE7",
+"2 c #258AE9",
+"3 c #268BEA",
+"4 c #268DEE",
+"5 c #338FE6",
+"6 c #3590E6",
+"7 c #258FF2",
+"8 c #208FF8",
+"9 c #2892F5",
+"0 c #2592F9",
+"q c #2193FF",
+"w c #2496FF",
+"e c #2596FF",
+"r c #2B98FF",
+"t c #2E9AFF",
+"y c #329CFF",
+"u c #399FFF",
+"i c #3EA2FF",
+"p c #53A1EB",
+"a c #45A5FF",
+"s c #55A6F1",
+"d c #52ABFF",
+"f c #57AEFF",
+"g c #5FB1FF",
+"h c #71B0EB",
+"j c #77B5EF",
+"k c #61ABF1",
+"l c #60B2FF",
+"z c #64B4FF",
+"x c #73B6F4",
+"c c #74BCFF",
+"v c #78BEFF",
+"b c #8BBEEE",
+"n c #9CC8F2",
+"m c #97CCFF",
+"M c #AACFF2",
+"N c #A0D1FF",
+"B c #A9D5FF",
+"V c #ABD6FF",
+"C c #ADD7FF",
+"Z c #B7D7F4",
+"A c #B8DAF9",
+"S c #B8DDFF",
+"D c #C3DDF6",
+"F c #C6E3FF",
+"G c #DBEDFF",
+"H c #E1EEFA",
+"J c #E4F0FA",
+"K c #E6F3FF",
+"L c #E8F4FF",
+"P c #F6FAFE",
+"I c #F6FBFF",
+"U c #F9FCFE",
+/* pixels */
+"........ X+%=18w881=%@X   X XX  ",
+".......X@*3wwwwwrwwr82*@X  X   X",
+"......O&2wwwwwrwwww8www2&OXX XX ",
+".....@-wwwwww8wwwrwwwwwww=@X  X ",
+"..XX#,wwwwwrwwwwww8wrwwrww<# X  ",
+".X.@,wwwww8www8ww8wwwwwwwww<@  X",
+"X.O=wwwwwwrw8wwwwrwww8r8wwww=O X",
+"..&wwwwwwwwwffww8wllwwwwwwwwr&X ",
+".@7wwww8wwyCUHawwiKUCiwwwwrww2@.",
+".*www>wwwaDUUKuwwiKUUDuwww8rww*.",
+"+2wwwwwwrCUUUKu7wuKUUUCr8wwwww2@",
+"%w7wwwwwlUUUUKuwwiHUUUUlwww87ww$",
+"=www7wwyCUUUUKuwwiKUUUUCwrwwwww=",
+",wwwwtvFUUUMnjwwwwjbMUUGy8w8www1",
+"wwwwtNUUUUUk;>wwww:;kUUKdwwrw8w8",
+"www>vUUUUUUGiwwwwwwaGUUUKDfwwwwr",
+"wwwyFUUUUUUUSywww8rSUUUUUUKlrwww",
+"7wwuKUUUUUUUUmrwwrmUUUUUUUUSrwww",
+"<wwuKUUUUUUUUUcwwvUUUUUUUUUKy7w<",
+"=wwyFUUUUUUUUUKllKUUUUUUUUUKuww=",
+"%ww8xUUUUUUUUUUUUUUUUUUUUUUAwww$",
+"+2ww7nUUUUUUUUUUUUUUUUUUUUHswr<+",
+"X*www2hDKHHKKKHHKKHKKKKJKZp>ww*.",
+" @7www415665666555556656527ww2@ ",
+" X&wwww88888w88888888888wwwww&XX",
+"X +=wwwwww8rwwrwwwwwwwwwwwww=+  ",
+"   @1wwwww8wwwwwwwwwwrwwwww1@XX ",
+"X X #1wwwrwwwww8rwwwwwwwww1@   X",
+" X   @=wwwwwr8wwwwwwww8ww=@  X  ",
+"  XX  O&2rwwwwwwww8wwww7&OX X  X",
+"X X  XXX@*18wwrwwrwww<*@X  XX X ",
+"X   X  X X@%=18w881=%+X XX X  X "
+};
diff --git a/NPLib/Core/icons/plugin.png b/NPLib/Core/icons/plugin.png
new file mode 100644
index 0000000000000000000000000000000000000000..cf0f9b077a7f68da6aece12f6a5f58c21a72eb68
Binary files /dev/null and b/NPLib/Core/icons/plugin.png differ
diff --git a/NPLib/Core/icons/plugin.xpm b/NPLib/Core/icons/plugin.xpm
new file mode 100644
index 0000000000000000000000000000000000000000..4b9037ba156ed5e7ea161ac19de9865cc108e4ce
--- /dev/null
+++ b/NPLib/Core/icons/plugin.xpm
@@ -0,0 +1,102 @@
+/* XPM */
+static char *plugin[] = {
+/* columns rows colors chars-per-pixel */
+"32 32 64 1 ",
+"  c #373737",
+". c #383939",
+"X c #3F4846",
+"o c #43524E",
+"O c #465954",
+"+ c #475A55",
+"@ c #49605A",
+"# c #4A5669",
+"$ c #4E5B72",
+"% c #505F74",
+"& c #54776F",
+"* c #516175",
+"= c #516875",
+"- c #546F78",
+"; c #556F7C",
+": c #57747E",
+"> c #577A7C",
+", c #5C887D",
+"< c #597982",
+"1 c #5B7D86",
+"2 c #5B8183",
+"3 c #5F8E82",
+"4 c #5E858B",
+"5 c #60898D",
+"6 c #70838D",
+"7 c #61928D",
+"8 c #649A8D",
+"9 c #7C8690",
+"0 c #639192",
+"q c #659D93",
+"w c #659994",
+"e c #66A095",
+"r c #69A596",
+"t c #6BA59E",
+"y c #6BAA9D",
+"u c #6EAFA1",
+"i c #6EB1A0",
+"p c #6FB3A2",
+"a c #73B2A1",
+"s c #70B6A4",
+"d c #72B9A7",
+"f c #72B6A8",
+"g c #72B7A8",
+"h c #72BAA8",
+"j c #75BFAD",
+"k c #79BAAB",
+"l c #76C2AF",
+"z c #76C3B0",
+"x c #7AC3B0",
+"c c #90B3A8",
+"v c #97BCAD",
+"b c #98C3B5",
+"n c #93CAB8",
+"m c #9ECDBC",
+"M c #A1CEBD",
+"N c #B0C8B9",
+"B c #B6D4C3",
+"V c #C4D8C8",
+"C c #D0D2C7",
+"Z c #D0D3C7",
+"A c #D9DCCD",
+"S c #DBE0D0",
+"D c #E0E0D1",
+"F c #E2E1D2",
+/* pixels */
+"        ..o&wpdllhp8&o..        ",
+"       .+3pzllllzzzzhp7O        ",
+"      X,fzzjllllllzzzzzp,X      ",
+"     OrzzzzzlllllzzzzzzzlrO     ",
+"    Opzlzzzzzzhzllxlllllzzp+    ",
+"   OpzllzjjzhzxzllxMnllllzzpO   ",
+"  XrzlllzzzzzzzzlxBFVxzlllllrX  ",
+"  ,zzlllzzhzfuhzxBFAvzzzlllll,  ",
+" Ohzlllllllz0$1kBSAvpllllllllhO ",
+" 3zllllllllzw$$6ZSvplllllllllz3.",
+"opzzllllzzzh1#$$9cazzllllxlllzpo",
+"&lzlllllzxh1$##$$1fzllllmVnllll&",
+"8zllllllzf1$%$$#$$1dllzmAFmlllz8",
+"pllllllzh4$%$%$$#$$1dxmFFNpllllp",
+"hzlllllzu%$$%$%$$#$$1bSFNdlllllh",
+"zzllllll5$$%$%$%$##$%9ZNadzllzzz",
+"zzjzzzzz1$$$*$*$$*##$$6ylzzllzhz",
+"hzzzzzzh2$*$$*$$*$$$#$$1hlzzllzh",
+"pzzzzzzz0$*$$$$$$$$$##$$wlzzzzza",
+"wzjzzzzzp*$$*$*$$*$*$-32plzzzzzw",
+"&hxzzzzzh4$$*$**$*$$:yhphlllzzz&",
+"opzzzzhzp:#$$$$$*$$:ylzzzlllzzpo",
+".3zzzzhp<$->=$$$$$>yllllzzllzz3.",
+".Ohzzzz0$-wpw2::17plllllzzllzhO ",
+". 3zzzzr2rfzlhpudhllllllzzzzz,. ",
+"  XrzzzhphzzllllllllllllllzzrX  ",
+"   opzzzlllllllllllllllllzzpo   ",
+"    +pzzlllllllllllllllllzpO.   ",
+"    .orzllllllllllllllllzrO     ",
+"    ..X2hlzllllllllllllh,X      ",
+"      . O3plllllzzlllp7o.       ",
+"          o&8plllhp8&o.         "
+};
diff --git a/NPLib/Core/icons/polaroid.xpm b/NPLib/Core/icons/polaroid.xpm
new file mode 100644
index 0000000000000000000000000000000000000000..db6e3070bf65b7f2197adf4249c46dac7018d65a
--- /dev/null
+++ b/NPLib/Core/icons/polaroid.xpm
@@ -0,0 +1,71 @@
+/* XPM */
+static char *polaroid[] = {
+/* columns rows colors chars-per-pixel */
+"20 20 45 1 ",
+"  c #4B5970",
+". c #4C5A70",
+"X c #4D5B72",
+"o c #4E5C72",
+"O c #4F5D73",
+"+ c #58667A",
+"@ c #59667B",
+"# c #5C697D",
+"$ c #5E6B7F",
+"% c #5F6B7F",
+"& c #687487",
+"* c #71AAC9",
+"= c #72ABCB",
+"- c #76B2D3",
+"; c #76B2D4",
+": c #76B3D4",
+"> c #77B3D4",
+", c #77B4D5",
+"< c #7EB6D5",
+"1 c #7FB7D6",
+"2 c #7FB8D7",
+"3 c #8C94A2",
+"4 c #8C95A3",
+"5 c #979EAB",
+"6 c #87BCD9",
+"7 c #88BDDA",
+"8 c #89BDDA",
+"9 c #B7D0DE",
+"0 c #BCDAEA",
+"q c #BDDAEA",
+"w c #C4D6E1",
+"e c #C5D7E1",
+"r c #D4DDE4",
+"t c #D4DEE5",
+"y c #D5DEE5",
+"u c #D6DFE6",
+"i c #C9E1EE",
+"p c #CAE1EE",
+"a c #DDE0E4",
+"s c #DEE6EC",
+"d c #E1E3E7",
+"f c #EAF1F6",
+"g c #EFF6FA",
+"h c white",
+"j c None",
+/* pixels */
+"jjjjjjj>>>>>>jjjjjjj",
+"jjjjj>>>>>>>>>>jjjjj",
+"jjj>>>>>>>>>>>>>>jjj",
+"jj>>>>>>>>>>>>>>>>jj",
+"jj>>10iipppeii01>>jj",
+"j>>>6s53344335s6>>>j",
+"j>>>7t#OOOO O#t7>>>j",
+">>>>7t#OOOOOO#t7>>>>",
+">>1=8u$oOOOOO+r6>>>>",
+">>>18u$oOOOOO&r6>>>>",
+">>--8u$oOOOOO+r6>>>>",
+">>--8r$oOOOO &t6>>>>",
+">>>>7u&@@@@@+&t7>>>>",
+"j>>>8fduauduudf6>>>j",
+"j>>>6fhhhhhhhhg6>>>j",
+"jj>>19wwwwwwww91>>jj",
+"jj>>>======*=*=>>>jj",
+"jjj>>>>>>>>>>>>>>jjj",
+"jjjjj>>>>>>>>>>jjjjj",
+"jjjjjjj>>>>>>jjjjjjj"
+};
diff --git a/NPLib/Core/icons/power.png b/NPLib/Core/icons/power.png
new file mode 100644
index 0000000000000000000000000000000000000000..ad5101afd834f41db3c2a491d4b794fd100e6e35
Binary files /dev/null and b/NPLib/Core/icons/power.png differ
diff --git a/NPLib/Core/icons/power.xbm b/NPLib/Core/icons/power.xbm
new file mode 100644
index 0000000000000000000000000000000000000000..2fd52e56f9e2ad912f069b3ea684b133d39f4a5e
--- /dev/null
+++ b/NPLib/Core/icons/power.xbm
@@ -0,0 +1,117 @@
+#define power_width 128
+#define power_height 128
+static unsigned short power_bits[] = {
+   0x0000, 0x0000, 0x0000, 0xffc0, 0x03ff, 0x0000, 0x0000, 0x0000, 0x0000,
+   0x0000, 0x0000, 0xfffe, 0x7fff, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+   0xc000, 0xffff, 0xffff, 0x0003, 0x0000, 0x0000, 0x0000, 0x0000, 0xf800,
+   0xffff, 0xffff, 0x001f, 0x0000, 0x0000, 0x0000, 0x0000, 0xff00, 0xffff,
+   0xffff, 0x00ff, 0x0000, 0x0000, 0x0000, 0x0000, 0xffc0, 0xffff, 0xffff,
+   0x03ff, 0x0000, 0x0000, 0x0000, 0x0000, 0xfff8, 0xffff, 0xffff, 0x1fff,
+   0x0000, 0x0000, 0x0000, 0x0000, 0xfffe, 0xffff, 0xffff, 0x7fff, 0x0000,
+   0x0000, 0x0000, 0x0000, 0xffff, 0xffff, 0xffff, 0xffff, 0x0000, 0x0000,
+   0x0000, 0xc000, 0xffff, 0xffff, 0xffff, 0xffff, 0x0003, 0x0000, 0x0000,
+   0xf000, 0xffff, 0xffff, 0xffff, 0xffff, 0x000f, 0x0000, 0x0000, 0xf800,
+   0xffff, 0xffff, 0xffff, 0xffff, 0x001f, 0x0000, 0x0000, 0xfc00, 0xffff,
+   0xffff, 0xffff, 0xffff, 0x003f, 0x0000, 0x0000, 0xff00, 0xffff, 0xffff,
+   0xffff, 0xffff, 0x00ff, 0x0000, 0x0000, 0xff80, 0xffff, 0xffff, 0xffff,
+   0xffff, 0x01ff, 0x0000, 0x0000, 0xffc0, 0xffff, 0xffff, 0xffff, 0xffff,
+   0x03ff, 0x0000, 0x0000, 0xffe0, 0xffff, 0xffff, 0xffff, 0xffff, 0x07ff,
+   0x0000, 0x0000, 0xfff0, 0xffff, 0xffff, 0xffff, 0xffff, 0x0fff, 0x0000,
+   0x0000, 0xfff8, 0xffff, 0xffff, 0xffff, 0xffff, 0x1fff, 0x0000, 0x0000,
+   0xfffc, 0xffff, 0xffff, 0xffff, 0xffff, 0x3fff, 0x0000, 0x0000, 0xfffe,
+   0xffff, 0x3fff, 0xfffc, 0xffff, 0x7fff, 0x0000, 0x0000, 0xffff, 0xffff,
+   0x1fff, 0xfff8, 0xffff, 0xffff, 0x0000, 0x8000, 0xffff, 0xffff, 0x0fff,
+   0xfff0, 0xffff, 0xffff, 0x0001, 0xc000, 0xffff, 0xffff, 0x0fff, 0xfff0,
+   0xffff, 0xffff, 0x0003, 0xe000, 0xffff, 0xffff, 0x0fff, 0xfff0, 0xffff,
+   0xffff, 0x0007, 0xe000, 0xffff, 0xffff, 0x0fff, 0xfff0, 0xffff, 0xffff,
+   0x0007, 0xf000, 0xffff, 0xffff, 0x0fff, 0xfff0, 0xffff, 0xffff, 0x000f,
+   0xf800, 0xffff, 0xffff, 0x0fff, 0xfff0, 0xffff, 0xffff, 0x001f, 0xfc00,
+   0xffff, 0xffff, 0x0fff, 0xfff0, 0xffff, 0xffff, 0x003f, 0xfc00, 0xffff,
+   0xffff, 0x0fff, 0xfff0, 0xffff, 0xffff, 0x003f, 0xfe00, 0xffff, 0xffff,
+   0x0fff, 0xfff0, 0xffff, 0xffff, 0x007f, 0xfe00, 0xffff, 0xffff, 0x0fff,
+   0xfff0, 0xffff, 0xffff, 0x007f, 0xff00, 0xffff, 0x3fff, 0x0ffd, 0x1ff0,
+   0xfffc, 0xffff, 0x00ff, 0xff80, 0xffff, 0x1fff, 0x0ff8, 0x1ff0, 0xfff8,
+   0xffff, 0x01ff, 0xff80, 0xffff, 0x07ff, 0x0ff8, 0x0ff0, 0xffe0, 0xffff,
+   0x01ff, 0xffc0, 0xffff, 0x03ff, 0x0ff0, 0x0ff0, 0xffc0, 0xffff, 0x03ff,
+   0xffc0, 0xffff, 0x00ff, 0x0ff0, 0x07f0, 0xff00, 0xffff, 0x03ff, 0xffc0,
+   0xffff, 0x00ff, 0x0ff0, 0x0ff0, 0xff00, 0xffff, 0x03ff, 0xffe0, 0xffff,
+   0x003f, 0x0ff8, 0x0ff0, 0xfc00, 0xffff, 0x07ff, 0xffe0, 0xffff, 0x003f,
+   0x0ffc, 0x3ff0, 0xfc00, 0xffff, 0x07ff, 0xfff0, 0xffff, 0x000f, 0x0ffe,
+   0x7ff0, 0xf000, 0xffff, 0x0fff, 0xfff0, 0xffff, 0x800f, 0x0fff, 0xfff0,
+   0xf001, 0xffff, 0x0fff, 0xfff0, 0xffff, 0xc007, 0x0fff, 0xfff0, 0xe003,
+   0xffff, 0x0fff, 0xfff8, 0xffff, 0xe003, 0x0fff, 0xfff0, 0xc007, 0xffff,
+   0x1fff, 0xfff8, 0xffff, 0xf003, 0x0fff, 0xfff0, 0xc00f, 0xffff, 0x1fff,
+   0xfff8, 0xffff, 0xf801, 0x0fff, 0xfff0, 0x801f, 0xffff, 0x1fff, 0xfffc,
+   0xffff, 0xfc00, 0x0fff, 0xfff0, 0x003f, 0xffff, 0x3fff, 0xfffc, 0xffff,
+   0xfc00, 0x0fff, 0xfff0, 0x007f, 0xffff, 0x3fff, 0xfffc, 0x7fff, 0xfe00,
+   0x0fff, 0xfff0, 0x007f, 0xfffe, 0x3fff, 0xfffe, 0x7fff, 0xff00, 0x0fff,
+   0xfff0, 0x00ff, 0xfffe, 0x7fff, 0xfffe, 0x7fff, 0xff80, 0x0fff, 0xfff0,
+   0x00ff, 0xfffe, 0x7fff, 0xfffe, 0x3fff, 0xff80, 0x0fff, 0xfff0, 0x01ff,
+   0xfffc, 0x7fff, 0xfffe, 0x3fff, 0xffc0, 0x0fff, 0xfff0, 0x03ff, 0xfffc,
+   0x7fff, 0xfffe, 0x3fff, 0xffc0, 0x0fff, 0xfff0, 0x03ff, 0xfff8, 0x7fff,
+   0xffff, 0x1fff, 0xffc0, 0x0fff, 0xfff0, 0x03ff, 0xfff8, 0xffff, 0xffff,
+   0x1fff, 0xffe0, 0x0fff, 0xfff0, 0x07ff, 0xfff8, 0xffff, 0xffff, 0x1fff,
+   0xffe0, 0x0fff, 0xfff0, 0x07ff, 0xfff8, 0xffff, 0xffff, 0x0fff, 0xffe0,
+   0x0fff, 0xfff0, 0x07ff, 0xfff0, 0xffff, 0xffff, 0x1fff, 0xfff0, 0x0fff,
+   0xfff0, 0x07ff, 0xfff8, 0xffff, 0xffff, 0x0fff, 0xffe0, 0x0fff, 0xfff0,
+   0x0fff, 0xfff0, 0xffff, 0xffff, 0x0fff, 0xfff0, 0x0fff, 0xfff0, 0x0fff,
+   0xfff0, 0xffff, 0xffff, 0x0fff, 0xfff0, 0x0fff, 0xfff0, 0x0fff, 0xfff0,
+   0xffff, 0xffff, 0x0fff, 0xfff0, 0x0fff, 0xfff0, 0x0fff, 0xfff0, 0xffff,
+   0xffff, 0x0fff, 0xfff0, 0x0fff, 0xfff0, 0x0fff, 0xfff0, 0xffff, 0xffff,
+   0x0fff, 0xfff0, 0x0fff, 0xfff0, 0x0fff, 0xfff0, 0xffff, 0xffff, 0x0fff,
+   0xfff0, 0x0fff, 0xfff0, 0x0fff, 0xfff0, 0xffff, 0xffff, 0x0fff, 0xfff0,
+   0x1fff, 0xfff8, 0x0fff, 0xfff0, 0xffff, 0xffff, 0x0fff, 0xfff0, 0x3fff,
+   0xfffc, 0x0fff, 0xfff0, 0xffff, 0xffff, 0x0fff, 0xfff0, 0xffff, 0xffff,
+   0x07ff, 0xfff0, 0xffff, 0xffff, 0x1fff, 0xffe0, 0xffff, 0xffff, 0x0fff,
+   0xfff0, 0xffff, 0xffff, 0x0fff, 0xffe0, 0xffff, 0xffff, 0x07ff, 0xfff8,
+   0xffff, 0xffff, 0x1fff, 0xffe0, 0xffff, 0xffff, 0x07ff, 0xfff8, 0xffff,
+   0xffff, 0x1fff, 0xffe0, 0xffff, 0xffff, 0x07ff, 0xfff8, 0xffff, 0xffff,
+   0x1fff, 0xffc0, 0xffff, 0xffff, 0x03ff, 0xfff8, 0xffff, 0xfffe, 0x3fff,
+   0xffc0, 0xffff, 0xffff, 0x03ff, 0xfffc, 0x7fff, 0xfffe, 0x3fff, 0xff80,
+   0xffff, 0xffff, 0x01ff, 0xfffc, 0x7fff, 0xfffe, 0x3fff, 0xff80, 0xffff,
+   0xffff, 0x01ff, 0xfffc, 0x7fff, 0xfffe, 0x7fff, 0xff00, 0xffff, 0xffff,
+   0x01ff, 0xfffc, 0x7fff, 0xfffe, 0x7fff, 0xff00, 0xffff, 0xffff, 0x00ff,
+   0xfffe, 0x7fff, 0xfffc, 0x7fff, 0xfe00, 0xffff, 0xffff, 0x007f, 0xffff,
+   0x3fff, 0xfffc, 0xffff, 0xfc00, 0xffff, 0xffff, 0x003f, 0xffff, 0x3fff,
+   0xfffc, 0xffff, 0xfc01, 0xffff, 0xffff, 0x003f, 0xffff, 0x3fff, 0xfff8,
+   0xffff, 0xf801, 0xffff, 0xffff, 0x801f, 0xffff, 0x1fff, 0xfff8, 0xffff,
+   0xf003, 0xffff, 0xffff, 0xc00f, 0xffff, 0x1fff, 0xfff8, 0xffff, 0xe003,
+   0xffff, 0xffff, 0xc007, 0xffff, 0x1fff, 0xfff0, 0xffff, 0xc007, 0xffff,
+   0xffff, 0xe003, 0xffff, 0x0fff, 0xfff0, 0xffff, 0x000f, 0xffff, 0xffff,
+   0xf000, 0xffff, 0x0fff, 0xfff0, 0xffff, 0x001f, 0xfffe, 0x7fff, 0xf800,
+   0xffff, 0x0fff, 0xffe0, 0xffff, 0x001f, 0xfff8, 0x1fff, 0xfc00, 0xffff,
+   0x07ff, 0xffe0, 0xffff, 0x007f, 0xffe0, 0x07ff, 0xfc00, 0xffff, 0x07ff,
+   0xffc0, 0xffff, 0x007f, 0xff80, 0x00ff, 0xff00, 0xffff, 0x03ff, 0xffc0,
+   0xffff, 0x01ff, 0xe800, 0x0017, 0xff80, 0xffff, 0x03ff, 0xffc0, 0xffff,
+   0x03ff, 0x0000, 0x0000, 0xffc0, 0xffff, 0x03ff, 0xff80, 0xffff, 0x07ff,
+   0x0000, 0x0000, 0xffe0, 0xffff, 0x01ff, 0xff80, 0xffff, 0x1fff, 0x0000,
+   0x0000, 0xfff8, 0xffff, 0x01ff, 0xff00, 0xffff, 0x7fff, 0x0000, 0x0000,
+   0xfffc, 0xffff, 0x00ff, 0xfe00, 0xffff, 0xffff, 0x0000, 0x8000, 0xffff,
+   0xffff, 0x007f, 0xfe00, 0xffff, 0xffff, 0x0007, 0xc000, 0xffff, 0xffff,
+   0x007f, 0xfc00, 0xffff, 0xffff, 0x003f, 0xfc00, 0xffff, 0xffff, 0x003f,
+   0xfc00, 0xffff, 0xffff, 0x05ff, 0xffa0, 0xffff, 0xffff, 0x003f, 0xf800,
+   0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0x001f, 0xf000, 0xffff,
+   0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0x000f, 0xe000, 0xffff, 0xffff,
+   0xffff, 0xffff, 0xffff, 0xffff, 0x0007, 0xe000, 0xffff, 0xffff, 0xffff,
+   0xffff, 0xffff, 0xffff, 0x0007, 0xc000, 0xffff, 0xffff, 0xffff, 0xffff,
+   0xffff, 0xffff, 0x0003, 0x8000, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff,
+   0xffff, 0x0001, 0x0000, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff,
+   0x0000, 0x0000, 0xfffe, 0xffff, 0xffff, 0xffff, 0xffff, 0x7fff, 0x0000,
+   0x0000, 0xfffc, 0xffff, 0xffff, 0xffff, 0xffff, 0x3fff, 0x0000, 0x0000,
+   0xfff8, 0xffff, 0xffff, 0xffff, 0xffff, 0x1fff, 0x0000, 0x0000, 0xfff0,
+   0xffff, 0xffff, 0xffff, 0xffff, 0x0fff, 0x0000, 0x0000, 0xffe0, 0xffff,
+   0xffff, 0xffff, 0xffff, 0x07ff, 0x0000, 0x0000, 0xffc0, 0xffff, 0xffff,
+   0xffff, 0xffff, 0x03ff, 0x0000, 0x0000, 0xff80, 0xffff, 0xffff, 0xffff,
+   0xffff, 0x01ff, 0x0000, 0x0000, 0xff00, 0xffff, 0xffff, 0xffff, 0xffff,
+   0x00ff, 0x0000, 0x0000, 0xfc00, 0xffff, 0xffff, 0xffff, 0xffff, 0x003f,
+   0x0000, 0x0000, 0xf800, 0xffff, 0xffff, 0xffff, 0xffff, 0x001f, 0x0000,
+   0x0000, 0xf000, 0xffff, 0xffff, 0xffff, 0xffff, 0x000f, 0x0000, 0x0000,
+   0xc000, 0xffff, 0xffff, 0xffff, 0xffff, 0x0003, 0x0000, 0x0000, 0x0000,
+   0xffff, 0xffff, 0xffff, 0xffff, 0x0000, 0x0000, 0x0000, 0x0000, 0xfffe,
+   0xffff, 0xffff, 0x7fff, 0x0000, 0x0000, 0x0000, 0x0000, 0xfff8, 0xffff,
+   0xffff, 0x1fff, 0x0000, 0x0000, 0x0000, 0x0000, 0xffc0, 0xffff, 0xffff,
+   0x03ff, 0x0000, 0x0000, 0x0000, 0x0000, 0xff00, 0xffff, 0xffff, 0x00ff,
+   0x0000, 0x0000, 0x0000, 0x0000, 0xf800, 0xffff, 0xffff, 0x001f, 0x0000,
+   0x0000, 0x0000, 0x0000, 0xc000, 0xffff, 0xffff, 0x0003, 0x0000, 0x0000,
+   0x0000, 0x0000, 0x0000, 0xfffe, 0x7fff, 0x0000, 0x0000, 0x0000, 0x0000,
+   0x0000, 0x0000, 0xffc0, 0x03ff, 0x0000, 0x0000, 0x0000 };
diff --git a/NPLib/Core/icons/power.xpm b/NPLib/Core/icons/power.xpm
new file mode 100644
index 0000000000000000000000000000000000000000..cb98d663ca2ffdf5f661b1860f888459137ebe4a
--- /dev/null
+++ b/NPLib/Core/icons/power.xpm
@@ -0,0 +1,93 @@
+/* XPM */
+static char *power[] = {
+/* columns rows colors chars-per-pixel */
+"32 32 55 1 ",
+"  c #373737",
+". c #393838",
+"X c #493C3C",
+"o c #533E3E",
+"O c #5A4040",
+"+ c #614242",
+"@ c #7A4848",
+"# c #8B4D4D",
+"$ c #914E4E",
+"% c #9E5151",
+"& c #A95454",
+"* c #B55757",
+"= c #BE5757",
+"- c #B65858",
+"; c #B25E5E",
+": c #BE5A5A",
+"> c #B46565",
+", c #B86969",
+"< c #BD6B6B",
+"1 c #BE7B7B",
+"2 c #C15858",
+"3 c #C75C5C",
+"4 c #C85C5C",
+"5 c #C95D5D",
+"6 c #C86363",
+"7 c #C86565",
+"8 c #CD6E6E",
+"9 c #CE6F6F",
+"0 c #CE7171",
+"q c #C47D7D",
+"w c #C58888",
+"e c #CE8D8D",
+"r c #D48383",
+"t c #D98F8F",
+"y c #D99191",
+"u c #D6A7A7",
+"i c #DDBDBD",
+"p c #E2ABAB",
+"a c #E3BFBF",
+"s c #E8BCBC",
+"d c #E5C7C7",
+"f c #EAC1C1",
+"g c #E6CFCF",
+"h c #E7CFCF",
+"j c #EDCACA",
+"k c #ECD7D7",
+"l c #EDDCDC",
+"z c #F0D3D3",
+"x c #F4DEDE",
+"c c #F0E1E1",
+"v c #F4EAEA",
+"b c #F8EBEB",
+"n c #F9EFEF",
+"m c #FDF9F9",
+"M c white",
+/* pixels */
+"          o@%*3333*%@X.         ",
+"       .o$:4443333333=$O.       ",
+"      X#:44343333333344=#X      ",
+"     O&433334333333333444&O     ",
+"    O-44333344477333333334-+    ",
+"   O-4443333447jf7333333334-O   ",
+"  X&43433334448bb04333333334&X  ",
+"  #443333334730bb047733333333#  ",
+" O:4333333rjs78bb88kzr4433334:O ",
+" $4333333tbMj78bb87kMbt4333334$ ",
+"o-443333rbMi,20bb8=,aMbq333333:o",
+"@3333337zMi-340bb033-iMk7333333@",
+"%433333yMc,3330bb044=,xMt333333%",
+"-433333fMu34338bb04433uMa333333-",
+"3333337xMq43338vb84333qMx7333333",
+"3333338bv843338vb833440bb8333333",
+"3333438cv833336hd733448bb8333333",
+"3333436xMr=3333**43342rmx7333333",
+"-33344=aMp333333333343pMa333333*",
+"%333333tMc833333333340cMe333333%",
+"@333333,jMf7333333436dMh7333333@",
+"o-333333qvMf83333340sMvq333333=X",
+" $443333=wvMcpr08rpcMvw:333333$ ",
+" O:433333:1hMMMbvMMMh1=3333343o ",
+"  #4333333:-wilvvliw*=3333334#  ",
+"  X&43333333:&->>-**33333333&X  ",
+"   O-3333333333:3:333333333=o   ",
+"    +-43333333333333333333*o    ",
+"     O&433333333333333334&o     ",
+"      X#333333333333333:#X.     ",
+"        X$-33333333343$o..      ",
+"          O@%-3333-%@o.         "
+};
diff --git a/NPLib/Core/icons/upload.png b/NPLib/Core/icons/upload.png
new file mode 100644
index 0000000000000000000000000000000000000000..3ce606b0c1aecd8435021cac323b25f0fc5ef3fb
Binary files /dev/null and b/NPLib/Core/icons/upload.png differ
diff --git a/NPLib/Exogam/TExogamSpectra.cxx b/NPLib/Exogam/TExogamSpectra.cxx
index 8676ed3c395dc35641c8211183f6085f5c3d76cb..a3b1e9634284a5f8f687e33b4e454b4b5b36bd32 100644
--- a/NPLib/Exogam/TExogamSpectra.cxx
+++ b/NPLib/Exogam/TExogamSpectra.cxx
@@ -40,6 +40,7 @@ using namespace NPUNITS;
 
 ////////////////////////////////////////////////////////////////////////////////
 TExogamSpectra::TExogamSpectra(){
+  SetName("Exogam");
   fnbinsRaw=16384;
   fbinRawMin=0;
   fbinRawMax=16384;
@@ -56,6 +57,7 @@ TExogamSpectra::TExogamSpectra(unsigned int NumberOfClover){
       << "TExogamSpectra : Initalising control spectra for " 
       << NumberOfClover << " Clover" << endl
       << "************************************************" << endl ;
+  SetName("Exogam");
   fNumberOfClover = NumberOfClover;
   fNumberOfSegments=4;
   fNumberOfCores=4;
diff --git a/NPLib/Hira/THiraData.h b/NPLib/Hira/THiraData.h
index 839a289c7739cedecc01fdba335353df30125764..cc84e80f2dc6704244c3e3f89d0e27792f515710 100644
--- a/NPLib/Hira/THiraData.h
+++ b/NPLib/Hira/THiraData.h
@@ -116,6 +116,17 @@ class THiraData : public TObject {
     void   SetHiraCsITTime(const Double_t Time)             {fHiRA_CsIT_Time.push_back(Time);}
 
     /////////////////////           GETTERS           ////////////////////////
+    // SSSD
+    // (X,E)
+    UShort_t   GetHiraThinSiEMult()                                 const {return fHiRA_ThickSi_StripXE_DetectorNbr.size();}
+    UShort_t   GetHiraThinSiStripEDetectorNbr(const Int_t i)        const {return fHiRA_ThinSi_StripE_DetectorNbr[i];}
+    UShort_t   GetHiraThinSiStripEStripNbr(const Int_t i)           const {return fHiRA_ThinSi_StripE_StripNbr[i];}
+    Double_t   GetHiraThinSiStripEEnergy(const Int_t i)             const {return fHiRA_ThinSi_StripE_Energy[i];}
+    // (X,T)
+    UShort_t   GetHiraThinSiStripTDetectorNbr(const Int_t i)        const {return fHiRA_ThinSi_StripT_DetectorNbr[i];}
+    UShort_t   GetHiraThinSiStripTStripNbr(const Int_t i)           const {return fHiRA_ThinSi_StripT_StripNbr[i];}
+    Double_t   GetHiraThinSiStripTTime(const Int_t i)               const {return fHiRA_ThinSi_StripT_Time[i];}
+    
     // DSSD
     // (X,E)
     UShort_t   GetHiraStripXEMult()                     const {return fHiRA_ThickSi_StripXE_DetectorNbr.size();}
diff --git a/NPLib/Hira/THiraPhysics.cxx b/NPLib/Hira/THiraPhysics.cxx
index 818acd40c337da6ae00f76e6e1da8a657b255dc6..8e334cbd1ad0b96badcc8b58470c050c39d0086e 100644
--- a/NPLib/Hira/THiraPhysics.cxx
+++ b/NPLib/Hira/THiraPhysics.cxx
@@ -6,13 +6,13 @@
  *****************************************************************************/
 
 /*****************************************************************************
- * Original Author: Adrien MATTA  contact address: matta@ipno.in2p3.fr       *
+ * Original Author: Pierre Morfouace  contact address: morfouac@nscl.msu.edu *
  *                                                                           *
- * Creation Date  : november 2009                                            *
+ * Creation Date  : June 2015                                                *
  * Last update    :                                                          *
  *---------------------------------------------------------------------------*
  * Decription:                                                               *
- *  This class hold Hira  Physics                                         *
+ *  This class hold Hira  Physics                                            *
  *                                                                           *
  *---------------------------------------------------------------------------*
  * Comment:                                                                  *
@@ -49,10 +49,12 @@ string itoa(int value)
 ClassImp(THiraPhysics)
 ///////////////////////////////////////////////////////////////////////////
 THiraPhysics::THiraPhysics()
-   {      
-      NumberOfDetector = 0 ;
-      EventData = new THiraData ;
-      EventPhysics = this ;
+   {
+       //EventMultiplicity    = 0 ;
+       m_NumberOfTelescope  = 0 ;
+       m_EventData          = new THiraData ;
+       m_PreTreatedData     = new THiraData;
+       m_EventPhysics       = this ;
    }
    
 ///////////////////////////////////////////////////////////////////////////
@@ -60,189 +62,292 @@ THiraPhysics::~THiraPhysics()
    {}
    
 ///////////////////////////////////////////////////////////////////////////
-void THiraPhysics::Clear()
-   {
+void THiraPhysics::Clear(){
+    TelescopeNumber.clear();
+    
+    // Thin Si
+    ThinSi_E.clear();
+    ThinSi_T.clear();
+    ThinSi_StripNumber.clear();
+    
+    //Thick Si
+    ThickSi_E.clear();
+    ThickSi_T.clear();
+    ThickSi_EX.clear();
+    ThickSi_EY.clear();
+    ThickSi_StripNumberX.clear();
+    ThickSi_StripNumberY.clear();
+    
+    // CsI
+    CsI_E.clear();
+    CsI_CrystalNumber.clear();
+    
+    
+}
 
-   }
-   
 ///////////////////////////////////////////////////////////////////////////
-void THiraPhysics::ReadConfiguration(string Path) 
-   {
-      ifstream ConfigFile           ;
-      ConfigFile.open(Path.c_str()) ;
-      string LineBuffer             ;
-      string DataBuffer             ;
-
-      bool check_Theta = false          ;
-      bool check_Phi  = false           ;
-      bool check_R     = false          ;
-      bool check_Thickness = false      ;
-      bool check_Radius = false         ;
-      bool check_LeadThickness = false  ;
-      bool check_Scintillator = false   ;
-      bool check_Height = false         ;
-      bool check_Width = false          ;
-      bool check_Shape = false          ;
-      bool check_X = false              ;
-      bool check_Y = false              ;
-      bool check_Z = false              ;      
-      bool ReadingStatus = false        ;
-
-    while (!ConfigFile.eof()) 
-       {
-         
-         getline(ConfigFile, LineBuffer);
+void THiraPhysics::ReadConfiguration(string Path){
+    ifstream ConfigFile           ;
+    ConfigFile.open(Path.c_str()) ;
+    string LineBuffer          ;
+    string DataBuffer          ;
+    
+    // A:X1_Y1     --> X:1    Y:1
+    // B:X128_Y1   --> X:128  Y:1
+    // C:X1_Y128   --> X:1    Y:128
+    // D:X128_Y128    --> X:128  Y:128
+    
+    double Ax , Bx , Cx , Dx , Ay , By , Cy , Dy , Az , Bz , Cz , Dz          ;
+    TVector3 A , B , C , D                                                 ;
 
-         //   If line is a Start Up Hira bloc, Reading toggle to true      
-         if (LineBuffer.compare(0, 3, "Hira") == 0)
-            {
-               cout << "///" << endl ;
-               cout << "Platic found: " << endl ;        
-               ReadingStatus = true ;
+    
+    bool ReadingStatus = false ;
+    
+    bool check_A = false ;
+    bool check_C = false ;
+    bool check_B = false ;
+    bool check_D = false ;
+    
+    /*bool check_Theta = false ;
+     bool check_Phi   = false ;
+     bool check_R     = false ;*/
+    
+    
+    
+    while (!ConfigFile.eof()) {
+        getline(ConfigFile, LineBuffer);
+        if (LineBuffer.compare(0, 13, "HiraTelescope") == 0) {
+            cout << "///" << endl           ;
+            cout << "Hira element found: " << endl   ;
+            ReadingStatus = true ;
+        }
+        
+        while(ReadingStatus){
+            
+            ConfigFile >> DataBuffer;
+            //   Comment Line
+            if (DataBuffer.compare(0, 1, "%") == 0) {/*do nothing */;}
+            
+            // Position method
+            else if (DataBuffer.compare(0, 2, "A=") == 0) {
+                check_A = true;
+                ConfigFile >> DataBuffer ;
+                Ax = atof(DataBuffer.c_str()) ;
+                Ax = Ax ;
+                ConfigFile >> DataBuffer ;
+                Ay = atof(DataBuffer.c_str()) ;
+                Ay = Ay;
+                ConfigFile >> DataBuffer ;
+                Az = atof(DataBuffer.c_str()) ;
+                Az = Az;
+                
+                A = TVector3(Ax, Ay, Az);
+                cout << "A corner position : " << A.X() << ";" << A.Y() << ";" << A.Z() << endl;
             }
             
-         //   Else don't toggle to Reading Block Status
-         else ReadingStatus = false ;
-         
-         //   Reading Block
-         while(ReadingStatus)
-            {
-               // Pickup Next Word 
-               ConfigFile >> DataBuffer ;
-
-               //   Comment Line 
-               if (DataBuffer.compare(0, 1, "%") == 0) {   ConfigFile.ignore ( std::numeric_limits<std::streamsize>::max(), '\n' );}
+            else if (DataBuffer.compare(0, 2, "B=") == 0) {
+                check_B = true;
+                ConfigFile >> DataBuffer ;
+                Bx = atof(DataBuffer.c_str()) ;
+                Bx = Bx;
+                ConfigFile >> DataBuffer ;
+                By = atof(DataBuffer.c_str()) ;
+                By = By;
+                ConfigFile >> DataBuffer ;
+                Bz = atof(DataBuffer.c_str()) ;
+                Bz = Bz;
+                
+                B = TVector3(Bx, By, Bz);
+                cout << "B corner position : " << B.X() << ";" << B.Y() << ";" << B.Z() << endl;
+            }
+            
+            else if (DataBuffer.compare(0, 2, "C=") == 0) {
+                check_C = true;
+                ConfigFile >> DataBuffer ;
+                Cx = atof(DataBuffer.c_str()) ;
+                Cx = Cx;
+                ConfigFile >> DataBuffer ;
+                Cy = atof(DataBuffer.c_str()) ;
+                Cy = Cy;
+                ConfigFile >> DataBuffer ;
+                Cz = atof(DataBuffer.c_str()) ;
+                Cz = Cz;
+                
+                C = TVector3(Cx, Cy, Cz);
+                cout << "C corner position : " << C.X() << ";" << C.Y() << ";" << C.Z() << endl;
+            }
+            
+            else if (DataBuffer.compare(0, 2, "D=") == 0) {
+                check_D = true;
+                ConfigFile >> DataBuffer ;
+                Dx = atof(DataBuffer.c_str()) ;
+                Dx = Dx;
+                ConfigFile >> DataBuffer ;
+                Dy = atof(DataBuffer.c_str()) ;
+                Dy = Dy;
+                ConfigFile >> DataBuffer ;
+                Dz = atof(DataBuffer.c_str()) ;
+                Dz = Dz;
+                
+                D = TVector3(Dx, Dy, Dz);
+                cout << "D corner position : " << D.X() << ";" << D.Y() << ";" << D.Z() << endl;
+            }
+            
+            
+            // Angle method
+            /*   else if (DataBuffer.compare(0, 6, "THETA=") == 0) {
+             check_Theta = true;
+             ConfigFile >> DataBuffer ;
+             Theta = atof(DataBuffer.c_str()) ;
+             Theta = Theta * deg;
+             cout << "Theta:  " << Theta / deg << endl;
+             }
+             
+             else if (DataBuffer.compare(0, 4, "PHI=") == 0) {
+             check_Phi = true;
+             ConfigFile >> DataBuffer ;
+             Phi = atof(DataBuffer.c_str()) ;
+             Phi = Phi * deg;
+             cout << "Phi:  " << Phi / deg << endl;
+             }
+             
+             else if (DataBuffer.compare(0, 2, "R=") == 0) {
+             check_R = true;
+             ConfigFile >> DataBuffer ;
+             R = atof(DataBuffer.c_str()) ;
+             R = R * mm;
+             cout << "R:  " << R / mm << endl;
+             }
+             
+             else if (DataBuffer.compare(0, 5, "BETA=") == 0) {
+             ConfigFile >> DataBuffer ;
+             beta_u = atof(DataBuffer.c_str()) ;
+             beta_u = beta_u * deg   ;
+             ConfigFile >> DataBuffer ;
+             beta_v = atof(DataBuffer.c_str()) ;
+             beta_v = beta_v * deg   ;
+             ConfigFile >> DataBuffer ;
+             beta_w = atof(DataBuffer.c_str()) ;
+             beta_w = beta_w * deg   ;
+             cout << "Beta:  " << beta_u / deg << " " << beta_v / deg << " " << beta_w / deg << endl  ;
+             }*/
+            
+            
+            else cout << "WARNING: Wrong Token, GaspardTrackerRectangle: Rectangle Element not added" << endl;
+            
+            //Add The previously define telescope
+            //With position method
+            if (check_A && check_B && check_C && check_D) {
+                
+                ReadingStatus = false ;
+                check_A = false ;
+                check_C = false ;
+                check_B = false ;
+                check_D = false ;
+                
+                AddTelescope(A                ,
+                             B                ,
+                             C                ,
+                             D);
+            }
+            
+            //with angle method
+            /*if ((check_Theta && check_Phi && check_R && check_FirstStage && check_SecondStage && check_ThirdStage && checkVis) && !(check_A && check_B && check_C && check_D)) {
+             ReadingStatus = false ;
+             check_Theta = false ;
+             check_Phi   = false ;
+             check_R     = false ;
+             check_FirstStage = false ;
+             check_SecondStage = false ;
+             check_ThirdStage = false ;
+             checkVis = false ;
+             
+             AddModule(R                ,
+             Theta            ,
+             Phi              ,
+             beta_u           ,
+             beta_v           ,
+             beta_w           ,
+             FIRSTSTAGE  == 1 ,
+             SECONDSTAGE == 1 ,
+             THIRDSTAGE  == 1);
+             }*/
+            
+            
+        }
+    }
+}
 
-                  //   Finding another telescope (safety), toggle out
-               else if (DataBuffer.compare(0, 6, "Hira") == 0) {
-                  cout << "WARNING: Another Detector is find before standard sequence of Token, Error may occured in Telecope definition" << endl ;
-                  ReadingStatus = false ;
-               }
-                              
-                                    //Angle method
-               else if (DataBuffer=="THETA=") {
-                  check_Theta = true;
-                  ConfigFile >> DataBuffer ;
-                  cout << "Theta:  " << atof(DataBuffer.c_str()) << "deg" << endl;
-               }
+//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
+void THiraPhysics::AddTelescope(TVector3 Pos1, TVector3 Pos2, TVector3 Pos3, TVector3 Pos4){
+    m_NumberOfTelescope++;
+    TVector3 Pos= 0.25*(Pos1+Pos2+Pos3+Pos4);//centroid of the telescope
+    TVector3 u = Pos4-Pos2;//Horizontal Vector->EF
+    TVector3 w = Pos.Unit();//Telescope normal
+    TVector3 v = w.Cross(u);//Vertical Vector->EB
+    u = u.Unit(); v = v.Unit(); w = w.Unit();
+    
+    //   Geometry Parameter
+    double Face = 64.; //mm
+    double NumberOfStrip = 32;
+    double StripPitch = Face/NumberOfStrip ; //mm
+    double offset = 0.5874*25.4; //mm
+    //   Buffer object to fill Position Array
+    vector<double> lineX ; vector<double> lineY ; vector<double> lineZ ;
+    
+    vector< vector< double > >   OneTelescopeStripPositionX;
+    vector< vector< double > >   OneTelescopeStripPositionY;
+    vector< vector< double > >   OneTelescopeStripPositionZ;
 
-               else if (DataBuffer=="PHI=") {
-                  check_Phi = true;
-                  ConfigFile >> DataBuffer ;
-                  cout << "Phi:  " << atof( DataBuffer.c_str() ) << "deg" << endl;
-               }
+    //   Position Vector of Strip Center
+    TVector3 StripCenter = TVector3(0,0,0);
+    //   Position Vector of X=1 Y=1 Strip
+    TVector3 Strip_1_1;
+    
+    //   Moving StripCenter to 1.1 corner:
+    Strip_1_1 = Pos + offset*w - (NumberOfStrip/2-0.5)*StripPitch*(u+v);
+    
+    for( int i = 0 ; i < 32 ; ++i ){
+        lineX.clear();
+        lineY.clear();
+        lineZ.clear();
+        
+        for( int j = 0 ; j < 32 ; ++j ){
+            StripCenter  = Strip_1_1 + StripPitch*( i*u + j*v  );
+            lineX.push_back( StripCenter.X() );
+            lineY.push_back( StripCenter.Y() );
+            lineZ.push_back( StripCenter.Z() );
+        }
+        
+        OneTelescopeStripPositionX.push_back(lineX);
+        OneTelescopeStripPositionY.push_back(lineY);
+        OneTelescopeStripPositionZ.push_back(lineZ);
+        
+    }
+    
+    m_StripPositionX.push_back( OneTelescopeStripPositionX ) ;
+    m_StripPositionY.push_back( OneTelescopeStripPositionY ) ;
+    m_StripPositionZ.push_back( OneTelescopeStripPositionZ ) ;
 
-               else if (DataBuffer=="R=") {
-                  check_R = true;
-                  ConfigFile >> DataBuffer ;
-                  cout << "R:  " << atof( DataBuffer.c_str() ) << "mm" << endl;
-               }
-               
-               //Position method
-               else if (DataBuffer=="X=") {
-                  check_X = true;
-                  ConfigFile >> DataBuffer ;
-                  cout << "X:  " << atof( DataBuffer.c_str() ) << "mm" << endl;
-               }
+}
 
-               else if (DataBuffer=="Y=") {
-                  check_Y = true;
-                  ConfigFile >> DataBuffer ;
-                  cout << "Y:  " << atof( DataBuffer.c_str() ) << "mm"<< endl;
-               }
 
-               else if (DataBuffer=="Z=") {
-                  check_Z = true;
-                  ConfigFile >> DataBuffer ;
-                  cout << "Z:  " << atof( DataBuffer.c_str() ) << "mm" << endl;
-               }
-               
-               
-               //General
-               else if (DataBuffer=="Shape=") {
-                  check_Shape = true;
-                  ConfigFile >> DataBuffer ;
-                  cout << "Shape:  " << DataBuffer << endl;
-               }
-               
-               // Cylindrical shape
-               else if (DataBuffer== "Radius=") {
-                  check_Radius = true;
-                  ConfigFile >> DataBuffer ;
-                  cout << "Hira Radius:  " << atof( DataBuffer.c_str() ) << "mm" << endl;
-               }
-               
-               // Squared shape
-               else if (DataBuffer=="Width=") {
-                  check_Width = true;
-                  ConfigFile >> DataBuffer ;
-                  cout << "Hira Width:  " <<atof( DataBuffer.c_str() ) << "mm" << endl;
-               }
-               
-               else if (DataBuffer== "Height=") {
-                  check_Height = true;
-                  ConfigFile >> DataBuffer ;
-                  cout << "Hira Height:  " << atof( DataBuffer.c_str() ) << "mm" << endl;
-               }
-               
-               // Common
-               else if (DataBuffer=="Thickness=") {
-                  check_Thickness = true;
-                  ConfigFile >> DataBuffer ;
-                  cout << "Hira Thickness:  " << atof( DataBuffer.c_str() ) << "mm" << endl;
-               }
-               
-               else if (DataBuffer== "Scintillator=") {
-                  check_Scintillator = true ;
-                  ConfigFile >> DataBuffer ;
-                  cout << "Hira Scintillator type:  " << DataBuffer << endl;
-               }
-               
-               else if (DataBuffer=="LeadThickness=") {
-                  check_LeadThickness = true;
-                  ConfigFile >> DataBuffer ;
-                  cout << "Lead Thickness :  " << atof( DataBuffer.c_str() ) << "mm" << endl;
-               }
-                                                
-               ///////////////////////////////////////////////////
-               //   If no Detector Token and no comment, toggle out
-               else 
-                  {ReadingStatus = false; cout << "Wrong Token Sequence: Getting out " << DataBuffer << endl ;}
-               
-                  /////////////////////////////////////////////////
-                  //   If All necessary information there, toggle out
-               
-               if ( check_Theta && check_Phi && check_R && check_Thickness && check_Radius &&   check_LeadThickness && check_Scintillator &&   check_Height &&   check_Width && check_Shape && check_X && check_Y && check_Z ) 
-                  { 
-                     NumberOfDetector++;
-                     
-                     //   Reinitialisation of Check Boolean  
-                     check_Theta = false          ;
-                     check_Phi  = false           ;
-                     check_R     = false          ;
-                     check_Thickness = false      ;
-                     check_Radius = false         ;
-                     check_LeadThickness = false  ;
-                     check_Scintillator = false   ;
-                     check_Height = false         ;
-                     check_Width = false          ;
-                     check_Shape = false          ;
-                     check_X = false              ;
-                     check_Y = false              ;
-                     check_Z = false              ;
-                     ReadingStatus = false        ;   
-                     cout << "///"<< endl         ;                
-                  }
-            }
-      }
-   }
+///////////////////////////////////////////////////////////////////////////
+TVector3 THiraPhysics::GetPositionOfInteraction(const int i) const{
+    TVector3 Position = TVector3 (   GetStripPositionX( TelescopeNumber[i] , ThickSi_StripNumberX[i] , ThickSi_StripNumberY[i] ),
+                                  GetStripPositionY( TelescopeNumber[i] , ThickSi_StripNumberX[i] , ThickSi_StripNumberY[i] ),
+                                  GetStripPositionZ( TelescopeNumber[i] , ThickSi_StripNumberX[i] , ThickSi_StripNumberY[i] )) ;
+    
+    return(Position) ;
+    
+}
 
 ///////////////////////////////////////////////////////////////////////////
 void THiraPhysics::AddParameterToCalibrationManager()
    {
       CalibrationManager* Cal = CalibrationManager::getInstance();
       
-      for(int i = 0 ; i < NumberOfDetector ; i++)
+      for(int i = 0 ; i < m_NumberOfTelescope ; i++)
          {
             for( int j = 0 ; j < 16 ; j++)
                {
@@ -259,36 +364,111 @@ void THiraPhysics::InitializeRootInputRaw()
       TChain* inputChain = RootInput::getInstance()->GetChain()     ;
       inputChain->SetBranchStatus ( "Hira"       , true )        ;
       inputChain->SetBranchStatus ( "fHira_*"    , true )        ;
-      inputChain->SetBranchAddress( "Hira"       , &EventData )  ;
+      inputChain->SetBranchAddress( "Hira"       , &m_EventData )  ;
    }
 ///////////////////////////////////////////////////////////////////////////
 void THiraPhysics::InitializeRootInputPhysics()
    {
-      /*TChain* inputChain = RootInput::getInstance()->GetChain();
+      TChain* inputChain = RootInput::getInstance()->GetChain();
       inputChain->SetBranchStatus ( "Hira", true );
       inputChain->SetBranchStatus ( "DetectorNumber", true );
       inputChain->SetBranchStatus ( "Energy", true );
       inputChain->SetBranchStatus ( "Time", true );
-      inputChain->SetBranchAddress( "Hira", &EventPhysics );*/
+      inputChain->SetBranchAddress( "Hira", &m_EventPhysics );
    }
 ///////////////////////////////////////////////////////////////////////////
 void THiraPhysics::InitializeRootOutput()
    {
       TTree* outputTree = RootOutput::getInstance()->GetTree()            ;
-      outputTree->Branch( "Hira" , "THiraPhysics" , &EventPhysics ) ;
+      outputTree->Branch( "Hira" , "THiraPhysics" , &m_EventPhysics ) ;
    }
 
 ///////////////////////////////////////////////////////////////////////////
-void THiraPhysics::BuildPhysicalEvent()
-   {
-      BuildSimplePhysicalEvent()   ;
-   }
+void THiraPhysics::BuildPhysicalEvent(){
+    BuildSimplePhysicalEvent()   ;
+}
 
 ///////////////////////////////////////////////////////////////////////////
-void THiraPhysics::BuildSimplePhysicalEvent()
-   {
-      
-   }
+void THiraPhysics::BuildSimplePhysicalEvent(){
+    PreTreat();
+    m_ThinSi_EMult      = m_PreTreatedData->GetHiraThinSiEMult();
+    m_ThickSi_EXMult    = m_PreTreatedData->GetHiraStripXEMult();
+    m_ThickSi_EYMult    = m_PreTreatedData->GetHiraStripYEMult();
+    m_CsI_EMult         = m_PreTreatedData->GetHiraCsIEMult();
+    
+    
+    for(unsigned int i = 0 ; i < m_ThinSi_EMult ; ++i){
+        TelescopeNumber.push_back(m_PreTreatedData->GetHiraThinSiStripEDetectorNbr(i));
+        ThinSi_StripNumber.push_back(m_PreTreatedData->GetHiraThinSiStripEStripNbr(i));
+        ThinSi_E.push_back(m_PreTreatedData->GetHiraThinSiStripEEnergy(i));
+        ThinSi_T.push_back(m_PreTreatedData->GetHiraThinSiStripTTime(i));
+    }
+    
+    for(unsigned int i = 0 ; i < m_ThickSi_EXMult ; ++i){
+        ThickSi_StripNumberX.push_back(m_PreTreatedData->GetHiraStripXEStripNbr(i));
+        ThickSi_EX.push_back(m_PreTreatedData->GetHiraStripXEEnergy(i));
+        ThickSi_T.push_back(m_EventData->GetHiraStripXTTime(i));
+        ThickSi_E.push_back(m_PreTreatedData->GetHiraStripXEEnergy(i));
+    }
+    
+    for(unsigned int i = 0 ; i < m_ThickSi_EXMult ; ++i){
+        ThickSi_StripNumberY.push_back(m_PreTreatedData->GetHiraStripYEStripNbr(i));
+        ThickSi_EY.push_back(m_PreTreatedData->GetHiraStripYEEnergy(i));
+    }
+    
+    for(unsigned int i = 0 ; i < m_CsI_EMult ; ++i){
+        CsI_CrystalNumber.push_back(m_PreTreatedData->GetHiraCsIECristalNbr(i));
+        CsI_E.push_back(m_PreTreatedData->GetHiraCsIEEnergy(i));
+    }
+    
+    return;
+}
+
+///////////////////////////////////////////////////////////////////////////
+void THiraPhysics::PreTreat(){
+    ClearPreTreatedData();
+    m_ThinSi_EMult      = m_EventData->GetHiraThinSiEMult();
+    m_ThickSi_EXMult    = m_EventData->GetHiraStripXEMult();
+    m_ThickSi_EYMult    = m_EventData->GetHiraStripYEMult();
+    m_CsI_EMult         = m_EventData->GetHiraCsIEMult();
+    
+    
+    // Thin Si
+    for(unsigned int i = 0 ; i < m_ThinSi_EMult ; ++i){
+        m_PreTreatedData->SetHiraThinSiStripEDetectorNbr( m_EventData->GetHiraThinSiStripEDetectorNbr(i) );
+        m_PreTreatedData->SetHiraThinSiStripEStripNbr( m_EventData->GetHiraThinSiStripEStripNbr(i) );
+        m_PreTreatedData->SetHiraThinSiStripEEnergy( m_EventData->GetHiraThinSiStripEEnergy(i) );
+        m_PreTreatedData->SetHiraThinSiStripTTime( m_EventData->GetHiraThinSiStripTTime(i));
+    }
+    
+    // Thick Si
+    // X
+    for(unsigned int i = 0 ; i < m_ThickSi_EXMult ; ++i){
+        m_PreTreatedData->SetHiraThickSiStripXEDetectorNbr( m_EventData->GetHiraStripXEDetectorNbr(i) );
+        m_PreTreatedData->SetHiraThickSiStripXEStripNbr( m_EventData->GetHiraStripXEStripNbr(i) );
+        m_PreTreatedData->SetHiraThickSiStripXEEnergy( m_EventData->GetHiraStripXEEnergy(i) );
+        m_PreTreatedData->SetHiraThickSiStripXTTime( m_EventData->GetHiraStripXTTime(i) );
+    }
+    // Y
+    for(unsigned int i = 0 ; i < m_ThickSi_EYMult ; ++i){
+        m_PreTreatedData->SetHiraThickSiStripYEDetectorNbr( m_EventData->GetHiraStripYEDetectorNbr(i) );
+        m_PreTreatedData->SetHiraThickSiStripYEStripNbr( m_EventData->GetHiraStripYEStripNbr(i) );
+        m_PreTreatedData->SetHiraThickSiStripYEEnergy( m_EventData->GetHiraStripYEEnergy(i) );
+        m_PreTreatedData->SetHiraThickSiStripYTTime( m_EventData->GetHiraStripYTTime(i) );
+    }
+    
+    // CsI
+    for(unsigned int i = 0 ; i < m_CsI_EMult ; ++i){
+        m_PreTreatedData->SetHiraCsIEDetectorNbr( m_EventData->GetHiraCsIEDetectorNbr(i) );
+        m_PreTreatedData->SetHiraCsIECristalNbr( m_EventData->GetHiraCsIECristalNbr(i) );
+        m_PreTreatedData->SetHiraCsIEEnergy( m_EventData->GetHiraCsIEEnergy(i) );
+    }
+    
+    
+
+    return;
+}
+
 
 ////////////////////////////////////////////////////////////////////////////////
 //            Construct Method to be pass to the DetectorFactory              //
diff --git a/NPLib/Hira/THiraPhysics.h b/NPLib/Hira/THiraPhysics.h
index d73396ffe8d3fa920c5f090fe6c338bb54d91648..2cb5a434ce693e4d41ae1695bce3b738fd6ef804 100644
--- a/NPLib/Hira/THiraPhysics.h
+++ b/NPLib/Hira/THiraPhysics.h
@@ -1,5 +1,5 @@
-#ifndef __HiraPhysics__
-#define __HiraPhysics__
+#ifndef __HIRAPHYSICS__
+#define __HIRAPHYSICS__
 /*****************************************************************************
  * Copyright (C) 2009-2014    this file is part of the NPTool Project        *
  *                                                                           *
@@ -28,12 +28,14 @@ using namespace std ;
 
 //   ROOT
 #include "TObject.h"
+#include "TVector3.h"
+
 
 //   NPL
 #include "THiraData.h"
 #include "NPVDetector.h"
+#include "NPCalibrationManager.h"
 
-//#include "../include/CalibrationManager.h"
 
 class THiraPhysics : public TObject, public NPL::VDetector
 {
@@ -46,51 +48,94 @@ class THiraPhysics : public TObject, public NPL::VDetector
       void  Clear(const Option_t*) {};
    
    public:   //   Calibrated Data
-      vector<UShort_t>   DetectorNumber ;
-      vector<Double_t>   Energy;
-      vector<Double_t>   Time;
+    // Telescope
+    vector<int> TelescopeNumber ;
+    
+    // Thin Si
+    vector<double> ThinSi_E;
+    vector<double> ThinSi_T;
+    vector<int> ThinSi_StripNumber;
+    
+    // Thick Si
+    vector<double> ThickSi_E;
+    vector<double> ThickSi_EX;
+    vector<double> ThickSi_EY;
+    vector<double> ThickSi_T;
+    vector<int> ThickSi_StripNumberX;
+    vector<int> ThickSi_StripNumberY;
+    
+    // CsI
+    vector<double> CsI_E;
+    vector<double> CsI_CrystalNumber;
 
    public:   //   inherrited from VDetector
-      //   Read stream at ConfigFile to pick-up parameters of detector (Position,...) using Token
-      void ReadConfiguration(string);
+    //   Read stream at ConfigFile to pick-up parameters of detector (Position,...) using Token
+    void ReadConfiguration(string);
       
 
-      //   Add Parameter to the CalibrationManger
-      void AddParameterToCalibrationManager();      
+    //   Add Parameter to the CalibrationManger
+    void AddParameterToCalibrationManager();
 
-      //   Activated associated Branches and link it to the private member DetectorData address
-      //   In this method mother Branches (Detector) AND daughter leaf (fDetector_parameter) have to be activated
-      void InitializeRootInputRaw() ;
+    //   Activated associated Branches and link it to the private member DetectorData address
+    //   In this method mother Branches (Detector) AND daughter leaf (fDetector_parameter) have to be activated
+    void InitializeRootInputRaw() ;
       
-      //   Activated associated Branches and link it to the private member DetectorPhysics address
-      //   In this method mother Branches (Detector) AND daughter leaf (parameter) have to be activated
-      void InitializeRootInputPhysics() ;
+    //   Activated associated Branches and link it to the private member DetectorPhysics address
+    //   In this method mother Branches (Detector) AND daughter leaf (parameter) have to be activated
+    void InitializeRootInputPhysics() ;
 
-      //   Create associated branches and associated private member DetectorPhysics address
-      void InitializeRootOutput();
+    //   Create associated branches and associated private member DetectorPhysics address
+    void InitializeRootOutput();
       
-      //   This method is called at each event read from the Input Tree. Aime is to build treat Raw dat in order to extract physical parameter. 
-      void BuildPhysicalEvent();
+    //   This method is called at each event read from the Input Tree. Aime is to build treat Raw dat in order to extract physical parameter.
+    void BuildPhysicalEvent();
       
-      //   Same as above, but only the simplest event and/or simple method are used (low multiplicity, faster algorythm but less efficient ...).
-      //   This method aimed to be used for analysis performed during experiment, when speed is requiered.
-      //   NB: This method can eventually be the same as BuildPhysicalEvent.
-      void BuildSimplePhysicalEvent();
-
-      // Same as above but for online analysis
-      void BuildOnlinePhysicalEvent()  {BuildPhysicalEvent();};
+    //   Same as above, but only the simplest event and/or simple method are used (low multiplicity, faster algorythm but less efficient ...).
+    //   This method aimed to be used for analysis performed during experiment, when speed is requiered.
+    //   NB: This method can eventually be the same as BuildPhysicalEvent.
+    void BuildSimplePhysicalEvent();
+
+    // Same as above but for online analysis
+    void BuildOnlinePhysicalEvent()  {BuildPhysicalEvent();};
+    
+    //   Add a Telescope using Corner Coordinate information
+    void AddTelescope(TVector3 A, TVector3 B, TVector3 C, TVector3 D);
+    
+    //   Clear The PreTeated object
+    void ClearPreTreatedData()   {m_PreTreatedData->Clear();}
+
+    //   Remove bad channel, calibrate the data and apply threshold
+    void PreTreat();
+    
+    // Use to access the strip position
+    double GetStripPositionX( const int N , const int X , const int Y )   const{ return m_StripPositionX[N-1][X-1][Y-1] ; }  ;
+    double GetStripPositionY( const int N , const int X , const int Y )   const{ return m_StripPositionY[N-1][X-1][Y-1] ; }  ;
+    double GetStripPositionZ( const int N , const int X , const int Y )   const{ return m_StripPositionZ[N-1][X-1][Y-1] ; }  ;
+    
+    TVector3 GetPositionOfInteraction(const int i) const;
+    
+    unsigned int m_ThinSi_EMult;//!
+    unsigned int m_ThickSi_EXMult;//!
+    unsigned int m_ThickSi_EYMult;//!
+    unsigned int m_CsI_EMult;//!
+    
 
       // Give and external THiraData object to THiraPhysics. Needed for online analysis for example.
-      void SetRawDataPointer(THiraData* rawDataPointer) {EventData = rawDataPointer;}
+      void SetRawDataPointer(THiraData* rawDataPointer) {m_EventData = rawDataPointer;}
 
       //   Those two method all to clear the Event Physics or Data
       void ClearEventPhysics() {Clear();}      
-      void ClearEventData()    {EventData->Clear();}      
+      void ClearEventData()    {m_EventData->Clear();}
 
    private:   // Data not writted in the tree
-      int                   NumberOfDetector ;//!
-      THiraData*         EventData ;//!
-      THiraPhysics*      EventPhysics ;//!
+    int                m_NumberOfTelescope ;//!
+    THiraData*         m_EventData ;//!
+    THiraData*         m_PreTreatedData ;//!
+    THiraPhysics*      m_EventPhysics ;//!
+    
+    vector< vector < vector < double > > >   m_StripPositionX;//!
+    vector< vector < vector < double > > >   m_StripPositionY;//!
+    vector< vector < vector < double > > >   m_StripPositionZ;//!
 
     public:// Static constructor to be passed to the Detector Factory
     static NPL::VDetector* Construct();
diff --git a/NPLib/MUST2/CMakeLists.txt b/NPLib/MUST2/CMakeLists.txt
index da6652b2b813b63ba044ab510ecbe68a633992f7..f9de5855937ae55fdfd25ac273a31d7f16ece004 100644
--- a/NPLib/MUST2/CMakeLists.txt
+++ b/NPLib/MUST2/CMakeLists.txt
@@ -2,5 +2,4 @@ add_custom_command(OUTPUT TMust2PhysicsDict.cxx TMust2PhysicsDict_rdict.pcm TMus
 add_custom_command(OUTPUT TMust2DataDict.cxx TMust2DataDict_rdict.pcm TMust2Data.rootmap COMMAND ../scripts/build_dict.sh TMust2Data.h TMust2DataDict.cxx TMust2Data.rootmap libNPMUST2.dylib DEPENDS TMust2Data.h)
 add_library(NPMUST2 SHARED TMust2Data.cxx TMust2Physics.cxx TMust2DataDict.cxx TMust2PhysicsDict.cxx TMust2Spectra.cxx)
 target_link_libraries(NPMUST2 ${ROOT_LIBRARIES} NPCore) 
-
 install(FILES TMust2Data.h TMust2Physics.h TMust2Spectra.h DESTINATION ${CMAKE_INCLUDE_OUTPUT_DIRECTORY})
diff --git a/NPLib/MUST2/TMust2Physics.cxx b/NPLib/MUST2/TMust2Physics.cxx
index 05293a3701de69e9d559c1f9da057b33b10ca016..a52eef92fefc18809d1f7bdb17d5ce1c58aacd08 100644
--- a/NPLib/MUST2/TMust2Physics.cxx
+++ b/NPLib/MUST2/TMust2Physics.cxx
@@ -1165,9 +1165,9 @@ void TMust2Physics::AddTelescope( TVector3 C_X1_Y1,
   Strip_1_1+= U*Ushift+V*Vshift ;
 
   for( int i = 0 ; i < 128 ; ++i ){
-    lineX.clear()   ;
-    lineY.clear()   ;
-    lineZ.clear()   ;
+    lineX.clear();
+    lineY.clear();
+    lineZ.clear();
 
     for( int j = 0 ; j < 128 ; ++j ){
       StripCenter  = Strip_1_1 + StripPitch*( i*U + j*V  );
diff --git a/NPLib/MUST2/TMust2Spectra.cxx b/NPLib/MUST2/TMust2Spectra.cxx
index 372a56f030159b94630fcca82ddc31477ab1124e..08f61511c53b293f4837df560ad8dbd22303c4c7 100644
--- a/NPLib/MUST2/TMust2Spectra.cxx
+++ b/NPLib/MUST2/TMust2Spectra.cxx
@@ -40,6 +40,7 @@ using namespace std;
 
 ////////////////////////////////////////////////////////////////////////////////
 TMust2Spectra::TMust2Spectra(){
+  SetName("Must2");
   fNumberOfTelescope = 0;
   fStripX=128;
   fStripY=128;
@@ -55,6 +56,7 @@ TMust2Spectra::TMust2Spectra(unsigned int NumberOfTelescope){
       << NumberOfTelescope << " Telescopes" << endl
       << "************************************************" << endl ;
 
+  SetName("Must2");
   fNumberOfTelescope = NumberOfTelescope;
   fStripX=128;
   fStripY=128;
diff --git a/NPLib/Physics/NPBeam.cxx b/NPLib/Physics/NPBeam.cxx
index ce69aa19cb7e4f2788bf444dac1778cda971ea69..93c90f27f3a8e0867d01fbc2ca6373b157c57dad 100644
--- a/NPLib/Physics/NPBeam.cxx
+++ b/NPLib/Physics/NPBeam.cxx
@@ -333,14 +333,14 @@ void Beam::GenerateRandomEvent(double& E, double& X, double& Y, double& Z, doubl
   
   if(fSigmaX!=-1){
   // Shoot within the target unless target size is null (no limit)
-    while(sqrt(X*X+Y*Y>fEffectiveTargetSize) || fEffectiveTargetSize == 0){
+    while(sqrt(X*X+Y*Y)>fEffectiveTargetSize || fEffectiveTargetSize == 0){
       NPL::RandomGaussian2D(fMeanX, fMeanThetaX, fSigmaX, fSigmaThetaX, X, ThetaX);
       NPL::RandomGaussian2D(fMeanY, fMeanPhiY, fSigmaY, fSigmaPhiY, Y, PhiY);
     }
   }
   
   else{
-    while(sqrt(X*X+Y*Y>fEffectiveTargetSize) || fEffectiveTargetSize == 0){
+    while(sqrt(X*X+Y*Y)>fEffectiveTargetSize || fEffectiveTargetSize == 0){
       fXThetaXHist->GetRandom2(X,ThetaX);
       fYPhiYHist->GetRandom2(Y,PhiY);
     }
diff --git a/NPLib/Physics/NPPhysicsLinkDef.h b/NPLib/Physics/NPPhysicsLinkDef.h
index 3ca75ab55b8209905747d9ea8fb85d3f743b6a85..7f7bb77816c1424f53d2fb4cd94b851cbd8b9975 100644
--- a/NPLib/Physics/NPPhysicsLinkDef.h
+++ b/NPLib/Physics/NPPhysicsLinkDef.h
@@ -2,4 +2,5 @@
 #pragma link C++ defined_in "./NPReaction.h";
 #pragma link C++ defined_in "./NPBeam.h";
 #pragma link C++ defined_in "./NPNucleus.h";
+#pragma link C++ defined_in "./NPEnergyLoss.h";
 #endif
diff --git a/NPLib/Physics/NPReaction.cxx b/NPLib/Physics/NPReaction.cxx
index af005801ba4ab601e861394d1683813c961b77bd..d173cf3889d19a5803595cfa9a61e57d9aebb04f 100644
--- a/NPLib/Physics/NPReaction.cxx
+++ b/NPLib/Physics/NPReaction.cxx
@@ -587,9 +587,11 @@ TGraph* Reaction::GetKinematicLine3(double AngleStep_CM){
 		SetThetaCM(angle*deg);
 		KineRelativistic(theta3, E3, theta4, E4);
 		fNuclei3->SetKineticEnergy(E3);
-		
-		vx.push_back(theta3/deg);
-		vy.push_back(E3);
+	
+    if(E3>0){
+		  vx.push_back(theta3/deg);
+		  vy.push_back(E3);
+    }
 	}
 	fKineLine3 = new TGraph(vx.size(),&vx[0],&vy[0]);
 	
@@ -604,12 +606,13 @@ TGraph* Reaction::GetKinematicLine4(double AngleStep_CM){
     double theta3,E3,theta4,E4;
     
 	for (double angle=0 ; angle < 360 ; angle+=AngleStep_CM){
-		SetThetaCM(angle*deg);
+    SetThetaCM(angle*deg);
 		KineRelativistic(theta3, E3, theta4, E4);
 		fNuclei4->SetKineticEnergy(E4);
-		
-		vx.push_back(theta3/deg);
-		vy.push_back(E4);
+		if(E4>0){
+		  vx.push_back(theta4/deg);
+		  vy.push_back(E4);
+    }
 	}
     fKineLine4= new TGraph(vx.size(),&vx[0],&vy[0]);
   
@@ -666,7 +669,7 @@ TGraph* Reaction::GetThetaLabVersusThetaCM(double AngleStep_CM){
 	for (double angle=0 ; angle < 360 ; angle+=AngleStep_CM){
 		SetThetaCM(angle*deg);
 		KineRelativistic(theta3, E3, theta4, E4);
-		
+
 		vx.push_back(fThetaCM/deg);
 		vy.push_back(theta3/deg);
   }
diff --git a/NPLib/Plastic/TPlasticPhysics.cxx b/NPLib/Plastic/TPlasticPhysics.cxx
index c45831e9358943f0ce12a428add03a5ad790e258..bae84998da8a2c821e0e99db5205e9c75981b6dc 100644
--- a/NPLib/Plastic/TPlasticPhysics.cxx
+++ b/NPLib/Plastic/TPlasticPhysics.cxx
@@ -213,7 +213,7 @@ void TPlasticPhysics::ReadConfiguration(string Path)
                   /////////////////////////////////////////////////
                   //   If All necessary information there, toggle out
                
-               if ( check_Theta && check_Phi && check_R && check_Thickness && check_Radius &&   check_LeadThickness && check_Scintillator &&   check_Height &&   check_Width && check_Shape && check_X && check_Y && check_Z ) 
+               if ( ((check_Theta && check_Phi && check_R) ||( check_X && check_Y && check_Z)  )&& check_Thickness  &&   check_LeadThickness && check_Scintillator && (check_Radius ||  (check_Height && check_Width)) && check_Shape ) 
                   { 
                      NumberOfDetector++;
                      
diff --git a/NPLib/Sharc/CMakeLists.txt b/NPLib/Sharc/CMakeLists.txt
index 9a0962973444e1d83cfc49bba7e74624b641a4eb..5a10a9122d63b7af77974143e13ddd9ae6beb677 100644
--- a/NPLib/Sharc/CMakeLists.txt
+++ b/NPLib/Sharc/CMakeLists.txt
@@ -1,6 +1,6 @@
 add_custom_command(OUTPUT TSharcPhysicsDict.cxx TSharcPhysicsDict_rdict.pcm TSharcPhysics.rootmap COMMAND ../scripts/build_dict.sh TSharcPhysics.h TSharcPhysicsDict.cxx TSharcPhysics.rootmap libNPSharc.dylib DEPENDS TSharcPhysics.h)
 add_custom_command(OUTPUT TSharcDataDict.cxx TSharcDataDict_rdict.pcm TSharcData.rootmap COMMAND ../scripts/build_dict.sh TSharcData.h TSharcDataDict.cxx TSharcData.rootmap libNPSharc.dylib DEPENDS TSharcData.h)
-add_library(NPSharc SHARED TSharcData.cxx TSharcPhysics.cxx TSharcDataDict.cxx TSharcPhysicsDict.cxx )
+add_library(NPSharc SHARED TSharcSpectra.cxx TSharcData.cxx TSharcPhysics.cxx TSharcDataDict.cxx TSharcPhysicsDict.cxx )
 target_link_libraries(NPSharc ${ROOT_LIBRARIES} NPCore) 
-install(FILES TSharcData.h TSharcPhysics.h DESTINATION ${CMAKE_INCLUDE_OUTPUT_DIRECTORY})
+install(FILES TSharcData.h TSharcPhysics.h TSharcSpectra.h DESTINATION ${CMAKE_INCLUDE_OUTPUT_DIRECTORY})
 
diff --git a/NPLib/Sharc/TSharcPhysics.cxx b/NPLib/Sharc/TSharcPhysics.cxx
index 5239f4848e3c7c855ab7521134463a69a1d31a87..a0efd2298123a092fffcb8c3b245dc4a1e32eca6 100644
--- a/NPLib/Sharc/TSharcPhysics.cxx
+++ b/NPLib/Sharc/TSharcPhysics.cxx
@@ -45,6 +45,7 @@ TSharcPhysics::TSharcPhysics(){
   m_EventData         = new TSharcData ;
   m_PreTreatedData    = new TSharcData ;
   m_EventPhysics      = this ;
+  m_Spectra           = NULL;
   m_NumberOfDetector = 0 ;
   m_MaximumStripMultiplicityAllowed = 10;
   m_StripEnergyMatchingSigma = 0.060    ;
@@ -59,7 +60,7 @@ TSharcPhysics::TSharcPhysics(){
   m_StripBack_E_Threshold = 0 ;
   
   m_Take_E_Front=false;
-  m_Take_T_Back=true;
+  m_Take_T_Back=false;
 }
 
 ///////////////////////////////////////////////////////////////////////////
@@ -604,7 +605,48 @@ void TSharcPhysics::ReadConfiguration(string Path){
   InitializeStandardParameter();
   ReadAnalysisConfig();
 }
+///////////////////////////////////////////////////////////////////////////
+void TSharcPhysics::InitSpectra(){  
+  m_Spectra = new TSharcSpectra(m_NumberOfDetector);
+}
+
+///////////////////////////////////////////////////////////////////////////
+void TSharcPhysics::FillSpectra(){  
+  m_Spectra -> FillRawSpectra(m_EventData);
+  m_Spectra -> FillPreTreatedSpectra(m_PreTreatedData);
+  m_Spectra -> FillPhysicsSpectra(m_EventPhysics);
+}
+///////////////////////////////////////////////////////////////////////////
+void TSharcPhysics::CheckSpectra(){  
+  m_Spectra->CheckSpectra();  
+}
+///////////////////////////////////////////////////////////////////////////
+void TSharcPhysics::ClearSpectra(){  
+  // To be done
+}
+///////////////////////////////////////////////////////////////////////////
+map< vector<string> , TH1*> TSharcPhysics::GetSpectra() {
+  if(m_Spectra)
+    return m_Spectra->GetMapHisto();
+  else{
+    map< vector<string> , TH1*> empty;
+    return empty;
+  }
+} 
+////////////////////////////////////////////////////////////////////////////////
+vector<TCanvas*> TSharcPhysics::GetCanvas() {
+  if(m_Spectra)
+    return m_Spectra->GetCanvas();
+  else{
+    vector<TCanvas*> empty;
+    return empty;
+  }
+} 
 
+///////////////////////////////////////////////////////////////////////////
+void TSharcPhysics::WriteSpectra(){
+  m_Spectra->WriteSpectra();
+}
 ///////////////////////////////////////////////////////////////////////////
 void TSharcPhysics::AddParameterToCalibrationManager(){
   CalibrationManager* Cal = CalibrationManager::getInstance();
@@ -638,9 +680,13 @@ void TSharcPhysics::AddParameterToCalibrationManager(){
 ///////////////////////////////////////////////////////////////////////////
 void TSharcPhysics::InitializeRootInputRaw(){
   TChain* inputChain = RootInput::getInstance()->GetChain()   ;
-  inputChain->SetBranchStatus( "Sharc" , true )               ;
-  inputChain->SetBranchStatus( "fSharc_*" , true )               ;
-  inputChain->SetBranchAddress( "Sharc" , &m_EventData )      ;
+  static UInt_t* found =  new UInt_t[100] ;
+  inputChain->SetBranchStatus( "Sharc" , true );
+  // The following line is necessary only for system were the tree is splitted
+  // (older root version). The found argument silenced the Branches not found
+  // warning for non splitted tree.
+  inputChain->SetBranchStatus( "fSharc_*",true,found);
+  inputChain->SetBranchAddress( "Sharc" , &m_EventData );
 
 }
 
@@ -661,7 +707,6 @@ void TSharcPhysics::InitializeRootInputPhysics(){
   inputChain->SetBranchStatus( "PAD_E" , true );
   inputChain->SetBranchStatus( "PAD_T" , true );
   inputChain->SetBranchAddress( "Sharc" , &m_EventPhysics )      ;
-
 }
 
 ///////////////////////////////////////////////////////////////////////////
@@ -670,15 +715,14 @@ void TSharcPhysics::InitializeRootOutput(){
   outputTree->Branch( "Sharc" , "TSharcPhysics" , &m_EventPhysics );
 }
 
-
+////////////////////////////////////////////////////////////////////////////////
 /////   Specific to SharcArray   ////
-
 void TSharcPhysics::AddBoxDetector(double Z){
   double BOX_Wafer_Width  = 52.20;
   // double BOX_Wafer_Length = 76.20;
   
-  double BOX_ActiveArea_Length = 72;
-  double BOX_ActiveArea_Width = 42;
+  double BOX_ActiveArea_Length = 76.2;
+  double BOX_ActiveArea_Width = 52.2;
   
   int    BOX_Wafer_Back_NumberOfStrip = 48 ;
   int    BOX_Wafer_Front_NumberOfStrip = 24 ;
@@ -703,8 +747,6 @@ void TSharcPhysics::AddBoxDetector(double Z){
       else if(i==3) {U=TVector3(0,1,0);V=TVector3(0,0,-1);  Strip_1_1=TVector3(40.5,-36,Z+BOX_Wafer_Width/2.)   ;}
     }
    
-cout << Z-BOX_Wafer_Width/2. << endl;
- 
     //   Buffer object to fill Position Array
     vector<double> lineX ; vector<double> lineY ; vector<double> lineZ ;
     
@@ -735,7 +777,7 @@ cout << Z-BOX_Wafer_Width/2. << endl;
     m_StripPositionZ.push_back( OneBoxStripPositionZ ) ;
   }
 }
-
+////////////////////////////////////////////////////////////////////////////////
 void TSharcPhysics::AddQQQDetector( double R,double Phi,double Z){
   
   double QQQ_R_Min = 9.+R;
@@ -832,22 +874,18 @@ void TSharcPhysics::InitializeStandardParameter()
   m_PADChannelStatus.clear() ;
   
   ChannelStatus.resize(24,true);
-  for(int i = 0 ; i < m_NumberOfDetector ; ++i)
-    {
+  for(int i = 0 ; i < m_NumberOfDetector ; ++i){
     m_FrontChannelStatus[i] = ChannelStatus;
     }
   
   ChannelStatus.resize(48,true);
-  for(int i = 0 ; i < m_NumberOfDetector ; ++i)
-    {
+  for(int i = 0 ; i < m_NumberOfDetector ; ++i){
     m_BackChannelStatus[i] = ChannelStatus;
     }
   
   ChannelStatus.resize(1,true);
-  for(int i = 0 ; i < m_NumberOfDetector ; ++i)
-    {
+  for(int i = 0 ; i < m_NumberOfDetector ; ++i){
     m_PADChannelStatus[i] = ChannelStatus;
-    
     }
   
   m_MaximumStripMultiplicityAllowed = m_NumberOfDetector   ;
diff --git a/NPLib/Sharc/TSharcPhysics.h b/NPLib/Sharc/TSharcPhysics.h
index ce39f0b62409537475d650dce2c1fcbb802fee1f..107f734ef5c26fa82008d530a77e9198cd73bf60 100644
--- a/NPLib/Sharc/TSharcPhysics.h
+++ b/NPLib/Sharc/TSharcPhysics.h
@@ -27,195 +27,219 @@
 
 // NPL
 #include "TSharcData.h"
+#include "TSharcSpectra.h"
 #include "NPCalibrationManager.h"
 #include "NPVDetector.h"
 // ROOT 
 #include "TVector2.h" 
 #include "TVector3.h" 
 #include "TObject.h"
+#include "TCanvas.h"
+// Forward declaration
+class TSharcSpectra;
+
 
 using namespace std ;
 
 class TSharcPhysics : public TObject, public NPL::VDetector
 {
-   public:
-      TSharcPhysics();
-      ~TSharcPhysics() {};
-
-   public: 
-      void Clear();   
-      void Clear(const Option_t*) {};
-
-   public: 
-      vector < TVector2 > Match_Front_Back() ;
-      int  CheckEvent();
-   
-   public:
-   
-      //   Provide Physical Multiplicity
-      Int_t EventMultiplicity;
-               
-      //   Provide a Classification of Event
-      vector<int> EventType ;
-         
-      // Detector
-      vector<int> DetectorNumber ;
-      
-      //   DSSD
-      vector<double> Strip_E ;
-      vector<double> Strip_T ;
-      vector<double> StripFront_E ;
-      vector<double> StripFront_T ;
-      vector<double> StripBack_E ;
-      vector<double> StripBack_T ;
-      vector<int>    Strip_Front ;
-      vector<int>    Strip_Back ;
-
-      vector<double> PAD_E ;
-      vector<double> PAD_T ;
-   
-   public:      //   Innherited from VDetector Class
-         
-      //   Read stream at ConfigFile to pick-up parameters of detector (Position,...) using Token
-      void ReadConfiguration(string) ;
-      
-
-      //   Add Parameter to the CalibrationManger
-      void AddParameterToCalibrationManager() ;      
-
-      //   Activated associated Branches and link it to the private member DetectorData address
-      //   In this method mother Branches (Detector) AND daughter leaf (fDetector_parameter) have to be activated
-      void InitializeRootInputRaw() ;
-      
-      //   Activated associated Branches and link it to the private member DetectorPhysics address
-      //   In this method mother Branches (Detector) AND daughter leaf (parameter) have to be activated
-      void InitializeRootInputPhysics() ;
-
-      //   Create associated branches and associated private member DetectorPhysics address
-      void InitializeRootOutput() ;
-      
-      //   This method is called at each event read from the Input Tree. Aime is to build treat Raw dat in order to extract physical parameter. 
-      void BuildPhysicalEvent() ;
-      
-      //   Same as above, but only the simplest event and/or simple method are used (low multiplicity, faster algorythm but less efficient ...).
-      //   This method aimed to be used for analysis performed during experiment, when speed is requiered.
-      //   NB: This method can eventually be the same as BuildPhysicalEvent.
-      void BuildSimplePhysicalEvent() ;
-
-      // Same as above but for online analysis
-      void BuildOnlinePhysicalEvent()  {BuildPhysicalEvent();};
-
-      //   Those two method all to clear the Event Physics or Data
-      void ClearEventPhysics() {Clear();}      
-      void ClearEventData()    {m_EventData->Clear();}   
-   
-   public:      //   Specific to Sharc Array
-   
-      //   Clear The PreTeated object
-      void ClearPreTreatedData()   {m_PreTreatedData->Clear();}
-   
-      //   Remove bad channel, calibrate the data and apply threshold
-      void PreTreat();
-   
-      //   Return false if the channel is disabled by user
-         //   Frist argument is either "X","Y","SiLi","CsI"
-      bool IsValidChannel(const string DetectorType, const int telescope , const int channel);
-   
-      //   Initialize the standard parameter for analysis
-         //   ie: all channel enable, maximum multiplicity for strip = number of telescope
-      void InitializeStandardParameter();
-      
-      //   Read the user configuration file; if no file found, load standard one
-      void ReadAnalysisConfig();
-         
-      //   Add a Detector
-      void AddBoxDetector( double Z);
-      void AddQQQDetector( double R,double Phi,double Z);
-      
-      // Give and external TMustData object to TSharcPhysics. Needed for online analysis for example.
-      void SetRawDataPointer(TSharcData* rawDataPointer) {m_EventData = rawDataPointer;}
-      // Retrieve raw and pre-treated data
-      TSharcData* GetRawData()        const {return m_EventData;}
-      TSharcData* GetPreTreatedData() const {return m_PreTreatedData;}
-
-      // Use to access the strip position
-      double GetStripPositionX( const int N , const int Front , const int Back )   const{ return m_StripPositionX[N-1][Front-1][Back-1] ; }  ;
-      double GetStripPositionY( const int N , const int Front , const int Back )   const{ return m_StripPositionY[N-1][Front-1][Back-1] ; }  ;
-      double GetStripPositionZ( const int N , const int Front , const int Back )   const{ return m_StripPositionZ[N-1][Front-1][Back-1] ; }  ;
-
-      double GetNumberOfDetector() const { return m_NumberOfDetector; };
-
-      // To be called after a build Physical Event 
-      int GetEventMultiplicity() const { return EventMultiplicity; };
-      
-      TVector3 GetPositionOfInteraction(const int i) const;   
-      TVector3 GetDetectorNormal(const int i) const;
-
-      private:   //   Parameter used in the analysis
-      
-         // By default take EX and TY.
-         bool m_Take_E_Front;//!
-         bool m_Take_T_Back;//!
-      
-      
-         //   Event over this value after pre-treatment are not treated / avoid long treatment time on spurious event   
-         unsigned int m_MaximumStripMultiplicityAllowed  ;//!
-         //   Give the allowance in percent of the difference in energy between X and Y
-         double m_StripEnergyMatchingSigma  ; //!
-         double m_StripEnergyMatchingNumberOfSigma  ; //!
-         
-         //  Threshold
-         double m_StripFront_E_RAW_Threshold ;//!
-         double m_StripFront_E_Threshold ;//!
-         double m_StripBack_E_RAW_Threshold ;//!
-         double m_StripBack_E_Threshold ;//!
-         double m_PAD_E_RAW_Threshold ;//!
-         double m_PAD_E_Threshold ;//!
-         
-
-
-       private:   //   Root Input and Output tree classes
-            
-         TSharcData*         m_EventData;//!
-         TSharcData*         m_PreTreatedData;//!
-         TSharcPhysics*      m_EventPhysics;//!
-
-
-      private:   //   Map of activated channel
-         map< int, vector<bool> > m_FrontChannelStatus;//!
-         map< int, vector<bool> > m_BackChannelStatus;//! 
-         map< int, vector<bool> > m_PADChannelStatus;//!
-
-      private:   //   Spatial Position of Strip Calculated on bases of detector position
-   
-         int m_NumberOfDetector;//!
-         vector< vector < vector < double > > >   m_StripPositionX;//!
-         vector< vector < vector < double > > >   m_StripPositionY;//!
-         vector< vector < vector < double > > >   m_StripPositionZ;//!
-         
-   public: // Static constructor to be passed to the Detector Factory
-     static NPL::VDetector* Construct();
-     ClassDef(TSharcPhysics,1)  // SharcPhysics structure
+  public:
+    TSharcPhysics();
+    ~TSharcPhysics() {};
+
+  public: 
+    void Clear();   
+    void Clear(const Option_t*) {};
+
+  public: 
+    vector < TVector2 > Match_Front_Back() ;
+    int  CheckEvent();
+
+  public:
+
+    //   Provide Physical Multiplicity
+    Int_t EventMultiplicity;
+
+    //   Provide a Classification of Event
+    vector<int> EventType ;
+
+    // Detector
+    vector<int> DetectorNumber ;
+
+    //   DSSD
+    vector<double> Strip_E ;
+    vector<double> Strip_T ;
+    vector<double> StripFront_E ;
+    vector<double> StripFront_T ;
+    vector<double> StripBack_E ;
+    vector<double> StripBack_T ;
+    vector<int>    Strip_Front ;
+    vector<int>    Strip_Back ;
+
+    vector<double> PAD_E ;
+    vector<double> PAD_T ;
+
+  public:      //   Innherited from VDetector Class
+
+    //   Read stream at ConfigFile to pick-up parameters of detector (Position,...) using Token
+    void ReadConfiguration(string) ;
+
+
+    //   Add Parameter to the CalibrationManger
+    void AddParameterToCalibrationManager() ;      
+
+    //   Activated associated Branches and link it to the private member DetectorData address
+    //   In this method mother Branches (Detector) AND daughter leaf (fDetector_parameter) have to be activated
+    void InitializeRootInputRaw() ;
+
+    //   Activated associated Branches and link it to the private member DetectorPhysics address
+    //   In this method mother Branches (Detector) AND daughter leaf (parameter) have to be activated
+    void InitializeRootInputPhysics() ;
+
+    //   Create associated branches and associated private member DetectorPhysics address
+    void InitializeRootOutput() ;
+
+    //   This method is called at each event read from the Input Tree. Aime is to build treat Raw dat in order to extract physical parameter. 
+    void BuildPhysicalEvent() ;
+
+    //   Same as above, but only the simplest event and/or simple method are used (low multiplicity, faster algorythm but less efficient ...).
+    //   This method aimed to be used for analysis performed during experiment, when speed is requiered.
+    //   NB: This method can eventually be the same as BuildPhysicalEvent.
+    void BuildSimplePhysicalEvent() ;
+
+    // Same as above but for online analysis
+    void BuildOnlinePhysicalEvent()  {BuildPhysicalEvent();};
+
+    //   Those two method all to clear the Event Physics or Data
+    void ClearEventPhysics() {Clear();}      
+    void ClearEventData()    {m_EventData->Clear();}   
+
+    // Method related to the TSpectra classes, aimed at providing a framework for online applications
+    // Instantiate the Spectra class and the histogramm throught it
+    void InitSpectra();
+    // Fill the spectra hold by the spectra class
+    void FillSpectra();
+    // Used for Online mainly, perform check on the histo and for example change their color if issues are found
+    void CheckSpectra();
+    // Used for Online only, clear all the spectra hold by the Spectra class
+    void ClearSpectra();
+    // Write Spectra to file
+    void WriteSpectra();
+
+  public:      //   Specific to Sharc Array
+
+    //   Clear The PreTeated object
+    void ClearPreTreatedData()   {m_PreTreatedData->Clear();}
+
+    //   Remove bad channel, calibrate the data and apply threshold
+    void PreTreat();
+
+    //   Return false if the channel is disabled by user
+    //   Frist argument is either "X","Y","SiLi","CsI"
+    bool IsValidChannel(const string DetectorType, const int telescope , const int channel);
+
+    //   Initialize the standard parameter for analysis
+    //   ie: all channel enable, maximum multiplicity for strip = number of telescope
+    void InitializeStandardParameter();
+
+    //   Read the user configuration file; if no file found, load standard one
+    void ReadAnalysisConfig();
+
+    //   Add a Detector
+    void AddBoxDetector( double Z);
+    void AddQQQDetector( double R,double Phi,double Z);
+
+    // Give and external TMustData object to TSharcPhysics. Needed for online analysis for example.
+    void SetRawDataPointer(TSharcData* rawDataPointer) {m_EventData = rawDataPointer;}
+    // Retrieve raw and pre-treated data
+    TSharcData* GetRawData()        const {return m_EventData;}
+    TSharcData* GetPreTreatedData() const {return m_PreTreatedData;}
+
+    // Use to access the strip position
+    double GetStripPositionX( const int N , const int Front , const int Back )   const{ return m_StripPositionX[N-1][Front-1][Back-1] ; }  ;
+    double GetStripPositionY( const int N , const int Front , const int Back )   const{ return m_StripPositionY[N-1][Front-1][Back-1] ; }  ;
+    double GetStripPositionZ( const int N , const int Front , const int Back )   const{ return m_StripPositionZ[N-1][Front-1][Back-1] ; }  ;
+
+    double GetNumberOfDetector() const { return m_NumberOfDetector; };
+
+    // To be called after a build Physical Event 
+    int GetEventMultiplicity() const { return EventMultiplicity; };
+
+    TVector3 GetPositionOfInteraction(const int i) const;   
+    TVector3 GetDetectorNormal(const int i) const;
+
+  private:   //   Parameter used in the analysis
+
+    // By default take EX and TY.
+    bool m_Take_E_Front;//!
+    bool m_Take_T_Back;//!
+
+
+    //   Event over this value after pre-treatment are not treated / avoid long treatment time on spurious event   
+    unsigned int m_MaximumStripMultiplicityAllowed  ;//!
+    //   Give the allowance in percent of the difference in energy between X and Y
+    double m_StripEnergyMatchingSigma  ; //!
+    double m_StripEnergyMatchingNumberOfSigma  ; //!
+
+    //  Threshold
+    double m_StripFront_E_RAW_Threshold ;//!
+    double m_StripFront_E_Threshold ;//!
+    double m_StripBack_E_RAW_Threshold ;//!
+    double m_StripBack_E_Threshold ;//!
+    double m_PAD_E_RAW_Threshold ;//!
+    double m_PAD_E_Threshold ;//!
+
+
+
+  private:   //   Root Input and Output tree classes
+
+    TSharcData*         m_EventData;//!
+    TSharcData*         m_PreTreatedData;//!
+    TSharcPhysics*      m_EventPhysics;//!
+
+
+  private:   //   Map of activated channel
+    map< int, vector<bool> > m_FrontChannelStatus;//!
+    map< int, vector<bool> > m_BackChannelStatus;//! 
+    map< int, vector<bool> > m_PADChannelStatus;//!
+
+  private:   //   Spatial Position of Strip Calculated on bases of detector position
+
+    int m_NumberOfDetector;//!
+    vector< vector < vector < double > > >   m_StripPositionX;//!
+    vector< vector < vector < double > > >   m_StripPositionY;//!
+    vector< vector < vector < double > > >   m_StripPositionZ;//!
+
+  private: // Spectra Class
+    TSharcSpectra* m_Spectra; // !
+
+  public: // Spectra Getter
+    map< vector<string> , TH1*> GetSpectra(); 
+    vector<TCanvas*> GetCanvas();
+
+  public: // Static constructor to be passed to the Detector Factory
+    static NPL::VDetector* Construct();
+    ClassDef(TSharcPhysics,1)  // SharcPhysics structure
 };
 
 namespace Sharc_LOCAL
-   {
-      //   tranform an integer to a string
-      string itoa(unsigned int value);
-      //   DSSD
-      //   Front
-      double fStrip_Front_E(const TSharcData* Data, const int i);
-      double fStrip_Front_T(const TSharcData* Data, const int i);
-      
-      //   Back   
-      double fStrip_Back_E(const TSharcData* Data, const int i);
-      double fStrip_Back_T(const TSharcData* Data, const int i);
-      
-      //   PAD   
-      double fPAD_E(const TSharcData* Data, const int i);
-      double fPAD_T(const TSharcData* Data, const int i);
-   
-   }
+{
+  //   tranform an integer to a string
+  string itoa(unsigned int value);
+  //   DSSD
+  //   Front
+  double fStrip_Front_E(const TSharcData* Data, const int i);
+  double fStrip_Front_T(const TSharcData* Data, const int i);
+
+  //   Back   
+  double fStrip_Back_E(const TSharcData* Data, const int i);
+  double fStrip_Back_T(const TSharcData* Data, const int i);
+
+  //   PAD   
+  double fPAD_E(const TSharcData* Data, const int i);
+  double fPAD_T(const TSharcData* Data, const int i);
+
+}
 
 
 #endif
diff --git a/NPLib/Sharc/TSharcSpectra.cxx b/NPLib/Sharc/TSharcSpectra.cxx
new file mode 100644
index 0000000000000000000000000000000000000000..92382988bd2b57a4ae368fb242bfd04542a31dbe
--- /dev/null
+++ b/NPLib/Sharc/TSharcSpectra.cxx
@@ -0,0 +1,406 @@
+/*****************************************************************************
+ * Copyright (C) 2009-2014   this file is part of the NPTool Project         *
+ *                                                                           *
+ * For the licensing terms see $NPTOOL/Licence/NPTool_Licence                *
+ * For the list of contributors see $NPTOOL/Licence/Contributors             *
+ ****************************************************************************/
+
+/*****************************************************************************
+ * Original Author: A. Matta                 address: a.matta@surrey.ac.uk   *
+ *                                                                           *
+ * Creation Date  : June 2015                                                *
+ * Last update    :                                                          *
+ *---------------------------------------------------------------------------*
+ * Decription:                                                               *
+ *  This class holds all the online spectra needed for Sharc                 *
+ *                                                                           *
+ *---------------------------------------------------------------------------*
+ * Comment:                                                                  *
+ *                                                                           *
+ *****************************************************************************/
+
+// NPL
+#include "TSharcSpectra.h"
+#include "NPOptionManager.h"
+#include "NPGlobalSystemOfUnits.h"
+#include "NPPhysicalConstants.h"
+#ifdef NP_SYSTEM_OF_UNITS_H
+using namespace NPUNITS;
+#endif
+
+// STL
+#include <stdexcept>
+#include <iostream>  
+#include <cstdlib>
+#include <string>
+using namespace std;
+
+
+////////////////////////////////////////////////////////////////////////////////
+TSharcSpectra::TSharcSpectra(){
+  SetName("Sharc");
+  fNumberOfDetector = 0;
+  fStripFront=24;
+  fStripBack=48;
+}
+
+////////////////////////////////////////////////////////////////////////////////
+TSharcSpectra::TSharcSpectra(unsigned int NumberOfDetector){
+  if(NPOptionManager::getInstance()->GetVerboseLevel()>0)
+    cout << "************************************************" << endl
+      << "TSharcSpectra : Initalising control spectra for " 
+      << NumberOfDetector << " Detectors" << endl
+      << "************************************************" << endl ;
+  SetName("Sharc");
+  fNumberOfDetector = NumberOfDetector;
+  fStripFront=24;
+  fStripBack=48;
+
+  InitRawSpectra();
+  InitPreTreatedSpectra();
+  InitPhysicsSpectra();
+}
+
+////////////////////////////////////////////////////////////////////////////////
+TSharcSpectra::~TSharcSpectra(){
+}
+
+////////////////////////////////////////////////////////////////////////////////
+void TSharcSpectra::InitRawSpectra(){
+
+  static string name;
+  for (unsigned int i = 0; i < fNumberOfDetector; i++) { // loop on number of detectors
+    name = "SharcRaw"+NPL::itoa(i+1);
+    TCanvas* c1 = new TCanvas(name.c_str(),name.c_str());
+    c1->Divide(3,2);
+    int i1 = 0;  
+    // STR_FRONT_E_RAW
+    c1->cd(++i1);
+    name = "SHARC"+NPL::itoa(i+1)+"_STR_FRONT_E_RAW";
+    AddHisto2D(name, name, fStripFront, 1, fStripFront+1, 5000, 0, 1.5e6, "SHARC/RAW/STR_FRONT_E")->Draw("colz");
+
+    // STR_BACK_E_RAW
+    c1->cd(++i1);
+    name = "SHARC"+NPL::itoa(i+1)+"_STR_BACK_E_RAW";
+    AddHisto2D(name, name, fStripBack, 1, fStripBack+1, 5000, 0, 1.5e6, "SHARC/RAW/STR_BACK_E")->Draw("colz");
+
+    // PAD_E_RAW
+    c1->cd(++i1);
+    name = "SHARC"+NPL::itoa(i+1)+"_PAD_E_RAW";
+    AddHisto1D(name, name, 500, 0, 2500, "SHARC/RAW/PAD_E")->Draw("");
+
+    // STR_FRONT_RAW_MULT
+    c1->cd(++i1);
+    name = "SHARC"+NPL::itoa(i+1)+"_STR_FRONT_RAW_MULT";
+    AddHisto1D(name, name, fStripFront, 1, fStripFront+1, "SHARC/RAW/MULT")->Draw("");
+    gPad->SetLogy();
+
+    // STR_BACK_RAW_MULT
+    c1->cd(++i1);
+    name = "SHARC"+NPL::itoa(i+1)+"_STR_BACK_RAW_MULT";
+    AddHisto1D(name, name, fStripFront, 1, fStripFront+1, "SHARC/RAW/MULT")->Draw("");
+    gPad->SetLogy();
+
+    // PAD_RAW_MULT
+    c1->cd(++i1);
+    name = "SHARC"+NPL::itoa(i+1)+"_PAD_RAW_MULT";
+    AddHisto1D(name, name, fNumberOfDetector, 1, fNumberOfDetector+1, "SHARC/RAW/MULT")->Draw("");
+    gPad->SetLogy();
+
+    AddCanvas(c1);  
+  } // end loop on number of detectors
+}
+
+////////////////////////////////////////////////////////////////////////////////
+void TSharcSpectra::InitPreTreatedSpectra(){
+  static string name;
+  for (unsigned int i = 0; i < fNumberOfDetector; i++) { // loop on number of detectors
+    // STR_FRONT_E_CAL
+    name = "SHARC"+NPL::itoa(i+1)+"_STR_FRONT_E_CAL";
+    AddHisto2D(name, name, fStripFront, 1, fStripFront+1, 500, 0, 25, "SHARC/CAL/STR_FRONT_E");
+
+    // STR_BACK_E_CAL
+    name = "SHARC"+NPL::itoa(i+1)+"_STR_BACK_E_CAL";
+    AddHisto2D(name, name, fStripBack, 1, fStripBack+1, 500, 0, 25, "SHARC/CAL/STR_BACK_E");
+
+    // PAD_E_CAL
+    name = "SHARC"+NPL::itoa(i+1)+"_PAD_E_CAL";
+    AddHisto1D(name, name, 100, 0, 50, "SHARC/CAL/PAD_E");
+
+    // STR_FRONT_CAL_MULT
+    name = "SHARC"+NPL::itoa(i+1)+"_STR_FRONT_CAL_MULT";
+    AddHisto1D(name, name, fStripFront, 1, fStripFront+1, "SHARC/CAL/MULT");
+
+    // STR_BACK_CAL_MULT
+    name = "SHARC"+NPL::itoa(i+1)+"_STR_BACK_CAL_MULT";
+    AddHisto1D(name, name, fStripFront, 1, fStripFront+1, "SHARC/CAL/MULT");
+
+    // PAD_CAL_MULT
+    name = "SHARC"+NPL::itoa(i+1)+"_PAD_CAL_MULT";
+    AddHisto1D(name, name, fNumberOfDetector, 1, fNumberOfDetector+1, "SHARC/CAL/MULT");
+
+    // PAD_CAL_ID 
+    name = "SHARC"+NPL::itoa(i+1)+"_PAD_CAL_ID";
+    AddHisto2D(name, name,100,0,50,500,0,50, "SHARC/CAL/ID");
+
+    // Front-Back Energy Correlation
+      name = "SHARC"+NPL::itoa(i+1)+"_FB_COR";
+      AddHisto2D(name, name,500,0,25,500,0,25, "SHARC/CAL/FB"); 
+
+  }  // end loop on number of detectors
+}
+
+////////////////////////////////////////////////////////////////////////////////
+void TSharcSpectra::InitPhysicsSpectra(){
+  static string name;
+  // Kinematic Plot 
+  name = "SHARC_THETA_E";
+  AddHisto2D(name, name,360,0,180,500,0,50,"SHARC/PHY");
+
+  // ID Plot
+  // PAD-DE:
+  name = "SHARC_PAD_E_E";
+  AddHisto1D(name, name,500,0,25,"SHARC/PHY");
+
+  for (unsigned int i = 0; i < fNumberOfDetector; i++) { // loop on number of detectors
+    // PAD-DE:
+    name = "SHARC"+NPL::itoa(i+1)+"_PAD_E_E";
+    AddHisto2D(name, name,100,0,100,500,0,25,"SHARC/PHY");
+  }
+}
+
+
+
+////////////////////////////////////////////////////////////////////////////////
+void TSharcSpectra::FillRawSpectra(TSharcData* RawData){
+  static string name;
+  static string family;
+
+  // STR_FRONT_E 
+  unsigned int mysize = RawData->GetMultiplicityFront();
+  for (unsigned int i = 0; i < mysize; i++) {
+    name = "SHARC"+NPL::itoa(RawData->GetFront_DetectorNbr(i))+"_STR_FRONT_E_RAW";
+    family = "SHARC/RAW/STR_FRONT_E";
+
+    GetHisto(family,name)
+      -> Fill(RawData->GetFront_StripNbr(i), 
+          RawData->GetFront_Energy(i));
+  }
+
+  // STR_BACK_E
+  mysize = RawData->GetMultiplicityBack();
+  for (unsigned int i = 0; i < mysize; i++) {
+    name = "SHARC"+NPL::itoa( RawData->GetBack_DetectorNbr(i) )+"_STR_BACK_E_RAW";
+    family = "SHARC/RAW/STR_BACK_E";
+
+    GetHisto(family,name)
+      -> Fill(RawData->GetBack_StripNbr(i),
+          RawData->GetBack_Energy(i));
+  }
+
+  // PAD_E
+  mysize = RawData->GetMultiplicityPAD();
+  for (unsigned int i = 0; i < mysize; i++) {
+    name = "SHARC"+NPL::itoa(RawData->GetPAD_DetectorNbr(i))+"_PAD_E_RAW";
+    family = "SHARC/RAW/PAD_E";
+
+    GetHisto(family,name)
+      -> Fill(RawData->GetPAD_Energy(i));
+  }
+
+  // STR_FRONT MULT
+  int myMULT[fNumberOfDetector];
+  for( unsigned int i = 0; i < fNumberOfDetector; i++)
+    myMULT[i] = 0 ; 
+
+  for(unsigned int i = 0 ; i < RawData->GetMultiplicityFront();i++){
+    myMULT[RawData->GetFront_DetectorNbr(i)-1] += 1;  
+  }
+
+  for( unsigned int i = 0; i < fNumberOfDetector; i++){
+    name = "SHARC"+NPL::itoa(i+1)+"_STR_FRONT_RAW_MULT";
+    family= "SHARC/RAW/MULT";
+    GetHisto(family,name)
+      -> Fill(myMULT[i]);
+  }
+
+  // STR_BACK MULT
+  for( unsigned int i = 0; i < fNumberOfDetector; i++)
+    myMULT[i] = 0 ; 
+
+  mysize = RawData->GetMultiplicityBack();
+  for(unsigned int i = 0 ; i < mysize;i++){
+    myMULT[RawData->GetBack_DetectorNbr(i)-1] += 1;  
+  }
+
+  for( unsigned int i = 0; i < fNumberOfDetector; i++){
+    name = "SHARC"+NPL::itoa(i+1)+"_STR_BACK_RAW_MULT";
+    family= "SHARC/RAW/MULT";
+    GetHisto(family,name)
+      -> Fill(myMULT[i]);
+  }
+
+  // PAD MULT
+  for( unsigned int i = 0; i < fNumberOfDetector; i++)
+    myMULT[i] = 0 ; 
+  mysize = RawData->GetMultiplicityPAD();
+  for(unsigned int i = 0 ; i < mysize ;i++){
+    myMULT[RawData->GetPAD_DetectorNbr(i)-1] += 1;  
+  }
+
+  for( unsigned int i = 0; i < fNumberOfDetector; i++){
+    name = "SHARC"+NPL::itoa(i+1)+"_PAD_RAW_MULT";
+    family= "SHARC/RAW/MULT";
+    GetHisto(family,name)
+      -> Fill(myMULT[i]);
+  }
+
+}
+
+////////////////////////////////////////////////////////////////////////////////
+void TSharcSpectra::FillPreTreatedSpectra(TSharcData* PreTreatedData){
+  static string name ;
+  static string family;
+
+  // Front-Back
+  unsigned int mysizeF = PreTreatedData->GetMultiplicityFront();
+  unsigned int mysizeB = PreTreatedData->GetMultiplicityBack();
+
+  for (unsigned int i = 0; i < mysizeF; i++) {
+    for (unsigned int j = 0; j < mysizeB; j++) {
+      if(PreTreatedData->GetFront_DetectorNbr(i)==PreTreatedData->GetBack_DetectorNbr(j)){
+        name = "SHARC"+NPL::itoa(PreTreatedData->GetFront_DetectorNbr(i))+"_FB_COR";
+        family = "SHARC/CAL/FB";
+      GetHisto(family,name)
+        -> Fill(PreTreatedData->GetFront_Energy(i),
+                PreTreatedData->GetBack_Energy(j) );
+      }
+    }
+  } 
+
+  // STR_FRONT_E
+  unsigned int mysize = PreTreatedData->GetMultiplicityFront();
+  for (unsigned int i = 0; i < mysize; i++) {
+    name = "SHARC"+NPL::itoa(PreTreatedData->GetFront_DetectorNbr(i))+"_STR_FRONT_E_CAL";
+    family = "SHARC/CAL/STR_FRONT_E";
+
+    GetHisto(family,name)
+      -> Fill(PreTreatedData->GetFront_StripNbr(i), 
+          PreTreatedData->GetFront_Energy(i));
+  }
+  // STR_BACK_E
+  mysize = PreTreatedData->GetMultiplicityBack();
+  for (unsigned int i = 0; i < mysize; i++) {
+    name = "SHARC"+NPL::itoa( PreTreatedData->GetBack_DetectorNbr(i))+"_STR_BACK_E_CAL";
+    family = "SHARC/CAL/STR_BACK_E";
+
+    GetHisto(family,name)
+      -> Fill(PreTreatedData->GetBack_StripNbr(i), 
+          PreTreatedData->GetBack_Energy(i));
+  }
+  // PAD_E
+  mysize = PreTreatedData->GetMultiplicityPAD();
+  for (unsigned int i = 0; i < mysize ; i++) {
+    name = "SHARC"+NPL::itoa(PreTreatedData->GetPAD_DetectorNbr(i))+"_PAD_E_CAL";
+    family = "SHARC/CAL/PAD_E";
+
+    GetHisto(family,name)
+      -> Fill(PreTreatedData->GetPAD_Energy(i));
+  }
+
+  // STR_FRONT MULT
+  int myMULT[fNumberOfDetector];
+  for( unsigned int i = 0; i < fNumberOfDetector; i++)
+    myMULT[i] = 0 ; 
+
+  mysize = PreTreatedData->GetMultiplicityFront(); 
+  for(unsigned int i = 0 ; i < mysize ;i++){
+    myMULT[PreTreatedData->GetFront_DetectorNbr(i)-1] += 1;  
+  }
+
+  for( unsigned int i = 0; i < fNumberOfDetector; i++){
+
+    name = "SHARC"+NPL::itoa(i+1)+"_STR_FRONT_CAL_MULT";
+    family= "SHARC/CAL/MULT";
+    GetHisto(family,name)
+      -> Fill(myMULT[i]);
+  }
+
+  // STR_BACK MULT
+  for( unsigned int i = 0; i < fNumberOfDetector; i++)
+    myMULT[i] = 0 ; 
+
+  mysize = PreTreatedData->GetMultiplicityBack();
+  for(unsigned int i = 0 ; i < mysize ;i++){
+    myMULT[PreTreatedData->GetBack_DetectorNbr(i)-1] += 1;  
+  }
+
+  for( unsigned int i = 0; i < fNumberOfDetector; i++){
+    name = "SHARC"+NPL::itoa(i+1)+"_STR_BACK_CAL_MULT";
+    family= "SHARC/CAL/MULT";
+    GetHisto(family,name)
+      -> Fill(myMULT[i]);
+  }
+
+  // PAD MULT
+  for( unsigned int i = 0; i < fNumberOfDetector; i++)
+    myMULT[i] = 0 ; 
+
+  mysize =  PreTreatedData->GetMultiplicityPAD();
+  for(unsigned int i = 0 ; i < mysize ;i++){
+    myMULT[PreTreatedData->GetPAD_DetectorNbr(i)-1] += 1;  
+  }
+
+  for( unsigned int i = 0; i < fNumberOfDetector; i++){
+    name = "SHARC"+NPL::itoa(i+1)+"_PAD_CAL_MULT";
+    family= "SHARC/CAL/MULT";
+    GetHisto(family,name)
+      -> Fill(myMULT[i]);
+  }
+
+  //E-PAD ID
+  family = "SHARC/CAL/ID";
+  mysize = PreTreatedData->GetMultiplicityFront();
+  unsigned int mysizePAD = PreTreatedData->GetMultiplicityPAD();
+  for (unsigned int i = 0; i < mysize ; i++) {
+    for (unsigned int j = 0; j < mysizePAD; j++) {
+
+      if(PreTreatedData->GetFront_DetectorNbr(i) == PreTreatedData->GetPAD_DetectorNbr(j)){ 
+        name = "SHARC"+NPL::itoa(PreTreatedData->GetFront_DetectorNbr(i))+"_PAD_CAL_ID";
+
+        GetHisto(family,name)
+          -> Fill(PreTreatedData->GetPAD_Energy(j), 
+              PreTreatedData->GetFront_Energy(i));
+      }
+    }
+  }
+
+
+}
+
+////////////////////////////////////////////////////////////////////////////////
+void TSharcSpectra::FillPhysicsSpectra(TSharcPhysics* Physics){
+  static string name;
+  static string family;
+  family= "SHARC/PHY";
+
+  // Kine plot
+  unsigned int mysize = Physics->Strip_E.size();
+  for(unsigned int i = 0 ; i < mysize ; i++){
+    double Theta = Physics->GetPositionOfInteraction(i).Angle(TVector3(0,0,1));
+    Theta = Theta/deg;
+    double Etot=Physics->Strip_E[i];
+
+    if(Physics->PAD_E[i]>0){
+      name = "SHARC_PAD_E_E";
+      Etot += Physics->PAD_E[i];
+      GetHisto(family,name)->Fill(Physics->PAD_E[i],Physics->Strip_E[i]);
+      name = "SHARC"+NPL::itoa(Physics->DetectorNumber[i])+"_PAD_E_E";
+      GetHisto(family,name)->Fill(Physics->PAD_E[i],Physics->Strip_E[i]);
+
+    }
+    name = "SHARC_THETA_E";
+    GetHisto(family,name)-> Fill(Theta,Etot);
+  }
+}
+
diff --git a/NPLib/Sharc/TSharcSpectra.h b/NPLib/Sharc/TSharcSpectra.h
new file mode 100644
index 0000000000000000000000000000000000000000..6484550ddbbbd176bb07abe703fa1cfd4c41a5a3
--- /dev/null
+++ b/NPLib/Sharc/TSharcSpectra.h
@@ -0,0 +1,58 @@
+#ifndef TSHARCSPECTRA_H
+#define TSHARCSPECTRA_H
+/*****************************************************************************
+ * Copyright (C) 2009-2014   this file is part of the NPTool Project         *
+ *                                                                           *
+ * For the licensing terms see $NPTOOL/Licence/NPTool_Licence                *
+ * For the list of contributors see $NPTOOL/Licence/Contributors             *
+ ****************************************************************************/
+
+/*****************************************************************************
+ * Original Author: A. Matta                 address: a.matta@surrey.ac.uk   *
+ *                                                                           *
+ * Creation Date  : June 2015                                                *
+ * Last update    :                                                          *
+ *---------------------------------------------------------------------------*
+ * Decription:                                                               *
+ *  This class holds all the online spectra needed for Sharc                 *
+ *                                                                           *
+ *---------------------------------------------------------------------------*
+ * Comment:                                                                  *
+ *                                                                           *
+ *****************************************************************************/
+
+// NPLib headers
+#include "NPVSpectra.h"
+#include "TSharcData.h"
+#include "TSharcPhysics.h"
+
+// ForwardDeclaration
+class TSharcPhysics ;
+
+class TSharcSpectra:public VSpectra {
+  public:
+    // constructor and destructor
+    TSharcSpectra();
+    TSharcSpectra(unsigned int NumberOfDetector);
+    ~TSharcSpectra();
+
+  private:
+    // Initialization methods
+    void InitRawSpectra();
+    void InitPreTreatedSpectra();
+    void InitPhysicsSpectra();
+
+  public:
+    // Filling methods
+    void FillRawSpectra(TSharcData*);
+    void FillPreTreatedSpectra(TSharcData*);
+    void FillPhysicsSpectra(TSharcPhysics*);
+
+  private: // Information on SHARC
+    unsigned int fNumberOfDetector;
+    unsigned int fStripFront;
+    unsigned int fStripBack;
+    unsigned int fPad;
+};
+
+#endif
diff --git a/NPLib/Tiara/TTiaraBarrelSpectra.cxx b/NPLib/Tiara/TTiaraBarrelSpectra.cxx
index 474356680d450084042b9c09b3d1307d9ac7f7b5..c3c7bcd957a42a4cca4e82a614fa58237f16f07e 100644
--- a/NPLib/Tiara/TTiaraBarrelSpectra.cxx
+++ b/NPLib/Tiara/TTiaraBarrelSpectra.cxx
@@ -40,6 +40,7 @@ using namespace NPUNITS;
 
 ////////////////////////////////////////////////////////////////////////////////
 TTiaraBarrelSpectra::TTiaraBarrelSpectra(){
+  SetName("TiaraBarrel");
   fNumberOfDetector= 0;
   fInnerBarrelStrip=4;
   fOuterBarrelStrip=4;
@@ -53,6 +54,7 @@ TTiaraBarrelSpectra::TTiaraBarrelSpectra(unsigned int NumberOfDetector){
       << NumberOfDetector << " Detectors" << endl
       << "************************************************" << endl ;
 
+  SetName("TiaraBarrel");
   fNumberOfDetector= NumberOfDetector;
   fInnerBarrelStrip=4;
   fOuterBarrelStrip=4;
diff --git a/NPLib/Tiara/TTiaraHyballSpectra.cxx b/NPLib/Tiara/TTiaraHyballSpectra.cxx
index 3a0ca4cf5613252559aa956ddaee8600345fc34d..dc2288b9eca17ae3b658e2461f9e5b470972948e 100644
--- a/NPLib/Tiara/TTiaraHyballSpectra.cxx
+++ b/NPLib/Tiara/TTiaraHyballSpectra.cxx
@@ -45,6 +45,7 @@ TTiaraHyballSpectra::TTiaraHyballSpectra(){
     cout << "************************************************" << endl;
   }
 
+  SetName("TiaraHyball");
   fRingsNumber   = 16;
   fSectorsNumber =  8;
   fWedgesNumber  =  6;
diff --git a/NPLib/Tigress/TTigressData.h b/NPLib/Tigress/TTigressData.h
index 016fc51c6157444b8a76c69349e33c3884c6d9d7..f1e9372219a652f6d846166a9369578c3de8194c 100644
--- a/NPLib/Tigress/TTigressData.h
+++ b/NPLib/Tigress/TTigressData.h
@@ -61,21 +61,22 @@ public:
   inline void SetGeCloverNbr(const UShort_t &GeCloverNbr){fTIG_Ge_CloverNbr.push_back(GeCloverNbr); }
   inline void SetGeCrystalNbr(const UShort_t &GeCrystalNbr){fTIG_Ge_CrystalNbr.push_back(GeCrystalNbr);}
   inline void SetGeSegmentNbr(const UShort_t &GeSegmentNbr){fTIG_Ge_SegmentNbr.push_back(GeSegmentNbr);}
-  inline void SetGeEnergy(const UShort_t &GeEnergy){fTIG_Ge_Energy.push_back(GeEnergy);}
-  inline void SetGeTimeCFD(const UShort_t &GeTimeCFD){fTIG_Ge_TimeCFD.push_back(GeTimeCFD);}
-  inline void SetGeTimeLED(const UShort_t &GeTimeLED){fTIG_Ge_TimeLED.push_back(GeTimeLED);}
+  inline void SetGeEnergy(const Double_t &GeEnergy){fTIG_Ge_Energy.push_back(GeEnergy);}
+  inline void SetGeTimeCFD(const Double_t &GeTimeCFD){fTIG_Ge_TimeCFD.push_back(GeTimeCFD);}
+  inline void SetGeTimeLED(const Double_t &GeTimeLED){fTIG_Ge_TimeLED.push_back(GeTimeLED);}
 
   inline void SetBGOCloverNbr(const UShort_t &BGOCloverNbr){fTIG_BGO_CloverNbr.push_back(BGOCloverNbr); }
   inline void SetBGOCrystalNbr(const UShort_t &BGOCrystalNbr){fTIG_BGO_CrystalNbr.push_back(BGOCrystalNbr);}
   inline void SetBGOPmNbr(const UShort_t &BGOPmNbr){fTIG_BGO_PmNbr.push_back(BGOPmNbr);}
-  inline void SetBGOEnergy(const UShort_t &BGOEnergy){fTIG_BGO_Energy.push_back(BGOEnergy);}
-  inline void SetBGOTimeCFD(const UShort_t &BGOTimeCFD){fTIG_BGO_TimeCFD.push_back(BGOTimeCFD);}
-  inline void SetBGOTimeLED(const UShort_t &BGOTimeLED){fTIG_BGO_TimeLED.push_back(BGOTimeLED);}
+  inline void SetBGOEnergy(const Double_t &BGOEnergy){fTIG_BGO_Energy.push_back(BGOEnergy);}
+  inline void SetBGOTimeCFD(const Double_t &BGOTimeCFD){fTIG_BGO_TimeCFD.push_back(BGOTimeCFD);}
+  inline void SetBGOTimeLED(const Double_t &BGOTimeLED){fTIG_BGO_TimeLED.push_back(BGOTimeLED);}
 
   /////////////////////           GETTERS           ////////////////////////
   inline UShort_t GetGeCloverNbr(const unsigned int &i)   {return fTIG_Ge_CloverNbr[i]; }
   inline UShort_t GetGeCrystalNbr(const unsigned int &i)  {return fTIG_Ge_CrystalNbr[i]; }
   inline UShort_t GetGeSegmentNbr(const unsigned int &i)  {return fTIG_Ge_SegmentNbr[i]; }
+
   inline Double_t GetGeEnergy(const unsigned int &i)      {return fTIG_Ge_Energy[i];}
   inline Double_t GetGeTimeCFD(const unsigned int &i)     {return fTIG_Ge_TimeCFD[i];}
   inline Double_t GetGeTimeLED(const unsigned int &i)     {return fTIG_Ge_TimeLED[i];}
diff --git a/NPLib/Tigress/TTigressPhysics.cxx b/NPLib/Tigress/TTigressPhysics.cxx
index fe99a5c96e2757fd7c5b128364569f9101feb272..6ff43e8a50e0c65bae5f2dada533df2ef417ef71 100644
--- a/NPLib/Tigress/TTigressPhysics.cxx
+++ b/NPLib/Tigress/TTigressPhysics.cxx
@@ -34,57 +34,84 @@ using namespace std;
 #include "TAsciiFile.h"
 //   ROOT
 #include "TChain.h"
+#include "TLorentzVector.h"
 ///////////////////////////////////////////////////////////////////////////
 
 ClassImp(TTigressPhysics)
-///////////////////////////////////////////////////////////////////////////
-TTigressPhysics::TTigressPhysics()  {
-  m_EventData         = new TTigressData ;
-  m_PreTreatedData    = new TTigressData ;
-  m_EventPhysics      = this ;
-  Clear();
-};
+  ///////////////////////////////////////////////////////////////////////////
+  TTigressPhysics::TTigressPhysics()  {
+    m_EventData         = new TTigressData ;
+    m_PreTreatedData    = new TTigressData ;
+    m_EventPhysics      = this ;
+    Clear();
+  };
 
 
 /////////////////////////////////////////////////
 void TTigressPhysics::BuildPhysicalEvent(){
   PreTreat();
- 
-  if(m_EventData->GetMultiplicityGe()<10){
-    for(unsigned int i = 0 ; i < m_EventData->GetMultiplicityGe() ; i++){
-      if( m_EventData->GetGeSegmentNbr(i)==9 && m_EventData->GetGeEnergy(i)>20){
-        Gamma_Energy.push_back( m_EventData->GetGeEnergy(i));
-        Crystal_Number.push_back( m_EventData->GetGeCrystalNbr(i));
-        Clover_Number.push_back( m_EventData->GetGeCloverNbr(i));
-        
-        // Look for Associate BGO
-        bool BGOcheck = false ;
-        for(unsigned j = 0 ;  j <  m_EventData->GetMultiplicityBGO() ; j++){
+
+  for(unsigned int i = 0 ; i < m_EventData->GetMultiplicityGe() ; i++){
+    if( m_EventData->GetGeSegmentNbr(i)==0 && m_EventData->GetGeEnergy(i)>20){
+      int clover = m_EventData->GetGeCloverNbr(i);
+      int cry = m_EventData->GetGeCrystalNbr(i);
+      double Energy =  CalibrationManager::getInstance()->ApplyCalibration("TIGRESS/D"+ NPL::itoa(clover)+"_CRY"+ NPL::itoa(cry)+"_SEG"+ NPL::itoa(m_EventData->GetGeSegmentNbr(i))+"_E", m_EventData->GetGeEnergy(i));
+      Gamma_Energy.push_back(Energy);
+      Crystal_Number.push_back(m_EventData->GetGeCrystalNbr(i));
+      Clover_Number.push_back(m_EventData->GetGeCloverNbr(i));
+      Gamma_Time.push_back(m_EventData->GetGeTimeCFD(i));
+      // Look for Associate BGO
+      bool BGOcheck = false ;
+      for(unsigned j = 0 ;  j <  m_EventData->GetMultiplicityBGO() ; j++){
+
+        if( m_EventData->GetBGOCloverNbr(j)== m_EventData->GetGeCloverNbr(i) && m_EventData->GetBGOEnergy(j)>20 )
+          BGOcheck = true ;
+      }
+      BGO.push_back(BGOcheck);
+    }
+  }
+
+  map<int, double> map_E;
+  for(unsigned int i = 0 ; i < 16 ; i ++) {
+    unsigned int mysize = Gamma_Energy.size();
+    for(unsigned int g = 0 ; g < mysize ; g++){
+      if(Clover_Number[g] == i+1){
+        map_E[i] += Gamma_Energy[g]  ; 
+      }
+    }
+  }
+
+
+  for(unsigned int i = 0 ; i < 16 ; i ++) {
+    if(map_E[i]>0){
+      AddBack_E.push_back(map_E[i]);
+      if(i>12){
+        TLorentzVector GammaLV( map_E[i]*sin(135*3.1459/180.),
+            map_E[i]*sin(135*3.1459/180.),
+            map_E[i]*cos(135*3.1459/180.),
+            map_E[i]);
         
-          if( m_EventData->GetBGOCloverNbr(j)== m_EventData->GetGeCloverNbr(i) && m_EventData->GetBGOEnergy(j)>20 )
-             BGOcheck = true ;
-        }
-        BGO.push_back(BGOcheck);
+        GammaLV.Boost(0,0,-0.12);
+        AddBack_DC.push_back(GammaLV.Energy());
       }
+      else
+         AddBack_DC.push_back(map_E[i]); 
     }
-  
   }
-  
-  
 
 }
 /////////////////////////////////////////////////
 TVector3 TTigressPhysics::GetPositionOfInteraction(int i){
-   TVector3 dummy;
+  TVector3 dummy;
 
-   return dummy;
+  return dummy;
 }
 /////////////////////////////////////////////////
 void TTigressPhysics::PreTreat(){
 
 
 } 
- 
+
 /////////////////////////////////////////////////
 void TTigressPhysics::Clear() {
 };
@@ -94,12 +121,12 @@ void TTigressPhysics::Clear() {
 void TTigressPhysics::ReadConfiguration(string Path)  {
   ifstream ConfigFile           ;
   ConfigFile.open(Path.c_str()) ;
-  
+
   if(!ConfigFile.is_open()) cout << "Config File not Found" << endl ;
-  
+
   string LineBuffer             ;
   string DataBuffer             ;
-     
+
   bool check_CloverId= false          ;
   bool check_R= false          ; 
   bool check_Theta= false          ;
@@ -112,105 +139,122 @@ void TTigressPhysics::ReadConfiguration(string Path)  {
   double Phi=0;
 
   while (!ConfigFile.eof()) {
-    
+
     getline(ConfigFile, LineBuffer);
     //   If line is a Start Up Tigress bloc, Reading toggle to true      
     if (LineBuffer.compare(0, 13, "TigressClover") == 0) {
       cout << "///" << endl ;
       cout << "Tigress Clover found: " << endl ;        
       ReadingStatus = true ;
-     }
+    }
     //   Else don't toggle to Reading Block Status
     else ReadingStatus = false ;
 
     //   Reading Block
     while(ReadingStatus)  {
       // Pickup Next Word 
- 
+
       ConfigFile >> DataBuffer ;
       //   Comment Line 
-             
+
       if (DataBuffer.compare(0, 1, "%") == 0) {ConfigFile.ignore ( std::numeric_limits<std::streamsize>::max(), '\n' );}
-    
+
       //   Finding another Clover toggle out (safety)
       else if (DataBuffer.compare(0, 13, "TigressClover") == 0) {
         cout << "WARNING: Another Detector is find before standard sequence of Token, Error may occured in Clover definition" << endl ;
         ReadingStatus = false ;
-       }
+      }
 
       else if (DataBuffer=="CloverId=") {
         check_CloverId = true;
         ConfigFile >> DataBuffer ;
         CloverId=atoi(DataBuffer.c_str());
         cout << "CloverId:  " << CloverId << endl;
-       }
-               
+      }
+
       else if (DataBuffer=="R=") {
         check_R = true;
         ConfigFile >> DataBuffer ;
         R = atof(DataBuffer.c_str());
         cout << "R:  " << R << "mm" << endl;
-       }
-               
-       else if (DataBuffer=="Theta=") {
+      }
+
+      else if (DataBuffer=="Theta=") {
         check_Theta = true;
         ConfigFile >> DataBuffer ;
         Theta = atof(DataBuffer.c_str());
         cout << "Theta:  " << Theta << "deg" << endl;
-       }
+      }
 
-       else if (DataBuffer=="Phi=") {
+      else if (DataBuffer=="Phi=") {
         check_Phi = true;
         ConfigFile >> DataBuffer ;
         Phi = atof(DataBuffer.c_str());
         cout << "Phi:  " << Phi << "deg" << endl;
-       }
-                                                
-       ///////////////////////////////////////////////////
-       //   If no Detector Token and no comment, toggle out
+      }
+
+      ///////////////////////////////////////////////////
+      //   If no Detector Token and no comment, toggle out
       else {
         ReadingStatus = false; cout << "Wrong Token Sequence: Getting out " << DataBuffer << endl ;}
-        /////////////////////////////////////////////////
-        //   If All necessary information there, toggle out
-        if ( check_Theta && check_Phi && check_R && check_CloverId) { 
-          ReadingStatus = false;
-           check_CloverId= false;
-           check_R= false; 
-           check_Theta= false;
-           check_Phi= false;
-        }
+      /////////////////////////////////////////////////
+      //   If All necessary information there, toggle out
+      if ( check_Theta && check_Phi && check_R && check_CloverId) { 
+        ReadingStatus = false;
+        check_CloverId= false;
+        check_R= false; 
+        check_Theta= false;
+        check_Phi= false;
       }
     }
- }
- 
+  }
+}
+
 ///////////////////////////////////////////////////////////////////////////
 void TTigressPhysics::InitializeRootInputRaw() 
-   {
-      TChain* inputChain = RootInput::getInstance()->GetChain()   ;
-      inputChain->SetBranchStatus( "Tigress" , true )               ;
-      inputChain->SetBranchStatus( "fTIG_*" , true )               ;
-      inputChain->SetBranchAddress( "Tigress" , &m_EventData )      ;
-   }
-   
+{
+  TChain* inputChain = RootInput::getInstance()->GetChain()   ;
+  inputChain->SetBranchStatus( "Tigress" , true )               ;
+  inputChain->SetBranchStatus( "fTIG_*" , true )               ;
+  inputChain->SetBranchAddress( "Tigress" , &m_EventData )      ;
+}
+
 ///////////////////////////////////////////////////////////////////////////
 void TTigressPhysics::InitializeRootOutput()    
-   {
-      TTree* outputTree = RootOutput::getInstance()->GetTree();
-      outputTree->Branch( "Tigress" , "TTigressPhysics" , &m_EventPhysics );
-   }
- ///////////////////////////////////////////////////////////////////////////  
+{
+  TTree* outputTree = RootOutput::getInstance()->GetTree();
+  outputTree->Branch( "Tigress" , "TTigressPhysics" , &m_EventPhysics );
+}
+///////////////////////////////////////////////////////////////////////////  
 void TTigressPhysics::ClearEventPhysics() {
   Gamma_Energy.clear();
+  Gamma_Time.clear();
   Crystal_Number.clear();
   Clover_Number.clear();
   BGO.clear();
+  AddBack_E.clear();
+  AddBack_DC.clear();
 }
- ///////////////////////////////////////////////////////////////////////////  
+///////////////////////////////////////////////////////////////////////////  
 void TTigressPhysics::ClearEventData() {
 
-m_EventData->Clear();
-m_PreTreatedData->Clear();
+  m_EventData->Clear();
+  m_PreTreatedData->Clear();
 }
+///////////////////////////////////////////////////////////////////////////
+void TTigressPhysics::AddParameterToCalibrationManager(){
+  CalibrationManager* Cal = CalibrationManager::getInstance();
+  for(int i = 0 ; i < 16; ++i){
+    for(int cry = 0 ; cry < 4 ; cry++){
+      // core are 0 and 9 , segment 1 to 8
+      for( int j = 0 ; j < 10 ; ++j){
+        Cal->AddParameter("TIGRESS", "D"+ NPL::itoa(i+1)+"_CRY"+NPL::itoa(cry+1)+"_SEG"+ NPL::itoa(j)+"_E","TIGRESS_D"+ NPL::itoa(i+1)+"_CRY"+NPL::itoa(cry+1)+"_SEG"+NPL::itoa(j)+"_E");
+      }
+    }
+  } 
+  return;
+}
+
 
 ////////////////////////////////////////////////////////////////////////////////
 //            Construct Method to be pass to the DetectorFactory              //
diff --git a/NPLib/Tigress/TTigressPhysics.h b/NPLib/Tigress/TTigressPhysics.h
index 71c80a67866133c3ca3f50c961bd9de6d2f6e902..72783f7210e16359ddaaa412fd64acc3d7c77471 100644
--- a/NPLib/Tigress/TTigressPhysics.h
+++ b/NPLib/Tigress/TTigressPhysics.h
@@ -48,7 +48,7 @@ class TTigressPhysics :  public TObject, public NPL::VDetector{
      void ReadConfiguration(string);
 
     //   Add Parameter to the CalibrationManger
-     void AddParameterToCalibrationManager(){} ;      
+     void AddParameterToCalibrationManager();      
 
     //   Activated associated Branches and link it to the private member DetectorData address
     //   In this method mother Branches (Detector) AND daughter leaf (fDetector_parameter) have to be activated
@@ -87,7 +87,10 @@ class TTigressPhysics :  public TObject, public NPL::VDetector{
     vector<int> Crystal_Number;
      vector<int> Clover_Number;
     vector<bool>   BGO;
-    
+   vector<double>   Gamma_Time;
+  vector<double> AddBack_E;   
+  vector<double> AddBack_DC;   
+
    public:
     TVector3 GetPositionOfInteraction(int i) ;
     
diff --git a/NPLib/Trifoil/TTrifoilData.cxx b/NPLib/Trifoil/TTrifoilData.cxx
index 6967214e03c83734854011c32578f272118a44be..2b24e37a1abb30ba9e4011aaafb9fed76c838258 100644
--- a/NPLib/Trifoil/TTrifoilData.cxx
+++ b/NPLib/Trifoil/TTrifoilData.cxx
@@ -36,24 +36,19 @@ using namespace std;
 ClassImp(TTrifoilData)
 
 /////////////////////////
-TTrifoilData::TTrifoilData()
-{
-
+TTrifoilData::TTrifoilData(){
 }
 
 /////////////////////////
-TTrifoilData::~TTrifoilData()
-{
+TTrifoilData::~TTrifoilData(){
 }
 
 /////////////////////////
-void TTrifoilData::Clear()
-{
+void TTrifoilData::Clear(){
   fTrifoil_Waveform.clear();
   fTrifoil_TimeCFD.clear();
   fTrifoil_TimeLED.clear();
 }
 /////////////////////////
-void TTrifoilData::Dump() const
-{
+void TTrifoilData::Dump() const{
 }
diff --git a/NPLib/Trifoil/TTrifoilData.h b/NPLib/Trifoil/TTrifoilData.h
index ebb87b4756cad5ea1b58dfa97c419cf5e413573a..2bba4f8afbb9591380232f5ca13f832ea56e38a1 100644
--- a/NPLib/Trifoil/TTrifoilData.h
+++ b/NPLib/Trifoil/TTrifoilData.h
@@ -59,7 +59,7 @@ public:
   inline Double_t GetTimeCFD(const unsigned int &i) {return fTrifoil_TimeCFD[i];}
   inline Double_t GetTimeLED(const unsigned int &i) {return fTrifoil_TimeLED[i];}
 
-  inline unsigned int GetMultiplicity() {return fTrifoil_TimeCFD.size();}
+  inline unsigned int GetMultiplicity() {return fTrifoil_Waveform.size();}
   ClassDef(TTrifoilData,1)  // TrifoilData structure
 };
 
diff --git a/NPLib/Trifoil/TTrifoilPhysics.cxx b/NPLib/Trifoil/TTrifoilPhysics.cxx
index e278a39285cbf78f216eb791c0f8c7ffbe53e52b..a898700fa92a7952fae32c7a104fdc9eb5bd4bd6 100644
--- a/NPLib/Trifoil/TTrifoilPhysics.cxx
+++ b/NPLib/Trifoil/TTrifoilPhysics.cxx
@@ -37,73 +37,76 @@
 ///////////////////////////////////////////////////////////////////////////
 
 ClassImp(TTrifoilPhysics)
+  ///////////////////////////////////////////////////////////////////////////
+  TTrifoilPhysics::TTrifoilPhysics() { 
+    m_EventPhysics = this;
+    m_EventData = new TTrifoilData();
+  }
+
 ///////////////////////////////////////////////////////////////////////////
-TTrifoilPhysics::TTrifoilPhysics() 
-   { 
-      
-   }
-      
-///////////////////////////////////////////////////////////////////////////
-void TTrifoilPhysics::BuildSimplePhysicalEvent()
-   { 
-     BuildPhysicalEvent();
-   }
-   
+void TTrifoilPhysics::BuildSimplePhysicalEvent(){ 
+  BuildPhysicalEvent();
+}
+
 ///////////////////////////////////////////////////////////////////////////
-   
-void TTrifoilPhysics::BuildPhysicalEvent()
-   { 
-  
-   }
+void TTrifoilPhysics::BuildPhysicalEvent(){ 
+  unsigned int mysize = m_EventData->GetMultiplicity();
+
+  for (unsigned int i = 0 ; i < mysize ; i++){
+    TH1F h = m_EventData->GetWaveform(i);
+    unsigned int bins = h.GetNbinsX();
+    for(unsigned int b = 1 ; b < bins ; b++){
+      double diff =  h.GetBinContent(b)-h.GetBinContent(b+1);
+        if(diff<-1000){
+          Time.push_back(b); 
+          Energy.push_back(diff);
+        }
+      }
+    }
+  }
 
 
 ///////////////////////////////////////////////////////////////////////////
 void TTrifoilPhysics::Clear(){
-  EventType.clear() ;
+  Energy.clear() ;
   Time.clear() ;
-  m_EventData->Clear();
-
 }
 ///////////////////////////////////////////////////////////////////////////
 
 ////   Innherited from VDetector Class   ////            
-            
+
 ///////////////////////////////////////////////////////////////////////////
-void TTrifoilPhysics::ReadConfiguration(string Path)  
-{
- /*Trifoil has only one key word, so do nothing*/
+void TTrifoilPhysics::ReadConfiguration(string Path)  {
+  /*Trifoil has only one key word, so do nothing*/
   Path.clear();
 }
 
 ///////////////////////////////////////////////////////////////////////////
-void TTrifoilPhysics::AddParameterToCalibrationManager()   
-   {
-   
-   }
+void TTrifoilPhysics::AddParameterToCalibrationManager()   {
+}
 
 ///////////////////////////////////////////////////////////////////////////
-void TTrifoilPhysics::InitializeRootInputRaw() 
-   {
-      TChain* inputChain = RootInput::getInstance()->GetChain()   ;
-      inputChain->SetBranchStatus( "Trifoil" , true )               ;
-      inputChain->SetBranchStatus( "fTrifoil_*" , true )               ;
-      inputChain->SetBranchAddress( "Trifoil" , &m_EventData )      ;
-   }
-   
+void TTrifoilPhysics::InitializeRootInputRaw(){
+  TChain* inputChain = RootInput::getInstance()->GetChain();
+  static UInt_t* found =  new UInt_t[100] ;
+  inputChain->SetBranchStatus( "Trifoil" , true );
+  inputChain->SetBranchStatus( "fTrifoil_*" , true , found);
+  inputChain->SetBranchAddress( "Trifoil" , &m_EventData );
+}
+
 ///////////////////////////////////////////////////////////////////////////
-void TTrifoilPhysics::InitializeRootInputPhysics() 
-   {
-      TChain* inputChain = RootInput::getInstance()->GetChain();
-      inputChain->SetBranchStatus( "EventType" , true );
-      inputChain->SetBranchStatus( "Time" , true );
-   }
+void TTrifoilPhysics::InitializeRootInputPhysics(){
+  TChain* inputChain = RootInput::getInstance()->GetChain();
+  inputChain->SetBranchStatus("EventType",true);
+  inputChain->SetBranchStatus("Time",true);
+  inputChain->SetBranchAddress("Trifoil",&m_EventPhysics);
+}
 
 ///////////////////////////////////////////////////////////////////////////
-void TTrifoilPhysics::InitializeRootOutput()    
-   {
-      TTree* outputTree = RootOutput::getInstance()->GetTree();
-      outputTree->Branch( "Trifoil" , "TTrifoilPhysics" , &m_EventPhysics );
-   }
+void TTrifoilPhysics::InitializeRootOutput(){
+  TTree* outputTree = RootOutput::getInstance()->GetTree();
+  outputTree->Branch( "Trifoil" , "TTrifoilPhysics" , &m_EventPhysics );
+}
 ////////////////////////////////////////////////////////////////////////////////
 //            Construct Method to be pass to the DetectorFactory              //
 ////////////////////////////////////////////////////////////////////////////////
diff --git a/NPLib/Trifoil/TTrifoilPhysics.h b/NPLib/Trifoil/TTrifoilPhysics.h
index 8d490f715be683a8cd5a4eb8063b7b70e97bf8f8..ba92c5f75b0664be3b0376718c47b8d1b530557f 100644
--- a/NPLib/Trifoil/TTrifoilPhysics.h
+++ b/NPLib/Trifoil/TTrifoilPhysics.h
@@ -48,7 +48,7 @@ class TTrifoilPhysics : public TObject, public NPL::VDetector
          
    public:
       // EventType is True if the wave form analysis return a valid Trifoil event
-      vector<bool>    EventType ;
+      vector<double>    Energy;
       vector<double>  Time ;
   
    public:      //   Innherited from VDetector Class
diff --git a/NPLib/Utility/CMakeLists.txt b/NPLib/Utility/CMakeLists.txt
index 1fcab31d014f5dac2874796afc8a71a45b3a5f32..2263ce4d87154df849aad832a2e8939f720cdcb4 100644
--- a/NPLib/Utility/CMakeLists.txt
+++ b/NPLib/Utility/CMakeLists.txt
@@ -2,4 +2,6 @@ add_executable(nptool-installer nptool-installer.cxx)
 target_link_libraries(nptool-installer ${ROOT_LIBRARIES} NPCore) 
 add_executable(npanalysis npanalysis.cxx)
 target_link_libraries(npanalysis ${ROOT_LIBRARIES} NPCore NPInitialConditions NPInteractionCoordinates) 
-install(PROGRAMS nptool-installer npanalysis DESTINATION ${CMAKE_BINARY_OUTPUT_DIRECTORY})
+add_executable(nponline nponline.cxx)
+target_link_libraries(nponline ${ROOT_LIBRARIES} NPCore) 
+install(PROGRAMS nptool-installer npanalysis nponline DESTINATION ${CMAKE_BINARY_OUTPUT_DIRECTORY})
diff --git a/NPLib/Utility/npanalysis.cxx b/NPLib/Utility/npanalysis.cxx
index 9b115d43e87eeeaf4c0f892385758f8e2949f286..2aa202ac6e343df60c1ec7b4ec25eb2f6e775282 100644
--- a/NPLib/Utility/npanalysis.cxx
+++ b/NPLib/Utility/npanalysis.cxx
@@ -11,6 +11,10 @@
 #include<stdio.h>
 #include<dlfcn.h>
 #include<stdlib.h>
+#include<unistd.h>
+
+// Root
+#include"TKey.h"
 
 #ifndef SHARED_LIB_EXTENSION_GLOB
 #define SHARED_LIB_EXTENSION_GLOB
@@ -64,7 +68,7 @@ int main(int argc , char** argv){
     if(myOptionManager->IsDefault("OutputFileName"))
       OutputfileName="PhysicsTree";
   }
-  
+
   // Case of Result tree produced
   else{
     TreeName="ResultTree";
@@ -99,13 +103,20 @@ int main(int argc , char** argv){
     }
   }
 
+  if(myOptionManager->GetOnline()){
+    // Request Detector manager to give the Spectra to the server
+    myDetector->SetSpectraServer(); 
+  }
+
   std::cout << std::endl << "///////// Starting Analysis ///////// "<< std::endl;
   TChain* Chain = RootInput:: getInstance()->GetChain();
   myOptionManager->GetNumberOfEntryToAnalyse();
   int nentries = Chain->GetEntries();
   if(nentries> myOptionManager->GetNumberOfEntryToAnalyse() && myOptionManager->GetNumberOfEntryToAnalyse()>0)
-    nentries = myOptionManager->GetNumberOfEntryToAnalyse() ;  
-  std::cout << " Number of Event to be treated : " << nentries << std::endl;
+    nentries = myOptionManager->GetNumberOfEntryToAnalyse() ; 
+
+  TString ChainName = Chain->GetName();
+  std::cout << " Number of Event to be treated : " << nentries << " on chain " << ChainName << std::endl;
 
   unsigned int inter = 0;
   unsigned int treated = 0;
@@ -113,7 +124,7 @@ int main(int argc , char** argv){
   int displayed=0;
   clock_t end;
   clock_t begin = clock();
-
+  int new_nentries = 0 ;
   bool IsPhysics = myOptionManager->GetInputPhysicalTreeOption();
 
   if(UserAnalysis==NULL){ 
@@ -125,13 +136,33 @@ int main(int argc , char** argv){
         myDetector->BuildPhysicalEvent();
         // Fill the tree
         tree->Fill();
+
         ProgressDisplay(begin,end,treated,inter,nentries,mean_rate,displayed);
+        if(myOptionManager->GetOnline() && i%10000==0){
+          bool first = true;
+          while(!Chain || first){
+            first = false;
+            myDetector->CheckSpectraServer();
+            RootInput::getInstance()->GetFile()->ReadKeys(kTRUE);
+
+            Chain = (TChain*)  RootInput::getInstance()->GetFile()->FindKeyAny(ChainName)->ReadObj();    
+            new_nentries = Chain->GetEntries();
+            if(new_nentries!=nentries){
+              RootInput::getInstance()->SetChain(Chain);
+              myDetector->InitializeRootInput();
+              nentries = Chain->GetEntries();
+            }
+            else{
+              first = true;
+            }
+          }
+        }
       }
     }
-    
+
     else{
-     cout << "\033[1;31m ERROR: You are requesting to rebuild a Physics Tree without any User Analysis, nothing to be done\033[0m" <<endl;
-     exit(1);
+      cout << "\033[1;31m ERROR: You are requesting to rebuild a Physics Tree without any User Analysis, nothing to be done\033[0m" <<endl;
+      exit(1);
     }
   }
 
@@ -147,6 +178,25 @@ int main(int argc , char** argv){
         // Fill the tree      
         tree->Fill();
         ProgressDisplay(begin,end,treated,inter,nentries,mean_rate,displayed);
+        if(myOptionManager->GetOnline() && i%10000==0){
+          bool first = true;
+          while(!Chain || first){
+            first = false;
+            myDetector->CheckSpectraServer();
+            RootInput::getInstance()->GetFile()->ReadKeys(kTRUE);
+
+            Chain = (TChain*)  RootInput::getInstance()->GetFile()->FindKeyAny(ChainName)->ReadObj();    
+            new_nentries = Chain->GetEntries();
+            if(new_nentries!=nentries){
+              RootInput::getInstance()->SetChain(Chain);
+              myDetector->InitializeRootInput();
+              nentries = Chain->GetEntries();
+            }
+            else{
+              first = true;
+            }
+          }
+        }      
       }
     }
 
@@ -159,6 +209,25 @@ int main(int argc , char** argv){
         // Fill the tree      
         tree->Fill();
         ProgressDisplay(begin,end,treated,inter,nentries,mean_rate,displayed);
+        if(myOptionManager->GetOnline() && i%10000==0){
+          bool first = true;
+          while(!Chain || first){
+            first = false;
+            myDetector->CheckSpectraServer();
+            RootInput::getInstance()->GetFile()->ReadKeys(kTRUE);
+
+            Chain = (TChain*)  RootInput::getInstance()->GetFile()->FindKeyAny(ChainName)->ReadObj();    
+            new_nentries = Chain->GetEntries();
+            if(new_nentries!=nentries){
+              RootInput::getInstance()->SetChain(Chain);
+              myDetector->InitializeRootInput();
+              nentries = Chain->GetEntries();
+            }
+            else{
+              first = true;
+            }
+          }
+        }      
       }
     }
     UserAnalysis->End();
@@ -168,11 +237,18 @@ int main(int argc , char** argv){
   myDetector->StopThread();
 #endif
   ProgressDisplay(begin,end,treated,inter,nentries,mean_rate,displayed);
+
+  if(myOptionManager->GetOnline()){
+    myDetector->CheckSpectraServer(); 
+  }
+
+
   if(myOptionManager->GetGenerateHistoOption())
     myDetector->WriteSpectra();
-  
+
   RootOutput::getInstance()->Destroy();
   RootInput::getInstance()->Destroy();
+
   return 0;
 }
 
diff --git a/NPLib/Utility/nponline.cxx b/NPLib/Utility/nponline.cxx
new file mode 100644
index 0000000000000000000000000000000000000000..a24338e94dff13c0250597e47f19c2846609526f
--- /dev/null
+++ b/NPLib/Utility/nponline.cxx
@@ -0,0 +1,15 @@
+#include"TApplication.h"
+#include"NPOnline.h"
+#include<cstdlib>
+int main(int argc , char** argv){
+  TApplication* app = new TApplication("NPOnline",0,0);
+  if(argc==3){
+   NPL::NPOnline* instance = new NPL::NPOnline(argv[1],std::atoi(argv[2]));
+  }
+  else{
+    NPL::NPOnline* instance = new NPL::NPOnline();
+  }
+  app->Run();
+  return 0;
+}
+
diff --git a/NPLib/scripts/NPToolLogon.C b/NPLib/scripts/NPToolLogon.C
index 1a0adcb649ad22123d038ae5aaf9176758cbbea2..fbec3b59098a47d96c15f1a091b475a6ca34a5a3 100644
--- a/NPLib/scripts/NPToolLogon.C
+++ b/NPLib/scripts/NPToolLogon.C
@@ -49,13 +49,22 @@ std::string LOGON_LIB_EXTENSION = ".so";
 #endif
 
 
-void NPToolLogon(){
+//#include "Style_nptool.C"
+
+void NPToolLogon(){ 
+  // Create the NPTool Stype
+  TString NPLPath = gSystem->Getenv("NPTOOL");  
+  gROOT->ProcessLine(Form(".x %s/NPLib/scripts/Style_nptool.C",NPLPath.Data()));
+  gROOT->ProcessLine(Form(".x %s/NPLib/scripts/Style_nponline.C",NPLPath.Data()));
+
+
+
   // Change the standard random generator to TRandom2
   gRandom = new TRandom2();
 
   TString currentpath = gSystem->Getenv("PWD");
   TString path = gSystem->Getenv("NPTOOL");
-
+ 
   // Add include path
   gROOT->ProcessLine(Form(".include %s/NPLib/include", path.Data()));
 
diff --git a/NPLib/scripts/Style_nponline.C b/NPLib/scripts/Style_nponline.C
new file mode 100644
index 0000000000000000000000000000000000000000..66b19c638db593304496587060690f351b091ed3
--- /dev/null
+++ b/NPLib/scripts/Style_nponline.C
@@ -0,0 +1,92 @@
+#include "TStyle.h"
+#include "TColor.h"
+void Style_nponline(){
+  //-----------------------------------
+  // standardised nptool root style
+  // produce minimalist publication ready
+  // outlook with nptool color scheme
+  //-----------------------------------
+  TStyle* style_nponline = new TStyle("nponline", "style_nponline");
+
+  //General 
+  style_nponline->SetFrameFillColor(kGray+3);	
+  style_nponline->SetFrameBorderMode(0);	
+  style_nponline->SetFrameLineColor(kGray+3);
+  style_nponline->SetStatColor(kGray+3);	
+  style_nponline->SetFillColor(kGray+3); 
+  style_nponline->SetTitleFillColor(kGray+3);  
+  style_nponline->SetTitleColor(kWhite,"pad");
+  style_nponline->SetTitleBorderSize(0);
+  style_nponline->SetTextColor(kWhite);
+
+
+  // Canvas
+  style_nponline->SetCanvasColor(kGray+3);	
+  style_nponline->SetCanvasDefH(800);
+  style_nponline->SetCanvasDefW(800);
+  style_nponline->SetCanvasBorderMode(0);	
+  
+  // Pad
+  style_nponline->SetPadBottomMargin(0.10);
+  style_nponline->SetPadLeftMargin(0.15);
+  style_nponline->SetPadTopMargin(0.10);
+  style_nponline->SetPadRightMargin(0.15);
+  style_nponline->SetPadBorderMode(0);	
+  style_nponline->SetPadBorderSize(1);
+  style_nponline->SetPadColor(kGray+3);		
+  style_nponline->SetPadTickX(1);
+  style_nponline->SetPadTickY(1);
+
+  // Desable stat title and fit  
+  style_nponline->SetOptStat(0);
+  style_nponline->SetOptTitle(1);
+  style_nponline->SetOptFit(1);		
+
+  // x axis
+  style_nponline->SetAxisColor(kWhite,"X");
+  style_nponline->SetLabelColor(kWhite,"X");
+  style_nponline->SetTitleXSize(0.06);     
+  style_nponline->SetTitleXOffset(1.0);     
+  style_nponline->SetLabelOffset(0.1,"X");   
+  style_nponline->SetLabelSize(0.06,"X");
+  style_nponline->SetLabelOffset(0.006,"X");
+
+  // y axis
+  style_nponline->SetTitleYSize(0.06);  
+  style_nponline->SetTitleYOffset(1.1);  
+  style_nponline->SetLabelOffset(0.1,"Y");
+  style_nponline->SetLabelSize(0.06,"Y");
+  style_nponline->SetLabelOffset(0.006,"Y");
+  style_nponline->SetAxisColor(kWhite,"Y");
+  style_nponline->SetLabelColor(kWhite,"Y");
+
+  // z axis
+  style_nponline->SetAxisColor(kWhite,"Z");
+  style_nponline->SetLabelSize(0.06,"Z");
+  style_nponline->SetLabelOffset(0.006,"Z");
+  style_nponline->SetLabelColor(kWhite,"Z");
+
+
+  // Histogramm
+  style_nponline->SetHistLineColor(kAzure+7);
+  style_nponline->SetHistFillStyle(1001);
+  style_nponline->SetHistFillColor(kAzure+7);
+  style_nponline->SetMarkerColor(kOrange+7);
+  style_nponline->SetMarkerStyle(20);
+  style_nponline->SetLineColor(kOrange+7);
+  style_nponline->SetLineWidth(1);
+  style_nponline->SetFuncColor(kOrange+7);
+  style_nponline->SetFuncWidth(2);
+
+  style_nponline->SetTitlePS("nptool");
+
+  const UInt_t Number = 4;
+  Double_t Red[Number]    = { 0,0.22,  0.5*0,     0   };
+  Double_t Green[Number]  = { 0,0.22,  0.5*0.8,   0.8 };
+  Double_t Blue[Number]   = { 0,0.22,  0.5*1.00,  1.00 };
+
+  Double_t Length[Number] = { 0, 0.5,0.5,1.00 };
+  Int_t nb=255;
+  TColor::CreateGradientColorTable(Number,Length,Red,Green,Blue,nb);
+  style_nponline->SetNumberContours(99);
+}
diff --git a/NPLib/scripts/Style_nptool.C b/NPLib/scripts/Style_nptool.C
new file mode 100644
index 0000000000000000000000000000000000000000..d6960b6cd055cd40953d747050db441dd5c49c13
--- /dev/null
+++ b/NPLib/scripts/Style_nptool.C
@@ -0,0 +1,82 @@
+#include "TStyle.h"
+#include "TColor.h"
+void Style_nptool(){
+  //-----------------------------------
+  // standardised nptool root style
+  // produce minimalist publication ready
+  // outlook with nptool color scheme
+  //-----------------------------------
+  TStyle* style_nptool = new TStyle("nptool", "style_nptool");
+
+  //General 
+  style_nptool->SetFrameFillColor(kWhite);	
+  style_nptool->SetFrameBorderMode(0);	
+  style_nptool->SetFrameLineColor(kBlack);
+  style_nptool->SetStatColor(kWhite);	
+  style_nptool->SetFillColor(kWhite); 
+  style_nptool->SetTitleFillColor(kWhite);  
+
+  // Canvas
+  style_nptool->SetCanvasColor(kWhite);	
+  style_nptool->SetCanvasDefH(800);
+  style_nptool->SetCanvasDefW(800);
+  style_nptool->SetCanvasBorderMode(0);	
+
+  // Pad
+  style_nptool->SetPadBottomMargin(0.15);
+  style_nptool->SetPadLeftMargin(0.15);
+  style_nptool->SetPadTopMargin(0.05);
+  style_nptool->SetPadRightMargin(0.10);
+  style_nptool->SetPadBorderMode(0);	
+  style_nptool->SetPadBorderSize(1);
+  style_nptool->SetPadColor(kWhite);		
+  style_nptool->SetPadTickX(1);
+  style_nptool->SetPadTickY(1);
+
+  // Desable stat title and fit  
+  style_nptool->SetOptStat(0);
+  style_nptool->SetOptTitle(0);
+  style_nptool->SetOptFit(0);		
+
+  // x axis
+  style_nptool->SetTitleXSize(0.06);     
+  style_nptool->SetTitleXOffset(1.0);     
+  style_nptool->SetLabelOffset(0.1,"X");   
+  style_nptool->SetLabelSize(0.04,"X");
+  style_nptool->SetLabelOffset(0.006,"X");
+
+  // y axis
+  style_nptool->SetTitleYSize(0.06);  
+  style_nptool->SetTitleYOffset(1.1);  
+  style_nptool->SetLabelOffset(0.1,"Y");
+  style_nptool->SetLabelSize(0.04,"Y");
+  style_nptool->SetLabelOffset(0.006,"Y");
+
+  // z axis
+  style_nptool->SetLabelSize(0.04,"Z");
+  style_nptool->SetLabelOffset(0.006,"Z");
+
+
+  // Histogramm
+  style_nptool->SetHistLineColor(kAzure+7);
+  style_nptool->SetHistFillStyle(1001);
+  style_nptool->SetHistFillColor(kAzure+7);
+  style_nptool->SetMarkerColor(kOrange+7);
+  style_nptool->SetMarkerStyle(20);
+  style_nptool->SetLineColor(kOrange+7);
+  style_nptool->SetLineWidth(2);
+  style_nptool->SetFuncColor(kOrange+7);
+  style_nptool->SetFuncWidth(2);
+
+  style_nptool->SetTitlePS("nptool");
+
+  const UInt_t Number = 4;
+  Double_t Red[Number]    = { 0,0.22,  0.5*0,     0   };
+  Double_t Green[Number]  = { 0,0.22,  0.5*0.8,   0.8 };
+  Double_t Blue[Number]   = { 0,0.22,  0.5*1.00,  1.00 };
+
+  Double_t Length[Number] = { 0, 0.5,0.5,1.00 };
+  Int_t nb=255;
+  TColor::CreateGradientColorTable(Number,Length,Red,Green,Blue,nb);
+  style_nptool->SetNumberContours(99);
+}
diff --git a/NPLib/scripts/build_dict.sh b/NPLib/scripts/build_dict.sh
index 2064d315c3e27399cc0e1ae9b656603a8af3a7bb..6d27743508fea911e28da9dcf411cf864f234be5 100755
--- a/NPLib/scripts/build_dict.sh
+++ b/NPLib/scripts/build_dict.sh
@@ -50,13 +50,13 @@ fi
 # Version 5 : generate the dictionnary then the libmap
 if [ $version_major -eq 5 ]
   then
-    rootcint -f $2 -c -I../Core $1 $5
+    rootcint -f $2 -c -I../Core -I../Physics $1 $5
 fi
 
 # Version 6 or more : generate both at once
 if [ $version_major -gt 5 ]
   then
-   rootcint -f $2 -rmf $3 -rml $lib_name -I../Core $1 $5
+   rootcint -f $2 -rmf $3 -rml $lib_name -I../Core -I../Physics $1 $5
 fi
 
 
diff --git a/NPSimulation/CMakeLists.txt b/NPSimulation/CMakeLists.txt
old mode 100644
new mode 100755
diff --git a/NPSimulation/Core/CalorimeterScorers.cc b/NPSimulation/Core/CalorimeterScorers.cc
index f82a086fbf7449a3ac70e3338f187d06249f2e88..513392530541b7ce941f6ec206901664b1aa2107 100644
--- a/NPSimulation/Core/CalorimeterScorers.cc
+++ b/NPSimulation/Core/CalorimeterScorers.cc
@@ -42,7 +42,6 @@ G4bool PS_Calorimeter::ProcessHits(G4Step* aStep, G4TouchableHistory*){
   G4double* Infos = new G4double[2+mysize];
   Infos[0] = aStep->GetTotalEnergyDeposit();
   Infos[1] = aStep->GetPreStepPoint()->GetGlobalTime();
-
   for(unsigned int i = 0 ; i < mysize ; i++){ 
     Infos[i+2] = aStep->GetPreStepPoint()->GetTouchableHandle()->GetCopyNumber(m_NestingLevel[i]);
   }
diff --git a/NPSimulation/Core/EventAction.cc b/NPSimulation/Core/EventAction.cc
index 78195ee83a986d91f3f325b8646d7fab59516932..6feb8ea6bc6f272682ec8d253617941f14f0e985 100644
--- a/NPSimulation/Core/EventAction.cc
+++ b/NPSimulation/Core/EventAction.cc
@@ -60,8 +60,12 @@ void EventAction::BeginOfEventAction(const G4Event* event){
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
 void EventAction::EndOfEventAction(const G4Event* event){
   m_detector->ReadAllSensitive(event) ;
-  RootOutput *pAnalysis = RootOutput::getInstance();
-  pAnalysis->GetTree()->Fill();
+  static TTree* tree =  RootOutput::getInstance()->GetTree();
+  tree->Fill();
+  if(treated%10000==0){
+    tree->AutoSave();
+     RootOutput::getInstance()->GetFile()->SaveSelf(kTRUE);
+  }
 }
 
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
diff --git a/NPSimulation/Core/EventGeneratorIsotropic.cc b/NPSimulation/Core/EventGeneratorIsotropic.cc
index ce6ae242b39cf959110ab17e30c189ec843d1aaf..7c018a95d3d386ac39b8c6deb5aadf6173f6bdbd 100644
--- a/NPSimulation/Core/EventGeneratorIsotropic.cc
+++ b/NPSimulation/Core/EventGeneratorIsotropic.cc
@@ -165,6 +165,7 @@ void EventGeneratorIsotropic::ReadConfiguration(string Path,int){
         else if(m_particleName=="alpha") { m_particleName="4He" ; check_ExcitationEnergy = true ;}
         else if(m_particleName=="gamma") { check_ExcitationEnergy = true ;}
         else if(m_particleName=="neutron") { check_ExcitationEnergy = true ;}
+          else { check_ExcitationEnergy = true ;}
 
       }
       
diff --git a/NPSimulation/Core/MaterialManager.cc b/NPSimulation/Core/MaterialManager.cc
index 4c0e7cd6924f9fdd2fedb237fe4cb5002a66ab2e..3687fb48041db77a28c1a9563c61cc4bcd2b81e1 100644
--- a/NPSimulation/Core/MaterialManager.cc
+++ b/NPSimulation/Core/MaterialManager.cc
@@ -123,6 +123,7 @@ G4Material* MaterialManager::GetMaterialFromLibrary(string Name){
       m_Material[Name]=material;
       return material; 
     }
+    
 
     else  if(Name == "Kapton"){
       G4Material* material = new G4Material(Name, 1.39*g/cm3,3);
@@ -316,7 +317,38 @@ G4Material* MaterialManager::GetMaterialFromLibrary(string Name){
       m_Material[Name]=material;
       return material; 
     }
+      
+    else  if(Name == "P10_1atm"){
+        G4Material* material = new G4Material(Name, 1.74*mg/cm3,3); //@ 0K, 1 atm
+        material->AddElement(GetElementFromLibrary("Ar"),0.9222);
+        material->AddElement(GetElementFromLibrary("C"),0.0623);
+        material->AddElement(GetElementFromLibrary("H"),0.0155);
+        m_Material[Name]=material;
+        return material;
+    }
+      
+    else  if(Name == "P10"){
+        G4Material* material = new G4Material(Name, 0.57*mg/cm3,3); //@ 0K, 1/3 atm
+        material->AddElement(GetElementFromLibrary("Ar"),0.9222);
+        material->AddElement(GetElementFromLibrary("C"),0.0623);
+        material->AddElement(GetElementFromLibrary("H"),0.0155);
+        m_Material[Name]=material;
+        return material;
+    }
 
+       else  if(Name == "Air_1atm"){ // 1 atm
+           G4Material* material = new G4Material("Air", 1.290*mg/cm3, 2);
+           material->AddElement(GetElementFromLibrary("N"), 0.7);
+           material->AddElement(GetElementFromLibrary("O"), 0.3);
+       }
+      
+       else  if(Name == "Air"){ // 1/3 atm
+           G4Material* material = new G4Material("Air", 1.290/3*mg/cm3, 2);
+           material->AddElement(GetElementFromLibrary("N"), 0.7);
+           material->AddElement(GetElementFromLibrary("O"), 0.3);
+       }
+      
+      
     else{
       G4cout << "ERROR: Material requested \""<< Name <<"\" is not available in the Material Librairy" << G4endl;
       exit(1);
diff --git a/NPSimulation/Hira/Hira.cc b/NPSimulation/Hira/Hira.cc
index f80216ddf400124fc292912c496562fcb19c4633..00d7cd80a2f6c7ded0c4a4ff93554a43ca00c13e 100644
--- a/NPSimulation/Hira/Hira.cc
+++ b/NPSimulation/Hira/Hira.cc
@@ -26,6 +26,7 @@
 //G4 Geometry object
 #include "G4Box.hh"
 #include "G4Trd.hh"
+#include "G4Trap.hh"
 #include "G4Tubs.hh"
 #include "G4Cons.hh"
 #include "G4UnionSolid.hh" 
@@ -326,13 +327,13 @@ void Hira::ReadSensitive(const G4Event* event){
     double E_ThinSi = RandGauss::shoot(Info[0],ResoThinSi);
 
     if(E_ThinSi>EnergyThreshold){
-	m_EventHira->SetHiraThinSiStripEEnergy(E_ThinSi); 
+        m_EventHira->SetHiraThinSiStripEEnergy(E_ThinSi);
       	m_EventHira->SetHiraThinSiStripEDetectorNbr(Info[7]);
-	m_EventHira->SetHiraThinSiStripEStripNbr(Info[8]);
+        m_EventHira->SetHiraThinSiStripEStripNbr(Info[8]);
 	
-	m_EventHira->SetHiraThinSiStripTTime(Info[1]);
-	m_EventHira->SetHiraThinSiStripTDetectorNbr(Info[7]);
-	m_EventHira->SetHiraThinSiStripTStripNbr(Info[8]);
+        m_EventHira->SetHiraThinSiStripTTime(Info[1]);
+        m_EventHira->SetHiraThinSiStripTDetectorNbr(Info[7]);
+        m_EventHira->SetHiraThinSiStripTStripNbr(Info[8]);
     }
   }
 
@@ -350,21 +351,28 @@ void Hira::ReadSensitive(const G4Event* event){
     G4double* Info = *(ThickSi_itr->second); 
     double E_ThickSi = RandGauss::shoot(Info[0],ResoThickSi);
     if(E_ThickSi>EnergyThreshold){
-	m_EventHira->SetHiraThickSiStripXEEnergy(E_ThickSi); 
-      	m_EventHira->SetHiraThickSiStripXEDetectorNbr(Info[7]);
-	m_EventHira->SetHiraThickSiStripXEStripNbr(Info[8]);
+        m_EventHira->SetHiraThickSiStripXEEnergy(E_ThickSi);
+        m_EventHira->SetHiraThickSiStripXEDetectorNbr(Info[7]);
+        m_EventHira->SetHiraThickSiStripXEStripNbr(Info[8]);
 	
-	m_EventHira->SetHiraThickSiStripXTTime(Info[1]);
-	m_EventHira->SetHiraThickSiStripXTDetectorNbr(Info[7]);
-	m_EventHira->SetHiraThickSiStripXTStripNbr(Info[8]);
+        m_EventHira->SetHiraThickSiStripXTTime(Info[1]);
+        m_EventHira->SetHiraThickSiStripXTDetectorNbr(Info[7]);
+        m_EventHira->SetHiraThickSiStripXTStripNbr(Info[8]);
 
-	m_EventHira->SetHiraThickSiStripYEEnergy(E_ThickSi); 
-      	m_EventHira->SetHiraThickSiStripYEDetectorNbr(Info[7]);
-	m_EventHira->SetHiraThickSiStripYEStripNbr(Info[9]);
+        m_EventHira->SetHiraThickSiStripYEEnergy(E_ThickSi);
+        m_EventHira->SetHiraThickSiStripYEDetectorNbr(Info[7]);
+        m_EventHira->SetHiraThickSiStripYEStripNbr(Info[9]);
 	
-	m_EventHira->SetHiraThickSiStripYTTime(Info[1]);
-	m_EventHira->SetHiraThickSiStripYTDetectorNbr(Info[7]);
-	m_EventHira->SetHiraThickSiStripYTStripNbr(Info[9]);
+        m_EventHira->SetHiraThickSiStripYTTime(Info[1]);
+        m_EventHira->SetHiraThickSiStripYTDetectorNbr(Info[7]);
+        m_EventHira->SetHiraThickSiStripYTStripNbr(Info[9]);
+        
+        // Interraction Coordinates
+        ms_InterCoord->SetDetectedPositionX(Info[2]) ;
+        ms_InterCoord->SetDetectedPositionY(Info[3]) ;
+        ms_InterCoord->SetDetectedPositionZ(Info[4]) ;
+        ms_InterCoord->SetDetectedAngleTheta(Info[5]/deg) ;
+        ms_InterCoord->SetDetectedAnglePhi(Info[6]/deg) ;
     }
   }
   // Clear Map for next event
@@ -381,14 +389,14 @@ void Hira::ReadSensitive(const G4Event* event){
     G4double* Info = *(CsI_itr->second); 
     double E_CsI = RandGauss::shoot(Info[0],ResoCsI);
     if(E_CsI>EnergyThreshold){
-	m_EventHira->SetHiraCsIEEnergy(E_CsI); 
-      	m_EventHira->SetHiraCsIEDetectorNbr(Info[3]);
-	m_EventHira->SetHiraCsIECristalNbr(Info[2]);
+        m_EventHira->SetHiraCsIEEnergy(E_CsI);
+      	m_EventHira->SetHiraCsIEDetectorNbr((int)Info[3]);
+        m_EventHira->SetHiraCsIECristalNbr((int)Info[2]);
     }
   }
   // Clear Map for next event
   CsIHitMap->clear();
-
+    
 }
 
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -396,8 +404,8 @@ void Hira::InitializeScorers(){
   //Look for previous definition of the scorer (geometry reload)
   bool already_exist = false;
   vector<G4int> NestingLevel;
+  NestingLevel.push_back(0);
   NestingLevel.push_back(2);
-  NestingLevel.push_back(3);
 
   m_ThinSiStripScorer = CheckScorer("Hira_ThinSiScorer",already_exist);
   m_ThickSiStripScorer = CheckScorer("Hira_ThickSiScorer",already_exist);
@@ -463,7 +471,7 @@ void Hira::VolumeMaker(G4int DetectorNumber,
 
    	// Definition of the volume containing the sensitive detector
    	G4Box*           solidMotherVolume = new G4Box(Name, 0.5*FaceFront, 0.5*FaceBack, 0.5*Length);
-   	G4LogicalVolume* m_logicMotherVolume = new G4LogicalVolume(solidMotherVolume, m_MaterialVacuum, Name, 0, 0, 0);
+    m_logicMotherVolume = new G4LogicalVolume(solidMotherVolume, m_MaterialVacuum, Name, 0, 0, 0);
 
    	new G4PVPlacement(G4Transform3D(*MMrot, MMpos), m_logicMotherVolume, Name, world, false, DetectorNumber);
 
@@ -520,12 +528,31 @@ void Hira::VolumeMaker(G4int DetectorNumber,
 	///////////////////////////////////////////////////
 	/////////////////////// CsI ///////////////////////
 	///////////////////////////////////////////////////
-	G4String NameCsI = "CsI"+DetNumber;
-	G4Trd* solidCsIStage = new G4Trd(NameCsI, 0.5*CsIFaceFront, 0.5*CsIFaceBack, 0.5*CsIFaceFront, 0.5*CsIFaceBack, 0.5*CsIThickness);
-    	m_LogicCsICrystal = new G4LogicalVolume(solidCsIStage, m_MaterialCsI, "logicCsICrystal", 0, 0, 0);
+    G4String NameCsI = "CsI"+DetNumber;
+    
+    double X1 = (CsIXFront-CsIXBack)/2.;
+    double Y1 = (CsIYFront-CsIYBack)/2.;
+    double l = sqrt(pow(X1,2) + pow(Y1,2));
+    
+    double pDz = 0.5*CsIThickness;
+    double pTheta = -atan( (l)/(CsIThickness) );
+    double pPhi = atan( X1/Y1 );
+    double pDy1 = 0.5*CsIYFront;
+    double pDx1 = 0.5*CsIXFront;
+    double pDx2 = 0.5*CsIXFront;
+    double pAlp1 = 0;
+    double pDy2 = 0.5*CsIYBack;
+    double pDx3 = 0.5*CsIXBack;
+    double pDx4 = 0.5*CsIXBack;
+    double pAlp2 = 0;
+    
+    G4Trap* solidCsIStage = new G4Trap(NameCsI, pDz, pTheta, pPhi, pDy1, pDx1, pDx2, pAlp1, pDy2, pDx3, pDx4, pAlp2);
+ 
+    
+    m_LogicCsICrystal = new G4LogicalVolume(solidCsIStage, m_MaterialCsI, "logicCsICrystal", 0, 0, 0);
     	
 	// Set CsI sensible
-    	m_LogicCsICrystal->SetSensitiveDetector(m_CsIScorer);
+    m_LogicCsICrystal->SetSensitiveDetector(m_CsIScorer);
     
  	// Visualisation of CsI
    	m_LogicCsICrystal->SetVisAttributes(m_CsIVisAtt);
@@ -535,164 +562,48 @@ void Hira::VolumeMaker(G4int DetectorNumber,
 	// Sub Mother Volume
     	G4Trd* solidCluster = new G4Trd("SolidCluster", 0.5*ClusterFaceFront,0.5*ClusterFaceBack,0.5*ClusterFaceFront,0.5*ClusterFaceBack, 0.5*CsIThickness);
     	m_LogicCluster = new G4LogicalVolume(solidCluster, m_MaterialVacuum, "LogicSolidCluster", 0, 0, 0);
-   	m_LogicCluster->SetVisAttributes(G4VisAttributes::Invisible);
+        m_LogicCluster->SetVisAttributes(G4VisAttributes::Invisible);
 
-	G4ThreeVector FramePos(0,0,CsI_PosZ);
+        G4ThreeVector FramePos(0,0,CsI_PosZ);
 
-	new G4PVPlacement(new G4RotationMatrix(0,0,0),
+        new G4PVPlacement(new G4RotationMatrix(0,0,0),
                       	FramePos,
                       	m_LogicCluster,"Cluster",
                       	m_logicMotherVolume,false,0);
 
+        const G4double CsIXMiddle = CsIXFront + (CsIThickness/2)*tan(-pTheta)*sin(pPhi);
+        const G4double CsIYMiddle = CsIYFront + (CsIThickness/2)*tan(-pTheta)*cos(pPhi);
+        const G4double DistInterCsIX = CsIXMiddle+DistInterCsI;
+        const G4double DistInterCsIY = CsIYMiddle+DistInterCsI;
+        
+        G4ThreeVector Origin(-0.5*DistInterCsIX,-0.5*DistInterCsIY,0);
+        G4ThreeVector Pos;
+        const G4double dangle = 90.*deg;
+        // A cluster is a 2 by 2 aggregat of CsI crystal
+        unsigned int CsINbr = 1;
+            for(unsigned int i = 0 ; i < 2 ; i++){
+                for(unsigned int j = 0 ; j < 2 ; j++){
+                    G4RotationMatrix* rotM = new G4RotationMatrix;
+                    unsigned int CrystalNbr = CsINbr++;
+                    if(i==0 && j==0)rotM->rotateZ(0);
+                    if(i==1 && j==0)rotM->rotateZ(dangle);
+                    if(i==0 && j==1)rotM->rotateZ(-dangle);
+                    if(i==1 && j==1)rotM->rotateZ(2*dangle);
+                    Pos = Origin + G4ThreeVector(i*DistInterCsIX,j*DistInterCsIY,0);
+                    
+                    new G4PVPlacement(G4Transform3D(*rotM,Pos),
+                                      m_LogicCsICrystal,
+                                      "CsI_Cristal",
+                                      m_LogicCluster,
+                                      false,
+                                      CrystalNbr);
+                    delete rotM;
+                }
+            }
+        }
+    }
 
-	//G4ThreeVector Origin(-CsIFaceFront,-CsIFaceFront,0);
-	G4ThreeVector Origin(-0.5*CsIFaceFront,-0.5*CsIFaceFront,0);
-	
-	// A cluster is a 2 by 2 aggregat of CsI crystal
-    		unsigned int CsINbr = 1;
-    		for(unsigned int i = 0 ; i < 2 ; i++){
-      			for(unsigned int j = 0 ; j <2 ; j++){
-        			G4ThreeVector Pos = Origin + G4ThreeVector(i*CsIFaceFront,j*CsIFaceFront,0);
-        			new G4PVPlacement(0, 
-        			 	Pos, 
-           			 	m_LogicCsICrystal, 
-            				"CsI_Cristal", 
-            			 	m_LogicCluster, 
-            			 	false, 
-            				CsINbr++); 
-      			}
-    		}
-	/*G4LogicalVolume* LogicClusterFrame = new G4LogicalVolume(solidCluster, m_MaterialCsI, "LogicSolidClusterFrame", 0, 0, 0);
-    	LogicClusterFrame->SetVisAttributes(m_CsIVisAtt);
-
-    	new G4PVPlacement(0, 
-        		FramePos, 
-       		 	LogicClusterFrame, 
-        		"ClusterFrame", 
-        		m_LogicCluster, 
-        		false, 
-        		0);*/
-	}
-
-   //ConstructThinSi();
-   //ConstructThickSi();
-   //ConstructCsICrystal();
-
-	
-}
-
-
-//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
-void Hira::ConstructCsICrystal(){
-	if(!m_LogicCsICrystal){
-
-		G4Trd* solidCsICrystal = new G4Trd("solidCsICrystal",0.5*CsIFaceFront,0.5*CsIFaceBack,0.5*CsIFaceFront,0.5*CsIFaceBack, 0.5*CsIThickness);
- 		m_LogicCsICrystal = new G4LogicalVolume(solidCsICrystal, m_MaterialVacuum, "logicCsI", 0, 0, 0);
-    		m_LogicCsICrystal->SetVisAttributes(G4VisAttributes::Invisible);
-    
-    		    // CsI
-    		G4Trd* solidCsIStage = new G4Trd("solidLaBr3Stage", 0.5*CsIFaceFront, 0.5*CsIFaceBack, 0.5*CsIFaceFront, 0.5*CsIFaceBack, 0.5*CsIThickness);
-    		G4LogicalVolume* logicCsIStage = new G4LogicalVolume(solidCsIStage, m_MaterialCsI, "logicCsIStage", 0, 0, 0);
-    	
-    		G4ThreeVector positionCsICrystal = G4ThreeVector(0, 0, CsI_PosZ);
-    
-    		new G4PVPlacement(new G4RotationMatrix(0,0,0),
-                      		positionCsICrystal,
-                      		logicCsIStage,"CsICrystal",
-                      		m_LogicCsICrystal,false,0);
-    
-    		// Set CsI sensible
-    		logicCsIStage->SetSensitiveDetector(m_CsIScorer);
-    
-    		// Visualisation of CsI
-    		logicCsIStage->SetVisAttributes(m_CsIVisAtt);
-	}
-
-	if(!m_LogicCluster){
-
-	// Mother Volume
-    	G4Trd* solidCluster = new G4Trd("SolidCluster", 0.5*CsIFaceFront,0.5*CsIFaceBack,0.5*CsIFaceFront,0.5*CsIFaceBack, 0.5*CsIThickness);
-    	m_LogicCluster = new G4LogicalVolume(solidCluster, m_MaterialVacuum, "LogicSolidCluster", 0, 0, 0);
-   	m_LogicCluster->SetVisAttributes(G4VisAttributes::Invisible);
-
-	G4ThreeVector Origin(-CsIFaceFront,-CsIFaceFront,0);
-	G4ThreeVector FramePos(0,0,CsI_PosZ);
-	// A cluster is a 2 by 2 aggregat of CsI crystal
-    		unsigned int CsINbr = 1;
-    		for(unsigned int i = 0 ; i < 2 ; i++){
-      			for(unsigned int j = 0 ; j <2 ; j++){
-        			G4ThreeVector Pos = Origin + G4ThreeVector(i*CsIFaceFront,j*CsIFaceFront,0);
-        			new G4PVPlacement(0, 
-        			 	Pos, 
-           			 	m_LogicCsICrystal, 
-            				"CsI_Cristal", 
-            			 	m_LogicCluster, 
-            			 	false, 
-            				CsINbr++); 
-      			}
-    		}
-		G4LogicalVolume* LogicClusterFrame = new G4LogicalVolume(solidCluster, m_MaterialCsI, "LogicSolidClusterFrame", 0, 0, 0);
-    		LogicClusterFrame->SetVisAttributes(m_CsIVisAtt);
-
-    		new G4PVPlacement(0, 
-        		FramePos, 
-       		 	LogicClusterFrame, 
-        		"ClusterFrame", 
-        		m_LogicCluster, 
-        		false, 
-        		0);
-	}
-    
-}
-
-//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
-void Hira::ConstructThinSi(){
-cout << "coucou1" << endl;
-	G4String Name = "ThinSi";
-	if(!m_LogicThinSi){
-cout << "coucou2" << endl;
-		G4Box* solidThinSi = new G4Box(Name, 0.5*SiliconFace, 0.5*SiliconFace, 0.5*ThinSiThickness);	;
-		m_LogicThinSi = new G4LogicalVolume(solidThinSi, m_MaterialSilicon, "logicThinSi", 0, 0, 0);
-
-		G4ThreeVector positionThinSi = G4ThreeVector(0, 0, ThinSi_PosZ);
-cout << "coucou3" << endl;
-		new G4PVPlacement(new G4RotationMatrix(0,0,0),
-               		      	 positionThinSi,
-                    		 m_LogicThinSi,"ThinSi",
-                   		 m_logicMotherVolume,false,0);
-cout << "coucou4" << endl;
-		// Set ThinSi sensible
-        	m_LogicThinSi->SetSensitiveDetector(m_ThinSiStripScorer);
-	
-		// Visualisation of ThinSi
-        	m_LogicThinSi->SetVisAttributes(m_SiliconVisAtt) ;   
-	}
-
-}
-
-//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
-void Hira::ConstructThickSi(){
-
-	G4String Name = "ThickSi";
-	if(!m_LogicThickSi){
-		G4Box* solidThickSi = new G4Box(Name, 0.5*SiliconFace, 0.5*SiliconFace, 0.5*ThickSiThickness);	
-		m_LogicThickSi = new G4LogicalVolume(solidThickSi, m_MaterialSilicon, "logicThickSi", 0, 0, 0);
-
-		G4ThreeVector positionThickSi = G4ThreeVector(0, 0, ThickSi_PosZ);
-
-		new G4PVPlacement(new G4RotationMatrix(0,0,0),
-                      	positionThickSi,
-                      	m_LogicThickSi,"ThickSi",
-                      	m_logicMotherVolume,false,0);
 
-		// Set ThickSi sensible
-        	m_LogicThickSi->SetSensitiveDetector(m_ThickSiStripScorer);
-	
-		// Visualisation of ThickSi
-        	m_LogicThickSi->SetVisAttributes(m_SiliconVisAtt) ; 
-	}
-  
-}
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
 void Hira::InitializeMaterial(){
     m_MaterialSilicon = MaterialManager::getInstance()->GetMaterialFromLibrary("Si");
diff --git a/NPSimulation/Hira/Hira.hh b/NPSimulation/Hira/Hira.hh
index 61ed65061fac4caefecb811b4d021bd9362bf740..112ae19a7be25acb566da699f46d5d6ca342cd95 100644
--- a/NPSimulation/Hira/Hira.hh
+++ b/NPSimulation/Hira/Hira.hh
@@ -1,5 +1,5 @@
-#ifndef Sharc_h
-#define Sharc_h 1
+#ifndef Hira_h
+#define Hira_h 1
 /*****************************************************************************
  * Copyright (C) 2009-2013   this file is part of the NPTool Project         *
  *                                                                           *
@@ -14,7 +14,7 @@
  * Last update    :                                                          *
  *---------------------------------------------------------------------------*
  * Decription:                                                               *
- *  This class describe the Sharc Silicon detector                           *
+ *  This class describe the Hira Telescops                                   *
  *                                                                           *
  *---------------------------------------------------------------------------*
  * Comment:                                                                  *
@@ -47,44 +47,47 @@ namespace HIRA
 {
 	
 	// Resolution
-	const G4double ResoTime		= 0.212765957    ;// = 500ps                 //   Unit is  ns/2.35
-	const G4double ResoCsI      	= 0.08           ;// = 188 kev of resolution //   Unit is MeV/2.35
-	const G4double ResoThickSi  	= 0.022          ;// = 52keV of Resolution   //   Unit is MeV/2.35
-	const G4double ResoThinSi	= 0.064          ;// = 150keV of Resolution   //   Unit is MeV/2.35
+    const G4double ResoTime         = 0.212765957;      // = 500ps                 //   Unit is  ns/2.35
+    const G4double ResoCsI      	= 0.200/2.35;       // = 250 kev of resolution //   Unit is MeV/2.35
+    const G4double ResoThickSi  	= 0.065/2.35;       // = 120keV of Resolution   //   Unit is MeV/2.35
+    const G4double ResoThinSi       = 0.050/2.35;       // = 80keV of Resolution   //   Unit is MeV/2.35
 	
-	const G4double EnergyThreshold = 100*keV;
+    const G4double EnergyThreshold = 0.;//100*keV;
 	
 	const G4double FaceFront	= 7.*cm ;
 	const G4double FaceBack		= 7*cm ;
 	const G4double Length		= 7.*cm ;
 	const G4int NumberOfStrip	= 32;
 	
-	const G4double SiliconFace       = 64*mm ;
+	const G4double SiliconFace       = 63*mm ;
 	const G4double AluStripThickness = 0.4*micrometer ;
 	const G4double ThinSiThickness	 = 65*micrometer ;
 	const G4double ThickSiThickness	 = 1500*micrometer ;
 	const G4double DistBetweenSi	 = 1*cm;
 	const G4double VacBoxThickness   = 1*cm ;
 	const G4double MylarCsIThickness = 3*micrometer;
-	const G4double CsIThickness      = 4.*cm + 2*MylarCsIThickness ;
-	const G4double CsIFaceFront      = 3.2*cm;
-	const G4double CsIFaceBack       = 3.7*cm;
-	const G4double DistInterCsI      = 0.2*mm;
+    const G4double CsIThickness      = 4.*cm;// + 2*MylarCsIThickness ;
+    
+    const G4double CsIXFront         = 33.*mm;
+    const G4double CsIXBack          = 37.*mm;
+    const G4double CsIYFront         = 33.*mm;
+    const G4double CsIYBack          = 37.*mm;
+    const G4double DistInterCsI      = 1.5*mm;
+    
 	const G4double ClusterFaceFront  = 7*cm;
 	const G4double ClusterFaceBack   = 9*cm;
 	
-	
 	// Starting at the front and going to CsI
 	const G4double AluStripFrontThinSi_PosZ		= Length* -0.5 + 0.5*AluStripThickness;
-	const G4double ThinSi_PosZ			= AluStripFrontThinSi_PosZ + 0.5*AluStripThickness + 0.5*ThinSiThickness;
+	const G4double ThinSi_PosZ                  = AluStripFrontThinSi_PosZ + 0.5*AluStripThickness + 0.5*ThinSiThickness;
 	const G4double AluStripBackThinSi_PosZ		= ThinSi_PosZ + 0.5*ThinSiThickness + 0.5*AluStripThickness;
 	
 	const G4double AluStripFrontThickSi_PosZ	= AluStripBackThinSi_PosZ + DistBetweenSi + 0.5*AluStripThickness + 0.5*AluStripThickness;
-	const G4double ThickSi_PosZ			= AluStripFrontThickSi_PosZ + 0.5*AluStripThickness + 0.5*ThickSiThickness;
+	const G4double ThickSi_PosZ                 = AluStripFrontThickSi_PosZ + 0.5*AluStripThickness + 0.5*ThickSiThickness;
 	const G4double AluStripBackThickSi_PosZ		= ThickSi_PosZ + 0.5*ThickSiThickness + 0.5*AluStripThickness;
 	
-	const G4double VacBox_PosZ			= AluStripBackThickSi_PosZ + 0.5*AluStripThickness + 0.5* VacBoxThickness;
-	const G4double CsI_PosZ				= VacBox_PosZ + 0.5*VacBoxThickness + 0.5*CsIThickness;
+	const G4double VacBox_PosZ                  = AluStripBackThickSi_PosZ + 0.5*AluStripThickness + 0.5* VacBoxThickness;
+	const G4double CsI_PosZ                     = VacBox_PosZ + 0.5*VacBoxThickness + 0.5*CsIThickness;
 	
 	
    
@@ -128,13 +131,7 @@ private:
 	////////////////////////////////////////////////////
 	//////// Specific Function of this Class ///////////
 	////////////////////////////////////////////////////
-public:
-	// To add a box detector
-	// Effectively construct Volume
-	void ConstructCsICrystal();
-	void ConstructThinSi();
-	void ConstructThickSi();
-	
+
   
   ////////////////////////////////////////////////////
   /////////  Inherite from VDetector class ///////////
diff --git a/NPSimulation/MUST2/MUST2Array.cc b/NPSimulation/MUST2/MUST2Array.cc
index 3595472084638e0da0c1763f26536b5c2060d5ed..3150e73019c171b8860f30ac55e84eed60b4b5b3 100644
--- a/NPSimulation/MUST2/MUST2Array.cc
+++ b/NPSimulation/MUST2/MUST2Array.cc
@@ -1289,7 +1289,8 @@ void MUST2Array::InitializeScorers() {
 
   G4VPrimitiveScorer* InteractionCoordinatesX 				= new OBSOLETEGENERALSCORERS::PSInteractionCoordinatesX("InterCoordX","MUST2Telescope", 0);
   G4VPrimitiveScorer* InteractionCoordinatesY				= new OBSOLETEGENERALSCORERS::PSInteractionCoordinatesY("InterCoordY","MUST2Telescope", 0);
-  G4VPrimitiveScorer* InteractionCoordinatesZ  			= new OBSOLETEGENERALSCORERS::PSInteractionCoordinatesZ("InterCoordZ","MUST2Telescope", 0);	 		 
+  G4VPrimitiveScorer* InteractionCoordinatesZ  			= new OBSOLETEGENERALSCORERS::PSInteractionCoordinatesZ("InterCoordZ","MUST2Telescope", 0);
+ 		 
   G4VPrimitiveScorer* InteractionCoordinatesAngleTheta	= new OBSOLETEGENERALSCORERS::PSInteractionCoordinatesAngleTheta("InterCoordAngTheta","MUST2Telescope", 0);
   G4VPrimitiveScorer* InteractionCoordinatesAnglePhi    = new OBSOLETEGENERALSCORERS::PSInteractionCoordinatesAnglePhi("InterCoordAngPhi","MUST2Telescope", 0) ;	    
 
diff --git a/NPSimulation/Plastic/Plastic.cc b/NPSimulation/Plastic/Plastic.cc
index 5c967240da198733fd4d6f4129b708f92857522e..b9e985696f19a4c8d1060dc241bb6037ff8c3e57 100644
--- a/NPSimulation/Plastic/Plastic.cc
+++ b/NPSimulation/Plastic/Plastic.cc
@@ -428,15 +428,15 @@ void Plastic::VolumeMaker(G4ThreeVector Det_pos, int DetNumber, G4LogicalVolume*
           0*deg, 
           360*deg);
 
-      G4Material* MaterialLead = MaterialManager::getInstance()->GetMaterialFromLibrary("Pb");
-      G4LogicalVolume* logicLead = new G4LogicalVolume(solidLead, MaterialLead, Name+"_Lead", 0, 0, 0);//AC changed lead to Al
+      G4Material* MaterialLead = MaterialManager::getInstance()->GetMaterialFromLibrary("Al");
+      G4LogicalVolume* logicLead = new G4LogicalVolume(solidLead, MaterialLead, Name+"_Al", 0, 0, 0);//AC changed lead to Al
       G4VisAttributes* LeadVisAtt = new G4VisAttributes(G4Colour(0.1, 0.1, 0.1)) ;
       logicLead->SetVisAttributes(LeadVisAtt) ;
 
       G4PVPlacement( 0,
           Det_pos+(m_PlasticThickness[i]/2+m_LeadThickness[i]/2)*Det_pos.unit(),
           logicLead,
-          Name+"_Lead",   
+          Name+"_Al",   
           world,
           false,
           0);
@@ -450,7 +450,7 @@ void Plastic::VolumeMaker(G4ThreeVector Det_pos, int DetNumber, G4LogicalVolume*
       G4LogicalVolume* logicPlastic = new G4LogicalVolume(solidPlastic, PlasticMaterial, Name+ "_Scintillator", 0, 0, 0);
       logicPlastic->SetSensitiveDetector(m_PlasticScorer);
 
-      G4VisAttributes* PlastVisAtt = new G4VisAttributes(G4Colour(0.0, 0.0, 0.9)) ;
+      G4VisAttributes* PlastVisAtt = new G4VisAttributes(G4Colour(0, 0, 1)) ;
       logicPlastic->SetVisAttributes(PlastVisAtt) ;
 
       G4RotationMatrix Rot3D;
@@ -464,17 +464,17 @@ void Plastic::VolumeMaker(G4ThreeVector Det_pos, int DetNumber, G4LogicalVolume*
     }
 
     if(m_LeadThickness[i]>0&& m_PlasticHeight[i]>0 && m_PlasticWidth[i]>0){
-      G4Box* solidLead = new G4Box(Name+"_Lead", 0.5*m_PlasticWidth[i], 0.5*m_PlasticHeight[i], 0.5*m_LeadThickness[i]);
+      G4Box* solidLead = new G4Box(Name+"_Al", 1*m_PlasticWidth[i], 1*m_PlasticHeight[i], 0.5*m_LeadThickness[i]);
 
-      G4Material* MaterialLead = MaterialManager::getInstance()->GetMaterialFromLibrary("Pb");
-      G4LogicalVolume* logicLead = new G4LogicalVolume(solidLead, MaterialLead, Name+"_Lead", 0, 0, 0);
-      G4VisAttributes* LeadVisAtt = new G4VisAttributes(G4Colour(0.1, 0.1, 0.1)) ;
+      G4Material* MaterialLead = MaterialManager::getInstance()->GetMaterialFromLibrary("Al");
+      G4LogicalVolume* logicLead = new G4LogicalVolume(solidLead, MaterialLead, Name+"_Al", 0, 0, 0);
+      G4VisAttributes* LeadVisAtt = new G4VisAttributes(G4Colour(0.5, 0.5, 0.5)) ;
       logicLead->SetVisAttributes(LeadVisAtt) ;
 
       new G4PVPlacement(0,
-          Det_pos+(m_PlasticThickness[i]/2+m_LeadThickness[i]/2)*Det_pos.unit() +G4ThreeVector(0,0,-10*cm)  ,
+          Det_pos-(m_PlasticThickness[i]/2+m_LeadThickness[i]/2)*Det_pos.unit() -G4ThreeVector(0,0,1*cm)  ,
           logicLead,
-          Name+"_Lead",   
+          Name+"_Al",   
           world,
           false,
           0);
diff --git a/NPSimulation/Sharc/Sharc.cc b/NPSimulation/Sharc/Sharc.cc
index 62659186fde9875c9375f84202a2476d74934b32..18fcbe31d56ba9a032c5ca8bdf079b0262b1f980 100644
--- a/NPSimulation/Sharc/Sharc.cc
+++ b/NPSimulation/Sharc/Sharc.cc
@@ -617,7 +617,6 @@ void Sharc::ConstructQQQDetector(G4LogicalVolume* world){
                       logicQQQDetector,"QQQ",world,false,DetNbr);
   }
 }
-
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
 // Add Detector branch to the EventTree.
 // Called After DetecorConstruction::AddDetector Method
@@ -731,6 +730,7 @@ void Sharc::ReadSensitive(const G4Event* event){
       
       m_Event->SetFront_DetectorNbr(DetNbr);
       m_Event->SetFront_StripNbr(QQQ_Wafer_NumberOf_AnnularStrip-StripFront+1); // Order is reverse (1 is outtermost strip)
+
       m_Event->SetFront_Energy(RandGauss::shoot(Energy, ResoEnergy));
       m_Event->SetFront_TimeCFD(RandGauss::shoot(Time, ResoTime));
       m_Event->SetFront_TimeLED(RandGauss::shoot(Time, ResoTime));
diff --git a/NPSimulation/Sharc/Sharc.hh b/NPSimulation/Sharc/Sharc.hh
index a0f2d9c121b7383ab6279cb9619e1ea0d9bb28de..29cb27d2416f92af4c4526288197dd7f7205945d 100644
--- a/NPSimulation/Sharc/Sharc.hh
+++ b/NPSimulation/Sharc/Sharc.hh
@@ -49,10 +49,7 @@ namespace SHARC{
   //const G4double ResoEnergy  = 0.035*MeV ;// = zzkeV of Resolution   //   Unit is MeV/2.35
   const G4double ResoEnergy  = 0.042*MeV ;// = zzkeV of Resolution   //   Unit is MeV/2.35
 
-  //const G4double EnergyThreshold = 0.4*MeV;
-  
-  // Change for TRex simulations
-  const G4double EnergyThreshold = 0.5*MeV;
+  const G4double EnergyThreshold = 0.1*MeV;
   // Geometry
   
   // BOX //
@@ -97,10 +94,10 @@ namespace SHARC{
   const G4double PAD_PCB_Border_ShortSide = 2.5*mm;
   
   // PAD Wafer
-//  const G4double PAD_Wafer_Width  = 51.00*mm;
-//  const G4double PAD_Wafer_Length = 77.00*mm;
-    const G4double PAD_Wafer_Width  = 42.00*mm;
-    const G4double PAD_Wafer_Length = 72.00*mm;
+  const G4double PAD_Wafer_Width  = 51.00*mm;
+  const G4double PAD_Wafer_Length = 77.00*mm;
+//    const G4double PAD_Wafer_Width  = 42.00*mm;
+//    const G4double PAD_Wafer_Length = 72.00*mm;
   
   const G4double PAD_Wafer_DeadLayer_Thickness = 0.1*um;