Skip to content

Commit

Permalink
migration to geant4 10.0
Browse files Browse the repository at this point in the history
  • Loading branch information
civanch authored and ktf committed Mar 25, 2014
1 parent df73ab9 commit a149634
Show file tree
Hide file tree
Showing 10 changed files with 67 additions and 59 deletions.
4 changes: 2 additions & 2 deletions SimG4Core/CustomPhysics/src/CustomPhysics.cc
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
#include "G4NeutronTrackingCut.hh"

#include "G4DataQuestionaire.hh"
#include "HadronPhysicsQGSP_FTFP_BERT.hh"
#include "G4HadronPhysicsQGSP_FTFP_BERT.hh"

CustomPhysics::CustomPhysics(G4LogicalVolumeToDDLogicalPartMap& map,
const HepPDT::ParticleDataTable * table_,
Expand Down Expand Up @@ -41,7 +41,7 @@ CustomPhysics::CustomPhysics(G4LogicalVolumeToDDLogicalPartMap& map,
RegisterPhysics(new G4HadronElasticPhysics(ver));

// Hadron Physics
RegisterPhysics(new HadronPhysicsQGSP_FTFP_BERT(ver));
RegisterPhysics(new G4HadronPhysicsQGSP_FTFP_BERT(ver));

// Stopping Physics
RegisterPhysics(new G4StoppingPhysics(ver));
Expand Down
18 changes: 11 additions & 7 deletions SimG4Core/CustomPhysics/src/CustomPhysicsList.cc
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ CustomPhysicsList::CustomPhysicsList(std::string name, const edm::ParameterSet &
myConfig = p;
edm::FileInPath fp = p.getParameter<edm::FileInPath>("particlesDef");
particleDefFilePath = fp.fullPath();
edm::LogInfo("CustomPhysics")<<"Path for custom particle definition file: "<<particleDefFilePath;
edm::LogInfo("CustomPhysics")<<"Path for custom particle definition file: "
<<particleDefFilePath;
myHelper = 0;

}
Expand All @@ -47,14 +48,15 @@ void CustomPhysicsList::ConstructProcess() {

void CustomPhysicsList::addCustomPhysics(){
LogDebug("CustomPhysics") << " CustomPhysics: adding CustomPhysics processes";
theParticleIterator->reset();
aParticleIterator->reset();

while((*theParticleIterator)()) {
while((*aParticleIterator)()) {
int i = 0;
G4ParticleDefinition* particle = theParticleIterator->value();
G4ParticleDefinition* particle = aParticleIterator->value();
CustomParticle* cp = dynamic_cast<CustomParticle*>(particle);
if(CustomParticleFactory::isCustomParticle(particle)) {
LogDebug("CustomPhysics") << particle->GetParticleName()<<", "<<particle->GetPDGEncoding()
LogDebug("CustomPhysics") << particle->GetParticleName()
<<", "<<particle->GetPDGEncoding()
<< " is Custom. Mass is "
<<particle->GetPDGMass()/GeV <<" GeV.";
if(cp->GetCloud()!=0) {
Expand All @@ -67,9 +69,11 @@ void CustomPhysicsList::addCustomPhysics(){
G4ProcessManager* pmanager = particle->GetProcessManager();
if(pmanager) {
if(cp!=0) {
if(particle->GetParticleType()=="rhadron" || particle->GetParticleType()=="mesonino" || particle->GetParticleType() == "sbaryon"){
if(particle->GetParticleType()=="rhadron" ||
particle->GetParticleType()=="mesonino" ||
particle->GetParticleType() == "sbaryon"){
if(!myHelper) myHelper = new G4ProcessHelper(myConfig);
pmanager->AddDiscreteProcess(new FullModelHadronicProcess(myHelper)); //GHEISHA
pmanager->AddDiscreteProcess(new FullModelHadronicProcess(myHelper));
}
}
if(particle->GetPDGCharge()/eplus != 0) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#include "G4ios.hh"

#include "G4VPhysicsConstructor.hh"
#include "G4MiscLHEPBuilder.hh"
//#include "G4MiscLHEPBuilder.hh"

#include "G4PiKBuilder.hh"
#include "SimG4Core/PhysicsLists/interface/CMSFTFPPiKBuilder.hh"
Expand All @@ -21,7 +21,7 @@
#include "SimG4Core/PhysicsLists/interface/CMSFTFPNeutronBuilder.hh"
#include "G4QGSPNeutronBuilder.hh"
#include "G4BertiniNeutronBuilder.hh"
#include "G4LEPNeutronBuilder.hh"
//#include "G4LEPNeutronBuilder.hh"

class G4PiKBuilder_WP;
class G4ProtonBuilder_WP;
Expand All @@ -46,7 +46,7 @@ class HadronPhysicsQGSPCMS_FTFP_BERT_WP : public G4VPhysicsConstructor
CMSFTFPNeutronBuilder * theFTFPNeutron;
G4QGSPNeutronBuilder * theQGSPNeutron;
G4BertiniNeutronBuilder * theBertiniNeutron;
G4LEPNeutronBuilder * theLEPNeutron;
//G4LEPNeutronBuilder * theLEPNeutron;

G4PiKBuilder_WP * thePiK;
CMSFTFPPiKBuilder * theFTFPPiK;
Expand Down
14 changes: 7 additions & 7 deletions SimG4Core/GFlash/interface/HadronPhysicsQGSP_BERT_WP.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,19 +46,19 @@
#include "G4ios.hh"

#include "G4VPhysicsConstructor.hh"
#include "G4MiscLHEPBuilder.hh"
//#include "G4MiscLHEPBuilder.hh"

#include "G4LEPPiKBuilder.hh"
//#include "G4LEPPiKBuilder.hh"
#include "G4QGSPPiKBuilder.hh"
#include "G4BertiniPiKBuilder.hh"

#include "G4ProtonBuilder.hh"
#include "G4LEPProtonBuilder.hh"
//#include "G4LEPProtonBuilder.hh"
#include "G4QGSPProtonBuilder.hh"
#include "G4BertiniProtonBuilder.hh"

#include "G4NeutronBuilder.hh"
#include "G4LEPNeutronBuilder.hh"
//#include "G4LEPNeutronBuilder.hh"
#include "G4QGSPNeutronBuilder.hh"
#include "G4BertiniNeutronBuilder.hh"

Expand All @@ -82,17 +82,17 @@ class HadronPhysicsQGSP_BERT_WP : public G4VPhysicsConstructor
private:
void CreateModels();
G4NeutronBuilder * theNeutrons;
G4LEPNeutronBuilder * theLEPNeutron;
//G4LEPNeutronBuilder * theLEPNeutron;
G4QGSPNeutronBuilder * theQGSPNeutron;
G4BertiniNeutronBuilder * theBertiniNeutron;

G4PiKBuilder_WP * thePiK;
G4LEPPiKBuilder * theLEPPiK;
// G4LEPPiKBuilder * theLEPPiK;
G4QGSPPiKBuilder * theQGSPPiK;
G4BertiniPiKBuilder * theBertiniPiK;

G4ProtonBuilder_WP * thePro;
G4LEPProtonBuilder * theLEPPro;
// G4LEPProtonBuilder * theLEPPro;
G4QGSPProtonBuilder * theQGSPPro;
G4BertiniProtonBuilder * theBertiniPro;

Expand Down
14 changes: 7 additions & 7 deletions SimG4Core/GFlash/interface/HadronPhysicsQGSP_WP.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,17 +46,17 @@
#include "G4ios.hh"

#include "G4VPhysicsConstructor.hh"
#include "G4MiscLHEPBuilder.hh"
//#include "G4MiscLHEPBuilder.hh"

#include "G4LEPPiKBuilder.hh"
//#include "G4LEPPiKBuilder.hh"
#include "G4QGSPPiKBuilder.hh"

#include "G4ProtonBuilder.hh"
#include "G4LEPProtonBuilder.hh"
//#include "G4LEPProtonBuilder.hh"
#include "G4QGSPProtonBuilder.hh"

#include "G4NeutronBuilder.hh"
#include "G4LEPNeutronBuilder.hh"
//#include "G4LEPNeutronBuilder.hh"
#include "G4QGSPNeutronBuilder.hh"

class G4PiKBuilder_WP;
Expand All @@ -76,15 +76,15 @@ class HadronPhysicsQGSP_WP : public G4VPhysicsConstructor
private:
void CreateModels();
G4NeutronBuilder * theNeutrons;
G4LEPNeutronBuilder * theLEPNeutron;
//G4LEPNeutronBuilder * theLEPNeutron;
G4QGSPNeutronBuilder * theQGSPNeutron;

G4PiKBuilder_WP * thePiK;
G4LEPPiKBuilder * theLEPPiK;
//G4LEPPiKBuilder * theLEPPiK;
G4QGSPPiKBuilder * theQGSPPiK;

G4ProtonBuilder_WP * thePro;
G4LEPProtonBuilder * theLEPPro;
// G4LEPProtonBuilder * theLEPPro;
G4QGSPProtonBuilder * theQGSPPro;

G4MiscLHEPBuilder_WP * theMiscLHEP;
Expand Down
4 changes: 2 additions & 2 deletions SimG4Core/GFlash/plugins/GFlash.cc
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
#include "G4StoppingPhysics.hh"
#include "G4HadronElasticPhysics.hh"
#include "G4NeutronTrackingCut.hh"
#include "HadronPhysicsQGSP_FTFP_BERT.hh"
#include "G4HadronPhysicsQGSP_FTFP_BERT.hh"

#include "G4DataQuestionaire.hh"
#include "SimGeneral/GFlash/interface/GflashHistogram.h"
Expand Down Expand Up @@ -63,7 +63,7 @@ GFlash::GFlash(G4LogicalVolumeToDDLogicalPartMap& map,
RegisterPhysics( new G4HadronElasticPhysics(ver));

// Hadron Physics
RegisterPhysics( new HadronPhysicsQGSP_FTFP_BERT(ver));
RegisterPhysics( new G4HadronPhysicsQGSP_FTFP_BERT(ver));
// Stopping Physics
RegisterPhysics( new G4StoppingPhysics(ver));

Expand Down
12 changes: 7 additions & 5 deletions SimG4Core/GFlash/src/HadronPhysicsQGSPCMS_FTFP_BERT_WP.cc
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
#include "G4BaryonConstructor.hh"
#include "G4ShortLivedConstructor.hh"

#include "G4SystemOfUnits.hh"

HadronPhysicsQGSPCMS_FTFP_BERT_WP::HadronPhysicsQGSPCMS_FTFP_BERT_WP(const G4String& name, G4bool quasiElastic)
: G4VPhysicsConstructor(name) , QuasiElastic(quasiElastic)
{
Expand Down Expand Up @@ -42,23 +44,23 @@ void HadronPhysicsQGSPCMS_FTFP_BERT_WP::CreateModels()
<< " and to " << quasiElasFTF << " (must be false) for FTF" << G4endl;

theNeutrons=new G4NeutronBuilder;
theNeutrons->RegisterMe(theQGSPNeutron=new G4QGSPNeutronBuilder(quasiElasQGS, ProjectileDiffraction));
theNeutrons->RegisterMe(theQGSPNeutron=new G4QGSPNeutronBuilder(quasiElasQGS));
theQGSPNeutron->SetMinEnergy(minQGSP);
theNeutrons->RegisterMe(theFTFPNeutron=new CMSFTFPNeutronBuilder(quasiElasFTF));
theFTFPNeutron->SetMinEnergy(minFTFP); // was (9.5*GeV);
theFTFPNeutron->SetMaxEnergy(maxFTFP); // was (25*GeV);
// Exclude LEP only from Inelastic
// -- Register it for other processes: Capture, Elastic
theNeutrons->RegisterMe(theLEPNeutron=new G4LEPNeutronBuilder);
theLEPNeutron->SetMinInelasticEnergy(0.0*GeV);
theLEPNeutron->SetMaxInelasticEnergy(0.0*GeV);
//theNeutrons->RegisterMe(theLEPNeutron=new G4LEPNeutronBuilder);
//theLEPNeutron->SetMinInelasticEnergy(0.0*GeV);
// theLEPNeutron->SetMaxInelasticEnergy(0.0*GeV);

theNeutrons->RegisterMe(theBertiniNeutron=new G4BertiniNeutronBuilder);
theBertiniNeutron->SetMinEnergy(0.0*GeV);
theBertiniNeutron->SetMaxEnergy(maxBERT); // was (9.9*GeV);

thePro=new G4ProtonBuilder_WP;
thePro->RegisterMe(theQGSPPro=new G4QGSPProtonBuilder(quasiElasQGS, ProjectileDiffraction));
thePro->RegisterMe(theQGSPPro=new G4QGSPProtonBuilder(quasiElasQGS));
theQGSPPro->SetMinEnergy(minQGSP);
thePro->RegisterMe(theFTFPPro=new CMSFTFPProtonBuilder(quasiElasFTF));
theFTFPPro->SetMinEnergy(minFTFP); // was (9.5*GeV);
Expand Down
29 changes: 15 additions & 14 deletions SimG4Core/GFlash/src/HadronPhysicsQGSP_BERT_WP.cc
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@
#include "G4MesonConstructor.hh"
#include "G4BaryonConstructor.hh"
#include "G4ShortLivedConstructor.hh"
#include "G4SystemOfUnits.hh"

HadronPhysicsQGSP_BERT_WP::HadronPhysicsQGSP_BERT_WP(const G4String& name, G4bool quasiElastic)
: G4VPhysicsConstructor(name) , QuasiElastic(quasiElastic)
Expand All @@ -64,29 +65,29 @@ HadronPhysicsQGSP_BERT_WP::HadronPhysicsQGSP_BERT_WP(const G4String& name, G4boo
void HadronPhysicsQGSP_BERT_WP::CreateModels()
{
theNeutrons=new G4NeutronBuilder;
theNeutrons->RegisterMe(theQGSPNeutron=new G4QGSPNeutronBuilder(QuasiElastic, ProjectileDiffraction));
theNeutrons->RegisterMe(theLEPNeutron=new G4LEPNeutronBuilder);
theLEPNeutron->SetMinInelasticEnergy(9.5*GeV);
theLEPNeutron->SetMaxInelasticEnergy(25*GeV);
theNeutrons->RegisterMe(theQGSPNeutron=new G4QGSPNeutronBuilder(QuasiElastic));
// theNeutrons->RegisterMe(theLEPNeutron=new G4LEPNeutronBuilder);
// theLEPNeutron->SetMinInelasticEnergy(9.5*GeV);
// theLEPNeutron->SetMaxInelasticEnergy(25*GeV);

theNeutrons->RegisterMe(theBertiniNeutron=new G4BertiniNeutronBuilder);
theBertiniNeutron->SetMinEnergy(0.0*GeV);
theBertiniNeutron->SetMaxEnergy(9.9*GeV);

thePro=new G4ProtonBuilder_WP;
thePro->RegisterMe(theQGSPPro=new G4QGSPProtonBuilder(QuasiElastic, ProjectileDiffraction));
thePro->RegisterMe(theLEPPro=new G4LEPProtonBuilder);
theLEPPro->SetMinEnergy(9.5*GeV);
theLEPPro->SetMaxEnergy(25*GeV);
thePro->RegisterMe(theQGSPPro=new G4QGSPProtonBuilder(QuasiElastic));
// thePro->RegisterMe(theLEPPro=new G4LEPProtonBuilder);
// theLEPPro->SetMinEnergy(9.5*GeV);
// theLEPPro->SetMaxEnergy(25*GeV);

thePro->RegisterMe(theBertiniPro=new G4BertiniProtonBuilder);
theBertiniPro->SetMaxEnergy(9.9*GeV);

thePiK=new G4PiKBuilder_WP;
thePiK->RegisterMe(theQGSPPiK=new G4QGSPPiKBuilder(QuasiElastic));
thePiK->RegisterMe(theLEPPiK=new G4LEPPiKBuilder);
theLEPPiK->SetMaxEnergy(25*GeV);
theLEPPiK->SetMinEnergy(9.5*GeV);
// thePiK->RegisterMe(theLEPPiK=new G4LEPPiKBuilder);
// theLEPPiK->SetMaxEnergy(25*GeV);
// theLEPPiK->SetMinEnergy(9.5*GeV);

thePiK->RegisterMe(theBertiniPiK=new G4BertiniPiKBuilder);
theBertiniPiK->SetMaxEnergy(9.9*GeV);
Expand All @@ -98,14 +99,14 @@ HadronPhysicsQGSP_BERT_WP::~HadronPhysicsQGSP_BERT_WP()
{
delete theMiscLHEP;
delete theQGSPNeutron;
delete theLEPNeutron;
// delete theLEPNeutron;
delete theBertiniNeutron;
delete theQGSPPro;
delete theLEPPro;
// delete theLEPPro;
delete thePro;
delete theBertiniPro;
delete theQGSPPiK;
delete theLEPPiK;
// delete theLEPPiK;
delete theBertiniPiK;
delete thePiK;
}
Expand Down
19 changes: 10 additions & 9 deletions SimG4Core/GFlash/src/HadronPhysicsQGSP_WP.cc
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@
#include "G4MesonConstructor.hh"
#include "G4BaryonConstructor.hh"
#include "G4ShortLivedConstructor.hh"
#include "G4SystemOfUnits.hh"

HadronPhysicsQGSP_WP::HadronPhysicsQGSP_WP(const G4String& name, G4bool quasiElastic)
: G4VPhysicsConstructor(name) , QuasiElastic(quasiElastic)
Expand All @@ -62,20 +63,20 @@ void HadronPhysicsQGSP_WP::CreateModels()
theNeutrons=new G4NeutronBuilder;
theQGSPNeutron=new G4QGSPNeutronBuilder(QuasiElastic);
theNeutrons->RegisterMe(theQGSPNeutron);
theNeutrons->RegisterMe(theLEPNeutron=new G4LEPNeutronBuilder);
theLEPNeutron->SetMaxInelasticEnergy(25*GeV);
// theNeutrons->RegisterMe(theLEPNeutron=new G4LEPNeutronBuilder);
// theLEPNeutron->SetMaxInelasticEnergy(25*GeV);

thePro=new G4ProtonBuilder_WP;
theQGSPPro=new G4QGSPProtonBuilder(QuasiElastic);
thePro->RegisterMe(theQGSPPro);
thePro->RegisterMe(theLEPPro=new G4LEPProtonBuilder);
theLEPPro->SetMaxEnergy(25*GeV);
// thePro->RegisterMe(theLEPPro=new G4LEPProtonBuilder);
// theLEPPro->SetMaxEnergy(25*GeV);

thePiK=new G4PiKBuilder_WP;
theQGSPPiK=new G4QGSPPiKBuilder(QuasiElastic);
thePiK->RegisterMe(theQGSPPiK);
thePiK->RegisterMe(theLEPPiK=new G4LEPPiKBuilder);
theLEPPiK->SetMaxEnergy(25*GeV);
// thePiK->RegisterMe(theLEPPiK=new G4LEPPiKBuilder);
// theLEPPiK->SetMaxEnergy(25*GeV);

theMiscLHEP=new G4MiscLHEPBuilder_WP;
}
Expand All @@ -84,12 +85,12 @@ HadronPhysicsQGSP_WP::~HadronPhysicsQGSP_WP()
{
delete theMiscLHEP;
delete theQGSPNeutron;
delete theLEPNeutron;
// delete theLEPNeutron;
delete theQGSPPro;
delete theLEPPro;
// delete theLEPPro;
delete thePro;
delete theQGSPPiK;
delete theLEPPiK;
// delete theLEPPiK;
delete thePiK;
}

Expand Down
6 changes: 3 additions & 3 deletions SimG4Core/GFlash/src/ParametrisedPhysics.cc
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,9 @@ void ParametrisedPhysics::ConstructProcess() {
if(gem || ghad) {
G4FastSimulationManagerProcess * theFastSimulationManagerProcess =
new G4FastSimulationManagerProcess();
theParticleIterator->reset();
while ((*theParticleIterator)()) {
G4ParticleDefinition * particle = theParticleIterator->value();
aParticleIterator->reset();
while ((*aParticleIterator)()) {
G4ParticleDefinition * particle = aParticleIterator->value();
G4ProcessManager * pmanager = particle->GetProcessManager();
G4String pname = particle->GetParticleName();
if(pname == "e-" || pname == "e+") {
Expand Down

0 comments on commit a149634

Please sign in to comment.