CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Classes | Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes
edm::PoolOutputModule Class Reference

#include <PoolOutputModule.h>

Inheritance diagram for edm::PoolOutputModule:
edm::one::OutputModule< WatchInputFiles > edm::one::OutputModuleBase edm::EDConsumerBase edm::TimeoutPoolOutputModule

Classes

struct  AuxItem
 
struct  OutputItem
 

Public Types

typedef std::array< AuxItem,
NumBranchTypes
AuxItemArray
 
enum  DropMetaData { DropNone, DropDroppedPrior, DropPrior, DropAll }
 
typedef std::vector< OutputItemOutputItemList
 
typedef std::array
< OutputItemList,
NumBranchTypes
OutputItemListArray
 
- Public Types inherited from edm::one::OutputModuleBase
typedef OutputModuleBase ModuleType
 

Public Member Functions

AuxItemArray const & auxItems () const
 
std::string const & basketOrder () const
 
int const & basketSize () const
 
std::string const & catalog () const
 
std::string const & compressionAlgorithm () const
 
int const & compressionLevel () const
 
std::string const & currentFileName () const
 
DropMetaData const & dropMetaData () const
 
int eventAutoFlushSize () const
 
std::string const & fileName () const
 
int const & inputFileCount () const
 
std::string const & logicalFileName () const
 
unsigned int const & maxFileSize () const
 
std::string const & moduleLabel () const
 
PoolOutputModuleoperator= (PoolOutputModule const &)=delete
 
bool const & overrideInputFileSplitLevels () const
 
 PoolOutputModule (ParameterSet const &ps)
 
 PoolOutputModule (PoolOutputModule const &)=delete
 
OutputItemListArray const & selectedOutputItemList () const
 
int const & splitLevel () const
 
int const & treeMaxVirtualSize () const
 
int const & whyNotFastClonable () const
 
virtual ~PoolOutputModule ()
 
- Public Member Functions inherited from edm::one::OutputModule< WatchInputFiles >
 OutputModule (edm::ParameterSet const &iPSet)
 
- Public Member Functions inherited from edm::one::OutputModuleBase
BranchChildren const & branchChildren () const
 
BranchIDLists const * branchIDLists () const
 
std::array< bool,
NumBranchTypes > const & 
hasNewlyDroppedBranch () const
 
SelectedProductsForBranchType
const & 
keptProducts () const
 
int maxEvents () const
 
const ModuleDescriptionmoduleDescription () const
 
OutputModuleBaseoperator= (OutputModuleBase const &)=delete
 
 OutputModuleBase (ParameterSet const &pset)
 
 OutputModuleBase (OutputModuleBase const &)=delete
 
std::string const & processName () const
 
int remainingEvents () const
 
bool selected (BranchDescription const &desc) const
 
void selectProducts (ProductRegistry const &preg)
 
bool wantAllEvents () const
 
virtual ~OutputModuleBase ()
 
- Public Member Functions inherited from edm::EDConsumerBase
 EDConsumerBase ()
 
ProductHolderIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
std::vector
< ProductHolderIndexAndSkipBit >
const & 
itemsToGetFromEvent () const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesDependentUpon (const std::string &iProcessName, std::vector< const char * > &oModuleLabels) const
 
bool registeredToConsume (ProductHolderIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

Static Public Member Functions

static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
- Static Public Member Functions inherited from edm::one::OutputModuleBase
static const std::string & baseType ()
 
static void fillDescription (ParameterSetDescription &desc)
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &)
 

Protected Member Functions

virtual bool shouldWeCloseFile () const override
 allow inheriting classes to override but still be able to call this method in the overridden version More...
 
virtual void write (EventPrincipal const &e, ModuleCallingContext const *) override
 
- Protected Member Functions inherited from edm::one::OutputModuleBase
void configure (OutputModuleDescription const &desc)
 
ModuleDescription const & description () const
 
void doBeginJob ()
 
bool doBeginLuminosityBlock (LuminosityBlockPrincipal const &lbp, EventSetup const &c, ModuleCallingContext const *)
 
bool doBeginRun (RunPrincipal const &rp, EventSetup const &c, ModuleCallingContext const *)
 
void doEndJob ()
 
bool doEndLuminosityBlock (LuminosityBlockPrincipal const &lbp, EventSetup const &c, ModuleCallingContext const *)
 
bool doEndRun (RunPrincipal const &rp, EventSetup const &c, ModuleCallingContext const *)
 
bool doEvent (EventPrincipal const &ep, EventSetup const &c, ActivityRegistry *, ModuleCallingContext const *)
 
void doPreallocate (PreallocationConfiguration const &)
 
std::map< BranchID::value_type,
BranchID::value_type > const & 
droppedBranchIDToKeptBranchID ()
 
Trig getTriggerResults (EventPrincipal const &ep, ModuleCallingContext const *) const
 
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)
 
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 ProductType , BranchType B = InEvent>
void consumesMany ()
 
void consumesMany (const TypeToGet &id)
 
template<BranchType B>
void consumesMany (const TypeToGet &id)
 
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)
 

Private Member Functions

void beginInputFile (FileBlock const &fb)
 
virtual void beginJob () override
 
void fillSelectedItemList (BranchType branchtype, TTree *theInputTree)
 
