From 0a63c9995a30738692a776f704a2b77b5258c3df Mon Sep 17 00:00:00 2001
From: matta <matta@npt>
Date: Wed, 22 Dec 2010 21:05:05 +0000
Subject: [PATCH] * Make several change in order to compile on Linux  - Bug in
 NPNucleus fixed  - Bug strip numerotation on Gaspard Annular  - Bug on
 numeric limit fixed by adding #include<limits> header

---
 NPLib/AnnularS1/Makefile                   | 1 -
 NPLib/CalibrationManager/Makefile          | 1 -
 NPLib/DummyDetector/Makefile               | 1 -
 NPLib/GASPARD/GaspardTrackerAnnular.cxx    | 2 ++
 NPLib/GASPARD/GaspardTrackerAnnular.h      | 2 +-
 NPLib/GASPARD/GaspardTrackerDummyShape.cxx | 3 ++-
 NPLib/GASPARD/GaspardTrackerSquare.cxx     | 2 ++
 NPLib/GASPARD/GaspardTrackerTrapezoid.cxx  | 2 ++
 NPLib/GASPARD/Makefile                     | 1 -
 NPLib/IORoot/Makefile                      | 1 -
 NPLib/InitialConditions/Makefile           | 1 -
 NPLib/InteractionCoordinates/Makefile      | 1 -
 NPLib/MUST2/Makefile                       | 1 -
 NPLib/MUST2/TMust2Physics.cxx              | 1 +
 NPLib/Makefile                             | 1 -
 NPLib/Paris/Makefile                       | 1 -
 NPLib/Paris/TParisPhysics.cxx              | 4 +++-
 NPLib/Plastic/Makefile                     | 1 -
 NPLib/SSSD/Makefile                        | 1 -
 NPLib/Shield/Makefile                      | 1 -
 NPLib/Shield/TShieldPhysics.cxx            | 4 +++-
 NPLib/Tools/Makefile                       | 1 -
 NPLib/Tools/NPEnergyLoss.cxx               | 1 +
 NPLib/Tools/NPNucleus.cxx                  | 7 ++++++-
 NPLib/VDetector/Makefile                   | 1 -
 NPSimulation/src/GaspardScorers.cc         | 2 ++
 26 files changed, 25 insertions(+), 20 deletions(-)

diff --git a/NPLib/AnnularS1/Makefile b/NPLib/AnnularS1/Makefile
index b418a5f16..ee646f98b 100644
--- a/NPLib/AnnularS1/Makefile
+++ b/NPLib/AnnularS1/Makefile
@@ -41,7 +41,6 @@ ROOTLIBS     := $(shell $(ROOTCONFIG) --libs)
 ROOTGLIBS    := $(shell $(ROOTCONFIG) --glibs)
 HASTHREAD    := $(shell $(ROOTCONFIG) --has-thread)
 ROOTDICTTYPE := $(shell $(ROOTCONFIG) --dicttype)
-NOSTUBS      := $(shell $(ROOTCONFIG) --nostubs)
 ROOTCINT     := rootcint
 
 ifeq ($(ARCH),linux)
diff --git a/NPLib/CalibrationManager/Makefile b/NPLib/CalibrationManager/Makefile
index 3b8a94b26..dacbd1f0f 100755
--- a/NPLib/CalibrationManager/Makefile
+++ b/NPLib/CalibrationManager/Makefile
@@ -41,7 +41,6 @@ ROOTLIBS     := $(shell $(ROOTCONFIG) --libs)
 ROOTGLIBS    := $(shell $(ROOTCONFIG) --glibs)
 HASTHREAD    := $(shell $(ROOTCONFIG) --has-thread)
 ROOTDICTTYPE := $(shell $(ROOTCONFIG) --dicttype)
-NOSTUBS      := $(shell $(ROOTCONFIG) --nostubs)
 ROOTCINT     := rootcint
 
 ifeq ($(ARCH),linux)
diff --git a/NPLib/DummyDetector/Makefile b/NPLib/DummyDetector/Makefile
index 1d864a05a..3be0b6cba 100755
--- a/NPLib/DummyDetector/Makefile
+++ b/NPLib/DummyDetector/Makefile
@@ -41,7 +41,6 @@ ROOTLIBS     := $(shell $(ROOTCONFIG) --libs)
 ROOTGLIBS    := $(shell $(ROOTCONFIG) --glibs)
 HASTHREAD    := $(shell $(ROOTCONFIG) --has-thread)
 ROOTDICTTYPE := $(shell $(ROOTCONFIG) --dicttype)
