Geant4  10.03.p02
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
DMXEventActionMessenger Class Reference

#include <DMXEventActionMessenger.hh>

Inheritance diagram for DMXEventActionMessenger:
Collaboration diagram for DMXEventActionMessenger:

Public Member Functions

 DMXEventActionMessenger (DMXEventAction *)
 
 ~DMXEventActionMessenger ()
 
void SetNewValue (G4UIcommand *, G4String)
 
- Public Member Functions inherited from G4UImessenger
 G4UImessenger ()
 
 G4UImessenger (const G4String &path, const G4String &dsc, G4bool commandsToBeBroadcasted=true)
 
virtual ~G4UImessenger ()
 
virtual G4String GetCurrentValue (G4UIcommand *command)
 
G4bool operator== (const G4UImessenger &messenger) const
 
G4bool CommandsShouldBeInMaster () const
 

Additional Inherited Members

- Protected Member Functions inherited from G4UImessenger
G4String ItoS (G4int i)
 
G4String DtoS (G4double a)
 
G4String BtoS (G4bool b)
 
G4int StoI (G4String s)
 
G4double StoD (G4String s)
 
G4bool StoB (G4String s)
 
void AddUIcommand (G4UIcommand *newCommand)
 
void CreateDirectory (const G4String &path, const G4String &dsc, G4bool commandsToBeBroadcasted=true)
 
template<typename T >
T * CreateCommand (const G4String &cname, const G4String &dsc)
 
- Protected Attributes inherited from G4UImessenger
G4UIdirectorybaseDir
 
G4String baseDirName
 
G4bool commandsShouldBeInMaster
 

Detailed Description

Definition at line 55 of file DMXEventActionMessenger.hh.

Constructor & Destructor Documentation

DMXEventActionMessenger::DMXEventActionMessenger ( DMXEventAction EvAct)

Definition at line 56 of file DMXEventActionMessenger.cc.

57 :eventAction(EvAct){
58 
59  // saving event information
60  dmxDirectory = new G4UIdirectory("/dmx/");
61  dmxDirectory->SetGuidance("DM Example commands.");
62 
63  SavePmtCmd = new G4UIcmdWithABool("/dmx/savePmt",this);
64  SavePmtCmd->SetGuidance("Set flag to save (x,y,z) of hits in PMT");
65  SavePmtCmd->SetGuidance("into file 'pmt.out'");
66  SavePmtCmd->SetGuidance("Default = false");
67  SavePmtCmd->SetParameterName("savePmtFlag", false);
68 
69  SaveHitsCmd = new G4UIcmdWithABool("/dmx/saveHits",this);
70  SaveHitsCmd->SetGuidance("Set flag to save hits in each run");
71  SaveHitsCmd->SetGuidance("into file 'hits.out'");
72  SaveHitsCmd->SetGuidance("Default = true");
73  SaveHitsCmd->SetParameterName("saveHitsFlag", false);
74 
75 
76  // drawing event
77  drawDirectory = new G4UIdirectory("/dmx/draw/");
78  drawDirectory->SetGuidance("DM Example draw commands.");
79 
80  DrawColsCmd = new G4UIcmdWithAString("/dmx/draw/drawColours",this);
81  DrawColsCmd->SetGuidance("Tracks drawn by Event (standard colours) or by Step (custom colours)");
82  DrawColsCmd->SetGuidance(" Choice : custom, standard(default)");
83  DrawColsCmd->SetParameterName("drawColsFlag", false);
84  DrawColsCmd->SetCandidates("custom standard");
85  DrawColsCmd->AvailableForStates(G4State_Idle);
86 
87  DrawTrksCmd = new G4UIcmdWithAString("/dmx/draw/drawTracks",this);
88  DrawTrksCmd->SetGuidance("Draw the tracks in the event");
89  DrawTrksCmd->SetGuidance(" Choice : none, charged, noscint, all(default)");
90  DrawTrksCmd->SetParameterName("drawTrksFlag", false);
91  DrawTrksCmd->SetCandidates("none charged noscint all");
92  DrawTrksCmd->AvailableForStates(G4State_Idle);
93 
94  DrawHitsCmd = new G4UIcmdWithABool("/dmx/draw/drawHits",this);
95  DrawHitsCmd->SetGuidance("Set flag to draw hits in PMT.");
96  DrawHitsCmd->SetGuidance("Default = true");
97  DrawHitsCmd->SetParameterName("drawHitsFlag", false);
98  DrawHitsCmd->SetDefaultValue(true);
99 
100  PrintCmd = new G4UIcmdWithAnInteger("/dmx/printModulo",this);
101  PrintCmd->SetGuidance("Print events modulo n");
102  PrintCmd->SetParameterName("EventNb",false);
103  PrintCmd->SetRange("EventNb>0");
104  PrintCmd->AvailableForStates(G4State_Idle);
105 
106 }
void SetParameterName(const char *theName, G4bool omittable, G4bool currentAsDefault=false)
void SetParameterName(const char *theName, G4bool omittable, G4bool currentAsDefault=false)
void SetDefaultValue(G4bool defVal)
void SetParameterName(const char *theName, G4bool omittable, G4bool currentAsDefault=false)
void SetRange(const char *rs)
Definition: G4UIcommand.hh:125
void SetGuidance(const char *aGuidance)
Definition: G4UIcommand.hh:161
void AvailableForStates(G4ApplicationState s1)
Definition: G4UIcommand.cc:240
void SetCandidates(const char *candidateList)

Here is the call graph for this function:

DMXEventActionMessenger::~DMXEventActionMessenger ( )

Definition at line 109 of file DMXEventActionMessenger.cc.

109  {
110 
111  delete SavePmtCmd;
112  delete SaveHitsCmd;
113  delete dmxDirectory;
114  delete DrawColsCmd;
115  delete DrawTrksCmd;
116  delete DrawHitsCmd;
117  delete drawDirectory;
118  delete PrintCmd;
119 
120 }

Member Function Documentation

void DMXEventActionMessenger::SetNewValue ( G4UIcommand command,
G4String  newValue 
)
virtual

Reimplemented from G4UImessenger.

Definition at line 123 of file DMXEventActionMessenger.cc.

123  {
124 
125  if(command == DrawColsCmd)
126  eventAction->SetDrawColsFlag(newValue);
127 
128  if(command == DrawTrksCmd)
129  eventAction->SetDrawTrksFlag(newValue);
130 
131  if(command == DrawHitsCmd) {
132  G4int vl;
133  const char* t = newValue;
134  std::istringstream is(t);
135  is >> vl;
136  eventAction->SetDrawHitsFlag(vl!=0);
137  }
138 
139  if(command == SavePmtCmd) {
140  G4int vl;
141  const char* t = newValue;
142  std::istringstream is(t);
143  is >> vl;
144  eventAction->SetSavePmtFlag(vl!=0);
145  }
146 
147  if(command == SaveHitsCmd) {
148  G4int vl;
149  const char* t = newValue;
150  std::istringstream is(t);
151  is >> vl;
152  eventAction->SetSaveHitsFlag(vl!=0);
153  }
154 
155  if(command == PrintCmd)
156  {eventAction->SetPrintModulo(PrintCmd->GetNewIntValue(newValue));}
157 
158 
159 }
static G4int GetNewIntValue(const char *paramString)
void SetSaveHitsFlag(G4int val)
void SetDrawColsFlag(G4String val)
int G4int
Definition: G4Types.hh:78
void SetPrintModulo(G4int val)
void SetDrawHitsFlag(G4int val)
void SetSavePmtFlag(G4int val)
void SetDrawTrksFlag(G4String val)

The documentation for this class was generated from the following files: