Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DAQ - fixing streamer count of HLT paths with the GlobalEvFOutputModule (12_2_X) #37055

Merged
merged 2 commits into from Feb 26, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 2 additions & 1 deletion EventFilter/Utilities/interface/EvFOutputModule.h
Expand Up @@ -48,7 +48,8 @@ namespace evf {
public:
EvFOutputJSONWriter(edm::ParameterSet const& ps,
edm::SelectedProducts const* selections,
std::string const& streamLabel);
std::string const& streamLabel,
std::string const& moduleLabel);

edm::StreamerOutputModuleCommon streamerCommon_;

Expand Down
5 changes: 3 additions & 2 deletions EventFilter/Utilities/plugins/GlobalEvFOutputModule.cc
Expand Up @@ -276,14 +276,15 @@ namespace evf {
}

std::unique_ptr<edm::StreamerOutputModuleCommon> GlobalEvFOutputModule::beginStream(edm::StreamID) const {
return std::make_unique<edm::StreamerOutputModuleCommon>(ps_, &keptProducts()[edm::InEvent]);
return std::make_unique<edm::StreamerOutputModuleCommon>(
ps_, &keptProducts()[edm::InEvent], description().moduleLabel());
}

std::shared_ptr<GlobalEvFOutputJSONDef> GlobalEvFOutputModule::globalBeginRun(edm::RunForOutput const& run) const {
//create run Cache holding JSON file writer and variables
auto jsonDef = std::make_unique<GlobalEvFOutputJSONDef>();

edm::StreamerOutputModuleCommon streamerCommon(ps_, &keptProducts()[edm::InEvent]);
edm::StreamerOutputModuleCommon streamerCommon(ps_, &keptProducts()[edm::InEvent], description().moduleLabel());

//output INI file (non-const). This doesn't require globalBeginRun to be finished
const std::string openIniFileName = edm::Service<evf::EvFDaqDirector>()->getOpenInitFilePath(streamLabel_);
Expand Down
8 changes: 5 additions & 3 deletions EventFilter/Utilities/src/EvFOutputModule.cc
Expand Up @@ -25,8 +25,9 @@ namespace evf {

EvFOutputJSONWriter::EvFOutputJSONWriter(edm::ParameterSet const& ps,
edm::SelectedProducts const* selections,
std::string const& streamLabel)
: streamerCommon_(ps, selections),
std::string const& streamLabel,
std::string const& moduleLabel)
: streamerCommon_(ps, selections, moduleLabel),
processed_(0),
accepted_(0),
errorEvents_(0),
Expand Down Expand Up @@ -147,7 +148,8 @@ namespace evf {

void EvFOutputModule::beginRun(edm::RunForOutput const& run) {
//create run Cache holding JSON file writer and variables
jsonWriter_ = std::make_unique<EvFOutputJSONWriter>(ps_, &keptProducts()[edm::InEvent], streamLabel_);
jsonWriter_ = std::make_unique<EvFOutputJSONWriter>(
ps_, &keptProducts()[edm::InEvent], streamLabel_, description().moduleLabel());

//output INI file (non-const). This doesn't require globalBeginRun to be finished
const std::string openIniFileName = edm::Service<evf::EvFDaqDirector>()->getOpenInitFilePath(streamLabel_);
Expand Down
4 changes: 3 additions & 1 deletion IOPool/Streamer/interface/StreamerOutputModuleCommon.h
Expand Up @@ -20,7 +20,9 @@ namespace edm {

class StreamerOutputModuleCommon {
public:
explicit StreamerOutputModuleCommon(ParameterSet const& ps, SelectedProducts const* selections);
explicit StreamerOutputModuleCommon(ParameterSet const& ps,
SelectedProducts const* selections,
std::string const& moduleLabel);
~StreamerOutputModuleCommon();
static void fillDescription(ParameterSetDescription& desc);

Expand Down
2 changes: 1 addition & 1 deletion IOPool/Streamer/src/StreamerOutputModuleBase.cc
Expand Up @@ -16,7 +16,7 @@ namespace edm {
StreamerOutputModuleBase::StreamerOutputModuleBase(ParameterSet const& ps)
: one::OutputModuleBase::OutputModuleBase(ps),
one::OutputModule<one::WatchRuns, one::WatchLuminosityBlocks>(ps),
StreamerOutputModuleCommon(ps, &keptProducts()[InEvent]),
StreamerOutputModuleCommon(ps, &keptProducts()[InEvent], description().moduleLabel()),
trToken_(consumes<edm::TriggerResults>(edm::InputTag("TriggerResults"))),
psetToken_(
consumes<SendJobHeader::ParameterSetMap, edm::InRun>(ps.getUntrackedParameter<edm::InputTag>("psetMap"))) {}
Expand Down
21 changes: 13 additions & 8 deletions IOPool/Streamer/src/StreamerOutputModuleCommon.cc
Expand Up @@ -23,7 +23,9 @@
#include <zlib.h>

namespace edm {
StreamerOutputModuleCommon::StreamerOutputModuleCommon(ParameterSet const& ps, SelectedProducts const* selections)
StreamerOutputModuleCommon::StreamerOutputModuleCommon(ParameterSet const& ps,
SelectedProducts const* selections,
std::string const& moduleLabel)
:

serializer_(selections),
Expand Down Expand Up @@ -84,6 +86,15 @@ namespace edm {
// 25-Jan-2008, KAB - pull out the trigger selection request
// which we need for the INIT message
hltTriggerSelections_ = EventSelector::getEventSelectionVString(ps);

Strings const& hltTriggerNames = edm::getAllTriggerNames();
hltsize_ = hltTriggerNames.size();

//Checksum of the module label
uLong crc = crc32(0L, Z_NULL, 0);
Bytef const* buf = (Bytef const*)(moduleLabel.data());
crc = crc32(crc, buf, moduleLabel.length());
outputModuleId_ = static_cast<uint32>(crc);
}

StreamerOutputModuleCommon::~StreamerOutputModuleCommon() {}
Expand Down Expand Up @@ -120,20 +131,14 @@ namespace edm {
// cms::MD5Result r1 = dig.digest();
// std::string hexy = r1.toString();
// std::cout << "HEX Representation of Process PSetID: " << hexy << std::endl;
Strings const& hltTriggerNames = edm::getAllTriggerNames();
hltsize_ = hltTriggerNames.size();

//L1 stays dummy as of today
Strings l1_names; //3
l1_names.push_back("t1");
l1_names.push_back("t10");
l1_names.push_back("t2");

//Setting the process name to HLT
uLong crc = crc32(0L, Z_NULL, 0);
Bytef const* buf = (Bytef const*)(moduleLabel.data());
crc = crc32(crc, buf, moduleLabel.length());
outputModuleId_ = static_cast<uint32>(crc);
Strings const& hltTriggerNames = edm::getAllTriggerNames();

auto init_message = std::make_unique<InitMsgBuilder>(&sbuf.header_buf_[0],
sbuf.header_buf_.size(),
Expand Down