CMS 3D CMS Logo

List of all members | Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes
evf::GlobalEvFOutputModule Class Reference
Inheritance diagram for evf::GlobalEvFOutputModule:
edm::global::OutputModule< T > edm::global::OutputModuleBase edm::core::OutputModuleCore edm::EDConsumerBase

Public Member Functions

 GlobalEvFOutputModule (edm::ParameterSet const &ps)
 
 ~GlobalEvFOutputModule () override
 
- Public Member Functions inherited from edm::global::OutputModule< T >
const OutputModuleoperator= (const OutputModule &)=delete
 
 OutputModule (edm::ParameterSet const &iPSet)
 
 OutputModule (const OutputModule &)=delete
 
bool wantsInputProcessBlocks () const final
 
bool wantsProcessBlocks () const final
 
bool wantsStreamLuminosityBlocks () const final
 
bool wantsStreamRuns () const final
 
- Public Member Functions inherited from edm::global::OutputModuleBase
OutputModuleBaseoperator= (OutputModuleBase const &)=delete
 
 OutputModuleBase (ParameterSet const &pset)
 
 OutputModuleBase (OutputModuleBase const &)=delete
 
bool wantsGlobalLuminosityBlocks () const
 
bool wantsGlobalRuns () const
 
- Public Member Functions inherited from edm::core::OutputModuleCore
BranchIDLists const * branchIDLists () const
 
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
std::array< bool, NumBranchTypes > const & hasNewlyDroppedBranch () const
 
SelectedProductsForBranchType const & keptProducts () const
 
int maxEvents () const
 
const ModuleDescriptionmoduleDescription () const
 
OutputModuleCoreoperator= (OutputModuleCore const &)=delete
 
 OutputModuleCore (ParameterSet const &pset)
 
 OutputModuleCore (OutputModuleCore const &)=delete
 
OutputProcessBlockHelper const & outputProcessBlockHelper () const
 
std::string const & processName () const
 
int remainingEvents () const
 
bool selected (BranchDescription const &desc) const
 
void selectProducts (ProductRegistry const &preg, ThinnedAssociationsHelper const &, ProcessBlockHelperBase const &)
 
ThinnedAssociationsHelper const * thinnedAssociationsHelper () const
 
bool wantAllEvents () const
 
 ~OutputModuleCore () override
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
void convertCurrentProcessAlias (std::string const &processName)
 Convert "@currentProcess" in InputTag process names to the actual current process name. More...
 
 EDConsumerBase ()
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
 EDConsumerBase (EDConsumerBase &&)=default
 
ESResolverIndex const * esGetTokenIndices (edm::Transition iTrans) const
 
std::vector< ESResolverIndex > const & esGetTokenIndicesVector (edm::Transition iTrans) const
 
std::vector< ESRecordIndex > const & esGetTokenRecordIndicesVector (edm::Transition iTrans) const
 
ProductResolverIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
std::vector< ProductResolverIndexAndSkipBit > const & itemsToGetFrom (BranchType iType) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesWhoseProductsAreConsumed (std::array< std::vector< ModuleDescription const *> *, NumBranchTypes > &modulesAll, std::vector< ModuleProcessName > &modulesInPreviousProcesses, ProductRegistry const &preg, std::map< std::string, ModuleDescription const *> const &labelsToDesc, std::string const &processName) const
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
void selectInputProcessBlocks (ProductRegistry const &productRegistry, ProcessBlockHelperBase const &processBlockHelperBase)
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
void updateLookup (eventsetup::ESRecordsToProductResolverIndices const &)
 
virtual ~EDConsumerBase () noexcept(false)
 

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &descriptions)
 
- Static Public Member Functions inherited from edm::core::OutputModuleCore
static const std::string & baseType ()
 
static void fillDescription (ParameterSetDescription &desc, std::vector< std::string > const &iDefaultOutputCommands=ProductSelectorRules::defaultSelectionStrings())
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &)
 

Private Member Functions

void acquire (edm::StreamID, edm::EventForOutput const &, edm::WaitingTaskWithArenaHolder) const final
 