void finishEndFile ()
 
virtual bool isFileOpen () const override
 
virtual void openFile (FileBlock const &fb) override
 
virtual void postForkReacquireResources (unsigned int iChildIndex, unsigned int iNumberOfChildren) override
 
virtual void reallyCloseFile () override
 
virtual void reallyOpenFile () override
 
virtual void respondToCloseInputFile (FileBlock const &fb) override
 
virtual void respondToOpenInputFile (FileBlock const &fb) override
 
void startEndFile ()
 
void writeBranchIDListRegistry ()
 
void writeFileFormatVersion ()
 
void writeFileIdentifier ()
 
void writeIndexIntoFile ()
 
virtual void writeLuminosityBlock (LuminosityBlockPrincipal const &lb, ModuleCallingContext const *) override
 
void writeParameterSetRegistry ()
 
void writeParentageRegistry ()
 
void writeProcessHistoryRegistry ()
 
void writeProductDependencies ()
 
void writeProductDescriptionRegistry ()
 
virtual void writeRun (RunPrincipal const &r, ModuleCallingContext const *) override
 

Private Attributes

AuxItemArray auxItems_
 
std::string basketOrder_
 
int const basketSize_
 
std::string const catalog_
 
unsigned int childIndex_
 
std::string const compressionAlgorithm_
 
int const compressionLevel_
 
DropMetaData dropMetaData_
 
int const eventAutoFlushSize_
 
std::string const fileName_
 
bool initializedFromInput_
 
int inputFileCount_
 
std::string const logicalFileName_
 
unsigned int const maxFileSize_
 
std::string const moduleLabel_
 
unsigned int numberOfDigitsInIndex_
 
int outputFileCount_
 
bool overrideInputFileSplitLevels_
 
std::unique_ptr< RootOutputFilerootOutputFile_
 
RootServiceChecker rootServiceChecker_
 
OutputItemListArray selectedOutputItemList_
 
int const splitLevel_
 
std::string statusFileName_
 
int const treeMaxVirtualSize_
 
int whyNotFastClonable_
 

Detailed Description

Definition at line 30 of file PoolOutputModule.h.

Member Typedef Documentation

Definition at line 65 of file PoolOutputModule.h.

Definition at line 96 of file PoolOutputModule.h.

Definition at line 98 of file PoolOutputModule.h.

Member Enumeration Documentation

Constructor & Destructor Documentation

edm::PoolOutputModule::PoolOutputModule ( ParameterSet const &  ps)
explicit

Definition at line 30 of file PoolOutputModule.cc.

References edm::errors::Configuration, DropAll, DropDroppedPrior, dropMetaData(), dropMetaData_, DropNone, DropPrior, edm::FileBlock::EventSelectionUsed, edm::hlt::Exception, edm::ParameterSet::getUntrackedParameter(), edm::ParameterSet::getUntrackedParameterSet(), moduleLabel_, statusFileName_, AlCaHLTBitMon_QueryRunRegistry::string, edm::one::OutputModuleBase::wantAllEvents(), and whyNotFastClonable_.

30  :
32  one::OutputModule<WatchInputFiles>(pset),
34  auxItems_(),
36  fileName_(pset.getUntrackedParameter<std::string>("fileName")),
37  logicalFileName_(pset.getUntrackedParameter<std::string>("logicalFileName")),
38  catalog_(pset.getUntrackedParameter<std::string>("catalog")),
39  maxFileSize_(pset.getUntrackedParameter<int>("maxSize")),
40  compressionLevel_(pset.getUntrackedParameter<int>("compressionLevel")),
41 #if ROOT_VERSION_CODE >= ROOT_VERSION(5,30,0)
42  compressionAlgorithm_(pset.getUntrackedParameter<std::string>("compressionAlgorithm")),
43 #else
44  compressionAlgorithm_("ZLIB"),
45 #endif
46  basketSize_(pset.getUntrackedParameter<int>("basketSize")),
47  eventAutoFlushSize_(pset.getUntrackedParameter<int>("eventAutoFlushCompressedSize")),
48  splitLevel_(std::min<int>(pset.getUntrackedParameter<int>("splitLevel") + 1, 99)),
49  basketOrder_(pset.getUntrackedParameter<std::string>("sortBaskets")),
50  treeMaxVirtualSize_(pset.getUntrackedParameter<int>("treeMaxVirtualSize")),
51  whyNotFastClonable_(pset.getUntrackedParameter<bool>("fastCloning") ? FileBlock::CanFastClone : FileBlock::DisabledInConfigFile),
53  moduleLabel_(pset.getParameter<std::string>("@module_label")),
54  initializedFromInput_(false),
56  inputFileCount_(0),
57  childIndex_(0U),
59  overrideInputFileSplitLevels_(pset.getUntrackedParameter<bool>("overrideInputFileSplitLevels")),
61  statusFileName_() {
62 
63  if (pset.getUntrackedParameter<bool>("writeStatusFile")) {
64  std::ostringstream statusfilename;
65  statusfilename << moduleLabel_ << '_' << getpid();
66  statusFileName_ = statusfilename.str();
67  }
68 
69  std::string dropMetaData(pset.getUntrackedParameter<std::string>("dropMetaData"));
70  if(dropMetaData.empty()) dropMetaData_ = DropNone;
71  else if(dropMetaData == std::string("NONE")) dropMetaData_ = DropNone;
72  else if(dropMetaData == std::string("DROPPED")) dropMetaData_ = DropDroppedPrior;
73  else if(dropMetaData == std::string("PRIOR")) dropMetaData_ = DropPrior;
74  else if(dropMetaData == std::string("ALL")) dropMetaData_ = DropAll;
75  else {
76  throw edm::Exception(errors::Configuration, "Illegal dropMetaData parameter value: ")
77  << dropMetaData << ".\n"
78  << "Legal values are 'NONE', 'DROPPED', 'PRIOR', and 'ALL'.\n";
79  }
80 
81  if (!wantAllEvents()) {
83  }
84 
85  // We don't use this next parameter, but we read it anyway because it is part
86  // of the configuration of this module. An external parser creates the
87  // configuration by reading this source code.
88  pset.getUntrackedParameterSet("dataset");
89  }
std::string const compressionAlgorithm_
std::string const catalog_
DropMetaData const & dropMetaData() const
std::string const moduleLabel_
OutputItemListArray selectedOutputItemList_
std::unique_ptr< RootOutputFile > rootOutputFile_
unsigned int numberOfDigitsInIndex_
OutputModuleBase(ParameterSet const &pset)
unsigned int const maxFileSize_
std::string const fileName_
std::string const logicalFileName_
RootServiceChecker rootServiceChecker_
edm::PoolOutputModule::~PoolOutputModule ( )
virtual

