From 8bb8ad6499535b1ee33e10a2581503d366670205 Mon Sep 17 00:00:00 2001
From: adrien-matta <a.matta@surrey.ac.uk>
Date: Sun, 6 Oct 2013 18:45:15 +0100
Subject: [PATCH] * Restore the Outputs file missed by git

---
 Inputs/DetectorConfiguration/MUST2.detector | 13 ++++++++++++-
 Inputs/EventGenerator/10He.reaction         |  6 +++---
 NPLib/IORoot/RootOutput.cxx                 |  8 +++++---
 NPLib/Makefile.arch                         |  2 +-
 NPLib/Physics/NPFunction.h                  |  2 +-
 NPLib/Physics/NPGlobalSystemOfUnits.h       |  2 +-
 NPLib/Physics/NPReaction.cxx                |  2 +-
 NPLib/Physics/linkdef.h                     |  2 +-
 NPSimulation/Makefile                       |  2 +-
 NPSimulation/src/DetectorConstruction.cc    |  6 ++++++
 Outputs/Analysis/.gitignore                 |  0
 Outputs/Simulation/.gitignore               |  0
 12 files changed, 32 insertions(+), 13 deletions(-)
 create mode 100644 Outputs/Analysis/.gitignore
 create mode 100644 Outputs/Simulation/.gitignore

diff --git a/Inputs/DetectorConfiguration/MUST2.detector b/Inputs/DetectorConfiguration/MUST2.detector
index bf64823e4..92fcd64d3 100644
--- a/Inputs/DetectorConfiguration/MUST2.detector
+++ b/Inputs/DetectorConfiguration/MUST2.detector
@@ -1,4 +1,15 @@
-%%%%%%%%%%%%%%%%%%%%%			
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+GeneralTarget
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+Target
+	THICKNESS= 4.8
+	RADIUS=	5
+	MATERIAL= CD2
+	ANGLE= 0
+	X= 0
+	Y= 0
+	Z= 0
+%%%%%%%%%%%%%%%%%%%%%
 MUST2Array			
 %%%%%%% Telescope 1 %%%%%%%			
 M2Telescope 			
diff --git a/Inputs/EventGenerator/10He.reaction b/Inputs/EventGenerator/10He.reaction
index e3dfbf774..32a211b93 100644
--- a/Inputs/EventGenerator/10He.reaction
+++ b/Inputs/EventGenerator/10He.reaction
@@ -43,7 +43,7 @@ TwoBodyReaction
   
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
     
-ParticleDecay 10He
+%ParticleDecay 10He
   Daughter= 9He n
   ExcitationEnergy= 0.1 0
   DifferentialCrossSection= 11Li(d,3He)10He.txt	particle9He
@@ -51,7 +51,7 @@ ParticleDecay 10He
     
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 
-GammaDecay 9He
+%GammaDecay 9He
   Cascade
     BranchingRatio= 30
     Energies= 0.1
@@ -62,7 +62,7 @@ GammaDecay 9He
 
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 
-ParticleDecay 9He
+%ParticleDecay 9He
   Daughter= 8He n
   DifferentialCrossSection= flat.txt
   shoot= 1 1
diff --git a/NPLib/IORoot/RootOutput.cxx b/NPLib/IORoot/RootOutput.cxx
index 2d1bea3d2..54f558898 100644
--- a/NPLib/IORoot/RootOutput.cxx
+++ b/NPLib/IORoot/RootOutput.cxx
@@ -73,9 +73,9 @@ RootOutput::RootOutput(TString fileNameBase, TString treeNameBase)
   
   pRootTree = new TTree(treeNameBase, "Data created / analyzed with the NPTool package");
   pRootList = new TList();
-
-   // Init TAsciiFile objects
-   InitAsciiFiles();
+  
+  // Init TAsciiFile objects
+  InitAsciiFiles();
 }
 
 