std::unique_ptr< edm::StreamerOutputModuleCommonbeginStream (edm::StreamID) const final
 
Trig getTriggerResults (edm::EDGetTokenT< edm::TriggerResults > const &token, edm::EventForOutput const &e) const
 
std::shared_ptr< GlobalEvFOutputEventWriterglobalBeginLuminosityBlock (edm::LuminosityBlockForOutput const &iLB) const final
 
std::shared_ptr< GlobalEvFOutputJSONDefglobalBeginRun (edm::RunForOutput const &run) const final
 
void globalEndLuminosityBlock (edm::LuminosityBlockForOutput const &iLB) const final
 
void globalEndRun (edm::RunForOutput const &) const final
 
void write (edm::EventForOutput const &e) final
 
void writeLuminosityBlock (edm::LuminosityBlockForOutput const &) final
 
void writeRun (edm::RunForOutput const &) final
 

Private Attributes

edm::StreamerOutputModuleCommon::Parameters commonParameters_
 
evf::FastMonitoringServicefms_
 
edm::EDGetTokenT< edm::SendJobHeader::ParameterSetMappsetToken_
 
std::string streamLabel_
 
edm::EDGetTokenT< edm::TriggerResultstrToken_
 

Additional Inherited Members

- Public Types inherited from edm::global::OutputModuleBase
typedef OutputModuleBase ModuleType
 
- Public Types inherited from edm::core::OutputModuleCore
typedef OutputModuleCore ModuleType
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Protected Member Functions inherited from edm::global::OutputModuleBase
void doAcquire (EventTransitionInfo const &, ActivityRegistry *, ModuleCallingContext const *, WaitingTaskWithArenaHolder &)
 
void doBeginJob ()
 
void doBeginStream (StreamID id)
 
void doEndStream (StreamID id)
 
bool doEvent (EventTransitionInfo const &, ActivityRegistry *, ModuleCallingContext const *)
 
void doPreallocate (PreallocationConfiguration const &)
 
void preActionBeforeRunEventAsync (WaitingTaskHolder iTask, ModuleCallingContext const &iModuleCallingContext, Principal const &iPrincipal) const
 
- Protected Member Functions inherited from edm::core::OutputModuleCore
void configure (OutputModuleDescription const &desc)
 
ModuleDescription const & description () const
 
void doAccessInputProcessBlock (ProcessBlockPrincipal const &, ModuleCallingContext const *)
 
void doBeginJob_ ()
 
bool doBeginLuminosityBlock (LumiTransitionInfo const &, ModuleCallingContext const *)
 
void doBeginProcessBlock (ProcessBlockPrincipal const &, ModuleCallingContext const *)
 
bool doBeginRun (RunTransitionInfo const &, ModuleCallingContext const *)
 
void doEndJob ()
 
bool doEndLuminosityBlock (LumiTransitionInfo const &, ModuleCallingContext const *)
 
void doEndProcessBlock (ProcessBlockPrincipal const &, ModuleCallingContext const *)
 
bool doEndRun (RunTransitionInfo const &, ModuleCallingContext const *)
 
bool doEvent_ (EventTransitionInfo const &, ActivityRegistry *, ModuleCallingContext const *)
 
void doPreallocate_ (PreallocationConfiguration const &)
 
std::map< BranchID::value_type, BranchID::value_type > const & droppedBranchIDToKeptBranchID ()
 
virtual void preallocLumis (unsigned int)
 
ParameterSetID selectorConfig () const
 
void setEventSelectionInfo (std::map< std::string, std::vector< std::pair< std::string, int >>> const &outputModulePathPositions, bool anyProductProduced)
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
template<BranchType B = InEvent>
EDConsumerBaseAdaptor< Bconsumes (edm::InputTag tag) noexcept
 
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken consumes (TypeToGet const &id, edm::InputTag const &tag)
 
ConsumesCollector consumesCollector ()
 Use a ConsumesCollector to gather consumes information from helper functions. More...
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes ()
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes (ESInputTag const &tag)
 