Definition at line 239 of file PoolOutputModule.cc.

239  {
240  }
edm::PoolOutputModule::PoolOutputModule ( PoolOutputModule const &  )
delete

Member Function Documentation

AuxItemArray const& edm::PoolOutputModule::auxItems ( ) const
inline

Definition at line 66 of file PoolOutputModule.h.

References auxItems_.

Referenced by edm::RootOutputFile::RootOutputFile().

66 {return auxItems_;}
std::string const& edm::PoolOutputModule::basketOrder ( ) const
inline

Definition at line 44 of file PoolOutputModule.h.

References basketOrder_.

Referenced by edm::RootOutputFile::beginInputFile().

44 {return basketOrder_;}
int const& edm::PoolOutputModule::basketSize ( ) const
inline
void edm::PoolOutputModule::beginInputFile ( FileBlock const &  fb)
private

Definition at line 196 of file PoolOutputModule.cc.

References isFileOpen(), edm::one::OutputModuleBase::remainingEvents(), and rootOutputFile_.

Referenced by openFile(), and respondToOpenInputFile().

196  {
197  if(isFileOpen()) {
198  rootOutputFile_->beginInputFile(fb, remainingEvents());
199  }
200  }
std::unique_ptr< RootOutputFile > rootOutputFile_
virtual bool isFileOpen() const override
void edm::PoolOutputModule::beginJob ( void  )
overrideprivatevirtual

Reimplemented from edm::one::OutputModuleBase.

Definition at line 91 of file PoolOutputModule.cc.

References revisionDML::branchType(), edm::checkDictionaries(), edm::BranchDescription::fullClassName(), i, edm::InEvent, edm::one::OutputModuleBase::keptProducts(), edm::NumBranchTypes, parseEventContent::prod, and edm::wrappedClassName().

91  {
92  for(int i = InEvent; i < NumBranchTypes; ++i) {
93  BranchType branchType = static_cast<BranchType>(i);
94  SelectedProducts const& keptVector = keptProducts()[branchType];
95  for(SelectedProducts::const_iterator it = keptVector.begin(), itEnd = keptVector.end(); it != itEnd; ++it) {
96  BranchDescription const& prod = **it;
97  checkDictionaries(prod.fullClassName(), true);
98  checkDictionaries(wrappedClassName(prod.fullClassName()), true);
99  }
100  }
101  }
int i
Definition: DBlmapReader.cc:9
BranchType
Definition: BranchType.h:11
void checkDictionaries(std::string const &name, bool noComponents=false)
SelectedProductsForBranchType const & keptProducts() const
std::string wrappedClassName(std::string const &iFullName)
std::vector< BranchDescription const * > SelectedProducts
std::string const& edm::PoolOutputModule::catalog ( ) const
inline

Definition at line 48 of file PoolOutputModule.h.

References catalog_.

Referenced by edm::RootOutputFile::RootOutputFile().

48 {return catalog_;}
std::string const catalog_
std::string const& edm::PoolOutputModule::compressionAlgorithm ( ) const
inline

Definition at line 40 of file PoolOutputModule.h.

References compressionAlgorithm_.

Referenced by edm::RootOutputFile::RootOutputFile().

40 {return compressionAlgorithm_;}
std::string const compressionAlgorithm_
int const& edm::PoolOutputModule::compressionLevel ( ) const
inline

Definition at line 39 of file PoolOutputModule.h.

References compressionLevel_.

39 {return compressionLevel_;}
std::string const & edm::PoolOutputModule::currentFileName ( ) const

Definition at line 103 of file PoolOutputModule.cc.

References rootOutputFile_.

Referenced by edm::TimeoutPoolOutputModule::shouldWeCloseFile().

