diff --git a/SimG4Core/CustomPhysics/interface/CMSQGSPSIMPBuilder.h b/SimG4Core/CustomPhysics/interface/CMSQGSPSIMPBuilder.h index e760d042f98d9..c2f1201be4741 100644 --- a/SimG4Core/CustomPhysics/interface/CMSQGSPSIMPBuilder.h +++ b/SimG4Core/CustomPhysics/interface/CMSQGSPSIMPBuilder.h @@ -21,7 +21,6 @@ class CMSQGSPSIMPBuilder { void Build(CMSSIMPInelasticProcess* aP); private: - G4QGSModel* theStringModel; G4ExcitedStringDecay* theStringDecay; G4QGSMFragmentation* theQGSM; diff --git a/SimG4Core/CustomPhysics/interface/CMSSIMPInelasticProcess.h b/SimG4Core/CustomPhysics/interface/CMSSIMPInelasticProcess.h index 69521fa316a41..c8f23541e8933 100644 --- a/SimG4Core/CustomPhysics/interface/CMSSIMPInelasticProcess.h +++ b/SimG4Core/CustomPhysics/interface/CMSSIMPInelasticProcess.h @@ -17,7 +17,6 @@ class CMSSIMPInelasticProcess : public G4HadronicProcess { G4VParticleChange* PostStepDoIt(const G4Track& aTrack, const G4Step& aStep) override; private: - // hide assignment operator as private CMSSIMPInelasticProcess& operator=(const CMSSIMPInelasticProcess& right); CMSSIMPInelasticProcess(const CMSSIMPInelasticProcess&); diff --git a/SimG4Core/CustomPhysics/src/CMSQGSPSIMPBuilder.cc b/SimG4Core/CustomPhysics/src/CMSQGSPSIMPBuilder.cc index 6bb27bf9bc0a6..1831b3e2512b2 100644 --- a/SimG4Core/CustomPhysics/src/CMSQGSPSIMPBuilder.cc +++ b/SimG4Core/CustomPhysics/src/CMSQGSPSIMPBuilder.cc @@ -24,9 +24,7 @@ CMSQGSPSIMPBuilder::~CMSQGSPSIMPBuilder() { } void CMSQGSPSIMPBuilder::Build(CMSSIMPInelasticProcess* aP) { - - G4GeneratorPrecompoundInterface* theCascade = - new G4GeneratorPrecompoundInterface; + G4GeneratorPrecompoundInterface* theCascade = new G4GeneratorPrecompoundInterface; G4PreCompoundModel* thePreEquilib = new G4PreCompoundModel(); theCascade->SetDeExcitation(thePreEquilib); diff --git a/SimG4Core/CustomPhysics/src/CMSSIMPInelasticProcess.cc b/SimG4Core/CustomPhysics/src/CMSSIMPInelasticProcess.cc index 3f7cc487925fe..769819b9c8b9a 100644 --- a/SimG4Core/CustomPhysics/src/CMSSIMPInelasticProcess.cc +++ b/SimG4Core/CustomPhysics/src/CMSSIMPInelasticProcess.cc @@ -21,24 +21,20 @@ #include "G4HadronInelasticDataSet.hh" #include "G4ParticleDefinition.hh" - ////////////////////////////////////////////////////////////////// CMSSIMPInelasticProcess::CMSSIMPInelasticProcess(const G4String& processName) : G4HadronicProcess(processName, fHadronic) { - AddDataSet(new CMSSIMPInelasticXS()); theParticle = CMSSIMP::SIMP(); } -CMSSIMPInelasticProcess::~CMSSIMPInelasticProcess() { -} +CMSSIMPInelasticProcess::~CMSSIMPInelasticProcess() {} G4bool CMSSIMPInelasticProcess::IsApplicable(const G4ParticleDefinition& aP) { return theParticle->GetParticleType() == aP.GetParticleType(); } -G4VParticleChange* -CMSSIMPInelasticProcess::PostStepDoIt(const G4Track& aTrack, const G4Step&) { +G4VParticleChange* CMSSIMPInelasticProcess::PostStepDoIt(const G4Track& aTrack, const G4Step&) { // if primary is not Alive then do nothing theTotalResult->Clear(); theTotalResult->Initialize(aTrack); @@ -49,8 +45,7 @@ CMSSIMPInelasticProcess::PostStepDoIt(const G4Track& aTrack, const G4Step&) { // Find cross section at end of step and check if <= 0 // - G4DynamicParticle* aParticle = - const_cast(aTrack.GetDynamicParticle()); + G4DynamicParticle* aParticle = const_cast(aTrack.GetDynamicParticle()); // change this SIMP particle in a neutron aParticle->SetPDGcode(2112); @@ -58,8 +53,7 @@ CMSSIMPInelasticProcess::PostStepDoIt(const G4Track& aTrack, const G4Step&) { G4Nucleus* target = GetTargetNucleusPointer(); G4Material* aMaterial = aTrack.GetMaterial(); - G4Element* anElement = - GetCrossSectionDataStore()->SampleZandA(aParticle,aMaterial,*target); + G4Element* anElement = GetCrossSectionDataStore()->SampleZandA(aParticle, aMaterial, *target); // Next check for illegal track status // @@ -78,8 +72,7 @@ CMSSIMPInelasticProcess::PostStepDoIt(const G4Track& aTrack, const G4Step&) { // Initialize the hadronic projectile from the track thePro.Initialise(aTrack); - G4HadronicInteraction* anInteraction = - ChooseHadronicInteraction(thePro, *target, aMaterial, anElement); + G4HadronicInteraction* anInteraction = ChooseHadronicInteraction(thePro, *target, aMaterial, anElement); G4HadFinalState* result = nullptr; G4int reentryCount = 0; @@ -93,8 +86,8 @@ CMSSIMPInelasticProcess::PostStepDoIt(const G4Track& aTrack, const G4Step&) { G4ExceptionDescription ed; aR.Report(ed); ed << "Call for " << anInteraction->GetModelName() << G4endl; - ed << "Target element " << anElement->GetName() << " Z= " - << target->GetZ_asInt() << " A= " << target->GetA_asInt() << G4endl; + ed << "Target element " << anElement->GetName() << " Z= " << target->GetZ_asInt() + << " A= " << target->GetA_asInt() << G4endl; DumpState(aTrack, "ApplyYourself", ed); ed << " ApplyYourself failed" << G4endl; G4Exception("CMSSIMPInelasticProcess::PostStepDoIt", "had006", FatalException, ed); @@ -105,35 +98,36 @@ CMSSIMPInelasticProcess::PostStepDoIt(const G4Track& aTrack, const G4Step&) { if (reentryCount > 100) { G4ExceptionDescription ed; ed << "Call for " << anInteraction->GetModelName() << G4endl; - ed << "Target element " << anElement->GetName() << " Z= " - << target->GetZ_asInt() << " A= " << target->GetA_asInt() << G4endl; + ed << "Target element " << anElement->GetName() << " Z= " << target->GetZ_asInt() + << " A= " << target->GetA_asInt() << G4endl; DumpState(aTrack, "ApplyYourself", ed); ed << " ApplyYourself does not completed after 100 attempts" << G4endl; G4Exception("CMSSIMPInelasticProcess::PostStepDoIt", "had006", FatalException, ed); } } while (!result); - // Check whether kaon0 or anti_kaon0 are present between the secondaries: + // Check whether kaon0 or anti_kaon0 are present between the secondaries: // if this is the case, transform them into either kaon0S or kaon0L, // with equal, 50% probability, keeping their dynamical masses (and - // the other kinematical properties). + // the other kinematical properties). // When this happens - very rarely - a "JustWarning" exception is thrown. G4int nSec = result->GetNumberOfSecondaries(); - if ( nSec > 0 ) { - for ( G4int i = 0; i < nSec; ++i ) { + if (nSec > 0) { + for (G4int i = 0; i < nSec; ++i) { G4DynamicParticle* dynamicParticle = result->GetSecondary(i)->GetParticle(); - const G4ParticleDefinition* particleDefinition = - dynamicParticle->GetParticleDefinition(); - if ( particleDefinition == G4KaonZero::Definition() || - particleDefinition == G4AntiKaonZero::Definition() ) { + const G4ParticleDefinition* particleDefinition = dynamicParticle->GetParticleDefinition(); + if (particleDefinition == G4KaonZero::Definition() || particleDefinition == G4AntiKaonZero::Definition()) { G4ParticleDefinition* newPart; - if( G4UniformRand() > 0.5 ) { newPart = G4KaonZeroShort::Definition(); } - else { newPart = G4KaonZeroLong::Definition(); } - dynamicParticle->SetDefinition( newPart ); + if (G4UniformRand() > 0.5) { + newPart = G4KaonZeroShort::Definition(); + } else { + newPart = G4KaonZeroLong::Definition(); + } + dynamicParticle->SetDefinition(newPart); G4ExceptionDescription ed; ed << " Hadronic model " << anInteraction->GetModelName() << G4endl; ed << " created " << particleDefinition->GetParticleName() << G4endl; ed << " -> forced to be " << newPart->GetParticleName() << G4endl; - G4Exception( "G4HadronicProcess::PostStepDoIt", "had007", JustWarning, ed ); + G4Exception("G4HadronicProcess::PostStepDoIt", "had007", JustWarning, ed); } } } @@ -146,4 +140,3 @@ CMSSIMPInelasticProcess::PostStepDoIt(const G4Track& aTrack, const G4Step&) { return theTotalResult; } - diff --git a/SimG4Core/CustomPhysics/src/CMSSIMPInelasticXS.cc b/SimG4Core/CustomPhysics/src/CMSSIMPInelasticXS.cc index b15c3da9153c2..19296bfbb418a 100644 --- a/SimG4Core/CustomPhysics/src/CMSSIMPInelasticXS.cc +++ b/SimG4Core/CustomPhysics/src/CMSSIMPInelasticXS.cc @@ -10,8 +10,7 @@ #include "G4Proton.hh" #include "G4Neutron.hh" -CMSSIMPInelasticXS::CMSSIMPInelasticXS() : -G4VCrossSectionDataSet("CMSSIMPInelasticXS"), neutron(G4Neutron::Neutron()) { +CMSSIMPInelasticXS::CMSSIMPInelasticXS() : G4VCrossSectionDataSet("CMSSIMPInelasticXS"), neutron(G4Neutron::Neutron()) { verboseLevel = 1; nXsection = new G4NeutronInelasticXS(); isInitialized = false; @@ -19,23 +18,25 @@ G4VCrossSectionDataSet("CMSSIMPInelasticXS"), neutron(G4Neutron::Neutron()) { CMSSIMPInelasticXS::~CMSSIMPInelasticXS() {} -G4bool CMSSIMPInelasticXS::IsElementApplicable(const G4DynamicParticle*, G4int, const G4Material*) { - return true; -} +G4bool CMSSIMPInelasticXS::IsElementApplicable(const G4DynamicParticle*, G4int, const G4Material*) { return true; } -G4bool CMSSIMPInelasticXS::IsIsoApplicable( - const G4DynamicParticle*, G4int, G4int, const G4Element*, const G4Material*) { +G4bool CMSSIMPInelasticXS::IsIsoApplicable(const G4DynamicParticle*, G4int, G4int, const G4Element*, const G4Material*) { return true; } -G4double CMSSIMPInelasticXS::GetElementCrossSection(const G4DynamicParticle* aParticle, G4int Z, const G4Material* mat) { - return nXsection->GetElementCrossSection(aParticle, Z, mat); +G4double CMSSIMPInelasticXS::GetElementCrossSection(const G4DynamicParticle* aParticle, + G4int Z, + const G4Material* mat) { + return nXsection->GetElementCrossSection(aParticle, Z, mat); } -G4double CMSSIMPInelasticXS::GetIsoCrossSection( - const G4DynamicParticle* aParticle, G4int Z, G4int A, const G4Isotope* iso, - const G4Element* elm, const G4Material* mat) { - return nXsection->GetIsoCrossSection(aParticle, Z, A, iso, elm, mat); +G4double CMSSIMPInelasticXS::GetIsoCrossSection(const G4DynamicParticle* aParticle, + G4int Z, + G4int A, + const G4Isotope* iso, + const G4Element* elm, + const G4Material* mat) { + return nXsection->GetIsoCrossSection(aParticle, Z, A, iso, elm, mat); } G4Isotope* CMSSIMPInelasticXS::SelectIsotope(const G4Element* anElement, G4double kinEnergy) { @@ -59,4 +60,3 @@ void CMSSIMPInelasticXS::BuildPhysicsTable(const G4ParticleDefinition& p) { } isInitialized = true; } - diff --git a/SimG4Core/CustomPhysics/src/CustomPhysicsList.cc b/SimG4Core/CustomPhysics/src/CustomPhysicsList.cc index 6cf692b0928a3..67cd877c15ddd 100644 --- a/SimG4Core/CustomPhysics/src/CustomPhysicsList.cc +++ b/SimG4Core/CustomPhysics/src/CustomPhysicsList.cc @@ -61,7 +61,7 @@ void CustomPhysicsList::ConstructProcess() { G4ProcessManager* pmanager = particle->GetProcessManager(); if (pmanager) { CMSSIMPInelasticProcess* simpInelPr = new CMSSIMPInelasticProcess(); - CMSQGSPSIMPBuilder* theQGSPSIMPB = new CMSQGSPSIMPBuilder(); + CMSQGSPSIMPBuilder* theQGSPSIMPB = new CMSQGSPSIMPBuilder(); theQGSPSIMPB->Build(simpInelPr); pmanager->AddDiscreteProcess(simpInelPr); } else