-NOSTUBS      := $(shell $(ROOTCONFIG) --nostubs)
 ROOTCINT     := rootcint
 
 ifeq ($(ARCH),linux)
diff --git a/NPLib/GASPARD/GaspardTrackerAnnular.cxx b/NPLib/GASPARD/GaspardTrackerAnnular.cxx
index 47a405621..b16d8f90c 100644
--- a/NPLib/GASPARD/GaspardTrackerAnnular.cxx
+++ b/NPLib/GASPARD/GaspardTrackerAnnular.cxx
@@ -1,10 +1,12 @@
 #include "GaspardTrackerAnnular.h"
 
 // C++ headers
+#include <limits>
 #include <iostream>
 #include <fstream>
 #include <string>
 #include <cmath>
+#include <stdlib.h>
 
 // Gaspard
 #include "TGaspardTrackerPhysics.h"
diff --git a/NPLib/GASPARD/GaspardTrackerAnnular.h b/NPLib/GASPARD/GaspardTrackerAnnular.h
index 33b9522d2..367d80ba5 100644
--- a/NPLib/GASPARD/GaspardTrackerAnnular.h
+++ b/NPLib/GASPARD/GaspardTrackerAnnular.h
@@ -63,7 +63,7 @@ public:
    // Getters to retrieve the (X,Y,Z) coordinates of a pixel defined by strips (X,Y)
    double GetStripPositionX(int N ,int X ,int Y)        { return m_StripPositionX[N-1-m_index["Annular"]][X-1][Y-1]; }
    double GetStripPositionY(int N ,int X ,int Y)        { return m_StripPositionY[N-1-m_index["Annular"]][X-1][Y-1]; }
-   double GetStripPositionZ(int N ,int X ,int Y)        { return m_StripPositionZ[N-1-m_index["Annular"]][X-1][Y-1]; }
+   double GetStripPositionZ(int N ,int X ,int Y)        { cout << N << " " << X << " " << Y << " " << endl ; return m_StripPositionZ[N-1-m_index["Annular"]][X-1][Y-1]; }
    double GetNumberOfModule()                           { return m_NumberOfModule; }
 
 private:
diff --git a/NPLib/GASPARD/GaspardTrackerDummyShape.cxx b/NPLib/GASPARD/GaspardTrackerDummyShape.cxx
index 7b1e104f3..5b856f3b6 100644
--- a/NPLib/GASPARD/GaspardTrackerDummyShape.cxx
+++ b/NPLib/GASPARD/GaspardTrackerDummyShape.cxx
@@ -1,15 +1,16 @@
 #include "GaspardTrackerDummyShape.h"
 
 // C++ headers
+#include <limits>
 #include <iostream>
 #include <fstream>
 #include <string>
 #include <cmath>
+#include <stdlib.h>
 
 // Gaspard
 #include "TGaspardTrackerPhysics.h"
 
-
 GaspardTrackerDummyShape::GaspardTrackerDummyShape(map<int, GaspardTrackerModule*> &Module,
 						   TGaspardTrackerPhysics* &EventPhysics) 
 	: m_ModuleTest(Module),
diff --git a/NPLib/GASPARD/GaspardTrackerSquare.cxx b/NPLib/GASPARD/GaspardTrackerSquare.cxx
index 54ec2eb74..f2930a72d 100644
--- a/NPLib/GASPARD/GaspardTrackerSquare.cxx
+++ b/NPLib/GASPARD/GaspardTrackerSquare.cxx
@@ -1,10 +1,12 @@
 #include "GaspardTrackerSquare.h"
 
 // C++ headers
+#include <limits>
 #include <iostream>
 #include <fstream>
 #include <string>
 #include <cmath>
+#include <stdlib.h>
 
 // Gaspard
 #include "TGaspardTrackerPhysics.h"
diff --git a/NPLib/GASPARD/GaspardTrackerTrapezoid.cxx b/NPLib/GASPARD/GaspardTrackerTrapezoid.cxx
index 0d7be723e..d2179f8ad 100644
--- a/NPLib/GASPARD/GaspardTrackerTrapezoid.cxx
+++ b/NPLib/GASPARD/GaspardTrackerTrapezoid.cxx
@@ -1,10 +1,12 @@
 #include "GaspardTrackerTrapezoid.h"
 
 // C++ headers
+#include <limits>
 #include <iostream>
 #include <fstream>
 #include <string>
 #include <cmath>
+#include <stdlib.h>
 
 // Gaspard
 #include "TGaspardTrackerPhysics.h"
