CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Public Member Functions | Public Attributes
evf::GlobalEvFOutputJSONDef Class Reference

Public Member Functions

 GlobalEvFOutputJSONDef ()
 

Public Attributes

jsoncollector::DataPointDefinition outJsonDef_
 
std::string outJsonDefName_
 

Detailed Description

Definition at line 87 of file GlobalEvFOutputModule.cc.

Constructor & Destructor Documentation

evf::GlobalEvFOutputJSONDef::GlobalEvFOutputJSONDef ( )

Definition at line 155 of file GlobalEvFOutputModule.cc.

References jsoncollector::DataPointDefinition::addLegendItem(), jsoncollector::DataPointDefinition::ADLER32, jsoncollector::DataPointDefinition::BINARYOR, jsoncollector::DataPointDefinition::CAT, ws_sso_content_reader::content, LogDebug, jsoncollector::DataPointDefinition::MERGE, outJsonDef_, outJsonDefName_, jsoncollector::DataPointDefinition::SAME, jsoncollector::JSONSerializer::serialize(), jsoncollector::DataPointDefinition::setDefaultGroup(), contentValuesCheck::ss, edm_modernize_messagelogger::stat, AlCaHLTBitMon_QueryRunRegistry::string, jsoncollector::DataPointDefinition::SUM, and jsoncollector::FileIO::writeStringToFile().

155  {
156  std::string baseRunDir = edm::Service<evf::EvFDaqDirector>()->baseRunDir();
157  LogDebug("GlobalEvFOutputModule") << "writing .dat files to -: " << baseRunDir;
158 
159  edm::Service<evf::EvFDaqDirector>()->createRunOpendirMaybe();
160 
170  outJsonDef_.addLegendItem("TransferDestination", "string", jsoncollector::DataPointDefinition::SAME);
173 
174  std::stringstream tmpss, ss;
175  tmpss << baseRunDir << "/open/"
176  << "output_" << getpid() << ".jsd";
177  ss << baseRunDir << "/"
178  << "output_" << getpid() << ".jsd";
179  std::string outTmpJsonDefName = tmpss.str();
180  outJsonDefName_ = ss.str();
181 
182  edm::Service<evf::EvFDaqDirector>()->lockInitLock();
183  struct stat fstat;
184  if (stat(outJsonDefName_.c_str(), &fstat) != 0) { //file does not exist
185  LogDebug("GlobalEvFOutputModule") << "writing output definition file -: " << outJsonDefName_;
188  jsoncollector::FileIO::writeStringToFile(outTmpJsonDefName, content);
189  std::filesystem::rename(outTmpJsonDefName, outJsonDefName_);
190  }
191  edm::Service<evf::EvFDaqDirector>()->unlockInitLock();
192  }
void addLegendItem(std::string const &name, std::string const &type, std::string const &operation)
jsoncollector::DataPointDefinition outJsonDef_
static bool serialize(JsonSerializable *pObj, std::string &output)
static void writeStringToFile(std::string const &filename, std::string &content)
Definition: FileIO.cc:21
void setDefaultGroup(std::string const &group)
#define LogDebug(id)

Member Data Documentation

jsoncollector::DataPointDefinition evf::GlobalEvFOutputJSONDef::outJsonDef_

Definition at line 91 of file GlobalEvFOutputModule.cc.

Referenced by GlobalEvFOutputJSONDef().

std::string evf::GlobalEvFOutputJSONDef::outJsonDefName_

Definition at line 92 of file GlobalEvFOutputModule.cc.

Referenced by GlobalEvFOutputJSONDef().