103  {
104  return rootOutputFile_->fileName();
105  }
std::unique_ptr< RootOutputFile > rootOutputFile_
DropMetaData const& edm::PoolOutputModule::dropMetaData ( ) const
inline
int edm::PoolOutputModule::eventAutoFlushSize ( ) const
inline

Definition at line 42 of file PoolOutputModule.h.

References eventAutoFlushSize_.

Referenced by edm::RootOutputFile::RootOutputFile().

42 {return eventAutoFlushSize_;}
std::string const& edm::PoolOutputModule::fileName ( ) const
inline

Definition at line 37 of file PoolOutputModule.h.

References fileName_.

Referenced by reallyOpenFile().

37 {return fileName_;}
std::string const fileName_
void edm::PoolOutputModule::fillDescriptions ( ConfigurationDescriptions descriptions)
static

Definition at line 324 of file PoolOutputModule.cc.

References edm::ConfigurationDescriptions::add(), edm::ParameterSetDescription::addUntracked(), edm::OutputModule::fillDescription(), edm::ParameterSetDescription::setAllowAnything(), edm::ParameterSetDescription::setComment(), and AlCaHLTBitMon_QueryRunRegistry::string.

324  {
325  std::string defaultString;
327  desc.setComment("Writes runs, lumis, and events into EDM/ROOT files.");
328  desc.addUntracked<std::string>("fileName")
329  ->setComment("Name of output file.");
330  desc.addUntracked<std::string>("logicalFileName", defaultString)
331  ->setComment("Passed to job report. Otherwise unused by module.");
332  desc.addUntracked<std::string>("catalog", defaultString)
333  ->setComment("Passed to job report. Otherwise unused by module.");
334  desc.addUntracked<int>("maxSize", 0x7f000000)
335  ->setComment("Maximum output file size, in kB.\n"
336  "If over maximum, new output file will be started at next input file transition.");
337  desc.addUntracked<int>("compressionLevel", 7)
338  ->setComment("ROOT compression level of output file.");
339 #if ROOT_VERSION_CODE >= ROOT_VERSION(5,30,0)
340  desc.addUntracked<std::string>("compressionAlgorithm", "ZLIB")
341  ->setComment("Algorithm used to compress data in the ROOT output file, allowed values are ZLIB and LZMA");
342 #endif
343  desc.addUntracked<int>("basketSize", 16384)
344  ->setComment("Default ROOT basket size in output file.");
345  desc.addUntracked<int>("eventAutoFlushCompressedSize",-1)->setComment("Set ROOT auto flush stored data size (in bytes) for event TTree. The value sets how large the compressed buffer is allowed to get. The uncompressed buffer can be quite a bit larger than this depending on the average compression ratio. The value of -1 just uses ROOT's default value. The value of 0 turns off this feature.");
346  desc.addUntracked<int>("splitLevel", 99)
347  ->setComment("Default ROOT branch split level in output file.");
348  desc.addUntracked<std::string>("sortBaskets", std::string("sortbasketsbyoffset"))
349  ->setComment("Legal values: 'sortbasketsbyoffset', 'sortbasketsbybranch', 'sortbasketsbyentry'.\n"
350  "Used by ROOT when fast copying. Affects performance.");
351  desc.addUntracked<int>("treeMaxVirtualSize", -1)
352  ->setComment("Size of ROOT TTree TBasket cache. Affects performance.");
353  desc.addUntracked<bool>("fastCloning", true)
354  ->setComment("True: Allow fast copying, if possible.\n"
355  "False: Disable fast copying.");
356  desc.addUntracked<bool>("overrideInputFileSplitLevels", false)
357  ->setComment("False: Use branch split levels and basket sizes from input file, if possible.\n"
358  "True: Always use specified or default split levels and basket sizes.");
359  desc.addUntracked<bool>("writeStatusFile", false)
360  ->setComment("Write a status file. Intended for use by workflow management.");
361  desc.addUntracked<std::string>("dropMetaData", defaultString)
362  ->setComment("Determines handling of per product per event metadata. Options are:\n"
363  "'NONE': Keep all of it.\n"
364  "'DROPPED': Keep it for products produced in current process and all kept products. Drop it for dropped products produced in prior processes.\n"
365  "'PRIOR': Keep it for products produced in current process. Drop it for products produced in prior processes.\n"
366  "'ALL': Drop all of it.");
367  ParameterSetDescription dataSet;
368  dataSet.setAllowAnything();
369  desc.addUntracked<ParameterSetDescription>("dataset", dataSet)
370  ->setComment("PSet is only used by Data Operations and not by this module.");
371 
373 
374  descriptions.add("edmOutput", desc);
375  }
static void fillDescription(ParameterSetDescription &desc)
void edm::PoolOutputModule::fillSelectedItemList ( BranchType  branchtype,
TTree *  theInputTree 
)
private

Definition at line 155 of file PoolOutputModule.cc.