diff --git a/NPLib/GASPARD/Makefile b/NPLib/GASPARD/Makefile
index 8fea1b0d1..a3feb5627 100644
--- a/NPLib/GASPARD/Makefile
+++ b/NPLib/GASPARD/Makefile
@@ -41,7 +41,6 @@ ROOTLIBS     := $(shell $(ROOTCONFIG) --libs)
 ROOTGLIBS    := $(shell $(ROOTCONFIG) --glibs)
 HASTHREAD    := $(shell $(ROOTCONFIG) --has-thread)
 ROOTDICTTYPE := $(shell $(ROOTCONFIG) --dicttype)
-NOSTUBS      := $(shell $(ROOTCONFIG) --nostubs)
 ROOTCINT     := rootcint
 
 ifeq ($(ARCH),linux)
diff --git a/NPLib/IORoot/Makefile b/NPLib/IORoot/Makefile
index adbf04549..ce8ea0702 100644
--- a/NPLib/IORoot/Makefile
+++ b/NPLib/IORoot/Makefile
@@ -41,7 +41,6 @@ ROOTLIBS     := $(shell $(ROOTCONFIG) --libs)
 ROOTGLIBS    := $(shell $(ROOTCONFIG) --glibs)
 HASTHREAD    := $(shell $(ROOTCONFIG) --has-thread)
 ROOTDICTTYPE := $(shell $(ROOTCONFIG) --dicttype)
-NOSTUBS      := $(shell $(ROOTCONFIG) --nostubs)
 ROOTCINT     := rootcint
 
 ifeq ($(ARCH),linux)
diff --git a/NPLib/InitialConditions/Makefile b/NPLib/InitialConditions/Makefile
index 0d8c9fc4e..ccf052580 100644
--- a/NPLib/InitialConditions/Makefile
+++ b/NPLib/InitialConditions/Makefile
@@ -41,7 +41,6 @@ ROOTLIBS     := $(shell $(ROOTCONFIG) --libs)
 ROOTGLIBS    := $(shell $(ROOTCONFIG) --glibs)
 HASTHREAD    := $(shell $(ROOTCONFIG) --has-thread)
 ROOTDICTTYPE := $(shell $(ROOTCONFIG) --dicttype)
-NOSTUBS      := $(shell $(ROOTCONFIG) --nostubs)
 ROOTCINT     := rootcint
 
 ifeq ($(ARCH),linux)
diff --git a/NPLib/InteractionCoordinates/Makefile b/NPLib/InteractionCoordinates/Makefile
index 9d2218499..682282e96 100644
--- a/NPLib/InteractionCoordinates/Makefile
+++ b/NPLib/InteractionCoordinates/Makefile
@@ -41,7 +41,6 @@ ROOTLIBS     := $(shell $(ROOTCONFIG) --libs)
 ROOTGLIBS    := $(shell $(ROOTCONFIG) --glibs)
 HASTHREAD    := $(shell $(ROOTCONFIG) --has-thread)
 ROOTDICTTYPE := $(shell $(ROOTCONFIG) --dicttype)
-NOSTUBS      := $(shell $(ROOTCONFIG) --nostubs)
 ROOTCINT     := rootcint
 
 ifeq ($(ARCH),linux)
diff --git a/NPLib/MUST2/Makefile b/NPLib/MUST2/Makefile
index 483202615..ae103d899 100644
--- a/NPLib/MUST2/Makefile
+++ b/NPLib/MUST2/Makefile
@@ -41,7 +41,6 @@ ROOTLIBS     := $(shell $(ROOTCONFIG) --libs)
 ROOTGLIBS    := $(shell $(ROOTCONFIG) --glibs)
 HASTHREAD    := $(shell $(ROOTCONFIG) --has-thread)
 ROOTDICTTYPE := $(shell $(ROOTCONFIG) --dicttype)
-NOSTUBS      := $(shell $(ROOTCONFIG) --nostubs)
 ROOTCINT     := rootcint
 
 ifeq ($(ARCH),linux)
diff --git a/NPLib/MUST2/TMust2Physics.cxx b/NPLib/MUST2/TMust2Physics.cxx
index 613ee8358..6ea861cef 100644
--- a/NPLib/MUST2/TMust2Physics.cxx
+++ b/NPLib/MUST2/TMust2Physics.cxx
@@ -26,6 +26,7 @@ using namespace LOCAL;
 #include <iostream>
 #include <cmath>
 #include <stdlib.h>
+#include <limits>
 
 //	NPL
 #include "RootInput.h"
