From e37a30b2ba498d89514cbda3b4ef76e4f63422f3 Mon Sep 17 00:00:00 2001 From: matta <matta@npt> Date: Fri, 8 Feb 2013 14:39:05 +0000 Subject: [PATCH] * Minor change in the cout in NPS --- Inputs/DetectorConfiguration/Sharc.detector | 4 +-- Inputs/EventGenerator/24Nadp.reaction | 16 +++++----- NPLib/IORoot/Makefile | 6 ++-- NPLib/IORoot/RootInput.cxx | 1 - NPLib/IORoot/RootInput.h | 1 + NPLib/IORoot/RootOutput.h | 1 + NPLib/Physics/Makefile | 10 ++++-- NPLib/Physics/NPReaction.cxx | 1 + NPLib/Physics/NPReaction.h | 3 ++ NPLib/Physics/linkdef.h | 5 +++ NPSimulation/src/DetectorConstruction.cc | 34 ++++++++++----------- NPSimulation/src/PrimaryGeneratorAction.cc | 12 +++++--- 12 files changed, 55 insertions(+), 39 deletions(-) create mode 100644 NPLib/Physics/linkdef.h diff --git a/Inputs/DetectorConfiguration/Sharc.detector b/Inputs/DetectorConfiguration/Sharc.detector index 45043e097..9c8290941 100644 --- a/Inputs/DetectorConfiguration/Sharc.detector +++ b/Inputs/DetectorConfiguration/Sharc.detector @@ -60,12 +60,12 @@ Sharc ThicknessPAD4= 1000 %%%%%%%%%%%%%%%%%%%%%%%%%%%%% %Downstream CD - SharcQQQ + SharcQQQ Z= 100 R= 0 Phi= 0 ThicknessDector= 100 - SharcQQQ + SharcQQQ Z= 100 R= 0 Phi= 90 diff --git a/Inputs/EventGenerator/24Nadp.reaction b/Inputs/EventGenerator/24Nadp.reaction index 34ab09e59..87827eeb9 100644 --- a/Inputs/EventGenerator/24Nadp.reaction +++ b/Inputs/EventGenerator/24Nadp.reaction @@ -3,11 +3,11 @@ Beam Particle= 24Na Energy= 192 - SigmaEnergy= 1 - SigmaThetaX= 0.01 - SigmaPhiY= 0.01 - SigmaX= 0.5 - SigmaY= 0.5 + SigmaEnergy= 1 + SigmaThetaX= 0.01 + SigmaPhiY= 0.01 + SigmaX= 0.5 + SigmaY= 0.5 MeanThetaX= 0 MeanPhiY= 0 MeanX= 0 @@ -24,16 +24,16 @@ TwoBodyReaction Heavy= 25Na ExcitationEnergyLight= 0.0 ExcitationEnergyHeavy= 2.2 - CrossSectionPath= flat.txt CSR + CrossSectionPath= flat.txt CSR ShootLight= 1 ShootHeavy= 1 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -GammaDecay 25Na +%GammaDecay 25Na Cascade BranchingRatio= 70 Energies= 2.2 DifferentialCrossSection= 11Li(d,3He)10He.txt Gamma25Na Cascade BranchingRatio= 30 - Energies= 1.0 1.2 \ No newline at end of file + Energies= 1.0 1.2 diff --git a/NPLib/IORoot/Makefile b/NPLib/IORoot/Makefile index dac9cbe99..ab2a4329c 100644 --- a/NPLib/IORoot/Makefile +++ b/NPLib/IORoot/Makefile @@ -9,11 +9,11 @@ all: $(SHARELIB) ## MUST2 ## libIORoot.so: RootInput.o RootOutput.o - $(LD) $(SOFLAGS) $^ $(OutPutOpt) $@ + $(LD) $(SOFLAGS) $^ $(OutPutOpt) $@ # dependances -RootInput.o: RootInput.cxx RootInput.h -RootOutput.o: RootOutput.cxx RootOutput.h +RootInput.o: RootInput.cxx RootInput.h +RootOutput.o: RootOutput.cxx RootOutput.h ####################################### ############# Clean and More ########## diff --git a/NPLib/IORoot/RootInput.cxx b/NPLib/IORoot/RootInput.cxx index b76981ab0..13c05a178 100644 --- a/NPLib/IORoot/RootInput.cxx +++ b/NPLib/IORoot/RootInput.cxx @@ -29,7 +29,6 @@ #include "RootInput.h" #include "TAsciiFile.h" - RootInput *RootInput::instance = 0; RootInput* RootInput::getInstance(string configFileName) diff --git a/NPLib/IORoot/RootInput.h b/NPLib/IORoot/RootInput.h index 683eca4d7..2d834dfce 100644 --- a/NPLib/IORoot/RootInput.h +++ b/NPLib/IORoot/RootInput.h @@ -78,6 +78,7 @@ private: TChain *pRootChain; TFile *pRootFile; int NumberOfFriend; + }; // A convenient function related to Root Input, coded Here so it can be called within ROOT CINT diff --git a/NPLib/IORoot/RootOutput.h b/NPLib/IORoot/RootOutput.h index 4abf787fc..a84c79660 100644 --- a/NPLib/IORoot/RootOutput.h +++ b/NPLib/IORoot/RootOutput.h @@ -87,6 +87,7 @@ private: TAsciiFile *pCalibrationFile; TAsciiFile *pRunToTreatFile; TAsciiFile *pAnalysisConfigFile; + }; #endif // ROOTOUTPUT_HH diff --git a/NPLib/Physics/Makefile b/NPLib/Physics/Makefile index d1607c44a..1985d512b 100644 --- a/NPLib/Physics/Makefile +++ b/NPLib/Physics/Makefile @@ -8,11 +8,15 @@ all: $(SHARELIB) ############# Various Tool ############ ## Reaction ## -libNPPhysics.so: NPReaction.o NPNucleus.o NPBeam.o NPEnergyLoss.o NPFunction.o - $(LD) $(SOFLAGS) $^ $(OutPutOpt) $@ - +libNPPhysics.so: NPReaction.o NPNucleus.o NPBeam.o NPEnergyLoss.o NPFunction.o NPReactionDict.o + $(LD) $(SOFLAGS) $^ $(OutPutOpt) $@ + +NPReactionDict.cxx: NPReaction.h + rootcint -f $@ -c $^ linkdef.h + # dependances NPReaction.o:NPReaction.cxx NPReaction.h +NPReactionDict.o:NPReaction.cxx NPReaction.h linkdef.h NPNucleus.o: NPNucleus.cxx NPNucleus.h NPEnergyLoss.o:NPEnergyLoss.cxx NPEnergyLoss.h NPBeam.o: NPBeam.cxx NPBeam.h diff --git a/NPLib/Physics/NPReaction.cxx b/NPLib/Physics/NPReaction.cxx index 6be8efae5..727e6aa5d 100644 --- a/NPLib/Physics/NPReaction.cxx +++ b/NPLib/Physics/NPReaction.cxx @@ -48,6 +48,7 @@ // Use CLHEP System of unit and Physical Constant #include "CLHEP/Units/GlobalSystemOfUnits.h" #include "CLHEP/Units/PhysicalConstants.h" +ClassImp(Reaction) //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... Reaction::Reaction(){ diff --git a/NPLib/Physics/NPReaction.h b/NPLib/Physics/NPReaction.h index 2b6136026..b8aca5c9c 100644 --- a/NPLib/Physics/NPReaction.h +++ b/NPLib/Physics/NPReaction.h @@ -187,6 +187,9 @@ namespace NPL{ // Print private paremeter void Print() const; + +ClassDef(Reaction,0) + }; } #endif diff --git a/NPLib/Physics/linkdef.h b/NPLib/Physics/linkdef.h new file mode 100644 index 000000000..87b5f45e1 --- /dev/null +++ b/NPLib/Physics/linkdef.h @@ -0,0 +1,5 @@ +#ifdef __CINT__ +#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 diff --git a/NPSimulation/src/DetectorConstruction.cc b/NPSimulation/src/DetectorConstruction.cc index d963b9995..00b1378e8 100644 --- a/NPSimulation/src/DetectorConstruction.cc +++ b/NPSimulation/src/DetectorConstruction.cc @@ -217,7 +217,7 @@ void DetectorConstruction::ReadConfigurationFile(string Path){ //////////////////////////////////////////// else if (LineBuffer.compare(0, 16, "TheDUMMYDetector") == 0 && cDummy == false) { cDummy = true ; - if(VerboseLevel==1) G4cout << G4endl << "//////// DUMMY DETECTOR ////////" << G4endl << G4endl ; + if(VerboseLevel==1) cout << endl << "//////// DUMMY DETECTOR ////////" << endl << endl ; // Instantiate the new array as a VDetector Object VDetector* myDetector = new DUMMYDetector() ; @@ -238,7 +238,7 @@ void DetectorConstruction::ReadConfigurationFile(string Path){ else if (LineBuffer.compare(0, 16, "ComptonTelescope") == 0 && cComptonTelescope == false) { #ifdef INC_COMPTONTELESCOPE cComptonTelescope = true; - if(VerboseLevel==1) G4cout << "//////// ComptonTelescope ////////" << G4endl; + if(VerboseLevel==1) cout << "//////// ComptonTelescope ////////" << endl; // Instantiate the new array as a VDetector Object VDetector* myDetector = new ComptonTelescope(); @@ -260,7 +260,7 @@ void DetectorConstruction::ReadConfigurationFile(string Path){ else if (LineBuffer.compare(0, 7, "Eurogam") == 0 && cEurogam == false) { #ifdef INC_EUROGAM cEurogam = true; - if(VerboseLevel==1) G4cout << "//////// Eurogam ////////" << G4endl; + if(VerboseLevel==1) cout << "//////// Eurogam ////////" << endl; // Instantiate the new array as a VDetector Object VDetector* myDetector = new Eurogam(); @@ -282,7 +282,7 @@ void DetectorConstruction::ReadConfigurationFile(string Path){ else if (LineBuffer.compare(0, 14, "GaspardTracker") == 0 && cGPDTracker == false) { #ifdef INC_GASPARD cGPDTracker = true ; - if(VerboseLevel==1) G4cout << G4endl << "//////// Gaspard Tracker ////////" << G4endl ; + if(VerboseLevel==1) cout << endl << "//////// Gaspard Tracker ////////" << endl ; // Instantiate the new array as a VDetector Object VDetector* myDetector = new GaspardTracker() ; @@ -304,7 +304,7 @@ void DetectorConstruction::ReadConfigurationFile(string Path){ else if (LineBuffer.compare(0, 11, "HydeTracker") == 0 && cHYDTracker == false) { #ifdef INC_HYDE cHYDTracker = true ; - if(VerboseLevel==1) G4cout << G4endl << "//////// Hyde Tracker ////////" << G4endl ; + if(VerboseLevel==1) cout << endl << "//////// Hyde Tracker ////////" << endl ; // Instantiate the new array as a VDetector Object VDetector* myDetector = new HydeTracker() ; @@ -326,7 +326,7 @@ void DetectorConstruction::ReadConfigurationFile(string Path){ else if (LineBuffer.compare(0, 5, "Paris") == 0 && cParis == false) { #ifdef INC_PARIS cParis = true ; - if(VerboseLevel==1) G4cout << G4endl << "//////// Paris ////////" << G4endl ; + if(VerboseLevel==1) cout << endl << "//////// Paris ////////" << endl ; // Instantiate the new array as a VDetector Object VDetector* myDetector = new Paris() ; @@ -347,7 +347,7 @@ void DetectorConstruction::ReadConfigurationFile(string Path){ else if (LineBuffer.compare(0, 6, "Shield") == 0 && cShield == false) { #ifdef INC_SHIELD cShield = true ; - if(VerboseLevel==1) G4cout << G4endl << "//////// Shield ////////" << G4endl ; + if(VerboseLevel==1) cout << endl << "//////// Shield ////////" << endl ; // Instantiate the new array as a VDetector Object VDetector* myDetector = new Shield() ; @@ -368,7 +368,7 @@ void DetectorConstruction::ReadConfigurationFile(string Path){ else if (LineBuffer.compare(0, 9, "AnnularS1") == 0 && cS1 == false) { #ifdef INC_ANNULARSi1 cS1 = true ; - if(VerboseLevel==1) G4cout << G4endl << "//////// S1 Annular detector ////////" << G4endl << G4endl ; + if(VerboseLevel==1) cout << endl << "//////// S1 Annular detector ////////" << endl << endl ; // Instantiate the new array as a VDetector Object VDetector* myDetector = new AnnularS1() ; @@ -389,7 +389,7 @@ void DetectorConstruction::ReadConfigurationFile(string Path){ else if (LineBuffer.compare(0, 2, "W1") == 0 && cW1 == false) { #ifdef INC_W1 cW1 = true ; - if(VerboseLevel==1) G4cout << G4endl << "//////// W1 Square detector ////////" << G4endl << G4endl; + if(VerboseLevel==1) cout << endl << "//////// W1 Square detector ////////" << endl << endl; // Instantiate the new array as a VDetector Object VDetector* myDetector = new W1(); @@ -410,7 +410,7 @@ void DetectorConstruction::ReadConfigurationFile(string Path){ else if (LineBuffer.compare(0, 10, "MUST2Array") == 0 && cMUST2 == false) { #ifdef INC_MUST2 cMUST2 = true ; - if(VerboseLevel==1) G4cout << G4endl << "//////// MUST2 Array ////////" << G4endl << G4endl ; + if(VerboseLevel==1) cout << endl << "//////// MUST2 Array ////////" << endl << endl ; // Instantiate the new array as a VDetector Object VDetector* myDetector = new MUST2Array() ; @@ -431,7 +431,7 @@ void DetectorConstruction::ReadConfigurationFile(string Path){ else if (LineBuffer.compare(0, 9, "SSSDArray") == 0 && cAddThinSi == false) { #ifdef INC_SSSD cAddThinSi = true ; - if(VerboseLevel==1) G4cout << G4endl << "//////// SSSD ////////" << G4endl << G4endl ; + if(VerboseLevel==1) cout << endl << "//////// SSSD ////////" << endl << endl ; // Instantiate the new array as a VDetector Object VDetector* myDetector = new ThinSi() ; @@ -452,7 +452,7 @@ void DetectorConstruction::ReadConfigurationFile(string Path){ else if (LineBuffer.compare(0, 5, "Sharc") == 0 && cSharc == false) { #ifdef INC_SHARC cSharc = true ; - if(VerboseLevel==1) G4cout << G4endl << "//////// Sharc ////////" << G4endl << G4endl ; + if(VerboseLevel==1) cout << endl << "//////// Sharc ////////" << endl << endl ; // Instantiate the new array as a VDetector Object VDetector* myDetector = new Sharc(); @@ -473,7 +473,7 @@ void DetectorConstruction::ReadConfigurationFile(string Path){ else if (LineBuffer.compare(0, 19, "ScintillatorPlastic") == 0 && cPlastic == false) { #ifdef INC_PLASTIC cPlastic = true ; - if(VerboseLevel==1) G4cout << G4endl << "//////// Plastic ////////" << G4endl << G4endl ; + if(VerboseLevel==1) cout << endl << "//////// Plastic ////////" << endl << endl ; // Instantiate the new array as a VDetector Object VDetector* myDetector = new Plastic() ; @@ -493,14 +493,14 @@ void DetectorConstruction::ReadConfigurationFile(string Path){ else if (LineBuffer.compare(0, 6, "Helios") == 0 && cHelios == false) { #ifdef INC_HELIOS cHelios = true ; - G4cout << "//////// Helios detector ////////" << G4endl ; + cout << "//////// Helios detector ////////" << endl ; ConfigFile >> DataBuffer ; if (DataBuffer.compare(0, 7, "MField=") == 0){ check_MField = true; ConfigFile >> DataBuffer ; Bz = atof(DataBuffer.c_str()) ; - G4cout << "//////// Magentic Field set at Bz= " << Bz << " ////////" << G4endl ; + cout << "//////// Magentic Field set at Bz= " << Bz << " ////////" << endl ; } // Instantiate the new array as a VDetector Object @@ -608,7 +608,7 @@ void DetectorConstruction::ReadConfigurationFile(string Path){ else if (LineBuffer.compare(0, 13, "GeneralTarget") == 0 && cGeneralTarget == false) { cGeneralTarget = true ; - if(VerboseLevel==1) G4cout << G4endl << "////////// Target ///////////" << G4endl << G4endl ; + if(VerboseLevel==1) cout << endl << "////////// Target ///////////" << endl << endl ; // Instantiate the new array as a VDetector Objects VDetector* myDetector = new Target(); @@ -631,7 +631,7 @@ void DetectorConstruction::ReadConfigurationFile(string Path){ else if (LineBuffer.compare(0, 14, "GeneralChamber") == 0 && cGeneralChamber == false) { cGeneralChamber = true ; - if(VerboseLevel==1) G4cout << G4endl << "////////// Chamber ///////////" << G4endl << G4endl ; + if(VerboseLevel==1) cout << endl << "////////// Chamber ///////////" << endl << endl ; // Instantiate the new array as a VDetector Objects VDetector* myDetector = new Chamber(); diff --git a/NPSimulation/src/PrimaryGeneratorAction.cc b/NPSimulation/src/PrimaryGeneratorAction.cc index b18c8f568..f468e600b 100644 --- a/NPSimulation/src/PrimaryGeneratorAction.cc +++ b/NPSimulation/src/PrimaryGeneratorAction.cc @@ -29,14 +29,15 @@ #include "G4ParticleDefinition.hh" // NPL -#include "PrimaryGeneratorAction.hh" -#include "PhysicsList.hh" -#include "Randomize.hh" -#include "ParticleStack.hh" +#include "NPOptionManager.h" // CLHEP #include "CLHEP/Random/RandGauss.h" #include "CLHEP/Random/RandGeneral.h" +#include "PrimaryGeneratorAction.hh" +#include "PhysicsList.hh" +#include "Randomize.hh" +#include "ParticleStack.hh" // Event Generator Class #include "EventGeneratorTwoBodyReaction.hh" @@ -80,6 +81,8 @@ void PrimaryGeneratorAction::ReadEventGeneratorFile(string Path){ int alreadyiInstantiate_ParticleDecay = 0; int seenToken_ParticleDecay = 0; + if(NPOptionManager::getInstance()->GetVerboseLevel()==1) cout << "/////////////////////////////////////////////////// " << endl ; + string LineBuffer; ifstream EventGeneratorFile; EventGeneratorFile.open(Path.c_str()); @@ -100,7 +103,6 @@ void PrimaryGeneratorAction::ReadEventGeneratorFile(string Path){ ; } - //Search for Isotropic source else if (LineBuffer.compare(0, 9, "Isotropic") == 0 && !check_Isotropic) { check_Isotropic = true; -- GitLab