References auxItems_, basketSize(), edm::BranchDescription::basketSize(), edm::PoolOutputModule::AuxItem::basketSize_, edm::PoolOutputModule::OutputItem::basketSize_, edm::BranchDescription::branchName(), revisionDML::branchType(), edm::BranchTypeToAuxiliaryBranchName(), edm::BranchDescription::invalidBasketSize, edm::BranchDescription::invalidSplitLevel, edm::one::OutputModuleBase::keptProducts(), overrideInputFileSplitLevels_, parseEventContent::prod, edm::BranchDescription::produced(), selectedOutputItemList_, edm::sort_all(), splitLevel(), edm::BranchDescription::splitLevel(), and edm::PoolOutputModule::OutputItem::splitLevel_.

Referenced by respondToOpenInputFile().

155  {
156 
157  SelectedProducts const& keptVector = keptProducts()[branchType];
159  AuxItem& auxItem = auxItems_[branchType];
160 
161  // Fill AuxItem
162  if (theInputTree != 0 && !overrideInputFileSplitLevels_) {
163  TBranch* auxBranch = theInputTree->GetBranch(BranchTypeToAuxiliaryBranchName(branchType).c_str());
164  if (auxBranch) {
165  auxItem.basketSize_ = auxBranch->GetBasketSize();
166  } else {
167  auxItem.basketSize_ = basketSize_;
168  }
169  } else {
170  auxItem.basketSize_ = basketSize_;
171  }
172 
173  // Fill outputItemList with an entry for each branch.
174  for(SelectedProducts::const_iterator it = keptVector.begin(), itEnd = keptVector.end(); it != itEnd; ++it) {
177 
178  BranchDescription const& prod = **it;
179  TBranch* theBranch = ((!prod.produced() && theInputTree != 0 && !overrideInputFileSplitLevels_) ? theInputTree->GetBranch(prod.branchName().c_str()) : 0);
180 
181  if(theBranch != 0) {
182  splitLevel = theBranch->GetSplitLevel();
183  basketSize = theBranch->GetBasketSize();
184  } else {
185  splitLevel = (prod.splitLevel() == BranchDescription::invalidSplitLevel ? splitLevel_ : prod.splitLevel());
186  basketSize = (prod.basketSize() == BranchDescription::invalidBasketSize ? basketSize_ : prod.basketSize());
187  }
188  outputItemList.emplace_back(&prod, splitLevel, basketSize);
189  }
190 
191  // Sort outputItemList to allow fast copying.
192  // The branches in outputItemList must be in the same order as in the input tree, with all new branches at the end.
193  sort_all(outputItemList, OutputItem::Sorter(theInputTree));
194  }
std::string const & BranchTypeToAuxiliaryBranchName(BranchType const &branchType)
Definition: BranchType.cc:114
int const & basketSize() const
static int const invalidSplitLevel
static int const invalidBasketSize
std::vector< OutputItem > OutputItemList
OutputItemListArray selectedOutputItemList_
SelectedProductsForBranchType const & keptProducts() const
int const & splitLevel() const
void sort_all(RandomAccessSequence &s)
wrappers for std::sort
Definition: Algorithms.h:120
std::vector< BranchDescription const * > SelectedProducts
void edm::PoolOutputModule::finishEndFile ( )
private

Definition at line 287 of file PoolOutputModule.cc.

References rootOutputFile_.

Referenced by reallyCloseFile().

287 { rootOutputFile_->finishEndFile(); rootOutputFile_.reset(); }
std::unique_ptr< RootOutputFile > rootOutputFile_
int const& edm::PoolOutputModule::inputFileCount ( ) const
inline

Definition at line 51 of file PoolOutputModule.h.

References inputFileCount_.

Referenced by edm::RootOutputFile::beginInputFile().

bool edm::PoolOutputModule::isFileOpen ( ) const
overrideprivatevirtual

Reimplemented from edm::one::OutputModuleBase.

Definition at line 288 of file PoolOutputModule.cc.

References rootOutputFile_.

Referenced by beginInputFile(), and openFile().

288 { return rootOutputFile_.get() != 0; }
std::unique_ptr< RootOutputFile > rootOutputFile_
std::string const& edm::PoolOutputModule::logicalFileName ( ) const
inline

Definition at line 38 of file PoolOutputModule.h.

References logicalFileName_.

Referenced by reallyOpenFile().

38 {return logicalFileName_;}
std::string const logicalFileName_
unsigned int const& edm::PoolOutputModule::maxFileSize ( ) const
inline

Definition at line 50 of file PoolOutputModule.h.

References maxFileSize_.

Referenced by edm::RootOutputFile::shouldWeCloseFile().

50 {return maxFileSize_;}
unsigned int const maxFileSize_
std::string const& edm::PoolOutputModule::moduleLabel ( ) const
inline

Definition at line 49 of file PoolOutputModule.h.

References moduleLabel_.

Referenced by edm::RootOutputFile::RootOutputFile().

49 {return moduleLabel_;}
std::string const moduleLabel_
void edm::PoolOutputModule::openFile ( FileBlock const &  fb)
overrideprivatevirtual

Reimplemented from edm::one::OutputModuleBase.

Definition at line 202 of file PoolOutputModule.cc.

References beginInputFile(), isFileOpen(), and reallyOpenFile().

