CMS 3D CMS Logo

List of all members | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes
dqmservices::JsonWritingTimeoutPoolOutputModule Class Reference

#include <JsonWritingTimeoutPoolOutputModule.h>

Inheritance diagram for dqmservices::JsonWritingTimeoutPoolOutputModule:
edm::TimeoutPoolOutputModule edm::PoolOutputModule edm::one::OutputModule< WatchInputFiles > edm::one::OutputModuleBase edm::core::OutputModuleCore edm::EDConsumerBase

Public Member Functions

 JsonWritingTimeoutPoolOutputModule (edm::ParameterSet const &ps)
 
 ~JsonWritingTimeoutPoolOutputModule () override=default
 
- Public Member Functions inherited from edm::TimeoutPoolOutputModule
TimeoutPoolOutputModuleoperator= (TimeoutPoolOutputModule const &)=delete
 
 TimeoutPoolOutputModule (ParameterSet const &ps)
 
 TimeoutPoolOutputModule (TimeoutPoolOutputModule const &)=delete
 
 ~TimeoutPoolOutputModule () override
 
- Public Member Functions inherited from edm::PoolOutputModule
AuxItemArray const & auxItems () const
 
std::string const & basketOrder () const
 
int basketSize () const
 
BranchChildren const & branchChildren () const
 
std::string const & catalog () const
 
bool compactEventAuxiliary () const
 
std::string const & compressionAlgorithm () const
 
int compressionLevel () const
 
std::string const & currentFileName () const
 
DropMetaData const & dropMetaData () const
 
int eventAutoFlushSize () const
 
int eventAuxiliaryBasketSize () const
 
std::string const & fileName () const
 
int inputFileCount () const
 
std::string const & logicalFileName () const
 
unsigned int maxFileSize () const
 
bool mergeJob () const
 
std::string const & moduleLabel () const
 
PoolOutputModuleoperator= (PoolOutputModule const &)=delete
 
bool overrideInputFileSplitLevels () const
 
 PoolOutputModule (ParameterSet const &ps)
 
 PoolOutputModule (PoolOutputModule const &)=delete
 
std::vector< OutputItemList > const & selectedOutputItemList () const
 
std::vector< OutputItemList > & selectedOutputItemList ()
 
int splitLevel () const
 
int treeMaxVirtualSize () const
 
int whyNotFastClonable () const
 
 ~PoolOutputModule () override
 
- Public Member Functions inherited from edm::one::OutputModule< WatchInputFiles >
SerialTaskQueueglobalLuminosityBlocksQueue () final
 
SerialTaskQueueglobalRunsQueue () final
 
const OutputModuleoperator= (const OutputModule &)=delete
 
 OutputModule (edm::ParameterSet const &iPSet)
 
 OutputModule (const OutputModule &)=delete
 
bool wantsGlobalLuminosityBlocks () const noexcept final
 
bool wantsGlobalRuns () const noexcept final
 
bool wantsInputProcessBlocks () const noexcept final
 
bool wantsProcessBlocks () const noexcept final
 
- Public Member Functions inherited from edm::one::OutputModuleBase
OutputModuleBaseoperator= (OutputModuleBase const &)=delete
 
 OutputModuleBase (ParameterSet const &pset)
 
 OutputModuleBase (OutputModuleBase const &)=delete
 
SharedResourcesAcquirersharedResourcesAcquirer ()
 
SubProcessParentageHelper const * subProcessParentageHelper () const
 
bool wantsStreamLuminosityBlocks () const noexcept
 
bool wantsStreamRuns () const noexcept
 
- 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 &)
 
- Static Public Member Functions inherited from edm::TimeoutPoolOutputModule
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
- Static Public Member Functions inherited from edm::PoolOutputModule
static void fillDescription (ParameterSetDescription &desc)
 
static void fillDescriptions (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 &)
 

Protected Member Functions

void doExtrasAfterCloseFile () override
 
std::pair< std::string, std::string > physicalAndLogicalNameForNewFile () override
 
- Protected Member Functions inherited from edm::TimeoutPoolOutputModule
bool shouldWeCloseFile () const override
 allow inheriting classes to override but still be able to call this method in the overridden version More...
 
void write (EventForOutput const &e) override
 
- Protected Member Functions inherited from edm::one::OutputModuleBase
void configure (OutputModuleDescription const &desc)
 
void doBeginJob ()
 
bool doEvent (EventTransitionInfo const &, ActivityRegistry *, ModuleCallingContext const *)
 
