4 #include "G4UIdirectory.hh" 5 #include "G4UIcmdWithAnInteger.hh" 6 #include "G4UIcmdWithADoubleAndUnit.hh" 7 #include "G4UIcmdWith3VectorAndUnit.hh" 8 #include "G4UIcmdWithADouble.hh" 9 #include "G4UIcmdWithAString.hh" 10 #include "G4UIcmdWithABool.hh" 11 #include "G4UIcmdWithoutParameter.hh" 14 #include "Randomize.hh" 24 G4cout <<
"LBNEPrimaryMessenger Constructor Called." << G4endl;
26 fDirectory =
new G4UIdirectory(
"/LBNE/generator/");
29 new G4UIcmdWithADoubleAndUnit(
"/LBNE/generator/beamOffsetX",
this);
38 new G4UIcmdWithADoubleAndUnit(
"/LBNE/generator/beamOffsetY",
this);
47 new G4UIcmdWithADoubleAndUnit(
"/LBNE/generator/beamSigmaX",
this);
56 new G4UIcmdWithADoubleAndUnit(
"/LBNE/generator/beamSigmaY",
this);
65 new G4UIcmdWithADoubleAndUnit(
"/LBNE/generator/beamMaxValX",
this);
66 fBeamMaxValXCmd->SetGuidance(
"Set the maximum value in Y that a proton can have on target");
74 new G4UIcmdWithADoubleAndUnit(
"/LBNE/generator/beamMaxValY",
this);
75 fBeamMaxValYCmd->SetGuidance(
"Set the maximum value in Y that a proton can have on target");
83 new G4UIcmdWithADoubleAndUnit(
"/LBNE/generator/beamTheta",
this);
84 fBeamThetaCmd->SetGuidance(
"Set the angle (theta) of the proton beam");
89 new G4UIcmdWithADoubleAndUnit(
"/LBNE/generator/beamPhi",
this);
90 fBeamPhiCmd->SetGuidance(
"Set the angle (phi) of the proton beam.");
95 new G4UIcmdWithABool(
"/LBNE/generator/correctForAngle",
this);
101 fProtonMomentum =
new G4UIcmdWithADoubleAndUnit(
"/LBNE/primary/protonMomentum",
this);
102 fProtonMomentum->SetGuidance(
"Primary proton momentum delivered by the Fermilab Main Injector ");
110 new G4UIcmdWithABool(
"/LBNE/generator/beamOnTarget",
this);
115 fBeamBetaFunctionX =
new G4UIcmdWithADoubleAndUnit(
"/LBNE/primary/beamBetaFunctionX",
this);
117 "LBNE beam line X beta function at the the target (MCZERO) delived by the Fermilab Main Injector ");
124 fBeamBetaFunctionY =
new G4UIcmdWithADoubleAndUnit(
"/LBNE/primary/beamBetaFunctionY",
this);
126 "LBNE beam line Y beta function at the the target (MCZERO) delived by the Fermilab Main Injector ");
133 fBeamEmittanceX =
new G4UIcmdWithADoubleAndUnit(
"/LBNE/primary/beamEmittanceX",
this);
135 "LBNE beam line X Emittance, in pi mm mRad, Fermilab units. ");
142 fBeamEmittanceY =
new G4UIcmdWithADoubleAndUnit(
"/LBNE/primary/beamEmittanceY",
this);
144 "LBNE beam line Y Emittance, in pi mm mRad, Fermilab units. ");
151 fRadiusAnnularBeam =
new G4UIcmdWithADoubleAndUnit(
"/LBNE/primary/annularBeamRadius",
this);
153 "LBNF Annular beam option. Setting the radius of the annulus. Width set by XY beam size. ");
161 fUseGeantino =
new G4UIcmdWithoutParameter(
"/LBNE/primary/useGeantino",
this);
162 fUseGeantino->SetGuidance(
"Using a Geantino at the Primary, to study absorption");
165 fUseMuonGeantino =
new G4UIcmdWithoutParameter(
"/LBNE/primary/useMuonGeantino",
this);
166 fUseMuonGeantino->SetGuidance(
"Using a muon at the Primary, to study absorption, with magnetic field effect ");
169 fUseChargedGeantino =
new G4UIcmdWithoutParameter(
"/LBNE/primary/useChargedGeantino",
this);
170 fUseChargedGeantino->SetGuidance(
"Using a particle with charge, but no other physics (I hope) magnetic field effect ");
189 fGeantinoZOrigin =
new G4UIcmdWithADoubleAndUnit(
"/LBNE/primary/geantinoZOrigin",
this);
190 fGeantinoZOrigin->SetGuidance(
"Z origin generating the geantino (or mu geantino) (in mm) ");
198 new G4UIcmdWithADoubleAndUnit(
"/LBNE/primary/geantinoSigmaZOrigin",
this);
199 fGeantinoZOriginSigma->SetGuidance(
"Z origin longitudinal spread generating the geantino (or mu geantino) (in mm) ");
207 new G4UIcmdWith3VectorAndUnit(
"/LBNE/primary/mugeantinoScanZOrigin",
this);
209 fMuGeantinoZOriginScan->SetParameterName(
"mugeantinoScanZOriginInit",
"mugeantinoScanZOriginStep",
"mugeantinoScanZOriginFlag",
true);
216 new G4UIcmdWith3VectorAndUnit(
"/LBNE/primary/mugeantinoScanAngle",
this);
218 fMuGeantinoAngleScan->SetParameterName(
"mugeantinoScanAlngleInit",
"mugeantinoScanAlngleStep",
"mugeantinoScanAlngleFlag",
true);
225 new G4UIcmdWith3VectorAndUnit(
"/LBNE/primary/mugeantinoScanMomentum",
this);
227 fMuGeantinoMomentumScan->SetParameterName(
"mugeantinoScanMomentumInit",
"mugeantinoScanMomentumStep",
"mugeantinoScanMomentumFlag",
true);
234 new G4UIcmdWith3VectorAndUnit(
"/LBNE/primary/mugeantinoScanPt",
this);
236 fMuGeantinoPtScan->SetParameterName(
"mugeantinoScanPtInit",
"mugeantinoScanPtStep",
"mugeantinoScanPtFlag",
true);
243 new G4UIcmdWith3VectorAndUnit(
"/LBNE/primary/mugeantinoScanYOrigin",
this);
245 fMuGeantinoYOriginScan->SetParameterName(
"mugeantinoScanZOriginInit",
"mugeantinoScanZOriginStep",
"mugeantinoScanZOriginFlag",
true);
252 std::string aGuideFluka(
"Set the input fluka ntuple file name. \n");
253 aGuideFluka +=
std::string(
"Proton beam will be off, we will generate hadrons from Fluka file \n");
254 aGuideFluka +=
std::string(
"Note: No checks are done on the consistency of Fluka vs this Geant geometry \n");
297 G4cout <<
"LBNEPrimaryMessenger::SetNewValue - Setting Parameter value from input macro." << G4endl;
303 G4cout <<
"LBNEPrimaryMessenger::SetNewValue - Done Setting parameter value." << G4endl;
351 G4UIcmdWithADoubleAndUnit* cmdWD =
dynamic_cast<G4UIcmdWithADoubleAndUnit*
> (
cmd);
354 G4UIcmdWithADoubleAndUnit* cmdWD =
dynamic_cast<G4UIcmdWithADoubleAndUnit*
> (
cmd);
357 G4UIcmdWithADoubleAndUnit* cmdWD =
dynamic_cast<G4UIcmdWithADoubleAndUnit*
> (
cmd);
360 G4UIcmdWithADoubleAndUnit* cmdWD =
dynamic_cast<G4UIcmdWithADoubleAndUnit*
> (
cmd);
363 G4UIcmdWith3VectorAndUnit* cmdWD =
dynamic_cast<G4UIcmdWith3VectorAndUnit*
> (
cmd);
366 G4UIcmdWith3VectorAndUnit* cmdWD =
dynamic_cast<G4UIcmdWith3VectorAndUnit*
> (
cmd);
369 G4UIcmdWith3VectorAndUnit* cmdWD =
dynamic_cast<G4UIcmdWith3VectorAndUnit*
> (
cmd);
372 G4UIcmdWith3VectorAndUnit* cmdWD =
dynamic_cast<G4UIcmdWith3VectorAndUnit*
> (
cmd);
375 G4UIcmdWith3VectorAndUnit* cmdWD =
dynamic_cast<G4UIcmdWith3VectorAndUnit*
> (
cmd);
379 G4Exception(
"LBNEPrimaryMessenger",
"Inconsistency in particle choice ", FatalException,
380 "Can't use both a muon geantino, and a geantino ");
385 G4Exception(
"LBNEPrimaryMessenger",
"Inconsistency in particle choice ", FatalException,
386 "Can't use both a muon (or charged) geantino, and a geantino ");
391 G4Exception(
"LBNEPrimaryMessenger",
"Inconsistency in particle choice ", FatalException,
392 "Can't use both a geantino or a muon geantino, and a Charged geantino ");
396 G4UIcmdWithADoubleAndUnit* cmdWD =
dynamic_cast<G4UIcmdWithADoubleAndUnit*
> (
cmd);
397 const double pz = cmdWD->GetNewDoubleValue(val);
399 std::string msg(
"With the current 1.2 MW option, and Proton Momentum != 120 GeV, \n");
400 msg +=
std::string(
"The calculation of the beam spot size is unreliable. \n");
401 msg +=
std::string(
"The user must set beam signa X and sigma Y explicitely via cmd /LBNE/generator/beamSigmaX (Y) ");
402 G4Exception(
"LBNEPrimaryMessenger",
"", JustWarning, msg.c_str());
421 G4UIcmdWithADoubleAndUnit* cmdWD =
dynamic_cast<G4UIcmdWithADoubleAndUnit*
> (
cmd);
427 G4UIcmdWithADoubleAndUnit* cmdWD =
dynamic_cast<G4UIcmdWithADoubleAndUnit*
> (
cmd);
433 G4UIcmdWithADoubleAndUnit* cmdWD =
dynamic_cast<G4UIcmdWithADoubleAndUnit*
> (
cmd);
439 G4UIcmdWithADoubleAndUnit* cmdWD =
dynamic_cast<G4UIcmdWithADoubleAndUnit*
> (
cmd);
449 G4UIcmdWithADoubleAndUnit* cmdWD =
dynamic_cast<G4UIcmdWithADoubleAndUnit*
> (
cmd);
void SetPolarAngleGeantino(double r)
void SetBeamBetaFunctionY(G4double t)
G4UIcmdWithADoubleAndUnit * fGeantinoZOrigin
G4UIcmdWithADoubleAndUnit * fProtonMomentum
void SetBeamEmittanceX(G4double t)
void SetBeamOffsetY(G4double y)
G4bool OpenNtupleFLUKAASCII(G4String ntupleName)
G4UIcmdWith3VectorAndUnit * fMuGeantinoZOriginScan
G4UIcmdWithoutParameter * fUseGeantino
G4UIcmdWithADoubleAndUnit * fBeamMaxValYCmd
void SetCorrectForAngle(G4bool aBool)
LBNEPrimaryMessenger(LBNEPrimaryGeneratorAction *)
void msg(const char *fmt,...)
G4UIcmdWithADoubleAndUnit * fBeamBetaFunctionX
G4UIcmdWithADoubleAndUnit * fBeamSigmaXCmd
void SetBeamPhi(G4double phi)
void SetBeamSigmaX(G4double x)
double GetBeamSigmaX() const
void SetYOriginForMuGeantinoScan(G4ThreeVector v)
double GetBeamSigmaY() const
LBNEPrimaryGeneratorAction * fPrimaryAction
void SetPtForMuGeantinoScan(G4ThreeVector v)
G4UIcmdWithoutParameter * fUseMuonGeantino
G4UIcmdWith3VectorAndUnit * fMuGeantinoMomentumScan
void SetNewValue(G4UIcommand *, G4String)
void SetUseCourantSniderParams(G4bool t)
G4UIcmdWithADoubleAndUnit * fRadiusAnnularBeam
void SetBeamSigmaY(G4double y)
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
G4UIcmdWith3VectorAndUnit * fMuGeantinoYOriginScan
G4UIcmdWithADoubleAndUnit * fBeamSigmaYCmd
G4UIcmdWithADoubleAndUnit * fGeantinoOpeningAngle
void SetAngleForMuGeantinoScan(G4ThreeVector v)
void SetBeamMaxValX(G4double x)
void SetBeamMaxValY(G4double y)
G4UIcmdWith3VectorAndUnit * fMuGeantinoPtScan
void SetZOriginGeantino(double v)
void SetBeamTheta(G4double theta)
G4UIcmdWithADoubleAndUnit * fBeamMaxValXCmd
G4UIcmdWithABool * fCorrectForAngleCmd
double GetBeamMaxValY() const
void SetBeamBetaFunctionX(G4double t)
void SetBeamEmittanceY(G4double t)
G4UIcmdWithABool * fBeamOnTargetCmd
void SetPolarAngleGeantinoMin(double r)
void SetUseGeantino(bool t)
void SetMomentumForMuGeantinoScan(G4ThreeVector v)
bool GetUseChargedGeantino() const
G4UIdirectory * fDirectory
G4UIcmdWithADoubleAndUnit * fBeamBetaFunctionY
bool GetUseGeantino() const
G4UIcmdWithADoubleAndUnit * fBeamEmittanceX
void SetUseMuonGeantino(bool t)
G4UIcmdWithADoubleAndUnit * fGeantinoZOriginSigma
void SetSigmaZOriginGeantino(double v)
G4UIcmdWithADoubleAndUnit * fBeamOffsetYCmd
G4UIcmdWithADoubleAndUnit * fBeamEmittanceY
G4UIcmdWithADoubleAndUnit * fBeamPhiCmd
G4UIcmdWith3VectorAndUnit * fMuGeantinoAngleScan
void SetRadiusAnnularBeam(G4double t)
void SetBeamOffsetX(G4double x)
void SetBeamOnTarget(G4bool aBool)
void SetProtonMomentum(G4double p)
void SetUseChargedGeantino(bool t)
int GetVerboseLevel() const
double GetBeamMaxValX() const
void SetZOriginForMuGeantinoScan(G4ThreeVector v)
bool GetUseMuonGeantino() const
G4UIcmdWithAString * fInputFlukaFileName
G4UIcmdWithoutParameter * fUseChargedGeantino
G4UIcmdWithADoubleAndUnit * fGeantinoOpeningAngleMin
G4UIcmdWithADoubleAndUnit * fBeamThetaCmd
G4UIcmdWithADoubleAndUnit * fBeamOffsetXCmd
void SetUseJustSigmaCoord(G4bool t)