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:
sedlak 2011-01-31 10:40:44 +00:00
parent eb3ed03c30
commit d11e19a7d8
5 changed files with 57 additions and 35 deletions

Binary file not shown.

View File

@ -685,6 +685,7 @@ Three special volumes ``Target, M0, M1 and M2''.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\section{Optical photons}
\label{sec:opticalPhotons}
Normaly the simulation of ``detected signal'' stops at the level of the deposited energy in
a sensitive volume (e.g.\ in a scintilator tile). However, in some special cases, one would
like to know how the light is propagated through the scintillators. In such case simulation
@ -945,7 +946,7 @@ The list of variables that can be stored in the Root tree:
Note that these variables are by default not calculated (and not stored) and therefore the user has
to switch the calculation on by ``/musr/command rootOutput fieldIntegralBx on'' in the macro file.
\item{\bf nOptPhot} (Int\_t) -- total number of optical photons generated in the current event.
\item{\bf det\_n} (Int\_t) -- number of ``detector hits'' in this event. Note that more then 1 detector
might be hit, and even the same detector might be hit more than once. The hit might be induced by just one
particle, by more then one particle originating from the same particle initially hitting the detector,
@ -986,6 +987,23 @@ The list of variables that can be stored in the Root tree:
given volume. This way one can better investigate which (hopefully) single particle caused the hit. Even though
even in this case it is not guaranteed that only a single particle gave origin to the hit, it is quite likely, though,
that it was in fact just a single particle. If the
\item{\bf odet\_n} (Int\_t) -- number of ``optical photon signals'' in this event. Note that there can be several optical photon signals
per detector. In principle, the optical photons contributing to the same signal may originate from more than
one charged particle. Ideally, there should be the same number of optical photon signals as there are
``detector hits'', i.e.\ odet\_n = det\_n. However, detector hits are treated independently of the
optical photon signals, and they do not have to match perfectly.
\item{\bf odet\_ID[odet\_n]} (array of Int\_t) -- ID number of the detector where the given optical photon signal occurred.
The detection of optical photons happens at the boundary of surfaces, and it is assigned to the volume ID \emph{to} which
the photon enters (and not \emph{from} which it comes). This e.g.\ allows one to attach more APDs to one scintillator,
in which case odet\_ID[] will correspond to the volume IDs of individual APDs.
\item{\bf odet\_nPhot[odet\_n]} (array of Int\_t) -- number of photons detected in the given optical photon signal.
\item{\bf odet\_timeFirst[odet\_n], odet\_timeLast[odet\_n]} (array of Int\_t)
-- times, when the the first and last photons contributing to the given signal were detected (odet\_timeFirst and odet\_timeLast).
\item{\bf odet\_timeA[odet\_n], odet\_timeB[odet\_n], odet\_timeC[odet\_n], odet\_timeD[odet\_n], odet\_timeE[odet\_n]} (array of Int\_t)
-- time, when the $n^{th}$ photon was detected, where $n$ for \emph{odet\_timeA[i]} is given as \emph{OPSA\_fracA}
multiplied by \emph{odet\_nPhot[i]}. Similary for \emph{odet\_timeB[i]}, ..., \emph{odet\_timeE[i]}.
The variables \emph{OPSA\_fracA}, ..., \emph{OPSA\_fracE}, are defined by ``/musr/command OPSA photonFractions'' command
(see chapter~\ref{sec:opticalPhotons}).
\item{\bf save\_n} (Int\_t) -- number of special kind of ``save'' volume that were hit in this event. The ``save volume'' is
any volume whose name starts with letters ``save''. Their purpose in the simulation is usually to check positions
and momenta of particles at some position of the detector, even if the particle does not deposit any energy in

View File

@ -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);

View File

@ -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){

View File

@ -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+" ) {