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 153 of file GlobalEvFOutputModule.cc.

Constructor & Destructor Documentation

◆ GlobalEvFOutputJSONDef()

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

Definition at line 239 of file GlobalEvFOutputModule.cc.

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

239  {
240  std::string baseRunDir = edm::Service<evf::EvFDaqDirector>()->baseRunDir();
241  LogDebug("GlobalEvFOutputModule") << "writing .dat files to -: " << baseRunDir;
242 
252  outJsonDef_.addLegendItem("TransferDestination", "string", jsoncollector::DataPointDefinition::SAME);
255 
256  std::stringstream ss;
257  ss << baseRunDir << "/"
258  << "output_" << getpid() << ".jsd";
259  outJsonDefName_ = ss.str();
260 
261  if (writeJsd) {
262  std::stringstream tmpss;
263  tmpss << baseRunDir << "/open/"
264  << "output_" << getpid() << ".jsd";
265  std::string outTmpJsonDefName = tmpss.str();
266  edm::Service<evf::EvFDaqDirector>()->createRunOpendirMaybe();
267  edm::Service<evf::EvFDaqDirector>()->lockInitLock();
268  struct stat fstat;
269  if (stat(outJsonDefName_.c_str(), &fstat) != 0) { //file does not exist
270  LogDebug("GlobalEvFOutputModule") << "writing output definition file -: " << outJsonDefName_;
274  std::filesystem::rename(outTmpJsonDefName, outJsonDefName_);
275  }
276  }
277  edm::Service<evf::EvFDaqDirector>()->unlockInitLock();
278  }
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 161 of file GlobalEvFOutputModule.cc.

◆ outJsonDef_

jsoncollector::DataPointDefinition evf::GlobalEvFOutputJSONDef::outJsonDef_

Definition at line 158 of file GlobalEvFOutputModule.cc.

◆ outJsonDefName_

std::string evf::GlobalEvFOutputJSONDef::outJsonDefName_

Definition at line 159 of file GlobalEvFOutputModule.cc.

◆ transferDestination_

jsoncollector::StringJ evf::GlobalEvFOutputJSONDef::transferDestination_

Definition at line 160 of file GlobalEvFOutputModule.cc.