31.1.2011 Kamil Sedlak - changes for Geant 4.9.4
Changes in musrPhysicsList.cc that were needed for new version of Geant = Geant4.9.4. The changes remove G4MultipleScattering and MultipleAndCoulombScattering, because multiple scattering has to be treated differently for different particles in Geant4.9.4 and "G4MultipleScattering" is not supported anymore. The documentation has to be updated (i.e. comments about MultipleAndCoulombScattering has to be removed from doc/musrSim.tex).
This commit is contained in:
@@ -214,7 +214,7 @@ void musrPhysicsList::ConstructProcess()
|
||||
#include "G4PhotoElectricEffect.hh"
|
||||
#include "G4RayleighScattering.hh"
|
||||
|
||||
#include "G4MultipleScattering.hh"
|
||||
// #include "G4MultipleScattering.hh" // obsolete in Geant4.9.4
|
||||
|
||||
#include "G4eMultipleScattering.hh"
|
||||
#include "G4eIonisation.hh"
|
||||
@@ -346,8 +346,9 @@ void musrPhysicsList::ConstructEM()
|
||||
G4int nr1, nr2, nr3;
|
||||
char charRegion1[100]="", charRegion2[100]="", charRegion3[100]="", charControlString[10]="";
|
||||
sscanf(&line[0],"%*s %*s %*s %*s %*s %d %d %d %s %s %s %s",&nr1,&nr2,&nr3,charRegion1,charRegion2,charRegion3,charControlString);
|
||||
if (stringProcessName=="G4MultipleScattering") pManager->AddProcess(new G4MultipleScattering,nr1,nr2,nr3);
|
||||
else if (stringProcessName=="G4eMultipleScattering") pManager->AddProcess(new G4eMultipleScattering,nr1,nr2,nr3);
|
||||
// if (stringProcessName=="G4MultipleScattering") pManager->AddProcess(new G4MultipleScattering,nr1,nr2,nr3);
|
||||
// obsolete in Geant4.9.4
|
||||
if (stringProcessName=="G4eMultipleScattering") pManager->AddProcess(new G4eMultipleScattering,nr1,nr2,nr3);
|
||||
else if (stringProcessName=="G4eIonisation") pManager->AddProcess(new G4eIonisation,nr1,nr2,nr3);
|
||||
else if (stringProcessName=="G4eBremsstrahlung") pManager->AddProcess(new G4eBremsstrahlung,nr1,nr2,nr3);
|
||||
else if (stringProcessName=="G4eplusAnnihilation") pManager->AddProcess(new G4eplusAnnihilation,nr1,nr2,nr3);
|
||||
@@ -371,35 +372,37 @@ void musrPhysicsList::ConstructEM()
|
||||
// cks: musrMuScatter could be uncommented here, but testing is needed, because Toni has some strange comments
|
||||
// in his original "musrPhysicsList.cc about implementing musrMuScatter.
|
||||
// else if (stringProcessName=="musrMuScatter") pManager->AddProcess(new musrMuScatter,nr1,nr2,nr3);
|
||||
else if (stringProcessName=="MultipleAndCoulombScattering") {
|
||||
G4MultipleScattering* multScat = new G4MultipleScattering();
|
||||
// G4CoulombScattering* coulScat = new G4CoulombScattering();
|
||||
G4CoulombScatteringModel* coulScatModel = new G4CoulombScatteringModel();
|
||||
if (strcmp(charRegion1,"")!=0) {
|
||||
G4Region* regionForCoulomb = FindG4Region(charRegion1,line);
|
||||
G4cout<<" Adding Coulomb scattering model to multiple scattering model for region "<<charRegion1<<G4endl;
|
||||
multScat->AddEmModel(0,coulScatModel,regionForCoulomb);
|
||||
// multScat->AddEmModel(0,multScat,regionForCoulomb);
|
||||
}
|
||||
if (strcmp(charRegion2,"")!=0) {
|
||||
G4Region* regionForCoulomb = FindG4Region(charRegion2,line);
|
||||
G4cout<<" Adding Coulomb scattering model to multiple scattering model for region "<<charRegion2<<G4endl;
|
||||
multScat->AddEmModel(0,coulScatModel,regionForCoulomb);
|
||||
}
|
||||
if (strcmp(charRegion3,"")!=0) {
|
||||
G4Region* regionForCoulomb = FindG4Region(charRegion3,line);
|
||||
G4cout<<" Adding Coulomb scattering model to multiple scattering model for region "<<charRegion3<<G4endl;
|
||||
multScat->AddEmModel(0,coulScatModel,regionForCoulomb);
|
||||
}
|
||||
if (strcmp(charControlString,"")!=0) {
|
||||
G4cout<<"More than 3 regions requested for Coulomb Scattering, but presently only up to 3 such regions are supported."<<G4endl;
|
||||
G4cout<<"Please extend the number of supported regions in musrPhysicsList.cc to higher number."<<G4endl;
|
||||
G4cout<<"The extention of the code to larger number of regions is not very difficult."<<G4endl;
|
||||
G4cout<<" S T O P F O R C E D"<<G4endl;
|
||||
exit(1);
|
||||
}
|
||||
pManager->AddProcess(multScat,nr1,nr2,nr3);
|
||||
}
|
||||
//
|
||||
// The G4MultipleScattering is obsolete in Geant4.9.4
|
||||
// else if (stringProcessName=="MultipleAndCoulombScattering") {
|
||||
// G4MultipleScattering* multScat = new G4MultipleScattering();
|
||||
// // G4CoulombScattering* coulScat = new G4CoulombScattering();
|
||||
// G4CoulombScatteringModel* coulScatModel = new G4CoulombScatteringModel();
|
||||
// if (strcmp(charRegion1,"")!=0) {
|
||||
// G4Region* regionForCoulomb = FindG4Region(charRegion1,line);
|
||||
// G4cout<<" Adding Coulomb scattering model to multiple scattering model for region "<<charRegion1<<G4endl;
|
||||
// multScat->AddEmModel(0,coulScatModel,regionForCoulomb);
|
||||
// // multScat->AddEmModel(0,multScat,regionForCoulomb);
|
||||
// }
|
||||
// if (strcmp(charRegion2,"")!=0) {
|
||||
// G4Region* regionForCoulomb = FindG4Region(charRegion2,line);
|
||||
// G4cout<<" Adding Coulomb scattering model to multiple scattering model for region "<<charRegion2<<G4endl;
|
||||
// multScat->AddEmModel(0,coulScatModel,regionForCoulomb);
|
||||
// }
|
||||
// if (strcmp(charRegion3,"")!=0) {
|
||||
// G4Region* regionForCoulomb = FindG4Region(charRegion3,line);
|
||||
// G4cout<<" Adding Coulomb scattering model to multiple scattering model for region "<<charRegion3<<G4endl;
|
||||
// multScat->AddEmModel(0,coulScatModel,regionForCoulomb);
|
||||
// }
|
||||
// if (strcmp(charControlString,"")!=0) {
|
||||
// G4cout<<"More than 3 regions requested for Coulomb Scattering, but presently only up to 3 such regions are supported."<<G4endl;
|
||||
// G4cout<<"Please extend the number of supported regions in musrPhysicsList.cc to higher number."<<G4endl;
|
||||
// G4cout<<"The extention of the code to larger number of regions is not very difficult."<<G4endl;
|
||||
// G4cout<<" S T O P F O R C E D"<<G4endl;
|
||||
// exit(1);
|
||||
// }
|
||||
// pManager->AddProcess(multScat,nr1,nr2,nr3);
|
||||
// }
|
||||
else {
|
||||
sprintf(eMessage,"musrPhysicsList: Process \"%s\" is not implemented in musrPhysicsList.cc for addProcess. It can be easily added.",
|
||||
charProcessName);
|
||||
|
||||
@@ -231,7 +231,8 @@ void musrScintSD::ProcessOpticalPhoton(G4Step* aStep) {
|
||||
if (boundaryStatus!=Detection) {
|
||||
char message[200];
|
||||
sprintf(message,"musrScintSD.cc::ProcessOpticalPhoton(): Optical photon boundary status is not Detection but %i",boundaryStatus);
|
||||
musrErrorMessage::GetInstance()->musrError(FATAL,message,false);
|
||||
// musrErrorMessage::GetInstance()->musrError(FATAL,message,false);
|
||||
musrErrorMessage::GetInstance()->musrError(WARNING,message,true);
|
||||
}
|
||||
|
||||
// switch(boundaryStatus){
|
||||
|
||||
@@ -353,7 +353,7 @@ void musrSteppingAction::UserSteppingAction(const G4Step* aStep) {
|
||||
// G4cout<<"================================================== BzIntegral = "<<BzIntegral<<G4endl;
|
||||
|
||||
// store the information about the emerging positron
|
||||
G4TrackVector* secondary = fpSteppingManager->GetSecondary();
|
||||
const G4TrackVector* secondary = fpSteppingManager->GetSecondary();
|
||||
G4int n_secondaries= (*secondary).size();
|
||||
for (G4int i=0; i<n_secondaries; i++) {
|
||||
if ( ((*secondary)[i]->GetDefinition()->GetParticleName()) == "e+" ) {
|
||||
|
||||
Reference in New Issue
Block a user