@@ -126,11 +126,13 @@ RootOutput::~RootOutput()
 {
     // The data is written to the file and the tree is closed:
     if (pRootFile && !NPOptionManager::getInstance()->GetPROOF()) {
+      pRootFile->cd();
       cout << endl;
       cout << "Got histograms and Tree !" << endl;
       cout << "  - Number of entries in the Tree: " << pRootTree->GetEntries() << endl;
       cout << "  - Number of bites written to file: " << pRootTree->Write() << endl;
 
+      
       // write TAsciiFile if used
       // EventGenerator
       if (!pEventGenerator->IsEmpty()) pEventGenerator->Write();
diff --git a/NPLib/Makefile.arch b/NPLib/Makefile.arch
index 988c5be16..caba32631 100644
--- a/NPLib/Makefile.arch
+++ b/NPLib/Makefile.arch
@@ -31,7 +31,7 @@ OPT           = -g
 OPT2          = -g
 else
 OPT           = -O
-OPT2          = -O2
+OPT2          = -O3
 endif
 endif
 
diff --git a/NPLib/Physics/NPFunction.h b/NPLib/Physics/NPFunction.h
index de1ee23af..39f195b53 100644
--- a/NPLib/Physics/NPFunction.h
+++ b/NPLib/Physics/NPFunction.h
@@ -57,4 +57,4 @@ namespace NPL{
   void RandomGaussian2D(double MeanX, double MeanY, double SigmaX, double SigmaY, double &X, double &Y, double NumberOfSigma= 10000);
 }
 
-#endif
\ No newline at end of file
+#endif
diff --git a/NPLib/Physics/NPGlobalSystemOfUnits.h b/NPLib/Physics/NPGlobalSystemOfUnits.h
index 2112b85b5..8fafc495e 100644
--- a/NPLib/Physics/NPGlobalSystemOfUnits.h
+++ b/NPLib/Physics/NPGlobalSystemOfUnits.h
@@ -118,4 +118,4 @@ using NPUNITS::perCent;
 using NPUNITS::perThousand;
 using NPUNITS::perMillion;
 
-#endif
\ No newline at end of file
+#endif
diff --git a/NPLib/Physics/NPReaction.cxx b/NPLib/Physics/NPReaction.cxx
index fb7639e0c..efa74ddfc 100644
--- a/NPLib/Physics/NPReaction.cxx
+++ b/NPLib/Physics/NPReaction.cxx
@@ -324,7 +324,7 @@ void Reaction::ReadConfigurationFile(string Path){
   while (!ReactionFile.eof()) {
     //Pick-up next line
     getline(ReactionFile, LineBuffer);
-    
+
     if (LineBuffer.compare(0, 15, "TwoBodyReaction") == 0) { ReadingStatus = true ;}
     
     
diff --git a/NPLib/Physics/linkdef.h b/NPLib/Physics/linkdef.h
index 87b5f45e1..3ca75ab55 100644
--- a/NPLib/Physics/linkdef.h
+++ b/NPLib/Physics/linkdef.h
@@ -2,4 +2,4 @@
 #pragma link C++ defined_in "./NPReaction.h";
 #pragma link C++ defined_in "./NPBeam.h";
 #pragma link C++ defined_in "./NPNucleus.h";
-#endif
\ No newline at end of file
+#endif
diff --git a/NPSimulation/Makefile b/NPSimulation/Makefile
index a2c7acc85..10c08a528 100644
--- a/NPSimulation/Makefile
+++ b/NPSimulation/Makefile
@@ -12,7 +12,7 @@ DelIncSrcFiles:
 	./scripts/deletefiles.sh
 
 NPSimulation:
-	make -j 10 -f Makefile.geant4
+	make -j -f Makefile.geant4
 
 clean:
 	./scripts/deletefiles.sh
diff --git a/NPSimulation/src/DetectorConstruction.cc b/NPSimulation/src/DetectorConstruction.cc
index bdfa7a5e5..5fc25dd67 100644
--- a/NPSimulation/src/DetectorConstruction.cc
+++ b/NPSimulation/src/DetectorConstruction.cc
@@ -725,6 +725,12 @@ void DetectorConstruction::ReadConfigurationFile(string Path){
   }
   
   ConfigFile.close();
+  
+  if(m_Target==NULL){
+    cout << "ERROR: No target define in detector file. Cannot perform simulation without target" << endl ;
+    exit(-1);
+  }
+  
   return   ;
 }
 
diff --git a/Outputs/Analysis/.gitignore b/Outputs/Analysis/.gitignore
new file mode 100644
index 000000000..e69de29bb
diff --git a/Outputs/Simulation/.gitignore b/Outputs/Simulation/.gitignore
new file mode 100644
index 000000000..e69de29bb
-- 
GitLab