diff --git a/NPSimulation/Core/Target.cc b/NPSimulation/Core/Target.cc index 3987c4ae54570ea197d8c1b1a23efeb3e3769923..ab785a372e6c0c2259f32a6c3a68cd9e51252772 100644 --- a/NPSimulation/Core/Target.cc +++ b/NPSimulation/Core/Target.cc @@ -74,7 +74,8 @@ Target::Target(){ m_TargetAngle = 0 ; m_TargetRadius = 0 ; m_TargetDensity = 0 ; - m_TargetNbLayers = 5; // Number of steps by default + m_TargetNbLayers = 5 ; // Number of steps by default + m_TargetBackingThickness = 0 ; m_ReactionRegion=NULL; m_TargetDensity = 0 ; @@ -98,6 +99,7 @@ Target::Target(){ m_ShieldFrontRadius = 0 ; m_ShieldBackRadius = 0 ; m_ShieldMaterial = 0 ; + TargetInstance = this; } //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... @@ -141,8 +143,15 @@ void Target::ReadConfiguration(NPL::InputParser parser){ cout << "ERROR: Target token list incomplete, check your input file" << endl; exit(1); } + if(starget[0]->HasToken("NBLAYERS")) m_TargetNbLayers = starget[0]->GetInt("NBLAYERS"); + + if(starget[0]->HasToken("BackingMaterial")&& starget[0]->HasToken("BackingThickness")){ + m_TargetBackingMaterial=GetMaterialFromLibrary(starget[0]->GetString("BackingMaterial")); + m_TargetBackingThickness=starget[0]->GetDouble("BackingThickness","micrometer"); + } + } @@ -229,13 +238,30 @@ void Target::ConstructDetector(G4LogicalVolume* world){ m_TargetLogic = new G4LogicalVolume(m_TargetSolid, m_TargetMaterial, "logicTarget"); + if(m_TargetBackingThickness>0){ + m_TargetBackingSolid = + new G4Tubs("solidTargetBacking", 0, m_TargetRadius, + 0.5*m_TargetBackingThickness, 0*deg, 360*deg); + m_TargetBackingLogic = + new G4LogicalVolume(m_TargetBackingSolid, m_TargetBackingMaterial, "logicTargetBacking"); + } + // rotation of target G4RotationMatrix *rotation = new G4RotationMatrix(); rotation->rotateY(m_TargetAngle); + new G4PVPlacement(rotation, G4ThreeVector(m_TargetX, m_TargetY, m_TargetZ), m_TargetLogic, "Target", world, false, 0); - G4VisAttributes* TargetVisAtt = new G4VisAttributes(G4Colour(0., 0., 1.)); + + G4VisAttributes* TargetVisAtt = new G4VisAttributes(G4Colour(0.4, 0.4, 0.4)); m_TargetLogic->SetVisAttributes(TargetVisAtt); + + if(m_TargetBackingThickness>0){ + new G4PVPlacement(rotation, G4ThreeVector(m_TargetX, m_TargetY, m_TargetZ+m_TargetThickness*0.5+m_TargetBackingThickness*0.5), + m_TargetBackingLogic, "TargetBacking", world, false, 0); + G4VisAttributes* TargetBackingVisAtt = new G4VisAttributes(G4Colour(0.5, 0.5, 0)); + m_TargetBackingLogic->SetVisAttributes(TargetBackingVisAtt); + } } } diff --git a/NPSimulation/Core/Target.hh b/NPSimulation/Core/Target.hh index 3427c9ec8a287016011732b9b015084217d81f37..b984a8540e7f59ef101557ceaff59014c80cee10 100644 --- a/NPSimulation/Core/Target.hh +++ b/NPSimulation/Core/Target.hh @@ -105,6 +105,8 @@ private: // Solid and Logic Volume G4Tubs* m_TargetSolid; G4LogicalVolume* m_TargetLogic; + G4Tubs* m_TargetBackingSolid; + G4LogicalVolume* m_TargetBackingLogic; // Standard parameter G4double m_TargetThickness; @@ -112,6 +114,8 @@ private: G4double m_TargetAngle; G4Material* m_TargetMaterial; G4int m_TargetNbLayers; + G4Material* m_TargetBackingMaterial; + G4double m_TargetBackingThickness; // For Cryo Target // this fonction generate a deformed target window shape diff --git a/NPSimulation/Process/PhysicsList.cc b/NPSimulation/Process/PhysicsList.cc index 2b58820af760ee27c87b98fc1acd74d809817bbd..536feb997cb29cd2e6357f75cfbbc35cf38e7ffc 100644 --- a/NPSimulation/Process/PhysicsList.cc +++ b/NPSimulation/Process/PhysicsList.cc @@ -52,6 +52,7 @@ #include "G4LevelManager.hh" #include "G4PAIModel.hh" #include "G4PAIPhotModel.hh" +#include "G4RadioactiveDecay.hh" #include "menate_R.hh" ///////////////////////////////////////////////////////////////////////////// @@ -419,13 +420,14 @@ void PhysicsList::ConstructProcess(){ for(it = m_PhysList.begin(); it!= m_PhysList.end(); it++){ it->second -> ConstructProcess(); } + BiasCrossSectionByFactor(m_IonBinaryCascadePhysics); + em_parameters=G4EmParameters::Instance(); - em_option.SetBuildCSDARange(true); - em_option.SetDEDXBinningForCSDARange(10*10); - em_option.SetFluo(true); - em_option.SetAuger(true); - + em_parameters->SetFluo(true); + em_parameters->SetAuger(true); + em_parameters->SetDeexActiveRegion ("DefaultRegionForTheWorld", true, true,true); + em_parameters->SetDeexcitationIgnoreCut(true); AddParametrisation(); AddLevelData(); return; @@ -487,6 +489,8 @@ void PhysicsList::AddLevelData(){ for(G4int j = 1; j < Nentries; j++){ // Excited states cout << " - Level " << j << " energy = " << levelManager->LevelEnergy(j) + << " MeV \t lifetime = " << levelManager->LifeTime(j) + << " ns \t half-life = " << levelManager->LifeTime(j)*log(2) << " ns" << endl; G4ParticleDefinition* excitedState = ionTable->GetIon(Z,A,levelManager->LevelEnergy(j)); diff --git a/NPSimulation/Process/PhysicsList.hh b/NPSimulation/Process/PhysicsList.hh index 5a7b488b364a7fabb35b78eccd3bba322d1c5e7f..791e3d6242bfbe974b7e815c9042955c24888c70 100644 --- a/NPSimulation/Process/PhysicsList.hh +++ b/NPSimulation/Process/PhysicsList.hh @@ -26,7 +26,6 @@ #include "G4VUserPhysicsList.hh" #include "G4EmConfigurator.hh" -#include "G4EmProcessOptions.hh" #include "globals.hh" #include <string> @@ -40,7 +39,7 @@ #include "G4RadioactiveDecayPhysics.hh" // EM -#include "G4EmProcessOptions.hh" +#include "G4EmParameters.hh" #include "G4EmStandardPhysics.hh" #include "G4EmLivermorePhysics.hh" #include "G4EmPenelopePhysics.hh" @@ -92,8 +91,6 @@ class PhysicsList: public G4VUserPhysicsList{ void AddLevelData(); private: std::map<std::string,G4VPhysicsConstructor*> m_PhysList; - G4EmConfigurator em_config; - G4EmProcessOptions em_option; private: // Physics List G4OpticalPhysics* opticalPhysicsList; @@ -102,6 +99,7 @@ class PhysicsList: public G4VUserPhysicsList{ G4VPhysicsConstructor* decay_List; G4VPhysicsConstructor* radioactiveDecay_List; G4EmConfigurator* emConfig; + G4EmParameters* em_parameters; private: // Physics option std::string m_EmList;