CMS 3D CMS Logo

List of all members | Public Member Functions | Public Attributes
evf::GlobalEvFOutputJSONDef Class Reference

Public Member Functions

 GlobalEvFOutputJSONDef (std::string const &streamLabel, bool writeJsd)
 
void updateDestination (std::string const &streamLabel)
 

Public Attributes

jsoncollector::StringJ mergeType_
 
jsoncollector::DataPointDefinition outJsonDef_
 
std::string outJsonDefName_
 
jsoncollector::StringJ transferDestination_
 

Detailed Description

Definition at line 123 of file GlobalEvFOutputModule.cc.

Constructor & Destructor Documentation

◆ GlobalEvFOutputJSONDef()

evf::GlobalEvFOutputJSONDef::GlobalEvFOutputJSONDef ( std::string const &  streamLabel,
bool  writeJsd 
)

Definition at line 196 of file GlobalEvFOutputModule.cc.

References jsoncollector::DataPointDefinition::addLegendItem(), jsoncollector::DataPointDefinition::ADLER32, jsoncollector::DataPointDefinition::BINARYOR, jsoncollector::DataPointDefinition::CAT, Skims_PA_cff::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().

196  {
197  std::string baseRunDir = edm::Service<evf::EvFDaqDirector>()->baseRunDir();
198  LogDebug("GlobalEvFOutputModule") << "writing .dat files to -: " << baseRunDir;
199 
209  outJsonDef_.addLegendItem("TransferDestination", "string", jsoncollector::DataPointDefinition::SAME);
212 
213  std::stringstream ss;
214  ss << baseRunDir << "/"
215  << "output_" << getpid() << ".jsd";
216  outJsonDefName_ = ss.str();
217 
218  if (writeJsd) {
219  std::stringstream tmpss;
220  tmpss << baseRunDir << "/open/"
221  << "output_" << getpid() << ".jsd";
222  std::string outTmpJsonDefName = tmpss.str();
223  edm::Service<evf::EvFDaqDirector>()->createRunOpendirMaybe();
224  edm::Service<evf::EvFDaqDirector>()->lockInitLock();
225  struct stat fstat;
226  if (stat(outJsonDefName_.c_str(), &fstat) != 0) { //file does not exist
227  LogDebug("GlobalEvFOutputModule") << "writing output definition file -: " << outJsonDefName_;
231  std::filesystem::rename(outTmpJsonDefName, outJsonDefName_);
232  }
233  }
234  edm::Service<evf::EvFDaqDirector>()->unlockInitLock();
235  }
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 Function Documentation

◆ updateDestination()

void evf::GlobalEvFOutputJSONDef::updateDestination ( std::string const &  streamLabel)

Member Data Documentation

◆ mergeType_

jsoncollector::StringJ evf::GlobalEvFOutputJSONDef::mergeType_

Definition at line 131 of file GlobalEvFOutputModule.cc.

Referenced by updateDestination().

◆ outJsonDef_

jsoncollector::DataPointDefinition evf::GlobalEvFOutputJSONDef::outJsonDef_

Definition at line 128 of file GlobalEvFOutputModule.cc.

Referenced by GlobalEvFOutputJSONDef().

◆ outJsonDefName_

std::string evf::GlobalEvFOutputJSONDef::outJsonDefName_

Definition at line 129 of file GlobalEvFOutputModule.cc.

Referenced by GlobalEvFOutputJSONDef().

◆ transferDestination_

jsoncollector::StringJ evf::GlobalEvFOutputJSONDef::transferDestination_

Definition at line 130 of file GlobalEvFOutputModule.cc.

Referenced by updateDestination().