MyAnalysisSvcMessenger Class Reference

#include <MyAnalysisSvcMessenger.hh>

List of all members.

Public Member Functions

 MyAnalysisSvcMessenger (MyAnalysisSvc *)
 ~MyAnalysisSvcMessenger ()
void SetNewValue (G4UIcommand *, G4String)

Private Attributes

MyAnalysisSvcm_myAnalysisSvc
G4UIdirectory * myAnalysisSvcDir
G4UIcmdWithAString * out_card_cmd
G4UIcmdWithAString * ofile_name_cmd
G4UIcmdWithAString * tree_name_cmd
G4UIcmdWithADoubleAndUnit * set_minT_cmd
G4UIcmdWithADoubleAndUnit * set_maxT_cmd
G4UIcmdWithAString * run_name_cmd
G4UIcmdWithAnInteger * PrintCmd

Detailed Description

Definition at line 20 of file MyAnalysisSvcMessenger.hh.


Constructor & Destructor Documentation

MyAnalysisSvcMessenger::MyAnalysisSvcMessenger ( MyAnalysisSvc myAnalysisSvc  ) 

Definition at line 20 of file MyAnalysisSvcMessenger.cc.

References myAnalysisSvcDir, ofile_name_cmd, out_card_cmd, PrintCmd, run_name_cmd, set_maxT_cmd, set_minT_cmd, and tree_name_cmd.

00021 :m_myAnalysisSvc(myAnalysisSvc)
00022 {
00023 
00024         myAnalysisSvcDir = new G4UIdirectory("/g4sim/myAnalysisSvc/");
00025         myAnalysisSvcDir->SetGuidance("myAnalysisSvc control");
00026 
00027         //about output
00028         out_card_cmd = new G4UIcmdWithAString("/g4sim/myAnalysisSvc/set_out_card",this);
00029         out_card_cmd->SetGuidance("set name for MyAnalysisSvc file");
00030         out_card_cmd->SetParameterName("out_card",false);
00031         out_card_cmd->AvailableForStates(G4State_PreInit,G4State_Idle);
00032 
00033         //about root file
00034         ofile_name_cmd = new G4UIcmdWithAString("/g4sim/myAnalysisSvc/set_ofile_name",this);
00035         ofile_name_cmd->SetGuidance("set name for MyAnalysisSvc file");
00036         ofile_name_cmd->SetParameterName("ofile_name",true);
00037         ofile_name_cmd->SetDefaultValue("raw_g4sim.root");
00038         ofile_name_cmd->AvailableForStates(G4State_PreInit,G4State_Idle);
00039 
00040         tree_name_cmd = new G4UIcmdWithAString("/g4sim/myAnalysisSvc/set_tree_name",this);
00041         tree_name_cmd->SetGuidance("set name for MyAnalysisSvc tree");
00042         tree_name_cmd->SetParameterName("tree_name",true);
00043         tree_name_cmd->SetDefaultValue("t");
00044         tree_name_cmd->AvailableForStates(G4State_PreInit,G4State_Idle);
00045 
00046         //about cut
00047         set_minT_cmd = new G4UIcmdWithADoubleAndUnit("/g4sim/myAnalysisSvc/set_minT",this);
00048         set_minT_cmd->SetGuidance("Define minimal time");
00049         set_minT_cmd->SetParameterName("minT",false,false);
00050         set_minT_cmd->SetDefaultUnit("ns");
00051         set_minT_cmd->AvailableForStates(G4State_PreInit,G4State_Idle);
00052 
00053         set_maxT_cmd = new G4UIcmdWithADoubleAndUnit("/g4sim/myAnalysisSvc/set_maxT",this);
00054         set_maxT_cmd->SetGuidance("Define minimal time");
00055         set_maxT_cmd->SetParameterName("maxT",false,false);
00056         set_maxT_cmd->SetDefaultUnit("ns");
00057         set_maxT_cmd->AvailableForStates(G4State_PreInit,G4State_Idle);
00058 
00059         //about log
00060         run_name_cmd = new G4UIcmdWithAString("/g4sim/myAnalysisSvc/set_run_name",this);
00061         run_name_cmd->SetGuidance("set run_name");
00062         run_name_cmd->SetParameterName("run_name",true);
00063         run_name_cmd->SetDefaultValue("test");
00064         run_name_cmd->AvailableForStates(G4State_PreInit,G4State_Idle);
00065 
00066         //about PrintModulo
00067         PrintCmd = new G4UIcmdWithAnInteger("/g4sim/myAnalysisSvc/printModulo",this);
00068         PrintCmd->SetGuidance("Print events modulo n");
00069         PrintCmd->SetParameterName("EventNb",false);
00070         PrintCmd->SetRange("EventNb>0");
00071 }

