LBNESteppingActionMessenger.cc
Go to the documentation of this file.
2 
3 #include "LBNESteppingAction.hh"
4 #include "G4UIdirectory.hh"
5 #include "G4UIcmdWithAnInteger.hh"
6 #include "G4UIcmdWithADoubleAndUnit.hh"
7 #include "G4UIcmdWithADouble.hh"
8 #include "G4UIcmdWithAString.hh"
9 #include "G4UIcmdWithABool.hh"
10 #include "G4UIcmdWithoutParameter.hh"
11 #include "G4ios.hh"
12 #include "globals.hh"
13 #include "Randomize.hh"
14 #include "G4RunManager.hh"
15 
17  :SteppingAction (RA)
18 {
19  //
20  //LBNE/stepping
21  //
22  StepDir = new G4UIdirectory("/LBNE/stepping/");
23  StepDir->SetGuidance("In Step analysis and control.");
24 
25  SimulationNameCmd = new G4UIcmdWithAString("/LBNE/stepping/name",this);
26  SimulationNameCmd->SetGuidance("Name for the study in question");
27  SimulationNameCmd->SetParameterName("Name",true);
28  SimulationNameCmd->SetDefaultValue ("GeomPos101");
29  SimulationNameCmd->AvailableForStates(G4State_Idle);
30 
31 
32  OutputNtupleFileNameCmd = new G4UIcmdWithAString("/LBNE/stepping/ntuplefilename",this);
33  OutputNtupleFileNameCmd->SetGuidance("Root ntuple with positions of volume transitions ");
34  OutputNtupleFileNameCmd->SetParameterName("NtupleFileName",true);
35  OutputNtupleFileNameCmd->SetDefaultValue ("./steppingTuple.root");
36  OutputNtupleFileNameCmd->AvailableForStates(G4State_Idle);
37 
38  OutputASCIIFileNameCmd = new G4UIcmdWithAString("/LBNE/stepping/filename",this);
39  OutputASCIIFileNameCmd->SetGuidance("Ascii file Name for a plain ASCII file with positions of the geantino ");
40  OutputASCIIFileNameCmd->SetParameterName("FileName",true);
41  OutputASCIIFileNameCmd->SetDefaultValue ("./steppingActionOut.txt");
42  OutputASCIIFileNameCmd->AvailableForStates(G4State_Idle);
43 
44  KeyVolumeForOutput = new G4UIcmdWithAString("/LBNE/stepping/keyVolumeForOutput",this);
45  KeyVolumeForOutput->SetGuidance("A volume that will trigger output running geantino propagation ");
46  KeyVolumeForOutput->SetParameterName("keyVolumeForOutput",true);
47  KeyVolumeForOutput->SetDefaultValue ("blank");
48  KeyVolumeForOutput->AvailableForStates(G4State_Idle);
49 
50  KeyVolumeForOutputTo = new G4UIcmdWithAString("/LBNE/stepping/keyVolumeForOutputTo",this);
51  KeyVolumeForOutputTo->SetGuidance(
52  "A volume that will trigger output running geantino propagation, second one Post or pre step ");
53  KeyVolumeForOutputTo->SetParameterName("keyVolumeForOutputTo ",true);
54  KeyVolumeForOutputTo->SetDefaultValue ("blank");
55  KeyVolumeForOutputTo->AvailableForStates(G4State_Idle);
56 
57  GenerateParticleOuputHorns = new G4UIcmdWithABool("/LBNE/stepping/generateParticlesFluxThroughHorns",this);
58  GenerateParticleOuputHorns->SetGuidance(
59  "Save bulky ASCII file with 6D phase info for muons, for instance, for z < 15000. ");
60  GenerateParticleOuputHorns->SetParameterName("ParticleFluxInfo",true);
61  GenerateParticleOuputHorns->SetDefaultValue (false);
62  GenerateParticleOuputHorns->AvailableForStates(G4State_Idle);
63 
64  GenerateMuonSculptedAbsorberFlux = new G4UIcmdWithABool("/LBNE/stepping/GenerateMuonSculptedAbsorberFlux",this);
66  "Save bulky ASCII file with 6D phase info for muons, at the front/back of the sculpted muon absorber ");
67  GenerateMuonSculptedAbsorberFlux->SetParameterName("MuonSculptedAbsorberFlux",true);
68  GenerateMuonSculptedAbsorberFlux->SetDefaultValue (false);
69  GenerateMuonSculptedAbsorberFlux->AvailableForStates(G4State_Idle);
70 
71  MuonSculptedAbsorberFluxFilename = new G4UIcmdWithAString("/LBNE/stepping/MuonSculptedAbsorberFluxFilename",this);
73  "Set filename for the muon absorber flux ASCII file ");
74  MuonSculptedAbsorberFluxFilename->SetParameterName("Filename",true);
75  MuonSculptedAbsorberFluxFilename->SetDefaultValue ("MuonFluxAtSculptedAbsorber.txt");
76  MuonSculptedAbsorberFluxFilename->AvailableForStates(G4State_Idle);
77 
78 
79 }
81 
82  delete SimulationNameCmd;
85  delete KeyVolumeForOutput;
88  delete StepDir;
89 }
90 
91 void LBNESteppingActionMessenger::SetNewValue(G4UIcommand* command,G4String newValues) {
92 
93  if (command == SimulationNameCmd)
94  {
95  G4cout << "\n---> Stepping Output info Data Set Name " << newValues << G4endl;
97 
98  } else if(command == OutputASCIIFileNameCmd) {
99  SteppingAction->OpenAscii(newValues.c_str());
100  } else if(command == OutputNtupleFileNameCmd) {
101  SteppingAction->OpenNtuple(newValues.c_str());
102  } else if(command == KeyVolumeForOutput) {
104  } else if(command == KeyVolumeForOutputTo) {
106  } else if(command == GenerateParticleOuputHorns) {
107  G4UIcmdWithABool* cmd= reinterpret_cast<G4UIcmdWithABool*>(command);
108  SteppingAction->SetStudyParticleThroughHorns(cmd->GetNewBoolValue(newValues));
109  } else if(command == GenerateMuonSculptedAbsorberFlux) {
110  G4UIcmdWithABool* cmd= reinterpret_cast<G4UIcmdWithABool*>(command);
111  SteppingAction->SetGenerateMuonSculptedAbsorberFlux(cmd->GetNewBoolValue(newValues));
112  }else if (command == MuonSculptedAbsorberFluxFilename){
114  }
115 }
116 
117 
void SetStudyGeantinoMode(G4String v)
int command
G4UIcmdWithABool * GenerateMuonSculptedAbsorberFlux
LBNESteppingActionMessenger(LBNESteppingAction *)
void SetKeyVolumeForOutputTo(G4String v)
void SetGenerateMuonSculptedAbsorberFlux(bool t)
void SetKeyVolumeForOutput(G4String v)
void SetStudyParticleThroughHorns(bool t)
void OpenNtuple(const char *fname)
void SetMuonSculptedAbsorberFluxFilename(G4String str="./MuonFluxAtSculptedAbsorber.txt")
G4UIcmdWithAString * MuonSculptedAbsorberFluxFilename
void SetNewValue(G4UIcommand *, G4String)
void OpenAscii(const char *fname)
list cmd
Definition: getreco.py:22