CMS 3D CMS Logo

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

#include <EvFOutputModule.h>

Public Member Functions

 EvFOutputJSONWriter (edm::ParameterSet const &ps, edm::SelectedProducts const *selections, std::string const &streamLabel, std::string const &moduleLabel)
 

Public Attributes

jsoncollector::IntJ accepted_
 
jsoncollector::IntJ errorEvents_
 
jsoncollector::IntJ fileAdler32_
 
jsoncollector::StringJ filelist_
 
jsoncollector::IntJ filesize_
 
jsoncollector::IntJ hltErrorEvents_
 
jsoncollector::StringJ inputFiles_
 
std::shared_ptr< jsoncollector::FastMonitorjsonMonitor_
 
jsoncollector::StringJ mergeType_
 
jsoncollector::DataPointDefinition outJsonDef_
 
jsoncollector::IntJ processed_
 
jsoncollector::IntJ retCodeMask_
 
edm::StreamerOutputModuleCommon streamerCommon_
 
jsoncollector::StringJ transferDestination_
 

Detailed Description

Definition at line 47 of file EvFOutputModule.h.

Constructor & Destructor Documentation

◆ EvFOutputJSONWriter()

evf::EvFOutputJSONWriter::EvFOutputJSONWriter ( edm::ParameterSet const &  ps,
edm::SelectedProducts const *  selections,
std::string const &  streamLabel,
std::string const &  moduleLabel 
)

Definition at line 27 of file EvFOutputModule.cc.

References accepted_, jsoncollector::DataPointDefinition::addLegendItem(), jsoncollector::DataPointDefinition::ADLER32, jsoncollector::DataPointDefinition::BINARYOR, jsoncollector::DataPointDefinition::CAT, Skims_PA_cff::content, errorEvents_, fileAdler32_, filelist_, filesize_, hltErrorEvents_, inputFiles_, jsonMonitor_, LogDebug, jsoncollector::DataPointDefinition::MERGE, mergeType_, evf::MergeTypeDAT, outJsonDef_, processed_, retCodeMask_, jsoncollector::DataPointDefinition::SAME, jsoncollector::JSONSerializer::serialize(), jsoncollector::DataPointDefinition::setDefaultGroup(), jsoncollector::JsonMonitorable::setName(), contentValuesCheck::ss, edm_modernize_messagelogger::stat, beamhlt_dqm_sourceclient-live_cfg::streamLabel, AlCaHLTBitMon_QueryRunRegistry::string, jsoncollector::DataPointDefinition::SUM, transferDestination_, and jsoncollector::FileIO::writeStringToFile().

32  processed_(0),
33  accepted_(0),
34  errorEvents_(0),
35  retCodeMask_(0),
36  filelist_(),
37  filesize_(0),
38  inputFiles_(),
39  fileAdler32_(1),
40  hltErrorEvents_(0) {
43 
44  std::string baseRunDir = edm::Service<evf::EvFDaqDirector>()->baseRunDir();
45  LogDebug("EvFOutputModule") << "writing .dat files to -: " << baseRunDir;
46 
47  edm::Service<evf::EvFDaqDirector>()->createRunOpendirMaybe();
48 
49  processed_.setName("Processed");
50  accepted_.setName("Accepted");
51  errorEvents_.setName("ErrorEvents");
52  retCodeMask_.setName("ReturnCodeMask");
53  filelist_.setName("Filelist");
54  filesize_.setName("Filesize");
55  inputFiles_.setName("InputFiles");
56  fileAdler32_.setName("FileAdler32");
57  transferDestination_.setName("TransferDestination");
58  mergeType_.setName("MergeType");
59  hltErrorEvents_.setName("HLTErrorEvents");
60 
70  outJsonDef_.addLegendItem("TransferDestination", "string", jsoncollector::DataPointDefinition::SAME);
73 
74  std::stringstream tmpss, ss;
75  tmpss << baseRunDir << "/open/"
76  << "output_" << getpid() << ".jsd";
77  ss << baseRunDir << "/"
78  << "output_" << getpid() << ".jsd";
79  std::string outTmpJsonDefName = tmpss.str();
80  std::string outJsonDefName = ss.str();
81 
82  edm::Service<evf::EvFDaqDirector>()->lockInitLock();
83  struct stat fstat;
84  if (stat(outJsonDefName.c_str(), &fstat) != 0) { //file does not exist
85  LogDebug("EvFOutputModule") << "writing output definition file -: " << outJsonDefName;
89  std::filesystem::rename(outTmpJsonDefName, outJsonDefName);
90  }
91  edm::Service<evf::EvFDaqDirector>()->unlockInitLock();
92 
94  jsonMonitor_->setDefPath(outJsonDefName);
95  jsonMonitor_->registerGlobalMonitorable(&processed_, false);
96  jsonMonitor_->registerGlobalMonitorable(&accepted_, false);
97  jsonMonitor_->registerGlobalMonitorable(&errorEvents_, false);
98  jsonMonitor_->registerGlobalMonitorable(&retCodeMask_, false);
99  jsonMonitor_->registerGlobalMonitorable(&filelist_, false);
100  jsonMonitor_->registerGlobalMonitorable(&filesize_, false);
101  jsonMonitor_->registerGlobalMonitorable(&inputFiles_, false);
102  jsonMonitor_->registerGlobalMonitorable(&fileAdler32_, false);
103  jsonMonitor_->registerGlobalMonitorable(&transferDestination_, false);
104  jsonMonitor_->registerGlobalMonitorable(&mergeType_, false);
105  jsonMonitor_->registerGlobalMonitorable(&hltErrorEvents_, false);
106  jsonMonitor_->commit(nullptr);
107  }
void addLegendItem(std::string const &name, std::string const &type, std::string const &operation)
edm::StreamerOutputModuleCommon streamerCommon_
jsoncollector::IntJ fileAdler32_
static bool serialize(JsonSerializable *pObj, std::string &output)
jsoncollector::DataPointDefinition outJsonDef_
jsoncollector::IntJ hltErrorEvents_
jsoncollector::StringJ inputFiles_
jsoncollector::IntJ retCodeMask_
virtual void setName(std::string name)
static void writeStringToFile(std::string const &filename, std::string &content)
Definition: FileIO.cc:21
jsoncollector::IntJ processed_
jsoncollector::IntJ filesize_
jsoncollector::StringJ filelist_
jsoncollector::StringJ transferDestination_
std::shared_ptr< jsoncollector::FastMonitor > jsonMonitor_
void setDefaultGroup(std::string const &group)
jsoncollector::IntJ accepted_
jsoncollector::StringJ mergeType_
jsoncollector::IntJ errorEvents_
#define LogDebug(id)