MyAnalysisSvcMessenger::~MyAnalysisSvcMessenger (  ) 

Definition at line 75 of file MyAnalysisSvcMessenger.cc.

References myAnalysisSvcDir, ofile_name_cmd, out_card_cmd, PrintCmd, run_name_cmd, set_maxT_cmd, set_minT_cmd, and tree_name_cmd.

00076 {
00077         delete myAnalysisSvcDir;
00078         //about output
00079         delete out_card_cmd;
00080 
00081         //about root file
00082         delete ofile_name_cmd;
00083         delete tree_name_cmd;
00084 
00085         //about cut
00086         delete set_minT_cmd;
00087         delete set_maxT_cmd;
00088 
00089         //about log
00090         delete run_name_cmd;
00091 
00092         //about PrintModulo
00093         delete PrintCmd;
00094 }


Member Function Documentation

void MyAnalysisSvcMessenger::SetNewValue ( G4UIcommand *  command,
G4String  newValue 
)

Definition at line 98 of file MyAnalysisSvcMessenger.cc.

References m_myAnalysisSvc, ofile_name_cmd, out_card_cmd, PrintCmd, run_name_cmd, MyAnalysisSvc::set_maxT(), set_maxT_cmd, MyAnalysisSvc::set_minT(), set_minT_cmd, MyAnalysisSvc::set_ofile_name(), MyAnalysisSvc::set_out_card(), MyAnalysisSvc::set_PrintModulo(), MyAnalysisSvc::set_run_name(), MyAnalysisSvc::set_tree_name(), and tree_name_cmd.

00099 {      
00100         //about output
00101         if(command==out_card_cmd){m_myAnalysisSvc->set_out_card(newValue);}
00102 
00103         //about root file
00104         if(command==ofile_name_cmd){m_myAnalysisSvc->set_ofile_name(newValue);}
00105         if(command==tree_name_cmd){m_myAnalysisSvc->set_tree_name(newValue);}
00106 
00107         //about cut
00108     if(command==set_minT_cmd) m_myAnalysisSvc->set_minT(set_minT_cmd->GetNewDoubleValue(newValue));
00109     if(command==set_maxT_cmd) m_myAnalysisSvc->set_maxT(set_maxT_cmd->GetNewDoubleValue(newValue));
00110 
00111         //about log
00112         if(command==run_name_cmd){m_myAnalysisSvc->set_run_name(newValue);}
00113 
00114         //about PrintModulo
00115         if(command == PrintCmd){m_myAnalysisSvc->set_PrintModulo(PrintCmd->GetNewIntValue(newValue));}
00116 }


Member Data Documentation

Definition at line 29 of file MyAnalysisSvcMessenger.hh.

Referenced by SetNewValue().

G4UIdirectory* MyAnalysisSvcMessenger::myAnalysisSvcDir [private]

Definition at line 31 of file MyAnalysisSvcMessenger.hh.

Referenced by MyAnalysisSvcMessenger(), and ~MyAnalysisSvcMessenger().

G4UIcmdWithAString* MyAnalysisSvcMessenger::ofile_name_cmd [private]
G4UIcmdWithAString* MyAnalysisSvcMessenger::out_card_cmd [private]
G4UIcmdWithAnInteger* MyAnalysisSvcMessenger::PrintCmd [private]
G4UIcmdWithAString* MyAnalysisSvcMessenger::run_name_cmd [private]
G4UIcmdWithADoubleAndUnit* MyAnalysisSvcMessenger::set_maxT_cmd [private]
G4UIcmdWithADoubleAndUnit* MyAnalysisSvcMessenger::set_minT_cmd [private]
G4UIcmdWithAString* MyAnalysisSvcMessenger::tree_name_cmd [private]

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

Generated on 15 Jun 2016 for g4sim by  doxygen 1.6.1