33 m_dstFile(
"digi.root"),
34 m_recFile(
"digi.root")
37 StatusCode sc = Gaudi::svcLocator()->service(
"JobOptionsSvc", svc);
38 CheckSTATUS(
"Failed to retrieve the JobOptionsSvc");
39 m_svc =
dynamic_cast<JobOptionsSvc*
>(svc);
41 sc = m_svc->setProperty( StringProperty(
"TYPE",
"FILE") );
42 sc = m_svc->setProperty( StringProperty(
"PATH", optname) );
43 CheckSTATUS(
"Failed to set the property of DistBossServer");
45 sc = m_svc->initialize();
48 const Property* pprop = getProperty(
"ApplicationMgr",
"EvtMax");
49 if ( pprop !=
NULL ) {
53 if ( (pprop = getProperty(
"RawDataInputSvc",
"InputFiles")) !=
NULL ) {
57 else if ( (pprop = getProperty(
"BesSim",
"TDSFlag")) !=
NULL ) {
61 else if ( (pprop = getProperty(
"EventCnvSvc",
"digiRootInputFile")) !=
NULL ) {
66 std::cout <<
"[JobOptionsMgr] Unknown Job Type!" << std::endl;
70 if ( (pprop = getProperty(
"EventPreSelect",
"WriteDst")) !=
NULL ) {
74 m_oFileTypes.push_back(3);
75 if ( (pprop = getProperty(
"WriteDst",
"digiRootOutputFile")) !=
NULL ) {
81 if ( (pprop = getProperty(
"EventPreSelect",
"WriteRec")) !=
NULL ) {
85 m_oFileTypes.push_back(4);
86 if ( (pprop = getProperty(
"WriteRec",
"digiRootOutputFile")) !=
NULL ) {
92 if ( (pprop = getProperty(
"NTupleSvc",
"Output")) !=
NULL ) {
93 m_oFileTypes.push_back(5);
97 if ( (pprop = getProperty(
"THistSvc",
"Output")) !=
NULL ) {
98 m_oFileTypes.push_back(6);
115 SvcCatalog* m_clientCatalogue =
new SvcCatalog;
119 std::vector<std::string> clients = m_svc->getClients();
120 for (
unsigned int i = 0; i < clients.size(); ++i ) {
121 const std::vector<const Property*>* properties = m_svc->getProperties(clients[i]);
122 for (
unsigned int j = 0; j < properties->size(); ++j ) {
123 const Property*
property = properties->at(j);
136 StringProperty* tmp=
new StringProperty(property->name(), property->toString());
137 sc = m_clientCatalogue->addProperty(clients[i], tmp);
138 if ( sc.isFailure() ) {
139 StringProperty* tmp2 =
new StringProperty(property->name(),
'"'+property->toString()+
'"');
140 m_clientCatalogue->addProperty(clients[i], tmp2);
145 StringProperty* tmpservername =
new StringProperty(
"ServerName",
'"'+svrName+
'"');
146 m_clientCatalogue->addProperty(
"DistBoss", tmpservername);
147 if ( m_iFileType == 0 ) {
148 StringProperty* tmprunmode =
new StringProperty(
"RunMode",
"3");
149 m_clientCatalogue->addProperty(
"RawDataInputSvc", tmprunmode);
157 for (
unsigned int i = 0; i < m_oFileTypes.size(); ++i ) {
158 int type = m_oFileTypes[i];
160 m_clientCatalogue->addProperty(
"WriteDst",
new StringProperty(
"RunMode",
"3"));
162 else if ( type == 4 ) {
163 m_clientCatalogue->addProperty(
"WriteRec",
new StringProperty(
"RunMode",
"3"));
173 std::string client_opt_name = m_optName +
".distboss_client";
174 std::ofstream os(client_opt_name.c_str(), std::ios::out|std::ios::trunc);
176 std::cout <<
"[JobOptionsMgr] Failed to open client_template file!" << std::endl;
180 m_clientCatalogue->fillStream( os );
182 delete m_clientCatalogue;