CMS 3D CMS Logo

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

Constructor & Destructor Documentation

◆ GlobalEvFOutputJSONDef()

evf::GlobalEvFOutputJSONDef::GlobalEvFOutputJSONDef ( )

Definition at line 169 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().

169  {
170  std::string baseRunDir = edm::Service<evf::EvFDaqDirector>()->baseRunDir();
171  LogDebug("GlobalEvFOutputModule") << "writing .dat files to -: " << baseRunDir;
172 
173  edm::Service<evf::EvFDaqDirector>()->createRunOpendirMaybe();
174 
184  outJsonDef_.addLegendItem("TransferDestination", "string", jsoncollector::DataPointDefinition::SAME);
187 
188  std::stringstream tmpss, ss;
189  tmpss << baseRunDir << "/open/"
190  << "output_" << getpid() << ".jsd";
191  ss << baseRunDir << "/"
192  << "output_" << getpid() << ".jsd";
193  std::string outTmpJsonDefName = tmpss.str();
194  outJsonDefName_ = ss.str();
195 
196  edm::Service<evf::EvFDaqDirector>()->lockInitLock();
197  struct stat fstat;
198  if (stat(outJsonDefName_.c_str(), &fstat) != 0) { //file does not exist
199  LogDebug("GlobalEvFOutputModule") << "writing output definition file -: " << outJsonDefName_;
203  std::filesystem::rename(outTmpJsonDefName, outJsonDefName_);
204  }
205  edm::Service<evf::EvFDaqDirector>()->unlockInitLock();
206  }
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

◆ 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().