202  {
203  if(!isFileOpen()) {
204  reallyOpenFile();
206  }
207  }
virtual void reallyOpenFile() override
virtual bool isFileOpen() const override
void beginInputFile(FileBlock const &fb)
PoolOutputModule& edm::PoolOutputModule::operator= ( PoolOutputModule const &  )
delete
bool const& edm::PoolOutputModule::overrideInputFileSplitLevels ( ) const
inline
void edm::PoolOutputModule::postForkReacquireResources ( unsigned int  iChildIndex,
unsigned int  iNumberOfChildren 
)
overrideprivatevirtual

Reimplemented from edm::one::OutputModuleBase.

Definition at line 228 of file PoolOutputModule.cc.

References childIndex_, and numberOfDigitsInIndex_.

228  {
229  childIndex_ = iChildIndex;
230  while (iNumberOfChildren != 0) {
232  iNumberOfChildren /= 10;
233  }
234  if (numberOfDigitsInIndex_ == 0) {
235  numberOfDigitsInIndex_ = 3; // Protect against zero iNumberOfChildren
236  }
237  }
unsigned int numberOfDigitsInIndex_
void edm::PoolOutputModule::reallyCloseFile ( )
overrideprivatevirtual

Reimplemented from edm::one::OutputModuleBase.

Definition at line 259 of file PoolOutputModule.cc.

References finishEndFile(), startEndFile(), writeBranchIDListRegistry(), writeFileFormatVersion(), writeFileIdentifier(), writeIndexIntoFile(), writeParameterSetRegistry(), writeParentageRegistry(), writeProcessHistoryRegistry(), writeProductDependencies(), and writeProductDescriptionRegistry().

259  {
260  startEndFile();
270  finishEndFile();
271  }
void edm::PoolOutputModule::reallyOpenFile ( )
overrideprivatevirtual

Reimplemented from edm::one::OutputModuleBase.

Definition at line 291 of file PoolOutputModule.cc.

References childIndex_, relativeConstraints::empty, edm::hlt::Exception, fileName(), inputFileCount_, logicalFileName(), edm::errors::LogicError, numberOfDigitsInIndex_, evf::evtn::offset(), outputFileCount_, rootOutputFile_, AlCaHLTBitMon_QueryRunRegistry::string, and createPayload::suffix.

Referenced by openFile().

291  {
292  if(inputFileCount_ == 0) {
294  << "Attempt to open output file before input file. "
295  << "Please report this to the core framework developers.\n";
296  }
297  std::string suffix(".root");
299  bool ext = (offset == fileName().size() - suffix.size());
300  if(!ext) suffix.clear();
301  std::string fileBase(ext ? fileName().substr(0, offset) : fileName());
302  std::ostringstream ofilename;
303  std::ostringstream lfilename;
304  ofilename << fileBase;
305  lfilename << logicalFileName();
307  ofilename << '_' << std::setw(numberOfDigitsInIndex_) << std::setfill('0') << childIndex_;
308  if(!logicalFileName().empty()) {
309  lfilename << '_' << std::setw(numberOfDigitsInIndex_) << std::setfill('0') << childIndex_;
310  }
311  }
312  if(outputFileCount_) {
313  ofilename << std::setw(3) << std::setfill('0') << outputFileCount_;
314  if(!logicalFileName().empty()) {
315  lfilename << std::setw(3) << std::setfill('0') << outputFileCount_;
316  }
317  }
318  ofilename << suffix;
319  rootOutputFile_.reset(new RootOutputFile(this, ofilename.str(), lfilename.str()));
321  }
std::string const & fileName() const
uint16_t size_type
std::string const & logicalFileName() const
std::unique_ptr< RootOutputFile > rootOutputFile_
unsigned int offset(bool)
unsigned int numberOfDigitsInIndex_
void edm::PoolOutputModule::respondToCloseInputFile ( FileBlock const &  fb)
overrideprivatevirtual

Definition at line 224 of file PoolOutputModule.cc.

References rootOutputFile_.

224  {
225  if(rootOutputFile_) rootOutputFile_->respondToCloseInputFile(fb);
226  }
std::unique_ptr< RootOutputFile > rootOutputFile_
void edm::PoolOutputModule::respondToOpenInputFile ( FileBlock const &  fb)
overrideprivatevirtual

Definition at line 209 of file PoolOutputModule.cc.

References beginInputFile(), revisionDML::branchType(), fillSelectedItemList(), i, edm::InEvent, initializedFromInput_, edm::InLumi, inputFileCount_, edm::FileBlock::lumiTree(), edm::NumBranchTypes, edm::FileBlock::runTree(), and edm::FileBlock::tree().

209  {
210  if(!initializedFromInput_) {
211  for(int i = InEvent; i < NumBranchTypes; ++i) {
212  BranchType branchType = static_cast<BranchType>(i);
213  TTree* theInputTree = (branchType == InEvent ? fb.tree() :
214  (branchType == InLumi ? fb.lumiTree() :
215  fb.runTree()));
216  fillSelectedItemList(branchType, theInputTree);
217  }
218  initializedFromInput_ = true;
219  }
220  ++inputFileCount_;
222  }
int i
Definition: DBlmapReader.cc:9
BranchType
Definition: BranchType.h:11
void fillSelectedItemList(BranchType branchtype, TTree *theInputTree)
void beginInputFile(FileBlock const &fb)
OutputItemListArray const& edm::PoolOutputModule::selectedOutputItemList ( ) const
inline

Definition at line 100 of file PoolOutputModule.h.