diff --git a/NPLib/Makefile b/NPLib/Makefile
index ab3361e48..41e9bebb4 100644
--- a/NPLib/Makefile
+++ b/NPLib/Makefile
@@ -41,7 +41,6 @@ ROOTLIBS     := $(shell $(ROOTCONFIG) --libs)
 ROOTGLIBS    := $(shell $(ROOTCONFIG) --glibs)
 HASTHREAD    := $(shell $(ROOTCONFIG) --has-thread)
 ROOTDICTTYPE := $(shell $(ROOTCONFIG) --dicttype)
-NOSTUBS      := $(shell $(ROOTCONFIG) --nostubs)
 ROOTCINT     := rootcint
 
 ifeq ($(ARCH),linux)
diff --git a/NPLib/Paris/Makefile b/NPLib/Paris/Makefile
index 02e00de1e..3fe9d1d23 100644
--- a/NPLib/Paris/Makefile
+++ b/NPLib/Paris/Makefile
@@ -41,7 +41,6 @@ ROOTLIBS     := $(shell $(ROOTCONFIG) --libs)
 ROOTGLIBS    := $(shell $(ROOTCONFIG) --glibs)
 HASTHREAD    := $(shell $(ROOTCONFIG) --has-thread)
 ROOTDICTTYPE := $(shell $(ROOTCONFIG) --dicttype)
-NOSTUBS      := $(shell $(ROOTCONFIG) --nostubs)
 ROOTCINT     := rootcint
 
 ifeq ($(ARCH),linux)
diff --git a/NPLib/Paris/TParisPhysics.cxx b/NPLib/Paris/TParisPhysics.cxx
index 6b744557c..8fb3b62e5 100644
--- a/NPLib/Paris/TParisPhysics.cxx
+++ b/NPLib/Paris/TParisPhysics.cxx
@@ -22,10 +22,12 @@
  *****************************************************************************/
 
 #include "TParisPhysics.h"
+
+//  STL
 #include <vector>
 #include <iostream>
 #include <cstdlib>
-
+#include <limits>
 
 ClassImp(TParisPhysics)
 
diff --git a/NPLib/Plastic/Makefile b/NPLib/Plastic/Makefile
index 06fc2ee60..1d21b1a8c 100644
--- a/NPLib/Plastic/Makefile
+++ b/NPLib/Plastic/Makefile
@@ -41,7 +41,6 @@ ROOTLIBS     := $(shell $(ROOTCONFIG) --libs)
 ROOTGLIBS    := $(shell $(ROOTCONFIG) --glibs)
 HASTHREAD    := $(shell $(ROOTCONFIG) --has-thread)
 ROOTDICTTYPE := $(shell $(ROOTCONFIG) --dicttype)
-NOSTUBS      := $(shell $(ROOTCONFIG) --nostubs)
 ROOTCINT     := rootcint
 
 ifeq ($(ARCH),linux)
diff --git a/NPLib/SSSD/Makefile b/NPLib/SSSD/Makefile
index f9b71f05d..95d06e3e3 100755
--- a/NPLib/SSSD/Makefile
+++ b/NPLib/SSSD/Makefile
@@ -41,7 +41,6 @@ ROOTLIBS     := $(shell $(ROOTCONFIG) --libs)
 ROOTGLIBS    := $(shell $(ROOTCONFIG) --glibs)
 HASTHREAD    := $(shell $(ROOTCONFIG) --has-thread)
 ROOTDICTTYPE := $(shell $(ROOTCONFIG) --dicttype)
-NOSTUBS      := $(shell $(ROOTCONFIG) --nostubs)
 ROOTCINT     := rootcint
 
 ifeq ($(ARCH),linux)
diff --git a/NPLib/Shield/Makefile b/NPLib/Shield/Makefile
index d89a5d789..b06b5851b 100644
--- a/NPLib/Shield/Makefile
+++ b/NPLib/Shield/Makefile
@@ -41,7 +41,6 @@ ROOTLIBS     := $(shell $(ROOTCONFIG) --libs)
 ROOTGLIBS    := $(shell $(ROOTCONFIG) --glibs)
 HASTHREAD    := $(shell $(ROOTCONFIG) --has-thread)
 ROOTDICTTYPE := $(shell $(ROOTCONFIG) --dicttype)
-NOSTUBS      := $(shell $(ROOTCONFIG) --nostubs)
 ROOTCINT     := rootcint
 
 ifeq ($(ARCH),linux)
