12 #define EVIO_BUFFER 30000000 17 if(outputFactoryMap->find(outputType) == outputFactoryMap->end())
19 cout << endl << endl <<
" >>> WARNING: Output type <" << outputType <<
"> NOT FOUND IN Output Map." << endl;
23 return (*outputFactoryMap)[outputType]();
32 string hd_msg = gemcOpt.
optMap[
"LOG_MSG"].args +
" Output File: >> ";
34 string optf = gemcOpt.optMap[
"OUTPUT"].args;
35 outType.assign(optf, 0, optf.find(
",")) ;
36 outFile.assign(optf, optf.find(
",") + 1, optf.size()) ;
38 if(outType !=
"no") cout << hd_msg <<
" Opening output file \"" <<
TrimSpaces(outFile) <<
"\"." << endl;
39 if(outType ==
"txt") txtoutput =
new ofstream(
TrimSpaces(outFile).c_str());
42 pchan =
new evioFileChannel(
TrimSpaces(outFile).c_str(),
"w", evio_buffer);
49 string hd_msg = gemcOpt.optMap[
"LOG_MSG"].args +
" Output File: >> ";
51 if(outType !=
"no") cout <<
" Closing " << outFile <<
"." << endl;
52 if(outType ==
"txt") txtoutput->close();
63 map<string, outputFactoryInMap> outputMap;
73 if(what ==
"pid")
return PID;
79 if(what ==
"px")
return momentum.x();
80 if(what ==
"py")
return momentum.y();
81 if(what ==
"pz")
return momentum.z();
82 if(what ==
"vx")
return vertex.x();
83 if(what ==
"vy")
return vertex.y();
84 if(what ==
"vz")
return vertex.z();
double getVariableFromStringD(string)
int getVariableFromStringI(string)
static outputFactory * createOutput()
map< string, aopt > optMap
Options map.
outputFactory * getOutputFactory(map< string, outputFactoryInMap > *outputFactoryMap, string outputType)
string TrimSpaces(string in)
Removes leading and trailing spaces.
map< string, outputFactoryInMap > registerOutputFactories()
outputContainer(goptions)
static outputFactory * createOutput()