|
|
|
| NanoAODOutputModule (edm::ParameterSet const &pset) |
|
| ~NanoAODOutputModule () override |
|
SerialTaskQueue * | globalLuminosityBlocksQueue () final |
|
SerialTaskQueue * | globalRunsQueue () final |
|
| OutputModule (edm::ParameterSet const &iPSet) |
|
bool | wantsGlobalLuminosityBlocks () const final |
|
bool | wantsGlobalRuns () const final |
|
BranchIDLists const * | branchIDLists () |
|
std::array< bool, NumBranchTypes > const & | hasNewlyDroppedBranch () const |
|
SelectedProductsForBranchType const & | keptProducts () const |
|
int | maxEvents () const |
|
const ModuleDescription & | moduleDescription () const |
|
OutputModuleBase & | operator= (OutputModuleBase const &)=delete |
|
| OutputModuleBase (OutputModuleBase const &)=delete |
|
| OutputModuleBase (ParameterSet const &pset) |
|
std::string const & | processName () const |
|
int | remainingEvents () const |
|
bool | selected (BranchDescription const &desc) const |
|
void | selectProducts (ProductRegistry const &preg, ThinnedAssociationsHelper const &) |
|
SharedResourcesAcquirer & | sharedResourcesAcquirer () |
|
SubProcessParentageHelper const * | subProcessParentageHelper () const |
|
ThinnedAssociationsHelper const * | thinnedAssociationsHelper () const |
|
bool | wantAllEvents () const |
|
bool | wantsStreamLuminosityBlocks () const |
|
bool | wantsStreamRuns () const |
|
| ~OutputModuleBase () override |
|
std::vector< ConsumesInfo > | consumesInfo () const |
|
void | convertCurrentProcessAlias (std::string const &processName) |
| Convert "@currentProcess" in InputTag process names to the actual current process name. More...
|
|
| EDConsumerBase () |
|
| EDConsumerBase (EDConsumerBase &&)=default |
|
| EDConsumerBase (EDConsumerBase const &)=delete |
|
ESProxyIndex const * | esGetTokenIndices (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::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const |
|
EDConsumerBase & | operator= (EDConsumerBase &&)=default |
|
EDConsumerBase const & | operator= (EDConsumerBase const &)=delete |
|
bool | registeredToConsume (ProductResolverIndex, bool, BranchType) const |
|
bool | registeredToConsumeMany (TypeID const &, BranchType) const |
|
ProductResolverIndexAndSkipBit | uncheckedIndexFrom (EDGetToken) const |
|
void | updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet) |
|
void | updateLookup (eventsetup::ESRecordsToProxyIndices const &) |
|
virtual | ~EDConsumerBase () noexcept(false) |
|
|
typedef OutputModuleBase | ModuleType |
|
typedef ProductLabels | Labels |
|
void | configure (OutputModuleDescription const &desc) |
|
ModuleDescription const & | description () const |
|
void | doBeginJob () |
|
bool | doBeginLuminosityBlock (LuminosityBlockPrincipal const &lbp, EventSetupImpl const &c, ModuleCallingContext const *) |
|
bool | doBeginRun (RunPrincipal const &rp, EventSetupImpl const &c, ModuleCallingContext const *) |
|
void | doEndJob () |
|
bool | doEndLuminosityBlock (LuminosityBlockPrincipal const &lbp, EventSetupImpl const &c, ModuleCallingContext const *) |
|
bool | doEndRun (RunPrincipal const &rp, EventSetupImpl const &c, ModuleCallingContext const *) |
|
bool | doEvent (EventPrincipal const &ep, EventSetupImpl const &c, 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) |
|
EDGetToken | consumes (const TypeToGet &id, edm::InputTag const &tag) |
|
template<typename ProductType , BranchType B = InEvent> |
EDGetTokenT< ProductType > | consumes (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 ProductType , BranchType B = InEvent> |
void | consumesMany () |
|
void | consumesMany (const TypeToGet &id) |
|
template<BranchType B> |
void | consumesMany (const TypeToGet &id) |
|
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) |
|
EDGetToken | mayConsume (const TypeToGet &id, edm::InputTag const &tag) |
|
template<BranchType B> |
EDGetToken | mayConsume (const TypeToGet &id, edm::InputTag const &tag) |
|
template<typename ProductType , BranchType B = InEvent> |
EDGetTokenT< ProductType > | mayConsume (edm::InputTag const &tag) |
|
Definition at line 46 of file NanoAODOutputModule.cc.
◆ NanoAODOutputModule()
◆ ~NanoAODOutputModule()
NanoAODOutputModule::~NanoAODOutputModule |
( |
| ) |
|
|
override |
◆ fillDescriptions()
Definition at line 356 of file NanoAODOutputModule.cc.
362 desc.
addUntracked<
int>(
"compressionLevel", 9)->setComment(
"ROOT compression level of output file.");
364 ->setComment(
"Algorithm used to compress data in the ROOT output file, allowed values are ZLIB and LZMA");
366 ->setComment(
"Save process provenance information, e.g. for edmProvDump");
369 "Change the OutputModule name in the fwk job report to fake PoolOutputModule. This is needed to run on cran "
370 "(and publish) till crab is fixed");
371 desc.
addUntracked<
int>(
"autoFlush", -10000000)->setComment(
"Autoflush parameter for ROOT file");
374 const std::vector<std::string>
keep = {
"drop *",
375 "keep nanoaodFlatTable_*Table_*_*",
376 "keep edmTriggerResults_*_*_*",
377 "keep String_*_genModel_*",
378 "keep nanoaodMergeableCounterTable_*Table_*_*",
379 "keep nanoaodUniqueString_nanoMetadata_*_*"};
386 ->setComment(
"PSet is only used by Data Operations and not by this module.");
References edm::ParameterSetDescription::add(), edm::ConfigurationDescriptions::addDefault(), edm::ParameterSetDescription::addUntracked(), EgammaPostProcessor_cfi::dataSet, edm::one::OutputModuleBase::fillDescription(), keep, edm::ParameterSetDescription::setAllowAnything(), and AlCaHLTBitMon_QueryRunRegistry::string.
◆ isFileOpen()
bool NanoAODOutputModule::isFileOpen |
( |
| ) |
const |
|
overrideprivatevirtual |
◆ openFile()
Reimplemented from edm::one::OutputModuleBase.
Definition at line 259 of file NanoAODOutputModule.cc.
266 m_fakeName ?
"PoolOutputModule" :
"NanoAODOutputModule",
271 std::vector<std::string>());
274 m_file->SetCompressionAlgorithm(ROOT::kZLIB);
276 m_file->SetCompressionAlgorithm(ROOT::kLZMA);
279 <<
"NanoAODOutputModule configured with unknown compression algorithm '" <<
m_compressionAlgorithm <<
"'\n"
280 <<
"Allowed compression algorithms are ZLIB and LZMA\n";
290 if (
keep.first->className() ==
"nanoaod::FlatTable")
292 else if (
keep.first->className() ==
"edm::TriggerResults") {
294 }
else if (
keep.first->className() ==
"std::basic_string<char,std::char_traits<char> >" &&
295 keep.first->productInstanceName() ==
"genModel") {
298 throw cms::Exception(
"Configuration",
"NanoAODOutputModule cannot handle class " +
keep.first->className());
302 if (
keep.first->className() ==
"nanoaod::MergeableCounterTable")
304 else if (
keep.first->className() ==
"nanoaod::UniqueString" &&
keep.first->moduleLabel() ==
"nanoMetadata")
308 "NanoAODOutputModule cannot handle class " +
keep.first->className() +
" in Run branch");
312 m_tree.reset(
new TTree(
"Events",
"Events"));
317 m_lumiTree.reset(
new TTree(
"LuminosityBlocks",
"LuminosityBlocks"));
321 m_runTree.reset(
new TTree(
"Runs",
"Runs"));
References NanoAODOutputModule::CommonEventBranches::branch(), NanoAODOutputModule::CommonLumiBranches::branch(), NanoAODOutputModule::CommonRunBranches::branch(), edm::createGlobalIdentifier(), edm::one::OutputModuleBase::description(), cms::Digest::digest(), Exception, edm::InEvent, edm::InRun, keep, edm::one::OutputModuleBase::keptProducts(), m_commonBranches, m_commonLumiBranches, m_commonRunBranches, m_compressionAlgorithm, m_compressionLevel, m_evstrings, m_fakeName, m_file, m_fileName, m_jrToken, m_logicalFileName, m_lumiTree, m_metaDataTree, m_nanoMetadata, m_parameterSetsTree, m_runTables, m_runTree, m_tables, m_tree, m_triggers, m_triggers_areSorted, m_writeProvenance, edm::poolNames::metaDataTreeName(), HerwigMaxPtPartonFilter_cfi::moduleLabel, edm::poolNames::parameterSetsTreeName(), AlCaHLTBitMon_QueryRunRegistry::string, and cms::MD5Result::toString().
◆ reallyCloseFile()
void NanoAODOutputModule::reallyCloseFile |
( |
| ) |
|
|
overrideprivatevirtual |
Reimplemented from edm::one::OutputModuleBase.
Definition at line 332 of file NanoAODOutputModule.cc.
334 int basketSize = 16384;
References edm::fillParameterSetBranch(), edm::fillProcessHistoryBranch(), m_file, m_jrToken, m_lumiTree, m_metaDataTree, m_parameterSetsTree, m_processHistoryRegistry, m_runTree, m_tree, m_writeProvenance, and edm::JobReport::outputFileClosed().
◆ write()
Implements edm::one::OutputModuleBase.
Definition at line 155 of file NanoAODOutputModule.cc.
169 maxMemory = static_cast<float>(
m_tree->GetTotBytes()) / percentClusterDone;
170 }
else if (
m_tree->GetZipBytes() == 0) {
171 maxMemory = 100 * 1024 * 1024;
174 float cxnRatio =
m_tree->GetTotBytes() / static_cast<float>(
m_tree->GetZipBytes());
176 float percentBytesDone = -
m_tree->GetZipBytes() / static_cast<float>(
m_autoFlush);
184 m_tree->OptimizeBaskets(static_cast<uint32_t>(maxMemory), 1,
"");
195 for (
unsigned int extensions = 0; extensions <= 1; ++extensions) {
200 std::vector<std::string> pnames;
201 for (
auto&
p :
iEvent.processHistory())
202 pnames.push_back(
p.processName());
204 return ((
std::find(pnames.begin(), pnames.end(),
a.processName()) - pnames.begin()) >
205 (
std::find(pnames.begin(), pnames.end(),
b.processName()) - pnames.begin()));
References a, b, patZpeak::events, edm::JobReport::eventWrittenToFile(), NanoAODOutputModule::CommonEventBranches::fill(), spr::find(), iEvent, m_autoFlush, m_commonBranches, m_eventsSinceFlush, m_evstrings, m_firstFlush, m_jrToken, m_processHistoryRegistry, m_tables, m_tree, m_triggers, m_triggers_areSorted, AlCaHLTBitMon_ParallelJobs::p, edm::ProcessHistoryRegistry::registerProcessHistory(), and OrderedSet::t.
◆ writeLuminosityBlock()
Implements edm::one::OutputModuleBase.
Definition at line 220 of file NanoAODOutputModule.cc.
References NanoAODOutputModule::CommonLumiBranches::fill(), edm::LuminosityBlockForOutput::id(), m_commonLumiBranches, m_jrToken, m_lumiTree, m_processHistoryRegistry, edm::OccurrenceForOutput::processHistory(), edm::ProcessHistoryRegistry::registerProcessHistory(), edm::JobReport::reportLumiSection(), edm::LuminosityBlockID::run(), and edm::LuminosityBlockID::value().
◆ writeRun()
Implements edm::one::OutputModuleBase.
Definition at line 230 of file NanoAODOutputModule.cc.
241 iRun.getByToken(
p.second, hstring);
242 TObjString* tos = dynamic_cast<TObjString*>(
m_file->Get(
p.first.c_str()));
244 if (hstring->
str() != tos->GetString())
245 throw cms::Exception(
"LogicError",
"Inconsistent nanoMetadata " +
p.first +
" (" + hstring->
str() +
")");
247 auto ostr = std::make_unique<TObjString>(hstring->
str().c_str());
248 m_file->WriteTObject(ostr.release(),
p.first.c_str());
References NanoAODOutputModule::CommonRunBranches::fill(), edm::OccurrenceForOutput::getByToken(), edm::RunForOutput::id(), m_commonRunBranches, m_file, m_jrToken, m_nanoMetadata, m_processHistoryRegistry, m_runTables, m_runTree, AlCaHLTBitMon_ParallelJobs::p, edm::OccurrenceForOutput::processHistory(), edm::ProcessHistoryRegistry::registerProcessHistory(), edm::JobReport::reportRunNumber(), edm::RunID::run(), nanoaod::UniqueString::str(), and OrderedSet::t.
◆ m_autoFlush
int NanoAODOutputModule::m_autoFlush |
|
private |
◆ m_commonBranches
◆ m_commonLumiBranches
◆ m_commonRunBranches
◆ m_compressionAlgorithm
std::string NanoAODOutputModule::m_compressionAlgorithm |
|
private |
◆ m_compressionLevel
int NanoAODOutputModule::m_compressionLevel |
|
private |
◆ m_eventsSinceFlush
int NanoAODOutputModule::m_eventsSinceFlush {0} |
|
private |
◆ m_evstrings
◆ m_fakeName
bool NanoAODOutputModule::m_fakeName |
|
private |
◆ m_file
std::unique_ptr<TFile> NanoAODOutputModule::m_file |
|
private |
◆ m_fileName
std::string NanoAODOutputModule::m_fileName |
|
private |
◆ m_firstFlush
constexpr int NanoAODOutputModule::m_firstFlush {1000} |
|
staticconstexprprivate |
◆ m_jrToken
◆ m_logicalFileName
std::string NanoAODOutputModule::m_logicalFileName |
|
private |
◆ m_lumiTree
std::unique_ptr<TTree> NanoAODOutputModule::m_lumiTree |
|
private |
◆ m_metaDataTree
std::unique_ptr<TTree> NanoAODOutputModule::m_metaDataTree |
|
private |
◆ m_nanoMetadata
std::vector<std::pair<std::string, edm::EDGetToken> > NanoAODOutputModule::m_nanoMetadata |
|
private |
◆ m_parameterSetsTree
std::unique_ptr<TTree> NanoAODOutputModule::m_parameterSetsTree |
|
private |
◆ m_processHistoryRegistry
◆ m_runTables
◆ m_runTree
std::unique_ptr<TTree> NanoAODOutputModule::m_runTree |
|
private |
◆ m_tables
◆ m_tree
std::unique_ptr<TTree> NanoAODOutputModule::m_tree |
|
private |
◆ m_triggers
◆ m_triggers_areSorted
bool NanoAODOutputModule::m_triggers_areSorted = false |
|
private |
◆ m_writeProvenance
bool NanoAODOutputModule::m_writeProvenance |
|
private |
void fill(const edm::EventID &id)
std::unique_ptr< TTree > m_tree
bool registerProcessHistory(ProcessHistory const &processHistory)
ParameterDescriptionBase * add(U const &iLabel, T const &value)
edm::JobReport::Token m_jrToken
std::vector< SummaryTableOutputBranches > m_runTables
class NanoAODOutputModule::CommonRunBranches m_commonRunBranches
std::unique_ptr< TTree > m_lumiTree
class NanoAODOutputModule::CommonLumiBranches m_commonLumiBranches
std::string const & parameterSetsTreeName()
std::string m_logicalFileName
void eventWrittenToFile(Token fileToken, RunNumber_t run, EventNumber_t event)
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
std::vector< EventStringOutputBranches > m_evstrings
std::vector< TableOutputBranches > m_tables
OutputModuleBase(ParameterSet const &pset)
class NanoAODOutputModule::CommonEventBranches m_commonBranches
edm::ProcessHistoryRegistry m_processHistoryRegistry
void fill(const edm::LuminosityBlockID &id)
void fillParameterSetBranch(TTree *parameterSetsTree, int basketSize)
void outputFileClosed(Token fileToken)
std::unique_ptr< TTree > m_runTree
static constexpr int m_firstFlush
static void fillDescription(ParameterSetDescription &desc, std::vector< std::string > const &iDefaultOutputCommands=ProductSelectorRules::defaultSelectionStrings())
std::string m_compressionAlgorithm
ParameterDescriptionBase * addUntracked(U const &iLabel, T const &value)
void reportLumiSection(JobReport::Token token, unsigned int run, unsigned int lumiSectId, unsigned long nEvents=0)
SelectedProductsForBranchType const & keptProducts() const
std::unique_ptr< TTree > m_parameterSetsTree
void reportRunNumber(JobReport::Token token, unsigned int run)
void setAllowAnything()
allow any parameter label/value pairs
std::vector< std::pair< std::string, edm::EDGetToken > > m_nanoMetadata
ModuleDescription const & description() const
std::unique_ptr< TFile > m_file
std::vector< TriggerOutputBranches > m_triggers
std::string const & metaDataTreeName()
void fillProcessHistoryBranch(TTree *metaDataTree, int basketSize, ProcessHistoryRegistry const &processHistoryRegistry)
std::unique_ptr< TTree > m_metaDataTree
std::string toString() const
void addDefault(ParameterSetDescription const &psetDescription)
bool m_triggers_areSorted
void fill(const edm::RunID &id)
const std::string & str() const
std::string createGlobalIdentifier()