CMS 3D CMS Logo

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)
 

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 
)

Definition at line 26 of file EvFOutputModule.cc.

30  processed_(0),
31  accepted_(0),
32  errorEvents_(0),
33  retCodeMask_(0),
34  filelist_(),
35  filesize_(0),
36  inputFiles_(),
37  fileAdler32_(1),
38  hltErrorEvents_(0) {
41 
42  std::string baseRunDir = edm::Service<evf::EvFDaqDirector>()->baseRunDir();
43  LogDebug("EvFOutputModule") << "writing .dat files to -: " << baseRunDir;
44 
45  edm::Service<evf::EvFDaqDirector>()->createRunOpendirMaybe();
46 
47  processed_.setName("Processed");
48  accepted_.setName("Accepted");
49  errorEvents_.setName("ErrorEvents");
50  retCodeMask_.setName("ReturnCodeMask");
51  filelist_.setName("Filelist");
52  filesize_.setName("Filesize");
53  inputFiles_.setName("InputFiles");
54  fileAdler32_.setName("FileAdler32");
55  transferDestination_.setName("TransferDestination");
56  mergeType_.setName("MergeType");
57  hltErrorEvents_.setName("HLTErrorEvents");
58 
68  outJsonDef_.addLegendItem("TransferDestination", "string", jsoncollector::DataPointDefinition::SAME);
71 
72  std::stringstream tmpss, ss;
73  tmpss << baseRunDir << "/open/"
74  << "output_" << getpid() << ".jsd";
75  ss << baseRunDir << "/"
76  << "output_" << getpid() << ".jsd";
77  std::string outTmpJsonDefName = tmpss.str();
78  std::string outJsonDefName = ss.str();
79 
80  edm::Service<evf::EvFDaqDirector>()->lockInitLock();
81  struct stat fstat;
82  if (stat(outJsonDefName.c_str(), &fstat) != 0) { //file does not exist
83  LogDebug("EvFOutputModule") << "writing output definition file -: " << outJsonDefName;
87  std::filesystem::rename(outTmpJsonDefName, outJsonDefName);
88  }
89  edm::Service<evf::EvFDaqDirector>()->unlockInitLock();
90 
92  jsonMonitor_->setDefPath(outJsonDefName);
93  jsonMonitor_->registerGlobalMonitorable(&processed_, false);
94  jsonMonitor_->registerGlobalMonitorable(&accepted_, false);
95  jsonMonitor_->registerGlobalMonitorable(&errorEvents_, false);
96  jsonMonitor_->registerGlobalMonitorable(&retCodeMask_, false);
97  jsonMonitor_->registerGlobalMonitorable(&filelist_, false);
98  jsonMonitor_->registerGlobalMonitorable(&filesize_, false);
99  jsonMonitor_->registerGlobalMonitorable(&inputFiles_, false);
100  jsonMonitor_->registerGlobalMonitorable(&fileAdler32_, false);
101  jsonMonitor_->registerGlobalMonitorable(&transferDestination_, false);
102  jsonMonitor_->registerGlobalMonitorable(&mergeType_, false);
103  jsonMonitor_->registerGlobalMonitorable(&hltErrorEvents_, false);
104  jsonMonitor_->commit(nullptr);
105  }

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

Member Data Documentation

◆ accepted_

jsoncollector::IntJ evf::EvFOutputJSONWriter::accepted_

Definition at line 56 of file EvFOutputModule.h.

Referenced by EvFOutputJSONWriter().

◆ errorEvents_

jsoncollector::IntJ evf::EvFOutputJSONWriter::errorEvents_

Definition at line 57 of file EvFOutputModule.h.

Referenced by EvFOutputJSONWriter().

◆ fileAdler32_

jsoncollector::IntJ evf::EvFOutputJSONWriter::fileAdler32_

Definition at line 62 of file EvFOutputModule.h.

Referenced by EvFOutputJSONWriter().

◆ filelist_

jsoncollector::StringJ evf::EvFOutputJSONWriter::filelist_

Definition at line 59 of file EvFOutputModule.h.

Referenced by EvFOutputJSONWriter().

◆ filesize_

jsoncollector::IntJ evf::EvFOutputJSONWriter::filesize_

Definition at line 60 of file EvFOutputModule.h.

Referenced by EvFOutputJSONWriter().

◆ hltErrorEvents_

jsoncollector::IntJ evf::EvFOutputJSONWriter::hltErrorEvents_

Definition at line 65 of file EvFOutputModule.h.

Referenced by EvFOutputJSONWriter().

◆ inputFiles_

jsoncollector::StringJ evf::EvFOutputJSONWriter::inputFiles_

Definition at line 61 of file EvFOutputModule.h.

Referenced by EvFOutputJSONWriter().

◆ jsonMonitor_

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

Definition at line 66 of file EvFOutputModule.h.

Referenced by EvFOutputJSONWriter().

◆ mergeType_

jsoncollector::StringJ evf::EvFOutputJSONWriter::mergeType_

Definition at line 64 of file EvFOutputModule.h.

Referenced by EvFOutputJSONWriter().

◆ outJsonDef_

jsoncollector::DataPointDefinition evf::EvFOutputJSONWriter::outJsonDef_

Definition at line 67 of file EvFOutputModule.h.