void doPreallocate (PreallocationConfiguration 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

std::string currentFileName_
 
std::string currentJsonName_
 
std::string const outputPath_
 
uint32_t const runNumber_
 
uint32_t sequence_
 
std::string const streamLabel_
 
- Protected Attributes inherited from edm::core::OutputModuleCore
std::atomic< int > remainingEvents_
 

Additional Inherited Members

- Public Types inherited from edm::PoolOutputModule
using AuxItemArray = std::array< AuxItem, numberOfRunLumiEventProductTrees >
 
enum  DropMetaData { DropNone, DropDroppedPrior, DropPrior, DropAll }
 
using OutputItemList = std::vector< OutputItem >
 
- Public Types inherited from edm::one::OutputModuleBase
typedef OutputModuleBase ModuleType
 
- Public Types inherited from edm::core::OutputModuleCore
typedef OutputModuleCore ModuleType
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 

Detailed Description

Definition at line 16 of file JsonWritingTimeoutPoolOutputModule.h.

Constructor & Destructor Documentation

◆ JsonWritingTimeoutPoolOutputModule()

dqmservices::JsonWritingTimeoutPoolOutputModule::JsonWritingTimeoutPoolOutputModule ( edm::ParameterSet const &  ps)
explicit

◆ ~JsonWritingTimeoutPoolOutputModule()

dqmservices::JsonWritingTimeoutPoolOutputModule::~JsonWritingTimeoutPoolOutputModule ( )
overridedefault

Member Function Documentation

◆ doExtrasAfterCloseFile()

void dqmservices::JsonWritingTimeoutPoolOutputModule::doExtrasAfterCloseFile ( )
overrideprotectedvirtual

Reimplemented from edm::PoolOutputModule.

Definition at line 36 of file JsonWritingTimeoutPoolOutputModule.cc.

References currentFileName_, currentJsonName_, dqmfilesaver::fillJson(), DiDispStaMuonMonitor_cfi::pt, runNumber_, sequence_, and AlCaHLTBitMon_QueryRunRegistry::string.

36  {
37  std::string json_tmp_ = currentJsonName_ + ".open";
38  std::string transferDest = "";
39  std::string mergeType = "ROOT";
40  auto pt = dqmfilesaver::fillJson(runNumber_, sequence_, currentFileName_, transferDest, mergeType, nullptr);
41  write_json(json_tmp_, pt);
42  rename(json_tmp_.c_str(), currentJsonName_.c_str());
43  }
Definition: rename.py:1
boost::property_tree::ptree fillJson(int run, int lumi, const std::string &dataFilePathName, const std::string &transferDestinationStr, const std::string &mergeTypeStr, evf::FastMonitoringService *fms)
Definition: fillJson.cc:29

◆ fillDescriptions()

void dqmservices::JsonWritingTimeoutPoolOutputModule::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
static

Definition at line 45 of file JsonWritingTimeoutPoolOutputModule.cc.

References edm::ConfigurationDescriptions::add(), submitPVResolutionJobs::desc, and AlCaHLTBitMon_QueryRunRegistry::string.

45  {
47  TimeoutPoolOutputModule::fillDescription(desc);
48 
49  desc.setComment(
50  "Almost same as TimeoutPoolOutputModule, but the output files names "
51  "follow the FFF naming convention. Additionally a json 'description' "
52  "file is emitted for every .root file written.");
53 
54  desc.addUntracked<uint32_t>("runNumber", 0)
55  ->setComment(
56  "The run number, only used for file prefix: "
57  "'run000001_lumi0000_...'.");
58 
59  desc.addUntracked<std::string>("outputPath", "./")
60  ->setComment(
61  "Output path for the root and json files, usually the run "
62  "directory.");
63 
64  desc.addUntracked<std::string>("streamLabel", "streamEvDOutput")->setComment("Stream label, used for file suffix.");
65 
66  descriptions.add("jsonWriting", desc);
67  }
void add(std::string const &label, ParameterSetDescription const &psetDescription)

◆ physicalAndLogicalNameForNewFile()

std::pair< std::string, std::string > dqmservices::JsonWritingTimeoutPoolOutputModule::physicalAndLogicalNameForNewFile ( )
overrideprotectedvirtual

Reimplemented from edm::PoolOutputModule.

Definition at line 23 of file JsonWritingTimeoutPoolOutputModule.cc.

References edmMakeDummyCfis::base, currentFileName_, currentJsonName_, outputPath_, AlCaHLTBitMon_ParallelJobs::p, EnsembleCalibrationLA_cfg::path, runNumber_, sequence_, streamLabel_, and AlCaHLTBitMon_QueryRunRegistry::string.

23  {
24  sequence_++;
25 
26  std::string base = fmt::sprintf("run%06d_ls%04d_%s", runNumber_, sequence_, streamLabel_);
27 
29 
30  currentFileName_ = (p / base).string() + ".root";
31  currentJsonName_ = (p / base).string() + ".jsn";
32 
33  return std::make_pair(currentFileName_, currentFileName_);
34  }

Member Data Documentation

◆ currentFileName_

std::string dqmservices::JsonWritingTimeoutPoolOutputModule::currentFileName_
protected

◆ currentJsonName_

std::string dqmservices::JsonWritingTimeoutPoolOutputModule::currentJsonName_
protected

◆ outputPath_

std::string const dqmservices::JsonWritingTimeoutPoolOutputModule::outputPath_
protected

◆ runNumber_

uint32_t const dqmservices::JsonWritingTimeoutPoolOutputModule::runNumber_
protected

◆ sequence_

uint32_t dqmservices::JsonWritingTimeoutPoolOutputModule::sequence_
protected

◆ streamLabel_

std::string const dqmservices::JsonWritingTimeoutPoolOutputModule::streamLabel_
protected