diff --git a/NPLib/Shield/TShieldPhysics.cxx b/NPLib/Shield/TShieldPhysics.cxx
index dae505443..524a5b6cd 100644
--- a/NPLib/Shield/TShieldPhysics.cxx
+++ b/NPLib/Shield/TShieldPhysics.cxx
@@ -22,10 +22,12 @@
  *****************************************************************************/
 
 #include "TShieldPhysics.h"
+
+//  STL
 #include <vector>
 #include <iostream>
 #include <cstdlib>
-
+#include <limits>
 
 ClassImp(TShieldPhysics)
 
diff --git a/NPLib/Tools/Makefile b/NPLib/Tools/Makefile
index dda7eeb70..f3e167bf5 100644
--- a/NPLib/Tools/Makefile
+++ b/NPLib/Tools/Makefile
@@ -41,7 +41,6 @@ ROOTLIBS     := $(shell $(ROOTCONFIG) --libs)
 ROOTGLIBS    := $(shell $(ROOTCONFIG) --glibs)
 HASTHREAD    := $(shell $(ROOTCONFIG) --has-thread)
 ROOTDICTTYPE := $(shell $(ROOTCONFIG) --dicttype)
-NOSTUBS      := $(shell $(ROOTCONFIG) --nostubs)
 ROOTCINT     := rootcint
 
 ifeq ($(ARCH),linux)
diff --git a/NPLib/Tools/NPEnergyLoss.cxx b/NPLib/Tools/NPEnergyLoss.cxx
index f41ac75f9..afb7567cd 100644
--- a/NPLib/Tools/NPEnergyLoss.cxx
+++ b/NPLib/Tools/NPEnergyLoss.cxx
@@ -30,6 +30,7 @@
  *****************************************************************************/
  
 
+//  STL
 #include <iostream>
 #include <fstream>
 #include <cmath>
diff --git a/NPLib/Tools/NPNucleus.cxx b/NPLib/Tools/NPNucleus.cxx
index abd0ccfaf..b81f0cbf0 100644
--- a/NPLib/Tools/NPNucleus.cxx
+++ b/NPLib/Tools/NPNucleus.cxx
@@ -59,10 +59,15 @@ Nucleus::Nucleus(string isotope)
    
    // reading the file
    string line, s_name;
+   size_t space;
    if (inFile.is_open()) {
       while (!inFile.eof()) {
          getline(inFile,line);
-	 s_name = line.substr(11,6);
+
+	 s_name = line.substr(11,7);
+	 space = s_name.find_first_of(" "); 
+	 s_name.resize(space);
+
 	 if (s_name.find(Isotope) != string::npos && s_name.length() == isotope.length()) break;
       }
       Extract(line.data());
diff --git a/NPLib/VDetector/Makefile b/NPLib/VDetector/Makefile
index b70479c53..450913cc3 100644
--- a/NPLib/VDetector/Makefile
+++ b/NPLib/VDetector/Makefile
@@ -41,7 +41,6 @@ ROOTLIBS     := $(shell $(ROOTCONFIG) --libs)
 ROOTGLIBS    := $(shell $(ROOTCONFIG) --glibs)
 HASTHREAD    := $(shell $(ROOTCONFIG) --has-thread)
 ROOTDICTTYPE := $(shell $(ROOTCONFIG) --dicttype)
-NOSTUBS      := $(shell $(ROOTCONFIG) --nostubs)
 ROOTCINT     := rootcint
 
 ifeq ($(ARCH),linux)
diff --git a/NPSimulation/src/GaspardScorers.cc b/NPSimulation/src/GaspardScorers.cc
index 0ec6364a2..4ebfe571f 100644
--- a/NPSimulation/src/GaspardScorers.cc
+++ b/NPSimulation/src/GaspardScorers.cc
@@ -695,6 +695,7 @@ G4bool GPDScorerFirstStageFrontStripAnnular::ProcessHits(G4Step* aStep, G4Toucha
    G4double edep = aStep->GetTotalEnergyDeposit();
    if (edep < 100*keV) return FALSE;
    G4int  index =  aStep->GetTrack()->GetTrackID();
+   ThetaStripNumber++;
    EvtMap->set(DetNbr + index, ThetaStripNumber);
 
    return TRUE;
@@ -769,6 +770,7 @@ G4bool GPDScorerFirstStageBackStripAnnular::ProcessHits(G4Step* aStep, G4Touchab
    G4double edep = aStep->GetTotalEnergyDeposit();
    if (edep < 100*keV) return FALSE;
    G4int  index =  aStep->GetTrack()->GetTrackID();
+   PhiStripNumber++;
    EvtMap->set(DetNbr + index, PhiStripNumber);
 
    return TRUE;
-- 
GitLab