Member Data Documentation

◆ accepted_

jsoncollector::IntJ evf::EvFOutputJSONWriter::accepted_

Definition at line 57 of file EvFOutputModule.h.

Referenced by EvFOutputJSONWriter().

◆ errorEvents_

jsoncollector::IntJ evf::EvFOutputJSONWriter::errorEvents_

Definition at line 58 of file EvFOutputModule.h.

Referenced by EvFOutputJSONWriter().

◆ fileAdler32_

jsoncollector::IntJ evf::EvFOutputJSONWriter::fileAdler32_

Definition at line 63 of file EvFOutputModule.h.

Referenced by EvFOutputJSONWriter().

◆ filelist_

jsoncollector::StringJ evf::EvFOutputJSONWriter::filelist_

Definition at line 60 of file EvFOutputModule.h.

Referenced by EvFOutputJSONWriter().

◆ filesize_

jsoncollector::IntJ evf::EvFOutputJSONWriter::filesize_

Definition at line 61 of file EvFOutputModule.h.

Referenced by EvFOutputJSONWriter().

◆ hltErrorEvents_

jsoncollector::IntJ evf::EvFOutputJSONWriter::hltErrorEvents_

Definition at line 66 of file EvFOutputModule.h.

Referenced by EvFOutputJSONWriter().

◆ inputFiles_

jsoncollector::StringJ evf::EvFOutputJSONWriter::inputFiles_

Definition at line 62 of file EvFOutputModule.h.

Referenced by EvFOutputJSONWriter().

◆ jsonMonitor_

std::shared_ptr<jsoncollector::FastMonitor> evf::EvFOutputJSONWriter::jsonMonitor_

Definition at line 67 of file EvFOutputModule.h.

Referenced by EvFOutputJSONWriter().

◆ mergeType_

jsoncollector::StringJ evf::EvFOutputJSONWriter::mergeType_

Definition at line 65 of file EvFOutputModule.h.

Referenced by EvFOutputJSONWriter().

◆ outJsonDef_

jsoncollector::DataPointDefinition evf::EvFOutputJSONWriter::outJsonDef_

Definition at line 68 of file EvFOutputModule.h.

Referenced by EvFOutputJSONWriter().

◆ processed_

jsoncollector::IntJ evf::EvFOutputJSONWriter::processed_

Definition at line 56 of file EvFOutputModule.h.

Referenced by EvFOutputJSONWriter().

◆ retCodeMask_

jsoncollector::IntJ evf::EvFOutputJSONWriter::retCodeMask_

Definition at line 59 of file EvFOutputModule.h.

Referenced by EvFOutputJSONWriter().

◆ streamerCommon_

edm::StreamerOutputModuleCommon evf::EvFOutputJSONWriter::streamerCommon_

Definition at line 54 of file EvFOutputModule.h.

◆ transferDestination_

jsoncollector::StringJ evf::EvFOutputJSONWriter::transferDestination_

Definition at line 64 of file EvFOutputModule.h.

Referenced by EvFOutputJSONWriter().