References selectedOutputItemList_.

Referenced by edm::RootOutputFile::fillBranches(), and edm::RootOutputFile::RootOutputFile().

100 {return selectedOutputItemList_;}
OutputItemListArray selectedOutputItemList_
bool edm::PoolOutputModule::shouldWeCloseFile ( ) const
overrideprotectedvirtual

allow inheriting classes to override but still be able to call this method in the overridden version

Reimplemented from edm::one::OutputModuleBase.

Reimplemented in edm::TimeoutPoolOutputModule.

Definition at line 289 of file PoolOutputModule.cc.

References rootOutputFile_.

Referenced by edm::TimeoutPoolOutputModule::shouldWeCloseFile().

289 { return rootOutputFile_->shouldWeCloseFile(); }
std::unique_ptr< RootOutputFile > rootOutputFile_
int const& edm::PoolOutputModule::splitLevel ( ) const
inline

Definition at line 43 of file PoolOutputModule.h.

References splitLevel_.

Referenced by fillSelectedItemList().

43 {return splitLevel_;}
void edm::PoolOutputModule::startEndFile ( )
private

Definition at line 275 of file PoolOutputModule.cc.

Referenced by reallyCloseFile().

275 { }
int const& edm::PoolOutputModule::treeMaxVirtualSize ( ) const
inline

Definition at line 45 of file PoolOutputModule.h.

References treeMaxVirtualSize_.

45 {return treeMaxVirtualSize_;}
int const& edm::PoolOutputModule::whyNotFastClonable ( ) const
inline

Definition at line 52 of file PoolOutputModule.h.

References whyNotFastClonable_.

Referenced by edm::RootOutputFile::beginInputFile().

void edm::PoolOutputModule::write ( EventPrincipal const &  e,
ModuleCallingContext const *  mcc 
)
overrideprotectedvirtual

Implements edm::one::OutputModuleBase.

Reimplemented in edm::TimeoutPoolOutputModule.

Definition at line 242 of file PoolOutputModule.cc.

References edm::EventPrincipal::id(), rootOutputFile_, and statusFileName_.

Referenced by edm::TimeoutPoolOutputModule::write().

242  {
243  rootOutputFile_->writeOne(e, mcc);
244  if (!statusFileName_.empty()) {
245  std::ofstream statusFile(statusFileName_.c_str());
246  statusFile << e.id() << " time: " << std::setprecision(3) << TimeOfDay() << '\n';
247  statusFile.close();
248  }
249  }
std::unique_ptr< RootOutputFile > rootOutputFile_
void edm::PoolOutputModule::writeBranchIDListRegistry ( )
private

Definition at line 285 of file PoolOutputModule.cc.

References rootOutputFile_.

Referenced by reallyCloseFile().

285 { rootOutputFile_->writeBranchIDListRegistry(); }
std::unique_ptr< RootOutputFile > rootOutputFile_
void edm::PoolOutputModule::writeFileFormatVersion ( )
private

Definition at line 278 of file PoolOutputModule.cc.

References rootOutputFile_.

Referenced by reallyCloseFile().

278 { rootOutputFile_->writeFileFormatVersion(); }
std::unique_ptr< RootOutputFile > rootOutputFile_
void edm::PoolOutputModule::writeFileIdentifier ( )
private

Definition at line 279 of file PoolOutputModule.cc.

References rootOutputFile_.

Referenced by reallyCloseFile().

279 { rootOutputFile_->writeFileIdentifier(); }
std::unique_ptr< RootOutputFile > rootOutputFile_
void edm::PoolOutputModule::writeIndexIntoFile ( )
private

Definition at line 280 of file PoolOutputModule.cc.

References rootOutputFile_.

Referenced by reallyCloseFile().

280 { rootOutputFile_->writeIndexIntoFile(); }
std::unique_ptr< RootOutputFile > rootOutputFile_
void edm::PoolOutputModule::writeLuminosityBlock ( LuminosityBlockPrincipal const &  lb,
ModuleCallingContext const *  mcc 
)
overrideprivatevirtual

Implements edm::one::OutputModuleBase.

Definition at line 251 of file PoolOutputModule.cc.

References rootOutputFile_.

251  {
252  rootOutputFile_->writeLuminosityBlock(lb, mcc);
253  }
std::unique_ptr< RootOutputFile > rootOutputFile_
void edm::PoolOutputModule::writeParameterSetRegistry ( )
private

Definition at line 282 of file PoolOutputModule.cc.

References rootOutputFile_.

Referenced by reallyCloseFile().

282 { rootOutputFile_->writeParameterSetRegistry(); }
std::unique_ptr< RootOutputFile > rootOutputFile_
void edm::PoolOutputModule::writeParentageRegistry ( )
private

Definition at line 284 of file PoolOutputModule.cc.

References rootOutputFile_.

Referenced by reallyCloseFile().

284 { rootOutputFile_->writeParentageRegistry(); }
std::unique_ptr< RootOutputFile > rootOutputFile_
void edm::PoolOutputModule::writeProcessHistoryRegistry ( )
private

Definition at line 281 of file PoolOutputModule.cc.

References rootOutputFile_.

Referenced by reallyCloseFile().

