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)
 

Public Attributes

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

Detailed Description

Definition at line 101 of file GlobalEvFOutputModule.cc.

Constructor & Destructor Documentation

◆ GlobalEvFOutputJSONDef()

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

Definition at line 173 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, mergeType_, evf::MergeTypeDAT, outJsonDef_, outJsonDefName_, jsoncollector::DataPointDefinition::SAME, jsoncollector::JSONSerializer::serialize(), jsoncollector::DataPointDefinition::setDefaultGroup(), contentValuesCheck::ss, edm_modernize_messagelogger::stat, beamhlt_dqm_sourceclient-live_cfg::streamLabel, AlCaHLTBitMon_QueryRunRegistry::string, jsoncollector::DataPointDefinition::SUM, transferDestination_, and jsoncollector::FileIO::writeStringToFile().

173  {
174  std::string baseRunDir = edm::Service<evf::EvFDaqDirector>()->baseRunDir();
175  LogDebug("GlobalEvFOutputModule") << "writing .dat files to -: " << baseRunDir;
176 
177  edm::Service<evf::EvFDaqDirector>()->createRunOpendirMaybe();
178 
188  outJsonDef_.addLegendItem("TransferDestination", "string", jsoncollector::DataPointDefinition::SAME);
191 
192  std::stringstream tmpss, ss;
193  tmpss << baseRunDir << "/open/"
194  << "output_" << getpid() << ".jsd";
195  ss << baseRunDir << "/"
196  << "output_" << getpid() << ".jsd";
197  std::string outTmpJsonDefName = tmpss.str();
198  outJsonDefName_ = ss.str();
199 
200  edm::Service<evf::EvFDaqDirector>()->lockInitLock();
201  struct stat fstat;
202  if (stat(outJsonDefName_.c_str(), &fstat) != 0) { //file does not exist
203  LogDebug("GlobalEvFOutputModule") << "writing output definition file -: " << outJsonDefName_;
207  std::filesystem::rename(outTmpJsonDefName, outJsonDefName_);
208  }
209  edm::Service<evf::EvFDaqDirector>()->unlockInitLock();
210 
213  }
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)
jsoncollector::StringJ transferDestination_
static void writeStringToFile(std::string const &filename, std::string &content)
Definition: FileIO.cc:21
void setDefaultGroup(std::string const &group)
jsoncollector::StringJ mergeType_
#define LogDebug(id)

Member Data Documentation

◆ mergeType_

jsoncollector::StringJ evf::GlobalEvFOutputJSONDef::mergeType_

Definition at line 108 of file GlobalEvFOutputModule.cc.

Referenced by GlobalEvFOutputJSONDef().

◆ outJsonDef_

jsoncollector::DataPointDefinition evf::GlobalEvFOutputJSONDef::outJsonDef_

Definition at line 105 of file GlobalEvFOutputModule.cc.

Referenced by GlobalEvFOutputJSONDef().

◆ outJsonDefName_

std::string evf::GlobalEvFOutputJSONDef::outJsonDefName_

Definition at line 106 of file GlobalEvFOutputModule.cc.

Referenced by GlobalEvFOutputJSONDef().

◆ transferDestination_

jsoncollector::StringJ evf::GlobalEvFOutputJSONDef::transferDestination_

Definition at line 107 of file GlobalEvFOutputModule.cc.

Referenced by GlobalEvFOutputJSONDef().