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

#include <TrackingMessenger.hh>

Inheritance diagram for TrackingMessenger:
Collaboration diagram for TrackingMessenger:

Public Member Functions

 TrackingMessenger (TrackingAction *)
 
 ~TrackingMessenger ()
 
virtual 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 46 of file TrackingMessenger.hh.

Constructor & Destructor Documentation

TrackingMessenger::TrackingMessenger ( TrackingAction trackA)

Definition at line 43 of file TrackingMessenger.cc.

44 :G4UImessenger(),
45  fTrackingAction(trackA),fTrackingCmd(0),fTimeWindowCmd(0)
46 {
47  fTrackingCmd = new G4UIcmdWithABool("/rdecay01/fullChain",this);
48  fTrackingCmd->SetGuidance("allow full decay chain");
49  fTrackingCmd->SetParameterName("flag",true);
50  fTrackingCmd->SetDefaultValue(true);
51 
52  fTimeWindowCmd = new G4UIcommand("/rdecay01/timeWindow",this);
53  fTimeWindowCmd->SetGuidance("set time window to survey activity per nuclide");
54  fTimeWindowCmd->SetGuidance(" t1, delta_t");
55  //
56  G4UIparameter* t1Prm = new G4UIparameter("t1",'d',false);
57  t1Prm->SetGuidance("time_1");
58  t1Prm->SetParameterRange("t1>0.");
59  fTimeWindowCmd->SetParameter(t1Prm);
60  //
61  G4UIparameter* unit1Prm = new G4UIparameter("unit1",'s',false);
62  unit1Prm->SetGuidance("unit of t1");
64  unit1Prm->SetParameterCandidates(unitList);
65  fTimeWindowCmd->SetParameter(unit1Prm);
66  //
67  G4UIparameter* dtPrm = new G4UIparameter("dt",'d',false);
68  dtPrm->SetGuidance("delta_t");
69  dtPrm->SetParameterRange("dt>0.");
70  fTimeWindowCmd->SetParameter(dtPrm);
71  //
72  G4UIparameter* unit2Prm = new G4UIparameter("unit2",'s',false);
73  unit2Prm->SetGuidance("unit of dt");
74  unit2Prm->SetParameterCandidates(unitList);
75  fTimeWindowCmd->SetParameter(unit2Prm);
76  //
78 }
void SetParameter(G4UIparameter *const newParameter)
Definition: G4UIcommand.hh:152
void SetParameterRange(const char *theRange)
void SetParameterCandidates(const char *theString)
void SetDefaultValue(G4bool defVal)
void SetParameterName(const char *theName, G4bool omittable, G4bool currentAsDefault=false)
static G4String UnitsList(const char *unitCategory)
Definition: G4UIcommand.cc:321
void SetGuidance(const char *aGuidance)
Definition: G4UIcommand.hh:161
void AvailableForStates(G4ApplicationState s1)
Definition: G4UIcommand.cc:240
void SetGuidance(const char *theGuidance)
static G4String CategoryOf(const char *unitName)
Definition: G4UIcommand.cc:316

Here is the call graph for this function:

TrackingMessenger::~TrackingMessenger ( )

Definition at line 82 of file TrackingMessenger.cc.

83 {
84  delete fTrackingCmd;
85  delete fTimeWindowCmd;
86 }

Member Function Documentation

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

Reimplemented from G4UImessenger.

Definition at line 90 of file TrackingMessenger.cc.

91 {
92  if (command == fTrackingCmd)
93  { fTrackingAction->SetFullChain(fTrackingCmd->GetNewBoolValue(newValue));}
94 
95  if (command == fTimeWindowCmd)
96  {
97  G4double t1; G4double dt;
98  G4String unt1, unt2;
99  std::istringstream is(newValue);
100  is >> t1 >> unt1 >> dt >> unt2;
101  t1 *= G4UIcommand::ValueOf(unt1);
102  dt *= G4UIcommand::ValueOf(unt2);
103  fTrackingAction->SetTimeWindow (t1, dt);
104  }
105 }
static G4bool GetNewBoolValue(const char *paramString)
void SetFullChain(G4bool flag)
void SetTimeWindow(G4double, G4double)
static G4double ValueOf(const char *unitName)
Definition: G4UIcommand.cc:309
tuple t1
Definition: plottest35.py:33
double G4double
Definition: G4Types.hh:76

Here is the call graph for this function:


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