28.9.2011 Kamil Sedlak

1) implemented a new command /gun/turtleMomentumScalingFactor in the musrSim
   (see the manual)
2) some small changes in the musrSimAna
This commit is contained in:
2011-09-28 10:01:31 +00:00
parent c10cb1791c
commit 0c995ad9d8
9 changed files with 54 additions and 7 deletions

View File

@ -71,7 +71,7 @@ musrPrimaryGeneratorAction::musrPrimaryGeneratorAction(
muonDecayTimeMin(-1), muonDecayTimeMax(-1), muonMeanLife(2197.03*ns),
takeMuonsFromTurtleFile(false), z0_InitialTurtle(0),
numberOfGeneratedEvents(0),
turtleMomentumBite(false), turtleMomentumP0(0.), turtleSmearingFactor(0.)
turtleMomentumBite(false), turtleMomentumP0(0.), turtleSmearingFactor(0.), turtleMomentumScalingFactor(1.)
//, firstCall(true)
{
//create a messenger for this class
@ -175,7 +175,7 @@ void musrPrimaryGeneratorAction::GeneratePrimaries(G4Event* anEvent)
yangle = yAngleTmp*mrad;
x = xTmp*cm + (z0-z0_InitialTurtle)*tan(xangle) ; // usually z0 is negative
y = yTmp*cm + (z0-z0_InitialTurtle)*tan(yangle) ; // z0_InitialTurtle is the z0 at whith the turtle file was generated.
p = pTmp*GeV;
p = pTmp*GeV*turtleMomentumScalingFactor;
// add some offset, if requested:
x = x + x0;
y = y + y0;

View File

@ -171,6 +171,12 @@ musrPrimaryGeneratorMessenger::musrPrimaryGeneratorMessenger(musrPrimaryGenerato
setTurtleMomentumBite->SetGuidance(" broader beam. The third parameter is dummy.");
setTurtleMomentumBite->SetParameterName("mes_turtleMomentumP0","mes_turtleSmearingFactor","mes_turtleSmearingDummy",true,true);
setTurtleMomentumScalingFactor = new G4UIcmdWithADouble("/gun/turtleMomentumScalingFactor",this);
setTurtleMomentumScalingFactor->SetGuidance(" Modify the turtle momentum by this scaling factor - e.g. if the user wants to shift");
setTurtleMomentumScalingFactor->SetGuidance(" the mean momentum from 28 MeV/c to 14 MeV/c, this scaling factor has to be set to 0.5 .");
setTurtleMomentumScalingFactor->SetGuidance(" Note that also the momentum bite will be reduced by the same scaling factor.");
setTurtleMomentumScalingFactor->SetParameterName("mes_turtleMomentumScalingFactor",true);
setTurtleEventNrCmd = new G4UIcmdWithAnInteger("/gun/turtleFirstEventNr",this);
setTurtleEventNrCmd->SetGuidance("Set the line number that should be taken as the first event from the turtle input file.");
@ -208,6 +214,7 @@ musrPrimaryGeneratorMessenger::~musrPrimaryGeneratorMessenger()
delete setTurtleZ0Cmd;
delete setTurtleInterpretAxesCmd;
delete setTurtleMomentumBite;
delete setTurtleMomentumScalingFactor;
delete setTurtleEventNrCmd;
}
@ -265,6 +272,8 @@ void musrPrimaryGeneratorMessenger::SetNewValue(G4UIcommand * command,G4String n
{ musrAction->SetTurtleInterpretAxes(newValue);}
if( command == setTurtleMomentumBite)
{ musrAction-> SetTurtleMomentumBite(setTurtleMomentumBite->GetNew3VectorValue(newValue)); }
if( command == setTurtleMomentumScalingFactor)
{ musrAction-> SetTurtleMomentumScalingFactor(setTurtleMomentumScalingFactor->GetNewDoubleValue(newValue));}
if( command == setTurtleEventNrCmd)
{ musrAction->SetTurtleInputFileToEventNo(setTurtleEventNrCmd->GetNewIntValue(newValue));}
}