template<Transition Tr = Transition::Event>
constexpr auto esConsumes ()
 
template<Transition Tr = Transition::Event>
auto esConsumes (ESInputTag tag)
 
template<Transition Tr = Transition::Event>
ESGetTokenGeneric esConsumes (eventsetup::EventSetupRecordKey const &iRecord, eventsetup::DataKey const &iKey)
 Used with EventSetupRecord::doGet. More...
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
void resetItemsToGetFrom (BranchType iType)
 
- Protected Attributes inherited from edm::core::OutputModuleCore
std::atomic< int > remainingEvents_
 

Detailed Description

Definition at line 162 of file GlobalEvFOutputModule.cc.

Constructor & Destructor Documentation

◆ GlobalEvFOutputModule()

evf::GlobalEvFOutputModule::GlobalEvFOutputModule ( edm::ParameterSet const &  ps)
explicit

Definition at line 286 of file GlobalEvFOutputModule.cc.

References Exception, geometryDiff::file, fms_, streamLabel_, AlCaHLTBitMon_QueryRunRegistry::string, and to_lower().

290  streamLabel_(ps.getParameter<std::string>("@module_label")),
291  trToken_(consumes<edm::TriggerResults>(edm::InputTag("TriggerResults"))),
292  psetToken_(consumes<edm::SendJobHeader::ParameterSetMap, edm::InRun>(
293  ps.getUntrackedParameter<edm::InputTag>("psetMap"))) {
294  //replace hltOutoputA with stream if the HLT menu uses this convention
295  std::string testPrefix = "hltOutput";
296  if (streamLabel_.find(testPrefix) == 0)
297  streamLabel_ = std::string("stream") + streamLabel_.substr(testPrefix.size());
298 
299  if (streamLabel_.find('_') != std::string::npos) {
300  throw cms::Exception("GlobalEvFOutputModule")
301  << "Underscore character is reserved can not be used for stream names in "
302  "FFF, but was detected in stream name -: "
303  << streamLabel_;
304  }
305 
306  std::string streamLabelLow = streamLabel_;
307  boost::algorithm::to_lower(streamLabelLow);
308  auto streampos = streamLabelLow.rfind("stream");
309  if (streampos != 0 && streampos != std::string::npos)
310  throw cms::Exception("GlobalEvFOutputModule")
311  << "stream (case-insensitive) sequence was found in stream suffix. This is reserved and can not be used for "
312  "names in FFF based HLT, but was detected in stream name";
313 
314  //output initemp file. This lets hltd know number of streams early on
315  if (!edm::Service<evf::EvFDaqDirector>().isAvailable())
316  throw cms::Exception("GlobalEvFOutputModule") << "EvFDaqDirector is not available";
317 
318  const std::string iniFileName = edm::Service<evf::EvFDaqDirector>()->getInitTempFilePath(streamLabel_);
319  std::ofstream file(iniFileName);
320  if (!file)
321  throw cms::Exception("GlobalEvFOutputModule") << "can not create " << iniFileName << "error: " << strerror(errno);
322  file.close();
323 
324  edm::LogInfo("GlobalEvFOutputModule") << "Constructor created initemp file -: " << iniFileName;
325 
326  //create JSD
328 
330  }
edm::global::OutputModule< edm::RunCache< GlobalEvFOutputJSONDef >, edm::LuminosityBlockCache< evf::GlobalEvFOutputEventWriter >, edm::StreamCache< edm::StreamerOutputModuleCommon >, edm::ExternalWork > GlobalEvFOutputModuleType
edm::EDGetTokenT< edm::TriggerResults > trToken_
std::string to_lower(const std::string &s)
edm::EDGetTokenT< edm::SendJobHeader::ParameterSetMap > psetToken_
edm::StreamerOutputModuleCommon::Parameters commonParameters_
evf::FastMonitoringService * fms_
static Parameters parameters(ParameterSet const &ps)
Log< level::Info, false > LogInfo

◆ ~GlobalEvFOutputModule()

