diff --git a/NPLib/Core/NPOptionManager.cxx b/NPLib/Core/NPOptionManager.cxx index 79f648d3175074a53a7ef494a4d04585c7f03c41..c4e1573dcac0485d213d57210bd726d570ced8c7 100644 --- a/NPLib/Core/NPOptionManager.cxx +++ b/NPLib/Core/NPOptionManager.cxx @@ -1,4 +1,4 @@ -/***************************************************************************** +;/***************************************************************************** * Copyright (C) 2009-2016 this file is part of the NPTool Project * * * * For the licensing terms see $NPTOOL/Licence/NPTool_Licence * @@ -96,7 +96,7 @@ void NPOptionManager::ReadTheInputArgument(int argc, char** argv){ - for (int i = 0; i < argc; i++) { + for (int i = 1; i < argc; i++) { std::string argument = argv[i]; if (argument == "-H" || argument == "-h" || argument == "--help") DisplayHelp(); @@ -168,8 +168,9 @@ void NPOptionManager::ReadTheInputArgument(int argc, char** argv){ else if (argument == "--circular") {fCircularTree = true;} - - //else ; + else{ + SendErrorAndExit(argument.c_str()); + } } CheckArguments(); if(argc!=0) @@ -384,7 +385,8 @@ void NPOptionManager::SendErrorAndExit(const char* type) const{ } else { - std::cout << "NPOptionManager::SendErrorAndExit() unkwown keyword" << std::endl; + std::cout << "NPOptionManager::SendErrorAndExit() unkwown program argument: " << type << std::endl; + exit(1); } } diff --git a/NPLib/Physics/NPReaction.cxx b/NPLib/Physics/NPReaction.cxx index ba6e8803ba0f5c3638a47d78c111eaf841e4d9c2..566194f56458581b04e8dd22f16548e31bec6c4c 100644 --- a/NPLib/Physics/NPReaction.cxx +++ b/NPLib/Physics/NPReaction.cxx @@ -87,7 +87,6 @@ ClassImp(Reaction) fshoot3=true; fshoot4=true; fUseExInGeant4=true; - RandGen=gRandom; fLabCrossSection=false; // flag if the provided cross-section is in the lab or not @@ -156,7 +155,6 @@ Reaction::Reaction(string reaction){ fshoot3=true; fshoot4=true; - RandGen=gRandom; fLabCrossSection=false; @@ -357,7 +355,7 @@ double Reaction::EnergyLabFromThetaLab(double ThetaLab){ if(B>D) { ThetaLabMax = asin(sqrt(D/B)); - if(RandGen->Rndm()<0.5) sign=-1; + if(gRandom->Rndm()<0.5) sign=-1; } if(ThetaLab>ThetaLabMax) return -1; diff --git a/NPSimulation/Process/BeamReaction.cc b/NPSimulation/Process/BeamReaction.cc index 446ffc9d6fddb10a9c9d87d423c0d7a5345bce44..0a367ce66e826cab52b9517032679fa548830d1b 100644 --- a/NPSimulation/Process/BeamReaction.cc +++ b/NPSimulation/Process/BeamReaction.cc @@ -320,7 +320,7 @@ void NPS::BeamReaction::DoIt(const G4FastTrack& fastTrack, // Angles // Shoot and Set a Random ThetaCM m_Reaction.ShootRandomThetaCM(); - double phi = RandFlat::shoot() * 2. * pi; + double phi = G4RandFlat::shoot() * 2. * pi; ////////////////////////////////////////////////// ///// Momentum and angles from kinematics ///// @@ -453,8 +453,8 @@ void NPS::BeamReaction::DoIt(const G4FastTrack& fastTrack, // Shoot and Set a Random ThetaCM //m_QFS.ShootRandomThetaCM(); //m_QFS.ShootRandomPhiCM(); - double theta = RandFlat::shoot() * pi; - double phi = RandFlat::shoot() * 2. * pi - pi; //rand in [-pi,pi] + double theta = G4RandFlat::shoot() * pi; + double phi = G4RandFlat::shoot() * 2. * pi - pi; //rand in [-pi,pi] m_QFS.SetThetaCM(theta); m_QFS.SetPhiCM(phi); diff --git a/NPSimulation/Simulation.cc b/NPSimulation/Simulation.cc index ba0ce3916324317772413aaaf22dea1290a84b48..ed862a21df62f611f1149d2c3d1cc51f136af25e 100644 --- a/NPSimulation/Simulation.cc +++ b/NPSimulation/Simulation.cc @@ -67,6 +67,7 @@ int main(int argc, char** argv){ // initialize the state of the root and geant4 random generator if(OptionManager->GetRandomSeed()>0){ + std::cout << " Seeds for random generators set to: " << OptionManager->GetRandomSeed() << std::endl; gRandom->SetSeed(OptionManager->GetRandomSeed()); CLHEP::HepRandom::setTheSeed(OptionManager->GetRandomSeed(),3); } diff --git a/Projects/Dali/PhysicsListOption.txt b/Projects/Dali/PhysicsListOption.txt index a8991fd396fd70fc80b1cdcb14efc5fec098c56e..55051b2daa3ff7d02c80ce05ada9b18aae3fecb9 100644 --- a/Projects/Dali/PhysicsListOption.txt +++ b/Projects/Dali/PhysicsListOption.txt @@ -1,7 +1,7 @@ EmPhysicsList Option4 DefaultCutOff 10000 IonBinaryCascadePhysics 0 -DriftElectronPhysics 1 +DriftElectronPhysics 1 NPIonInelasticPhysics 0 EmExtraPhysics 0 HadronElasticPhysics 0 diff --git a/Projects/Minos/PhysicsListOption.txt b/Projects/Minos/PhysicsListOption.txt index 5e948e6061566e703143f8c5a86e4ee5ff6d7f76..68f97e860e04654d462d3f6e1888f1ab694af8de 100644 --- a/Projects/Minos/PhysicsListOption.txt +++ b/Projects/Minos/PhysicsListOption.txt @@ -1,5 +1,5 @@ EmPhysicsList Option4 -DriftElectronPhysics 1 +DriftElectronPhysics 0 DefaultCutOff 1e9 IonBinaryCascadePhysics 0 NPIonInelasticPhysics 0