281 { rootOutputFile_->writeProcessHistoryRegistry(); }
std::unique_ptr< RootOutputFile > rootOutputFile_
void edm::PoolOutputModule::writeProductDependencies ( )
private

Definition at line 286 of file PoolOutputModule.cc.

References rootOutputFile_.

Referenced by reallyCloseFile().

286 { rootOutputFile_->writeProductDependencies(); }
std::unique_ptr< RootOutputFile > rootOutputFile_
void edm::PoolOutputModule::writeProductDescriptionRegistry ( )
private

Definition at line 283 of file PoolOutputModule.cc.

References rootOutputFile_.

Referenced by reallyCloseFile().

283 { rootOutputFile_->writeProductDescriptionRegistry(); }
std::unique_ptr< RootOutputFile > rootOutputFile_
void edm::PoolOutputModule::writeRun ( RunPrincipal const &  r,
ModuleCallingContext const *  mcc 
)
overrideprivatevirtual

Implements edm::one::OutputModuleBase.

Definition at line 255 of file PoolOutputModule.cc.

References rootOutputFile_.

255  {
256  rootOutputFile_->writeRun(r, mcc);
257  }
std::unique_ptr< RootOutputFile > rootOutputFile_

Member Data Documentation

AuxItemArray edm::PoolOutputModule::auxItems_
private

Definition at line 134 of file PoolOutputModule.h.

Referenced by auxItems(), and fillSelectedItemList().

std::string edm::PoolOutputModule::basketOrder_
private

Definition at line 145 of file PoolOutputModule.h.

Referenced by basketOrder().

int const edm::PoolOutputModule::basketSize_
private

Definition at line 142 of file PoolOutputModule.h.

Referenced by basketSize().

std::string const edm::PoolOutputModule::catalog_
private

Definition at line 138 of file PoolOutputModule.h.

Referenced by catalog().

unsigned int edm::PoolOutputModule::childIndex_
private

Definition at line 153 of file PoolOutputModule.h.

Referenced by postForkReacquireResources(), and reallyOpenFile().

std::string const edm::PoolOutputModule::compressionAlgorithm_
private

Definition at line 141 of file PoolOutputModule.h.

Referenced by compressionAlgorithm().

int const edm::PoolOutputModule::compressionLevel_
private

Definition at line 140 of file PoolOutputModule.h.

Referenced by compressionLevel().

DropMetaData edm::PoolOutputModule::dropMetaData_
private

Definition at line 148 of file PoolOutputModule.h.

Referenced by dropMetaData(), and PoolOutputModule().

int const edm::PoolOutputModule::eventAutoFlushSize_
private

Definition at line 143 of file PoolOutputModule.h.

Referenced by eventAutoFlushSize().

std::string const edm::PoolOutputModule::fileName_
private

Definition at line 136 of file PoolOutputModule.h.

Referenced by fileName().

bool edm::PoolOutputModule::initializedFromInput_
private

Definition at line 150 of file PoolOutputModule.h.

Referenced by respondToOpenInputFile().

int edm::PoolOutputModule::inputFileCount_
private

Definition at line 152 of file PoolOutputModule.h.

Referenced by inputFileCount(), reallyOpenFile(), and respondToOpenInputFile().

std::string const edm::PoolOutputModule::logicalFileName_
private

Definition at line 137 of file PoolOutputModule.h.

Referenced by logicalFileName().

unsigned int const edm::PoolOutputModule::maxFileSize_
private

Definition at line 139 of file PoolOutputModule.h.

Referenced by maxFileSize().

std::string const edm::PoolOutputModule::moduleLabel_
private
unsigned int edm::PoolOutputModule::numberOfDigitsInIndex_
private

Definition at line 154 of file PoolOutputModule.h.

Referenced by postForkReacquireResources(), and reallyOpenFile().

int edm::PoolOutputModule::outputFileCount_
private

Definition at line 151 of file PoolOutputModule.h.

Referenced by reallyOpenFile().

bool edm::PoolOutputModule::overrideInputFileSplitLevels_
private

Definition at line 155 of file PoolOutputModule.h.

Referenced by fillSelectedItemList(), and overrideInputFileSplitLevels().

std::unique_ptr<RootOutputFile> edm::PoolOutputModule::rootOutputFile_
private
RootServiceChecker edm::PoolOutputModule::rootServiceChecker_
private

Definition at line 133 of file PoolOutputModule.h.

OutputItemListArray edm::PoolOutputModule::selectedOutputItemList_
private

Definition at line 135 of file PoolOutputModule.h.

Referenced by fillSelectedItemList(), and selectedOutputItemList().

int const edm::PoolOutputModule::splitLevel_
private

Definition at line 144 of file PoolOutputModule.h.

Referenced by splitLevel().

std::string edm::PoolOutputModule::statusFileName_
private

Definition at line 157 of file PoolOutputModule.h.

Referenced by PoolOutputModule(), and write().

int const edm::PoolOutputModule::treeMaxVirtualSize_
private

Definition at line 146 of file PoolOutputModule.h.

Referenced by treeMaxVirtualSize().

int edm::PoolOutputModule::whyNotFastClonable_
private

Definition at line 147 of file PoolOutputModule.h.

Referenced by PoolOutputModule(), and whyNotFastClonable().