Skip to content
Snippets Groups Projects

Patches for GenFSRJson to correct JSON output

Merged Alex Grecu requested to merge agrecu/genfsrjson-patch into master
@@ -74,10 +74,9 @@ private:
Gaudi::Property<std::string> m_gaussVersion{this, "gaussVersion", "", "Gauss version used in the simulation"};
Gaudi::Property<std::string> m_simCond{this, "simCond", "", "Tag for the SimCond database"};
Gaudi::Property<std::string> m_dddb{this, "dddb", "", "Tag for the DDDB database"};
Gaudi::Property<std::string> m_jsonOutputLocation{this, "jsonOutputLocation", "",
"Path where to save the .json output"};
Gaudi::Property<std::string> m_jsonOutputName{this, "jsonOutputName", "GenerationFSR_" + m_appConfigFile + ".json",
"Name of the .json output"};
Gaudi::Property<std::string> m_jsonOutputLocation{
this, "jsonOutputLocation", "", "Path where to save the .json output (including final path separator!)"};
Gaudi::Property<std::string> m_jsonOutputName{this, "jsonOutputName", "", "Name of the .json output"};
SmartIF<IDataProviderSvc> m_fileRecordSvc;
PublicToolHandle<IFSRNavigator> m_navigatorTool{this, "FSRNavigator",
@@ -331,6 +330,15 @@ StatusCode GenFSRJson::initialize() {
// get the File Records service
m_fileRecordSvc = Gaudi::svcLocator()->service( "FileRecordDataSvc" );
// set default value for m_jsonOutputName if necessary
if ( m_jsonOutputName.value().length() == 0 ) {
std::string mfilename = "GenerationFSR";
std::string mappcfg = m_appConfigFile.value();
if ( mappcfg.length() > 0 ) mfilename += "_" + mappcfg;
mfilename += ".json";
m_jsonOutputName.setValue( mfilename );
};
return sc;
}
@@ -398,15 +406,15 @@ void GenFSRJson::printFSR() {
ptree main_tree;
std::string evtDesc = getEvtTypeDesc( evtType );
main_tree.put( "APPCONFIG_file", m_appConfigFile );
main_tree.put( "APPCONFIG_version", m_appConfigVersion );
main_tree.put( "APPCONFIG_file", m_appConfigFile.value() );
main_tree.put( "APPCONFIG_version", m_appConfigVersion.value() );
main_tree.put( "evtType", evtType_str );
main_tree.put( "evtTypeDesc", evtDesc );
main_tree.put( "DecFiles_version", decFiles );
main_tree.put( "Hard Generator", genName );
main_tree.put( "Gauss_version", m_gaussVersion );
main_tree.put( "DDDB", m_dddb );
main_tree.put( "SIMCOND", m_simCond );
main_tree.put( "Gauss_version", m_gaussVersion.value() );
main_tree.put( "DDDB", m_dddb.value() );
main_tree.put( "SIMCOND", m_simCond.value() );
main_tree.put( "genTimeStamp", time );
ptree gencounters_array = writeGeneratorCounters( *genFSR );
Loading