Skip to content
Snippets Groups Projects
Commit 6945ceb6 authored by Morfouace's avatar Morfouace
Browse files

Merge branch 'NPTool.2.dev' of https://github.com/adrien-matta/nptool into NPTool.2.dev

parents 1e074454 af0fef7c
No related branches found
No related tags found
No related merge requests found
...@@ -15,7 +15,6 @@ TChain* chain = LoadChain(); ...@@ -15,7 +15,6 @@ TChain* chain = LoadChain();
TCanvas* c1 = new TCanvas("Example2","Example2",0,0,800,800); TCanvas* c1 = new TCanvas("Example2","Example2",0,0,800,800);
c1->Divide(2,2); c1->Divide(2,2);
// Kinematic Line // Kinematic Line
c1->cd(1); c1->cd(1);
chain->Draw("ELab:ThetaLab>>hKine(180,0,180,400,0,20)","ELab>0","colz"); chain->Draw("ELab:ThetaLab>>hKine(180,0,180,400,0,20)","ELab>0","colz");
......
...@@ -47,6 +47,15 @@ if(${CMAKE_CXX_COMPILER_ID} MATCHES ".*Clang.*") ...@@ -47,6 +47,15 @@ if(${CMAKE_CXX_COMPILER_ID} MATCHES ".*Clang.*")
endif() endif()
endif() endif()
# If compiler is GCC active the color diagnostic
if(${CMAKE_CXX_COMPILER_ID} MATCHES ".*GNU.*")
execute_process(COMMAND ${CMAKE_C_COMPILER} -dumpversion
OUTPUT_VARIABLE GCC_VERSION)
if (GCC_VERSION VERSION_GREATER 4.9 OR GCC_VERSION VERSION_EQUAL 4.9)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fdiagnostics-color=always")
endif()
endif()
# Adjust the compiler language flag # Adjust the compiler language flag
set(NOCPPFLAGS true) set(NOCPPFLAGS true)
if(${CMAKE_CXX_FLAGS} MATCHES ".*std=.*11") if(${CMAKE_CXX_FLAGS} MATCHES ".*std=.*11")
......
...@@ -301,6 +301,8 @@ RootInput::~RootInput(){ ...@@ -301,6 +301,8 @@ RootInput::~RootInput(){
cout << endl << "Root Input summary" << endl; cout << endl << "Root Input summary" << endl;
cout << " - Number of bites read: " << pRootFile->GetBytesRead() << endl; cout << " - Number of bites read: " << pRootFile->GetBytesRead() << endl;
cout << " - Number of transactions: " << pRootFile->GetReadCalls() << endl; cout << " - Number of transactions: " << pRootFile->GetReadCalls() << endl;
// Close the Root file
pRootFile->Close();
} }
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
......
...@@ -147,7 +147,7 @@ Reaction::Reaction(string reaction){ ...@@ -147,7 +147,7 @@ Reaction::Reaction(string reaction){
fCrossSectionHist = new TH1F(Form("EnergyHist_%i",offset),"Reaction_CS",1,0,180); fCrossSectionHist = new TH1F(Form("EnergyHist_%i",offset),"Reaction_CS",1,0,180);
fDoubleDifferentialCrossSectionHist = NULL ; fDoubleDifferentialCrossSectionHist = NULL ;
fshoot3=true; fshoot3=true;
fshoot4=true; fshoot4=true;
initializePrecomputeVariable(); initializePrecomputeVariable();
......
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
// Root // Root
#include"TKey.h" #include"TKey.h"
#include"TEnv.h" #include"TEnv.h"
#include"TROOT.h"
void ProgressDisplay(clock_t&,clock_t&,unsigned long&, unsigned long&, unsigned long&, double&, unsigned long&, int&, int&); void ProgressDisplay(clock_t&,clock_t&,unsigned long&, unsigned long&, unsigned long&, double&, unsigned long&, int&, int&);
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
int main(int argc , char** argv){ int main(int argc , char** argv){
...@@ -249,7 +249,7 @@ int main(int argc , char** argv){ ...@@ -249,7 +249,7 @@ int main(int argc , char** argv){
RootOutput::Destroy(); RootOutput::Destroy();
RootInput::Destroy(); RootInput::Destroy();
return 0; return 0;
} }
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
......
...@@ -136,13 +136,17 @@ int main(int argc , char** argv){ ...@@ -136,13 +136,17 @@ int main(int argc , char** argv){
} }
// Change all the .so to .dylib for Mac Os X in the installed rootmap // Change all the .so to .dylib for Mac Os X in the installed rootmap
#ifdef __APPLE__
path = getenv("NPTOOL"); path = getenv("NPTOOL");
path += "/NPLib/*/*.rootmap"; path += "/NPLib/*/*.rootmap";
string command = "ls "+ path +" > /dev/null 2>/dev/null"; string command = "ls "+ path +" > /dev/null 2>/dev/null";
return_value=system(command.c_str()); return_value=system(command.c_str());
if(!return_value){ if(!return_value){
std::string command = "sed -i '' -e 's/"+INCORRECT_LIB_EXTENSION+"/"+CORRECT_LIB_EXTENSION+"/g' "+path; std::string command = "sed -i '' -e 's/"+INCORRECT_LIB_EXTENSION+"/"+CORRECT_LIB_EXTENSION+"/g' "+path;
return_value=system(command.c_str()); return_value=system(command.c_str());
} }
#endif
return 0; return 0;
} }
...@@ -43,6 +43,16 @@ if(${CMAKE_CXX_COMPILER_ID} MATCHES ".*Clang.*") ...@@ -43,6 +43,16 @@ if(${CMAKE_CXX_COMPILER_ID} MATCHES ".*Clang.*")
endif() endif()
endif() endif()
# If compiler is GCC active the color diagnostic
if(${CMAKE_CXX_COMPILER_ID} MATCHES ".*GNU.*")
execute_process(COMMAND ${CMAKE_C_COMPILER} -dumpversion
OUTPUT_VARIABLE GCC_VERSION)
if (GCC_VERSION VERSION_GREATER 4.9 OR GCC_VERSION VERSION_EQUAL 4.9)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fdiagnostics-color=always")
endif()
endif()
# Adjust the compiler language flag # Adjust the compiler language flag
set(NOCPPFLAGS true) set(NOCPPFLAGS true)
if(${CMAKE_CXX_FLAGS} MATCHES ".*std=.*11") if(${CMAKE_CXX_FLAGS} MATCHES ".*std=.*11")
......
...@@ -6,79 +6,79 @@ void Style_nponline(){ ...@@ -6,79 +6,79 @@ void Style_nponline(){
// produce minimalist publication ready // produce minimalist publication ready
// outlook with nptool color scheme // outlook with nptool color scheme
//----------------------------------- //-----------------------------------
TStyle* style_nponline = new TStyle("nponline", "style_nponline"); TStyle* style = new TStyle("nponline", "style");
//General //General
style_nponline->SetFrameFillColor(kGray+3); style->SetFrameFillColor(kGray+3);
style_nponline->SetFrameBorderMode(0); style->SetFrameBorderMode(0);
style_nponline->SetFrameLineColor(kGray+3); style->SetFrameLineColor(kGray+3);
style_nponline->SetStatColor(kGray+3); style->SetStatColor(kGray+3);
style_nponline->SetFillColor(kGray+3); style->SetFillColor(kGray+3);
style_nponline->SetTitleFillColor(kGray+3); style->SetTitleFillColor(kGray+3);
style_nponline->SetTitleColor(kWhite,"pad"); style->SetTitleColor(kWhite,"pad");
style_nponline->SetTitleBorderSize(0); style->SetTitleBorderSize(0);
style_nponline->SetTextColor(kWhite); style->SetTextColor(kWhite);
// Canvas // Canvas
style_nponline->SetCanvasColor(kGray+3); style->SetCanvasColor(kGray+3);
style_nponline->SetCanvasDefH(800); style->SetCanvasDefH(800);
style_nponline->SetCanvasDefW(800); style->SetCanvasDefW(800);
style_nponline->SetCanvasBorderMode(0); style->SetCanvasBorderMode(0);
// Pad // Pad
style_nponline->SetPadBottomMargin(0.10); style->SetPadBottomMargin(0.10);
style_nponline->SetPadLeftMargin(0.15); style->SetPadLeftMargin(0.15);
style_nponline->SetPadTopMargin(0.10); style->SetPadTopMargin(0.10);
style_nponline->SetPadRightMargin(0.15); style->SetPadRightMargin(0.15);
style_nponline->SetPadBorderMode(0); style->SetPadBorderMode(0);
style_nponline->SetPadBorderSize(1); style->SetPadBorderSize(1);
style_nponline->SetPadColor(kGray+3); style->SetPadColor(kGray+3);
style_nponline->SetPadTickX(1); style->SetPadTickX(1);
style_nponline->SetPadTickY(1); style->SetPadTickY(1);
// Desable stat title and fit // Desable stat title and fit
style_nponline->SetOptStat(0); style->SetOptStat(0);
style_nponline->SetOptTitle(1); style->SetOptTitle(1);
style_nponline->SetOptFit(1); style->SetOptFit(1);
// x axis // x axis
style_nponline->SetAxisColor(kWhite,"X"); style->SetAxisColor(kWhite,"X");
style_nponline->SetLabelColor(kWhite,"X"); style->SetLabelColor(kWhite,"X");
style_nponline->SetTitleXSize(0.06); style->SetTitleXSize(0.06);
style_nponline->SetTitleXOffset(1.0); style->SetTitleXOffset(1.0);
style_nponline->SetLabelOffset(0.1,"X"); style->SetLabelOffset(0.1,"X");
style_nponline->SetLabelSize(0.06,"X"); style->SetLabelSize(0.06,"X");
style_nponline->SetLabelOffset(0.006,"X"); style->SetLabelOffset(0.006,"X");
// y axis // y axis
style_nponline->SetTitleYSize(0.06); style->SetTitleYSize(0.06);
style_nponline->SetTitleYOffset(1.1); style->SetTitleYOffset(1.1);
style_nponline->SetLabelOffset(0.1,"Y"); style->SetLabelOffset(0.1,"Y");
style_nponline->SetLabelSize(0.06,"Y"); style->SetLabelSize(0.06,"Y");
style_nponline->SetLabelOffset(0.006,"Y"); style->SetLabelOffset(0.006,"Y");
style_nponline->SetAxisColor(kWhite,"Y"); style->SetAxisColor(kWhite,"Y");
style_nponline->SetLabelColor(kWhite,"Y"); style->SetLabelColor(kWhite,"Y");
// z axis // z axis
style_nponline->SetAxisColor(kWhite,"Z"); style->SetAxisColor(kWhite,"Z");
style_nponline->SetLabelSize(0.06,"Z"); style->SetLabelSize(0.06,"Z");
style_nponline->SetLabelOffset(0.006,"Z"); style->SetLabelOffset(0.006,"Z");
style_nponline->SetLabelColor(kWhite,"Z"); style->SetLabelColor(kWhite,"Z");
// Histogramm // Histogramm
style_nponline->SetHistLineColor(kAzure+7); style->SetHistLineColor(kAzure+7);
style_nponline->SetHistFillStyle(1001); style->SetHistFillStyle(1001);
style_nponline->SetHistFillColor(kAzure+7); style->SetHistFillColor(kAzure+7);
style_nponline->SetMarkerColor(kOrange+7); style->SetMarkerColor(kOrange+7);
style_nponline->SetMarkerStyle(20); style->SetMarkerStyle(20);
style_nponline->SetLineColor(kOrange+7); style->SetLineColor(kOrange+7);
style_nponline->SetLineWidth(1); style->SetLineWidth(1);
style_nponline->SetFuncColor(kOrange+7); style->SetFuncColor(kOrange+7);
style_nponline->SetFuncWidth(2); style->SetFuncWidth(2);
style_nponline->SetTitlePS("nptool"); style->SetTitlePS("nptool");
const UInt_t Number = 2; const UInt_t Number = 2;
Double_t Red[Number] = { 0,0 }; Double_t Red[Number] = { 0,0 };
...@@ -88,5 +88,5 @@ void Style_nponline(){ ...@@ -88,5 +88,5 @@ void Style_nponline(){
Double_t Length[Number] = { 0,1.00 }; Double_t Length[Number] = { 0,1.00 };
Int_t nb=255; Int_t nb=255;
TColor::CreateGradientColorTable(Number,Length,Red,Green,Blue,nb); TColor::CreateGradientColorTable(Number,Length,Red,Green,Blue,nb);
style_nponline->SetNumberContours(99); style->SetNumberContours(99);
} }
...@@ -6,83 +6,87 @@ void Style_nptool(){ ...@@ -6,83 +6,87 @@ void Style_nptool(){
// produce minimalist publication ready // produce minimalist publication ready
// outlook with nptool color scheme // outlook with nptool color scheme
//----------------------------------- //-----------------------------------
TStyle* style_nptool = new TStyle("nptool", "style_nptool"); TStyle* style = new TStyle("nptool", "style");
style->SetTitlePS("nptool");
//General //General
style_nptool->SetFrameFillColor(kWhite); style->SetFrameFillColor(kWhite);
style_nptool->SetFrameBorderMode(0); style->SetFrameBorderMode(0);
style_nptool->SetFrameLineColor(kBlack); style->SetFrameLineColor(kWhite);
style_nptool->SetStatColor(kWhite); style->SetStatColor(kBlack);
style_nptool->SetFillColor(kWhite); style->SetTitleFillColor(kWhite);
style_nptool->SetTitleFillColor(kWhite); style->SetTitleColor(kBlack,"pad");
style_nptool->SetPaperSize(20,24); style->SetTitleBorderSize(0);
// Canvas style->SetTextColor(kBlack);
style_nptool->SetCanvasColor(kWhite);
style_nptool->SetCanvasDefH(800);
style_nptool->SetCanvasDefW(800);
style_nptool->SetCanvasBorderMode(0);
// Canvas
style->SetCanvasPreferGL(true);
style->SetCanvasColor(kWhite);
style->SetCanvasDefH(800);
style->SetCanvasDefW(800);
style->SetCanvasBorderMode(0);
// Pad // Pad
style_nptool->SetPadBottomMargin(0.15); style->SetPadBottomMargin(0.10);
style_nptool->SetPadLeftMargin(0.15); style->SetPadLeftMargin(0.10);
style_nptool->SetPadTopMargin(0.05); style->SetPadTopMargin(0.15);
style_nptool->SetPadRightMargin(0.10); style->SetPadRightMargin(0.15);
style_nptool->SetPadBorderMode(0); style->SetPadBorderMode(0);
style_nptool->SetPadBorderSize(1); style->SetPadBorderSize(1);
style_nptool->SetPadColor(kWhite); // style->SetPadColor(kWhite);
style_nptool->SetPadTickX(1); style->SetPadTickX(1);
style_nptool->SetPadTickY(1); style->SetPadTickY(1);
// Desable stat title and fit // Disable stat, title and fit
style_nptool->SetOptStat(0); style->SetOptStat(0);
style_nptool->SetOptTitle(0); style->SetOptTitle(0);
//style_nptool->SetOptFit(0); style->SetOptFit(0);
// x axis // x axis
style_nptool->SetTitleXSize(0.07); style->SetAxisColor(kBlack,"X");
style_nptool->SetTitleXOffset(1.0); style->SetLabelColor(kBlack,"X");
style_nptool->SetLabelOffset(0.1,"X"); style->SetTitleXSize(0.04);
style_nptool->SetLabelSize(0.04,"X"); style->SetTitleXOffset(1.0);
style_nptool->SetLabelOffset(0.006,"X"); style->SetLabelOffset(0.1,"X");
style->SetLabelSize(0.04,"X");
/*style_nptool->SetTitleBorderSize(0); style->SetLabelOffset(0.004,"X");
style_nptool->SetTitleX(0.1f);
style_nptool->SetTitleW(0.8f);
style_nptool->SetTitleAlign(3);*/
// y axis // y axis
//style_nptool->GetYaxis()->CenterTitle(); style->SetTitleYSize(0.04);
style_nptool->SetTitleYSize(0.07); style->SetTitleYOffset(1.1);
style_nptool->SetTitleYOffset(1.02); style->SetLabelOffset(0.1,"Y");
style_nptool->SetLabelOffset(0.1,"Y"); style->SetLabelSize(0.04,"Y");
style_nptool->SetLabelSize(0.04,"Y"); style->SetLabelOffset(0.004,"Y");
style_nptool->SetLabelOffset(0.006,"Y"); style->SetAxisColor(kBlack,"Y");
style->SetLabelColor(kBlack,"Y");
// z axis // z axis
style_nptool->SetLabelSize(0.04,"Z"); style->SetAxisColor(kBlack,"Z");
style_nptool->SetLabelOffset(0.006,"Z"); style->SetLabelSize(0.04,"Z");
style->SetLabelOffset(0.004,"Z");
style->SetLabelColor(kBlack,"Z");
// Histogramm // Histogramm
style_nptool->SetHistLineColor(kAzure+7); style->SetHistLineColor(kAzure+7);
style_nptool->SetHistFillStyle(1001); // style->SetHistFillStyle(1001);
style_nptool->SetHistFillColor(kAzure+7); style->SetHistFillColor(kAzure+7);
style_nptool->SetMarkerColor(kOrange+7);
style_nptool->SetMarkerStyle(20); // Graph, Line and Marker
style_nptool->SetLineColor(kOrange+7); style->SetMarkerStyle(20);
style_nptool->SetLineWidth(2); style->SetMarkerColor(kOrange+7);
style_nptool->SetFuncColor(kOrange+7); style->SetLineColor(kOrange+7);
style_nptool->SetFuncWidth(2); style->SetLineWidth(1);
style->SetFuncColor(kOrange+7);
style_nptool->SetTitlePS("nptool"); style->SetFuncWidth(2);
// Create the color gradiant
const UInt_t Number = 2; const UInt_t Number = 2;
Double_t Red[Number] = { 0, 0 }; Double_t Red[Number] = { 0,0 };
Double_t Green[Number] = { 0, 0.8 }; Double_t Green[Number] = { 0,0.8 };
Double_t Blue[Number] = { 0, 1.00 }; Double_t Blue[Number] = { 0,1.00 };
Double_t Length[Number] = { 0,1.00 }; Double_t Length[Number] = { 0,1.00 };
Int_t nb=255; Int_t nb=255;
TColor::CreateGradientColorTable(Number,Length,Red,Green,Blue,nb); TColor::CreateGradientColorTable(Number,Length,Red,Green,Blue,nb);
style_nptool->SetNumberContours(99); style->SetNumberContours(99);
} }
...@@ -7,4 +7,4 @@ set -ev ...@@ -7,4 +7,4 @@ set -ev
cd $NPTOOL/Examples/Example2 cd $NPTOOL/Examples/Example2
npsimulation -D Example2.detector -E Example2.reaction -O Example2 -B 28Mg.mac npsimulation -D Example2.detector -E Example2.reaction -O Example2 -B 28Mg.mac
npanalysis --last-sim -O Example2 npanalysis --last-sim -O Example2
echo ".q" | root -b -l ShowResult.C echo ".q" | root -b -l ShowResults.C
...@@ -50,6 +50,15 @@ if(${CMAKE_CXX_COMPILER_ID} MATCHES ".*Clang.*") ...@@ -50,6 +50,15 @@ if(${CMAKE_CXX_COMPILER_ID} MATCHES ".*Clang.*")
endif() endif()
endif() endif()
# If compiler is GCC active the color diagnostic
if(${CMAKE_CXX_COMPILER_ID} MATCHES ".*GNU.*")
execute_process(COMMAND ${CMAKE_C_COMPILER} -dumpversion
OUTPUT_VARIABLE GCC_VERSION)
if (GCC_VERSION VERSION_GREATER 4.9 OR GCC_VERSION VERSION_EQUAL 4.9)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fdiagnostics-color=always")
endif()
endif()
# Adjust the compiler language flag # Adjust the compiler language flag
set(NOCPPFLAGS true) set(NOCPPFLAGS true)
if(${CMAKE_CXX_FLAGS} MATCHES ".*std=.*11") if(${CMAKE_CXX_FLAGS} MATCHES ".*std=.*11")
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment