6 #include "PackageInfo.hh"
12 #include "lcdd/core/LCDDProcessor.hh"
13 #include "lcdd/util/StringUtil.hh"
17 #include "G4RunManager.hh"
18 #include "G4SystemOfUnits.hh"
27 std::string LcioFileNamer::m_sep =
"_";
29 LcioFileNamer::LcioFileNamer() :
43 static std::string
sep(
"-");
45 if (field ==
"application") {
46 value = PackageInfo::getShortName() +
"-v" + PackageInfo::getVersion(
sep);
47 }
else if (field ==
"geometry") {
48 value = LCDDProcessor::instance()->getDetectorName();
49 }
else if (field ==
"date") {
51 }
else if (field ==
"event" || field ==
"evt") {
53 }
else if (field ==
"eventNumber") {
55 }
else if (field ==
"run") {
57 }
else if (field ==
"binary") {
59 }
else if (field ==
"physics") {
71 std::string filename =
"";
72 if (fieldList.size() != 0) {
73 for (std::vector<std::string>::const_iterator it = fieldList.begin(); it != fieldList.end(); it++) {
76 filename = filename + value +
m_sep;
80 filename.erase(filename.end() - 1, filename.end());
122 std::string pname = gps->GetParticleDefinition()->GetParticleName();
125 double ene = gps->GetCurrentSource()->GetEneDist()->GenerateOne(gps->GetParticleDefinition());
126 std::string eneStr = StringUtil::toString(ene / GeV) +
"GeV";
129 std::string evtname = pname +
m_sep + eneStr;
138 std::string pname = gun->GetParticleDefinition()->GetParticleName();
141 std::string pE = StringUtil::toString(gun->GetParticleEnergy() / GeV) +
"GeV";
144 std::string evtname = pname +
m_sep + pE;
150 return StringUtil::toString(G4RunManager::GetRunManager()->GetCurrentRun()->GetRunID());
static SlicApplication * instance()
static std::string removeExtension(std::string filename)
static std::string basename(std::string filename)
static std::string makeGunName()
std::string getFieldValue(std::string field)
static std::string makeGPSName()
static std::string makeFileBasedName()
std::vector< std::string > m_defaultFields
static std::string makeEventName()
static std::string makeEventNumberString()
std::string makeFileName(std::vector< std::string > fields)
std::string makeDefaultFileName()
static std::string makeRunNumberString()
Base class for slic code modules that provides common functionality, such as logging to an output str...
static std::string getDate()