Referenced by EvFOutputJSONWriter().

◆ processed_

jsoncollector::IntJ evf::EvFOutputJSONWriter::processed_

Definition at line 55 of file EvFOutputModule.h.

Referenced by EvFOutputJSONWriter().

◆ retCodeMask_

jsoncollector::IntJ evf::EvFOutputJSONWriter::retCodeMask_

Definition at line 58 of file EvFOutputModule.h.

Referenced by EvFOutputJSONWriter().

◆ streamerCommon_

edm::StreamerOutputModuleCommon evf::EvFOutputJSONWriter::streamerCommon_

Definition at line 53 of file EvFOutputModule.h.

◆ transferDestination_

jsoncollector::StringJ evf::EvFOutputJSONWriter::transferDestination_

Definition at line 63 of file EvFOutputModule.h.

Referenced by EvFOutputJSONWriter().

jsoncollector::DataPointDefinition::addLegendItem
void addLegendItem(std::string const &name, std::string const &type, std::string const &operation)
Definition: DataPointDefinition.cc:93
jsoncollector::DataPointDefinition::setDefaultGroup
void setDefaultGroup(std::string const &group)
Definition: DataPointDefinition.h:54
evf::EvFOutputJSONWriter::filesize_
jsoncollector::IntJ filesize_
Definition: EvFOutputModule.h:60
evf::EvFOutputJSONWriter::streamerCommon_
edm::StreamerOutputModuleCommon streamerCommon_
Definition: EvFOutputModule.h:53
jsoncollector::DataPointDefinition::MERGE
static const std::string MERGE
Definition: DataPointDefinition.h:69
evf::EvFOutputJSONWriter::errorEvents_
jsoncollector::IntJ errorEvents_
Definition: EvFOutputModule.h:57
jsoncollector::DataPointDefinition::SUM
static const std::string SUM
Definition: DataPointDefinition.h:64
evf::EvFOutputJSONWriter::mergeType_
jsoncollector::StringJ mergeType_
Definition: EvFOutputModule.h:64
evf::EvFOutputJSONWriter::transferDestination_
jsoncollector::StringJ transferDestination_
Definition: EvFOutputModule.h:63
contentValuesCheck.ss
ss
Definition: contentValuesCheck.py:33
jsoncollector::JsonMonitorable::setName
virtual void setName(std::string name)
Definition: JsonMonitorable.h:38
evf::EvFOutputJSONWriter::jsonMonitor_
std::shared_ptr< jsoncollector::FastMonitor > jsonMonitor_
Definition: EvFOutputModule.h:66
jsoncollector::DataPointDefinition::CAT
static const std::string CAT
Definition: DataPointDefinition.h:68
evf::MergeTypeDAT
Definition: EvFDaqDirector.h:58
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
jsoncollector::DataPointDefinition::BINARYOR
static const std::string BINARYOR
Definition: DataPointDefinition.h:70
evf::EvFOutputJSONWriter::fileAdler32_
jsoncollector::IntJ fileAdler32_
Definition: EvFOutputModule.h:62
Skims_PA_cff.content
content
Definition: Skims_PA_cff.py:19
LogDebug
#define LogDebug(id)
Definition: MessageLogger.h:233
evf::EvFOutputJSONWriter::inputFiles_
jsoncollector::StringJ inputFiles_
Definition: EvFOutputModule.h:61
evf::EvFOutputJSONWriter::outJsonDef_
jsoncollector::DataPointDefinition outJsonDef_
Definition: EvFOutputModule.h:67
evf::EvFOutputJSONWriter::accepted_
jsoncollector::IntJ accepted_
Definition: EvFOutputModule.h:56
edm::Service
Definition: Service.h:30
jsoncollector::DataPointDefinition::SAME
static const std::string SAME
Definition: DataPointDefinition.h:66
jsoncollector::FileIO::writeStringToFile
static void writeStringToFile(std::string const &filename, std::string &content)
Definition: FileIO.cc:21
evf::EvFOutputJSONWriter::hltErrorEvents_
jsoncollector::IntJ hltErrorEvents_
Definition: EvFOutputModule.h:65
jsoncollector::FastMonitor
Definition: FastMonitor.h:19
evf::EvFOutputJSONWriter::processed_
jsoncollector::IntJ processed_
Definition: EvFOutputModule.h:55
evf::EvFOutputJSONWriter::retCodeMask_
jsoncollector::IntJ retCodeMask_
Definition: EvFOutputModule.h:58
evf::EvFOutputJSONWriter::filelist_
jsoncollector::StringJ filelist_
Definition: EvFOutputModule.h:59
jsoncollector::DataPointDefinition::ADLER32
static const std::string ADLER32
Definition: DataPointDefinition.h:71
clusterbigeventsdebugger_cfi.selections
selections
Definition: clusterbigeventsdebugger_cfi.py:10
jsoncollector::JSONSerializer::serialize
static bool serialize(JsonSerializable *pObj, std::string &output)
Definition: JSONSerializer.cc:14
edm_modernize_messagelogger.stat
stat
Definition: edm_modernize_messagelogger.py:27
beamhlt_dqm_sourceclient-live_cfg.streamLabel
streamLabel
Definition: beamhlt_dqm_sourceclient-live_cfg.py:58