diff --git a/Inputs/EventGenerator/proton.source b/Inputs/EventGenerator/proton.source index 1b6bb1ffc512f82430028692ab81baff58a6585e..ca319dcce20732a0f9db709dbe1e22e986c5163c 100644 --- a/Inputs/EventGenerator/proton.source +++ b/Inputs/EventGenerator/proton.source @@ -11,6 +11,6 @@ Isotropic x0= 0 y0= 0 z0= 0 - particle= proton + Particle= proton %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Supported particle type: proton, neutron, deuton, triton, He3 , alpha diff --git a/NPAnalysis/MakePhysicalTree/RunToTreat.txt b/NPAnalysis/MakePhysicalTree/RunToTreat.txt index c4a2947a858c004599167c1f8ee390dcd2696f9d..a54d65b1c3d4ab602a5d1d27f2fd24d2d1e91082 100644 --- a/NPAnalysis/MakePhysicalTree/RunToTreat.txt +++ b/NPAnalysis/MakePhysicalTree/RunToTreat.txt @@ -1,5 +1,4 @@ TTreeName S1107Data RootFileName - /Volumes/S1107/RootData/data2251*.root - + /Users/adrienmatta/Desktop/S1107/data2251*.root diff --git a/NPAnalysis/pMakePhysicalTree/MakePhysicalTree.cxx b/NPAnalysis/pMakePhysicalTree/MakePhysicalTree.cxx index eb400f7f478732c15a28fff8a8ac5cb22ae17494..dc535aca122d8759891acd24e42734efadf6ddb7 100644 --- a/NPAnalysis/pMakePhysicalTree/MakePhysicalTree.cxx +++ b/NPAnalysis/pMakePhysicalTree/MakePhysicalTree.cxx @@ -7,9 +7,13 @@ void MakePhysicalTree(string option){ string runToReadfileName = NPOptionManager::getInstance(option)->GetRunToReadFile(); TDSet* DSet = new TDSet( *(RootInput::getInstance(runToReadfileName)->GetChain()) ); - + TProof* plite; + + if(!gProof) + plite = TProof::Open("lite://") ; + else + plite = gProof; - TProof *plite = TProof::Open("lite://") ; plite->Process(DSet, "DataProcessor.cxx+", option.c_str()); return ; diff --git a/NPAnalysis/pMakePhysicalTree/RunToTreat.txt b/NPAnalysis/pMakePhysicalTree/RunToTreat.txt index f8a37350cd88c30cff2f7bcfc410b7b892eac783..a54d65b1c3d4ab602a5d1d27f2fd24d2d1e91082 100644 --- a/NPAnalysis/pMakePhysicalTree/RunToTreat.txt +++ b/NPAnalysis/pMakePhysicalTree/RunToTreat.txt @@ -1,4 +1,4 @@ TTreeName S1107Data RootFileName - /Volumes/S1107/RootData/data2251*.root + /Users/adrienmatta/Desktop/S1107/data2251*.root diff --git a/NPLib/IORoot/RootInput.cxx b/NPLib/IORoot/RootInput.cxx index de8cc2dbcdcc84aba30b58185aeab91dc3c5b9ff..d5f7e9467a6e6c374efa3a92fc892cc53c321b36 100644 --- a/NPLib/IORoot/RootInput.cxx +++ b/NPLib/IORoot/RootInput.cxx @@ -112,7 +112,7 @@ RootInput::RootInput(string configFileName) } } - cout << "ROOTInput has loaded " << pRootChain->GetEntries() << " entries in the inout chain " << endl ; + cout << "ROOTInput: " << pRootChain->GetEntries() << " entries loaded in the input chain " << endl ; } if (!CheckRootFileName || !CheckTreeName) diff --git a/NPLib/Physics/NPBeam.cxx b/NPLib/Physics/NPBeam.cxx index 1bd2b7a3a5b901226d8a257a5920510c42019df8..1269606f76b21b3478fce4a2ed7ecaf68c077489 100644 --- a/NPLib/Physics/NPBeam.cxx +++ b/NPLib/Physics/NPBeam.cxx @@ -39,11 +39,12 @@ #include "TDirectory.h" // Use CLHEP System of unit and Physical Constant -//#include "CLHEP/Units/GlobalSystemOfUnits.h" -//#include "CLHEP/Units/PhysicalConstants.h" #include "NPGlobalSystemOfUnits.h" #include "NPPhysicalConstants.h" + +#ifdef NP_SYSTEM_OF_UNITS_H using namespace NPUNITS; +#endif using namespace NPL; diff --git a/NPLib/Physics/NPEnergyLoss.h b/NPLib/Physics/NPEnergyLoss.h index 49ec4322cf851e3bcb14047e51c903d943ab5bbb..30cf8e73710f0f28eb359d67bedb6b84f76bfee5 100644 --- a/NPLib/Physics/NPEnergyLoss.h +++ b/NPLib/Physics/NPEnergyLoss.h @@ -40,12 +40,11 @@ using namespace std ; //#include "TObject.h" // Use CLHEP System of unit and Physical Constant -//#include "CLHEP/Units/GlobalSystemOfUnits.h" -//#include "CLHEP/Units/PhysicalConstants.h" -//using namespace CLHEP ; #include "NPGlobalSystemOfUnits.h" #include "NPPhysicalConstants.h" +#ifdef NP_SYSTEM_OF_UNITS_H using namespace NPUNITS; +#endif // ROOT #include "Math/InterpolationTypes.h" diff --git a/NPLib/Physics/NPGlobalSystemOfUnits.h b/NPLib/Physics/NPGlobalSystemOfUnits.h index a8b4cc2c704798316e3500bac2b159ebe57d691d..2112b85b5c0dd9d05a72251daf9738744f631ac6 100644 --- a/NPLib/Physics/NPGlobalSystemOfUnits.h +++ b/NPLib/Physics/NPGlobalSystemOfUnits.h @@ -1,3 +1,4 @@ +#ifdef NP_SYSTEM_OF_UNITS_H #include "NPSystemOfUnits.h" @@ -116,3 +117,5 @@ using NPUNITS::lux; using NPUNITS::perCent; using NPUNITS::perThousand; using NPUNITS::perMillion; + +#endif \ No newline at end of file diff --git a/NPLib/Physics/NPNucleus.cxx b/NPLib/Physics/NPNucleus.cxx index 1bc6f7f6d6ffdb901475d056b5be8cdc01adc37c..e16ebd17540353bbd9889d8a6e9c17426378f9d0 100644 --- a/NPLib/Physics/NPNucleus.cxx +++ b/NPLib/Physics/NPNucleus.cxx @@ -31,7 +31,9 @@ using namespace NPL; //#include "CLHEP/Units/PhysicalConstants.h" #include "NPGlobalSystemOfUnits.h" #include "NPPhysicalConstants.h" +#ifdef NP_SYSTEM_OF_UNITS_H using namespace NPUNITS; +#endif // C++ headers #include <iostream> diff --git a/NPLib/Physics/NPNucleus.h b/NPLib/Physics/NPNucleus.h index 8134522ad10c13943cebb2b52c57d816fcf86470..e3e12992e250e9a80e0b2e9d91a9ac0b5e77d85b 100644 --- a/NPLib/Physics/NPNucleus.h +++ b/NPLib/Physics/NPNucleus.h @@ -26,8 +26,11 @@ #include "TLorentzVector.h" // NPTOOL headers +#include "NPGlobalSystemOfUnits.h" #include "NPPhysicalConstants.h" +#ifdef NP_SYSTEM_OF_UNITS_H using namespace NPUNITS; +#endif // C++ headers #include <string> diff --git a/NPLib/Physics/NPPhysicalConstants.h b/NPLib/Physics/NPPhysicalConstants.h index 9b5959e964a3823d60b61f2a1ae5ec3ae4d6c912..82be85caf6a1065cbaf4fbf34ee46c6ff405afc2 100644 --- a/NPLib/Physics/NPPhysicalConstants.h +++ b/NPLib/Physics/NPPhysicalConstants.h @@ -36,8 +36,11 @@ // 29.04.08 use PDG 2006 values // 03.11.08 use PDG 2008 values +// Prevent to use NPSystem of unit while HEP system of unit is in use (in G4 for example) #ifndef HEP_PHYSICAL_CONSTANTS_H -#define HEP_PHYSICAL_CONSTANTS_H + +#ifndef NP_PHYSICAL_CONSTANTS_H +#define NP_PHYSICAL_CONSTANTS_H #include "NPSystemOfUnits.h" @@ -132,6 +135,7 @@ static const double universe_mean_density = 1.e-25*g/cm3; } // namespace NPUNITS +#endif #endif /* HEP_PHYSICAL_CONSTANTS_H */ diff --git a/NPLib/Physics/NPReaction.cxx b/NPLib/Physics/NPReaction.cxx index 637ac5f33db4d0c4f05b4add0fe923b22d0d9b17..3a153d3bca608fc4f773eadd552d2bef69dceb1d 100644 --- a/NPLib/Physics/NPReaction.cxx +++ b/NPLib/Physics/NPReaction.cxx @@ -46,11 +46,11 @@ #include "NPFunction.h" // Use CLHEP System of unit and Physical Constant -//#include "CLHEP/Units/GlobalSystemOfUnits.h" -//#include "CLHEP/Units/PhysicalConstants.h" #include "NPGlobalSystemOfUnits.h" #include "NPPhysicalConstants.h" +#ifdef NP_SYSTEM_OF_UNITS_H using namespace NPUNITS; +#endif ClassImp(Reaction) diff --git a/NPLib/Physics/NPSystemOfUnits.h b/NPLib/Physics/NPSystemOfUnits.h index f15152b04576ce55f856312877f5db7563a7890a..7cd9f18aa292e2d963b87bba90883298403c32f0 100644 --- a/NPLib/Physics/NPSystemOfUnits.h +++ b/NPLib/Physics/NPSystemOfUnits.h @@ -42,7 +42,9 @@ // 03.11.08 use PDG 2008 value of e_SI #ifndef HEP_SYSTEM_OF_UNITS_H -#define HEP_SYSTEM_OF_UNITS_H + +#ifndef NP_SYSTEM_OF_UNITS_H +#define NP_SYSTEM_OF_UNITS_H namespace NPUNITS { @@ -286,4 +288,5 @@ namespace NPUNITS { } // namespace NPUNITS +#endif #endif /* HEP_SYSTEM_OF_UNITS_H */ diff --git a/NPLib/Sharc/TSharcPhysics.cxx b/NPLib/Sharc/TSharcPhysics.cxx index a57aa3d8c714a46213e64cee8ee26c5a242f2cd5..d2d76932d2441b73e5c3ac2fcde944ea829e3625 100644 --- a/NPLib/Sharc/TSharcPhysics.cxx +++ b/NPLib/Sharc/TSharcPhysics.cxx @@ -32,6 +32,7 @@ using namespace Sharc_LOCAL; #include "RootInput.h" #include "RootOutput.h" #include "TAsciiFile.h" +#include "NPOptionManager.h" // ROOT #include "TChain.h" /////////////////////////////////////////////////////////////////////////// @@ -449,6 +450,9 @@ void TSharcPhysics::ReadConfiguration(string Path) bool ReadingStatusQQQ = false ; bool ReadingStatusBOX = false ; bool ReadingStatus = false ; + + bool VerboseLevel = NPOptionManager::getInstance()->GetVerboseLevel(); ; + while (!ConfigFile.eof()){ getline(ConfigFile, LineBuffer); @@ -463,15 +467,15 @@ void TSharcPhysics::ReadConfiguration(string Path) // CD case if (DataBuffer=="SharcQQQ"){ - cout << "///" << endl ; - cout << "QQQ Quadrant found: " << endl ; + if(VerboseLevel) cout << "///" << endl ; + if(VerboseLevel) cout << "QQQ Quadrant found: " << endl ; ReadingStatusQQQ = true ; } // Box case else if (DataBuffer=="SharcBOX"){ - cout << "///" << endl ; - cout << "Box Detector found: " << endl ; + if(VerboseLevel) cout << "///" << endl ; + if(VerboseLevel) cout << "Box Detector found: " << endl ; ReadingStatusBOX = true ; } @@ -488,21 +492,21 @@ void TSharcPhysics::ReadConfiguration(string Path) check_Z = true; ConfigFile >> DataBuffer ; Z= atof(DataBuffer.c_str()); - cout << " Z= " << Z << "mm" << endl; + if(VerboseLevel) cout << " Z= " << Z << "mm" << endl; } else if (DataBuffer == "R=") { check_R = true; ConfigFile >> DataBuffer ; R= atof(DataBuffer.c_str()); - cout << " R= " << R << "mm" << endl; + if(VerboseLevel) cout << " R= " << R << "mm" << endl; } else if (DataBuffer == "Phi=") { check_Phi = true; ConfigFile >> DataBuffer ; Phi= atof(DataBuffer.c_str()); - cout << " Phi= " << Phi << "deg" << endl; + if(VerboseLevel) cout << " Phi= " << Phi << "deg" << endl; } else if (DataBuffer == "ThicknessDector=") { @@ -543,7 +547,7 @@ void TSharcPhysics::ReadConfiguration(string Path) check_Z = true; ConfigFile >> DataBuffer ; Z= atof(DataBuffer.c_str()); - cout << " Z= " << Z << "mm" << endl; + if(VerboseLevel) cout << " Z= " << Z << "mm" << endl; } else if (DataBuffer == "ThicknessDector1=") { diff --git a/NPSimulation/src/DetectorConstruction.cc b/NPSimulation/src/DetectorConstruction.cc index 65fbd8cff1f0df4d2d17e1efc3a3bea46121bdf6..2e4531c593ff07f39bd8a97b18f04a2778f222bd 100644 --- a/NPSimulation/src/DetectorConstruction.cc +++ b/NPSimulation/src/DetectorConstruction.cc @@ -363,7 +363,7 @@ void DetectorConstruction::ReadConfigurationFile(string Path){ ///// Search for S1 Annular detector ////// //////////////////////////////////////////// else if (LineBuffer.compare(0, 9, "AnnularS1") == 0 && cS1 == false) { -#ifdef INC_ANNULARSi1 +#ifdef INC_ANNULARS1 cS1 = true ; if(VerboseLevel==1) cout << endl << "//////// S1 Annular detector ////////" << endl << endl ; diff --git a/NPSimulation/src/EventGeneratorIsotropic.cc b/NPSimulation/src/EventGeneratorIsotropic.cc index 5b2d29cc31b83b2da535948f4c54d396822eb512..3e0c78171a2f0cc31e3760e7e92dd384fbf32433 100644 --- a/NPSimulation/src/EventGeneratorIsotropic.cc +++ b/NPSimulation/src/EventGeneratorIsotropic.cc @@ -100,7 +100,6 @@ void EventGeneratorIsotropic::ReadConfiguration(string Path,int){ while (ReadingStatus) { ReactionFile >> DataBuffer; - //Search for comment Symbol % if (DataBuffer.compare(0, 1, "%") == 0) { ReactionFile.ignore ( std::numeric_limits<std::streamsize>::max(), '\n' );} @@ -158,6 +157,11 @@ void EventGeneratorIsotropic::ReadConfiguration(string Path,int){ ReactionFile >> m_particleName; G4cout << "Particle : " << m_particleName << endl ; + // Case of light particle + if(m_particleName=="proton"){ m_particleName="1H" ; check_ExcitationEnergy = true ;} + else if(m_particleName=="deuton"){ m_particleName="2H" ; check_ExcitationEnergy = true ;} + else if(m_particleName=="triton"){ m_particleName="3H" ; check_ExcitationEnergy = true ;} + else if(m_particleName=="alpha") { m_particleName="4He" ; check_ExcitationEnergy = true ;} } else if (DataBuffer=="ExcitationEnergy=") { @@ -181,7 +185,7 @@ void EventGeneratorIsotropic::ReadConfiguration(string Path,int){ } if( !check_EnergyLow || !check_EnergyHigh || !check_HalfOpenAngleMin || !check_HalfOpenAngleMax || !check_x0 || !check_y0 || !check_z0 || !check_particle ) - {cout << "WARNING : Token Sequence Incomplete, Isotropic definition could not be Fonctionnal" << endl ;} + {cout << "ERROR : Token Sequence Incomplete, Isotropic definition can not be Fonctionnal" << endl ; exit(1);}