11.20.2009. - Kamil Sedlak

This svn update includes several smaller corrections and updates accumulated
over last few months:
1) For the Geant4.9.2 it was necessary to remove the privately modified file
   src/G4EqEMFieldWithSpin.cc.  Our corrections in this file (and also in
   the file src/G4DecayWithSpin.cc) were adopted by the Geant developers into
   the official Geant code, and therefore these two files were deleted.
   However, if one uses older version of Geant (i.e. Geant4.9.1 or older),
   one should rename the G4EqEMFieldWithSpin.cc_for_Geant4.9.1_and_older in
   his/her src directory to G4EqEMFieldWithSpin.cc to correct for a Geant
   bug.
2) Implementation of save_polx, save_poly and save_polz variables
3) Implementation of the field map normalisation within the field map
   itself (was already possible for the field-map formats generated by Toni,
   now it is extended also for the field maps generated by OPERA).
4) Possibility to swap and invert x and y axis read out from the TURTLE
   file.
5) Perhaps some other tiny changes
This commit is contained in:
2009-11-20 10:29:02 +00:00
parent d05e77dbe5
commit b5594b4513
15 changed files with 183 additions and 14 deletions

View File

@@ -82,6 +82,7 @@ musrPrimaryGeneratorAction::musrPrimaryGeneratorAction(
// cks Implement also alpha and proton particles for the simulation of Juan Pablo Urrego
alphaParticle= particleTable->FindParticle("alpha");
protonParticle= particleTable->FindParticle("proton");
turtleInterpretAxes="undefined";
// csk
G4int n_particle = 1;
@@ -149,6 +150,7 @@ void musrPrimaryGeneratorAction::GeneratePrimaries(G4Event* anEvent)
}
numberOfGeneratedEvents++;
sscanf(&line[0],"%g %g %g %g %g %g %g %d %d",&xTmp,&xAngleTmp,&yTmp,&yAngleTmp,&pTmp,&dummy1,&dummy2,&Ztmp,&Atmp);
if (turtleInterpretAxes!="undefined") swapTheAxisInTurtle(xTmp,xAngleTmp,yTmp,yAngleTmp);
if (boolPrintInfoAboutGeneratedParticles) {
G4cout<<"musrPrimaryGeneratorAction::GeneratePrimaries: Turtle input for this event: "
<<xTmp<<", "<<xAngleTmp<<" "<<yTmp<<" "<<yAngleTmp<<" "<< pTmp<<G4endl;
@@ -475,3 +477,38 @@ void musrPrimaryGeneratorAction::SetPrimaryParticule(G4String particleName) {
exit(1);
}
}
//===============================================================================
void musrPrimaryGeneratorAction::swapTheAxisInTurtle(float& x_x, float& x_xprime ,float& y_y, float& y_yprime) {
// G4cout<<"turtleInterpretAxes = "<<turtleInterpretAxes<<G4endl;
if (turtleInterpretAxes=="-xy") {
x_x = -x_x; x_xprime = -x_xprime;
}
else if (turtleInterpretAxes=="x-y") {
y_y = -y_y; y_yprime = -y_yprime;
}
else if (turtleInterpretAxes=="-x-y") {
x_x = -x_x; x_xprime = -x_xprime; y_y = -y_y; y_yprime = -y_yprime;
}
else if (turtleInterpretAxes=="yx") {
float tmpX = x_x; float tmpXprime = x_xprime;
x_x = y_y; x_xprime = y_yprime; y_y = tmpX; y_yprime = tmpXprime;
}
else if (turtleInterpretAxes=="-yx") {
float tmpX = x_x; float tmpXprime = x_xprime;
x_x = y_y; x_xprime = y_yprime; y_y = -tmpX; y_yprime = -tmpXprime;
}
else if (turtleInterpretAxes=="y-x") {
float tmpX = x_x; float tmpXprime = x_xprime;
x_x = -y_y; x_xprime = -y_yprime; y_y = tmpX; y_yprime = tmpXprime;
}
else if (turtleInterpretAxes=="-y-x") {
float tmpX = x_x; float tmpXprime = x_xprime;
x_x = -y_y; x_xprime = -y_yprime; y_y = -tmpX; y_yprime = -tmpXprime;
}
else {
G4cout<<"musrPrimaryGeneratorAction::swapTheAxisInTurtle: Not known how to inpterpret turtleInterpretAxes="<<turtleInterpretAxes<<G4endl;
G4cout<<"S T O P F O R C E D" << G4endl;
exit(1);
}
}