evf::GlobalEvFOutputModule::~GlobalEvFOutputModule ( )
override

Definition at line 332 of file GlobalEvFOutputModule.cc.

332 {}

Member Function Documentation

◆ acquire()

void evf::GlobalEvFOutputModule::acquire ( edm::StreamID  id,
edm::EventForOutput const &  e,
edm::WaitingTaskWithArenaHolder  iHolder 
) const
finalprivate

Definition at line 435 of file GlobalEvFOutputModule.cc.

References MillePedeFileConverter_cfg::e, getTriggerResults(), edm::WaitingTaskWithArenaHolder::makeWaitingTaskHolderAndRelease(), eostools::move(), mps_check::msg, edm::core::OutputModuleCore::selectorConfig(), triggerResults, and trToken_.

437  {
439 
440  auto streamerCommon = streamCache(id);
441  std::unique_ptr<EventMsgBuilder> msg =
442  streamerCommon->serializeEvent(*streamerCommon->getSerializerBuffer(), e, triggerResults, selectorConfig());
443 
444  auto lumiWriter = luminosityBlockCache(e.getLuminosityBlock().index());
445  const_cast<evf::GlobalEvFOutputEventWriter*>(lumiWriter)
446  ->doOutputEventAsync(std::move(msg), iHolder.makeWaitingTaskHolderAndRelease());
447  }
edm::EDGetTokenT< edm::TriggerResults > trToken_
Trig getTriggerResults(edm::EDGetTokenT< edm::TriggerResults > const &token, edm::EventForOutput const &e) const
static std::string const triggerResults
Definition: EdmProvDump.cc:47
ParameterSetID selectorConfig() const
tuple msg
Definition: mps_check.py:286
def move(src, dest)
Definition: eostools.py:511

◆ beginStream()

std::unique_ptr< edm::StreamerOutputModuleCommon > evf::GlobalEvFOutputModule::beginStream ( edm::StreamID  ) const
finalprivate

Definition at line 343 of file GlobalEvFOutputModule.cc.

References commonParameters_, edm::core::OutputModuleCore::description(), edm::InEvent, edm::core::OutputModuleCore::keptProducts(), and edm::ModuleDescription::moduleLabel().

