37 std::string name =
"/persistency/";
39 directory->
SetGuidance(
"Control commands for Persistency package");
41 std::string cmd = name +
"verbose";
44 verboseCmd->
SetGuidance(
"Set the verbose level of G4PersistencyManager.");
46 verboseCmd->
SetGuidance(
" 1 : Display main topics");
47 verboseCmd->
SetGuidance(
" 2 : Display event-level topics");
48 verboseCmd->
SetGuidance(
" 3 : Display debug information");
51 verboseCmd->
SetRange(
"level >=0 && level <=3");
53 std::string vname = name +
"select";
57 select->
SetGuidance(
"Selection of a persistency package");
61 vname = name +
"store/";
64 subdir1->
SetGuidance(
"Specifiy object types for store");
66 wrObj.push_back(
"HepMC");
67 wrObj.push_back(
"MCTruth");
68 wrObj.push_back(
"Hits");
73 for ( i = 0; i < 3; i++ )
75 cmd = vname + wrObj[i];
76 guidance =
"Store " + wrObj[i] +
" objects for output";
78 storeObj[i]->SetGuidance(guidance.c_str());
79 if ( wrObj[i] ==
"HepMC" ) {
80 storeObj[i]->SetCandidates(
"on off recycle");
82 storeObj[i]->SetCandidates(
"on off");
88 subdir2->
SetGuidance(
"Select I/O manager for store");
90 cmd = vname +
"hitIO";
95 vname = name +
"set/";
99 vname +=
"writeFile/";
101 subdir4->
SetGuidance(
"Set output file names for object types");
103 for ( i = 0; i < 3; i++ )
105 cmd = vname + wrObj[i];
106 guidance =
"Set an output file name for " + wrObj[i] +
".";
108 setWrFile[i]->SetGuidance(guidance.c_str());
109 setWrFile[i]->SetParameterName(
"file name",
true,
true);
112 vname = name +
"set/ReadFile/";
114 subdir5->
SetGuidance(
"Set input file names for object types");
116 rdObj.push_back(
"Hits");
118 cmd = vname + rdObj[0];
119 guidance =
"Set an input file name for " + rdObj[0] +
".";
121 setRdFile[0]->SetGuidance(guidance.c_str());
122 setRdFile[0]->SetParameterName(
"file name",
true,
true);
124 cmd = name +
"printall";
142 for (
int i = 0; i < 3; i++ )
154 if (command==verboseCmd)
158 else if (command==select)
162 else if (command==regHitIO)
164 pc->
AddHCIOmanager(PopWord(newValues,1,
" "),PopWord(newValues,2,
" "));
166 else if (command==setRdFile[0])
168 pc -> SetReadFile ( rdObj[0],newValues);
170 else if (command==printAll)
176 for(
int i=0; i<3; i++ ) {
177 if( command==storeObj[i] )
180 if( newValues ==
"on" ) {
182 }
else if ( newValues ==
"off" ) {
184 }
else if ( newValues ==
"recycle" ) {
187 G4cerr <<
"Unrecognized keyword - \"" << newValues <<
"\"."
193 else if( command==setWrFile[i] )
211 else if (command==select)
215 else if (command==regHitIO)
219 else if (command==setRdFile[0])
225 for(
int i=0; i<3; i++ ) {
226 if( command==storeObj[i] )
243 else if( command==setWrFile[i] )
254std::string G4PersistencyCenterMessenger::PopWord(std::string text,
int n, std::string delim)
256 if ( text.length() <= 0 )
return "";
259 for (
int i = 0; i < n; i++ ) {
260 p1 = text.find_first_of(delim,p0+1);
261 while( p1 == p0+1 ) {
263 p1 = text.find_first_of(delim,p0+1);
267 if ( i+1 < n )
return "";
274 return text.substr(p,p1-p);
G4DLLIMPORT std::ostream G4cerr
void SetNewValue(G4UIcommand *command, G4String newValues)
~G4PersistencyCenterMessenger()
G4String GetCurrentValue(G4UIcommand *command)
G4PersistencyCenterMessenger(G4PersistencyCenter *p)
void SelectSystem(std::string systemName)
const std::string CurrentSystem()
std::string CurrentHCIOmanager()
std::string CurrentWriteFile(std::string objName)
void SetVerboseLevel(int v)
StoreMode CurrentStoreMode(std::string objName)
void SetStoreMode(std::string objName, StoreMode mode)
void AddHCIOmanager(std::string detName, std::string colName)
G4bool SetWriteFile(std::string objName, std::string writeFileName)
std::string CurrentReadFile(std::string objName)
void SetCandidates(const char *candidateList)
void SetParameterName(const char *theName, G4bool omittable, G4bool currentAsDefault=false)
void SetParameterName(const char *theName, G4bool omittable, G4bool currentAsDefault=false)
static G4int GetNewIntValue(const char *paramString)
void SetDefaultValue(G4int defVal)
void SetGuidance(const char *aGuidance)
void SetRange(const char *rs)