343  {
344  return std::make_unique<edm::StreamerOutputModuleCommon>(
346  }
ModuleDescription const & description() const
edm::StreamerOutputModuleCommon::Parameters commonParameters_
SelectedProductsForBranchType const & keptProducts() const
std::string const & moduleLabel() const

◆ fillDescriptions()

void evf::GlobalEvFOutputModule::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
static

Definition at line 334 of file GlobalEvFOutputModule.cc.

References edm::ConfigurationDescriptions::add(), submitPVResolutionJobs::desc, edm::StreamerOutputModuleCommon::fillDescription(), and edm::core::OutputModuleCore::fillDescription().

334  {
338  desc.addUntracked<edm::InputTag>("psetMap", {"hltPSetMap"})
339  ->setComment("Optionally allow the map of ParameterSets to be calculated externally.");
340  descriptions.add("globalEvfOutputModule", desc);
341  }
static void fillDescription(ParameterSetDescription &desc)
void add(std::string const &label, ParameterSetDescription const &psetDescription)
static void fillDescription(ParameterSetDescription &desc, std::vector< std::string > const &iDefaultOutputCommands=ProductSelectorRules::defaultSelectionStrings())

◆ getTriggerResults()

Trig evf::GlobalEvFOutputModule::getTriggerResults ( edm::EDGetTokenT< edm::TriggerResults > const &  token,
edm::EventForOutput const &  e 
) const
private

◆ globalBeginLuminosityBlock()

std::shared_ptr< GlobalEvFOutputEventWriter > evf::GlobalEvFOutputModule::globalBeginLuminosityBlock ( edm::LuminosityBlockForOutput const &  iLB) const
finalprivate

Definition at line 428 of file GlobalEvFOutputModule.cc.

References edm::LuminosityBlockForOutput::luminosityBlock(), and streamLabel_.

429  {
430  auto openDatFilePath = edm::Service<evf::EvFDaqDirector>()->getOpenDatFilePath(iLB.luminosityBlock(), streamLabel_);
431 
432  return std::make_shared<GlobalEvFOutputEventWriter>(openDatFilePath, iLB.luminosityBlock());
433  }

◆ globalBeginRun()

std::shared_ptr< GlobalEvFOutputJSONDef > evf::GlobalEvFOutputModule::globalBeginRun ( edm::RunForOutput const &  run) const
finalprivate

Definition at line 348 of file GlobalEvFOutputModule.cc.

References cms::Adler32(), StreamerOutputFile::adler32(), edm::core::OutputModuleCore::branchIDLists(), SerializeDataBuffer::clearHeaderBuffer(), StreamerOutputFile::close(), commonParameters_, edm::core::OutputModuleCore::description(), Exception, edm::StreamerOutputModuleCommon::getSerializerBuffer(), edm::InEvent, edm::Hash< I >::isValid(), edm::core::OutputModuleCore::keptProducts(), LogDebug, edm::ModuleDescription::mainParameterSetID(), edm::core::OutputModuleCore::moduleDescription(), HerwigMaxPtPartonFilter_cfi::moduleLabel, edm::ModuleDescription::moduleLabel(), SimL1EmulatorRepack_CalouGT_cff::processName, psetToken_, writedatasetfile::run, edm::StreamerOutputModuleCommon::serializeRegistry(), TrackRefitter_38T_cff::src, edm_modernize_messagelogger::stat, streamLabel_, AlCaHLTBitMon_QueryRunRegistry::string, edm::core::OutputModuleCore::thinnedAssociationsHelper(), and StreamerOutputFile::write().

348  {
349  //create run Cache holding JSON file writer and variables
350  auto jsonDef = std::make_unique<GlobalEvFOutputJSONDef>(streamLabel_, false);
351  jsonDef->updateDestination(streamLabel_);
352  edm::StreamerOutputModuleCommon streamerCommon(
354 
355  //output INI file (non-const). This doesn't require globalBeginRun to be finished
356  const std::string openIniFileName = edm::Service<evf::EvFDaqDirector>()->getOpenInitFilePath(streamLabel_);
357  edm::LogInfo("GlobalEvFOutputModule") << "beginRun init stream -: " << openIniFileName;
358 
359  StreamerOutputFile stream_writer_preamble(openIniFileName);
360  uint32 preamble_adler32 = 1;
361  edm::BranchIDLists const* bidlPtr = branchIDLists();
362 
363  auto psetMapHandle = run.getHandle(psetToken_);
364 
365  std::unique_ptr<InitMsgBuilder> init_message =
366  streamerCommon.serializeRegistry(*streamerCommon.getSerializerBuffer(),
367  *bidlPtr,
372  psetMapHandle.isValid() ? psetMapHandle.product() : nullptr);
373 
374  //Let us turn it into a View
375  InitMsgView view(init_message->startAddress());
376 
377  //output header
378  stream_writer_preamble.write(view);
379  preamble_adler32 = stream_writer_preamble.adler32();
380  stream_writer_preamble.close();
381 
382  struct stat istat;
383  stat(openIniFileName.c_str(), &istat);
384  //read back file to check integrity of what was written
385  off_t readInput = 0;
386  uint32_t adlera = 1, adlerb = 0;
387  std::ifstream src(openIniFileName, std::ifstream::binary);
388  if (!src)
389  throw cms::Exception("GlobalEvFOutputModule")
390  << "can not read back " << openIniFileName << " error: " << strerror(errno);
391 
392  //allocate buffer to write INI file
393  std::unique_ptr<char[]> outBuf = std::make_unique<char[]>(1024 * 1024);
394  while (readInput < istat.st_size) {
395  size_t toRead = readInput + 1024 * 1024 < istat.st_size ? 1024 * 1024 : istat.st_size - readInput;
396  src.read(outBuf.get(), toRead);
397  //cms::Adler32(const_cast<const char*>(reinterpret_cast<char*>(outBuf.get())), toRead, adlera, adlerb);
398  cms::Adler32(const_cast<const char*>(outBuf.get()), toRead, adlera, adlerb);
399  readInput += toRead;
400  }
401  src.close();
402 
403  //clear serialization buffers
404  streamerCommon.getSerializerBuffer()->clearHeaderBuffer();
405 
406  //free output buffer needed only for the file write
407  outBuf.reset();
408 
409  uint32_t adler32c = (adlerb << 16) | adlera;
410  if (adler32c != preamble_adler32) {
411  throw cms::Exception("GlobalEvFOutputModule") << "Checksum mismatch of ini file -: " << openIniFileName
412  << " expected:" << preamble_adler32 << " obtained:" << adler32c;
413  } else {
414  LogDebug("GlobalEvFOutputModule") << "Ini file checksum -: " << streamLabel_ << " " << adler32c;
415  std::filesystem::rename(openIniFileName, edm::Service<evf::EvFDaqDirector>()->getInitFilePath(streamLabel_));
416  }
417 
418  return jsonDef;
419  }
std::vector< BranchIDList > BranchIDLists
Definition: BranchIDList.h:19
ParameterSetID const & mainParameterSetID() const
ModuleDescription const & description() const
edm::EDGetTokenT< edm::SendJobHeader::ParameterSetMap > psetToken_
bool isValid() const
Definition: Hash.h:141
ThinnedAssociationsHelper const * thinnedAssociationsHelper() const
edm::StreamerOutputModuleCommon::Parameters commonParameters_
BranchIDLists const * branchIDLists() const
unsigned int uint32
Definition: MsgTools.h:13
Log< level::Info, false > LogInfo
void Adler32(char const *data, size_t len, uint32_t &a, uint32_t &b)
SelectedProductsForBranchType const & keptProducts() const
const ModuleDescription & moduleDescription() const
std::string const & moduleLabel() const
#define LogDebug(id)

◆ globalEndLuminosityBlock()

void evf::GlobalEvFOutputModule::globalEndLuminosityBlock ( edm::LuminosityBlockForOutput const &  iLB) const
finalprivate

Definition at line 450 of file GlobalEvFOutputModule.cc.

References fms_, evf::FastMonitoringService::getEventsProcessedForLumi(), edm::LuminosityBlockForOutput::getRun(), edm::LuminosityBlockForOutput::index(), edm::RunForOutput::index(), edm::LuminosityBlockForOutput::luminosityBlock(), castor_dqm_sourceclient_file_cfg::path, edm_modernize_messagelogger::stat, streamLabel_, and AlCaHLTBitMon_QueryRunRegistry::string.

450  {
451  auto lumiWriter = luminosityBlockCache(iLB.index());
452  //close dat file
453  const bool discarded = const_cast<evf::GlobalEvFOutputEventWriter*>(lumiWriter)->close();
454 
455  //auto jsonWriter = const_cast<GlobalEvFOutputJSONWriter*>(runCache(iLB.getRun().index()));
456  auto jsonDef = runCache(iLB.getRun().index());
458  jsonDef->outJsonDef_,
459  jsonDef->outJsonDefName_,
460  jsonDef->transferDestination_,
461  jsonDef->mergeType_);
462 
463  jsonWriter.fileAdler32_.value() = lumiWriter->get_adler32();
464  jsonWriter.accepted_.value() = lumiWriter->getAccepted();
465 
466  bool abortFlag = false;
467 
468  if (!discarded) {
469  jsonWriter.processed_.value() = fms_->getEventsProcessedForLumi(iLB.luminosityBlock(), &abortFlag);
470  } else {
471  jsonWriter.errorEvents_.value() = fms_->getEventsProcessedForLumi(iLB.luminosityBlock(), &abortFlag);
472  jsonWriter.processed_.value() = 0;
473  jsonWriter.accepted_.value() = 0;
474  edm::LogInfo("GlobalEvFOutputModule")
475  << "Output suppressed, setting error events for LS -: " << iLB.luminosityBlock();
476  }
477 
478  if (abortFlag) {
479  edm::LogInfo("GlobalEvFOutputModule") << "Abort flag has been set. Output is suppressed";
480  return;
481  }
482 
483  if (jsonWriter.processed_.value() != 0) {
484  struct stat istat;
485  std::filesystem::path openDatFilePath = lumiWriter->getFilePath();
486  stat(openDatFilePath.string().c_str(), &istat);
487  jsonWriter.filesize_ = istat.st_size;
488  std::filesystem::rename(openDatFilePath.string().c_str(),
489  edm::Service<evf::EvFDaqDirector>()->getDatFilePath(iLB.luminosityBlock(), streamLabel_));
490  jsonWriter.filelist_ = openDatFilePath.filename().string();
491  } else {
492  //remove empty file when no event processing has occurred
493  remove(lumiWriter->getFilePath().c_str());
494  jsonWriter.filesize_ = 0;
495  jsonWriter.filelist_ = "";
496  jsonWriter.fileAdler32_.value() = -1; //no files in signed long
497  }
498 
499  //produce JSON file
500  jsonWriter.jsonMonitor_->snap(iLB.luminosityBlock());
501  const std::string outputJsonNameStream =
502  edm::Service<evf::EvFDaqDirector>()->getOutputJsonFilePath(iLB.luminosityBlock(), streamLabel_);
503  jsonWriter.jsonMonitor_->outputFullJSON(outputJsonNameStream, iLB.luminosityBlock());
504  }
evf::FastMonitoringService * fms_
Log< level::Info, false > LogInfo
unsigned int getEventsProcessedForLumi(unsigned int lumi, bool *abortFlag=nullptr)

◆ globalEndRun()

void evf::GlobalEvFOutputModule::globalEndRun ( edm::RunForOutput const &  ) const
inlinefinalprivate

Definition at line 179 of file GlobalEvFOutputModule.cc.

179 {}

◆ write()

void evf::GlobalEvFOutputModule::write ( edm::EventForOutput const &  e)
finalprivatevirtual

Implements edm::core::OutputModuleCore.

Definition at line 448 of file GlobalEvFOutputModule.cc.

Referenced by pkg.AbstractPkg::generate().

448 {}

◆ writeLuminosityBlock()

void evf::GlobalEvFOutputModule::writeLuminosityBlock ( edm::LuminosityBlockForOutput const &  )
inlinefinalprivatevirtual

Implements edm::core::OutputModuleCore.

Definition at line 177 of file GlobalEvFOutputModule.cc.

177 {}

◆ writeRun()

void evf::GlobalEvFOutputModule::writeRun ( edm::RunForOutput const &  )
inlinefinalprivatevirtual

Implements edm::core::OutputModuleCore.

Definition at line 178 of file GlobalEvFOutputModule.cc.

178 {}

Member Data Documentation

◆ commonParameters_

edm::StreamerOutputModuleCommon::Parameters evf::GlobalEvFOutputModule::commonParameters_
private

Definition at line 187 of file GlobalEvFOutputModule.cc.

Referenced by beginStream(), and globalBeginRun().

◆ fms_

evf::FastMonitoringService* evf::GlobalEvFOutputModule::fms_
private

Definition at line 192 of file GlobalEvFOutputModule.cc.

Referenced by globalEndLuminosityBlock(), and GlobalEvFOutputModule().

◆ psetToken_

edm::EDGetTokenT<edm::SendJobHeader::ParameterSetMap> evf::GlobalEvFOutputModule::psetToken_
private

Definition at line 190 of file GlobalEvFOutputModule.cc.

Referenced by globalBeginRun().

◆ streamLabel_

std::string evf::GlobalEvFOutputModule::streamLabel_
private

◆ trToken_

edm::EDGetTokenT<edm::TriggerResults> evf::GlobalEvFOutputModule::trToken_
private

Definition at line 189 of file GlobalEvFOutputModule.cc.

Referenced by acquire().