CMS 3D CMS Logo

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

#include <RootOutputFile.h>

Public Types

typedef
PoolOutputModule::OutputItem 
OutputItem
 
typedef
PoolOutputModule::OutputItemList 
OutputItemList
 
typedef std::array
< RootOutputTree
*, NumBranchTypes
RootOutputTreePtrArray
 

Public Member Functions

void beginInputFile (FileBlock const &fb, int remainingEvents)
 
std::string const & fileName () const
 
void finishEndFile ()
 
void respondToCloseInputFile (FileBlock const &fb)
 
 RootOutputFile (PoolOutputModule *om, std::string const &fileName, std::string const &logicalFileName)
 
bool shouldWeCloseFile () const
 
void writeBranchIDListRegistry ()
 
void writeFileFormatVersion ()
 
void writeFileIdentifier ()
 
void writeIndexIntoFile ()
 
void writeLuminosityBlock (LuminosityBlockPrincipal const &lb, ModuleCallingContext const *)
 
void writeOne (EventPrincipal const &e, ModuleCallingContext const *)
 
void writeParameterSetRegistry ()
 
void writeParentageRegistry ()
 
void writeProcessHistoryRegistry ()
 
void writeProductDependencies ()
 
void writeProductDescriptionRegistry ()
 
void writeRun (RunPrincipal const &r, ModuleCallingContext const *)
 
void writeThinnedAssociationsHelper ()
 
 ~RootOutputFile ()
 

Private Member Functions

void fillBranches (BranchType const &branchType, Principal const &principal, StoredProductProvenanceVector *productProvenanceVecPtr, ModuleCallingContext const *)
 
void insertAncestors (ProductProvenance const &iGetParents, EventPrincipal const &principal, bool produced, std::set< StoredProductProvenance > &oToFill, ModuleCallingContext const *)
 
bool insertProductProvenance (const ProductProvenance &, std::set< StoredProductProvenance > &oToInsert)
 
void setBranchAliases (TTree *tree, SelectedProducts const &branches) const
 

Private Attributes

std::set< BranchIDbranchesWithStoredHistory_
 
bool canFastCloneAux_
 
bool dataTypeReported_
 
StoredProductProvenanceVector eventEntryInfoVector_
 
IndexIntoFile::EntryNumber_t eventEntryNumber_
 
RootOutputTree eventTree_
 
FileID fid_
 
std::string file_
 
std::shared_ptr< TFile > filePtr_
 
IndexIntoFile indexIntoFile_
 
std::string logicalFile_
 
LuminosityBlockAuxiliary lumiAux_
 
IndexIntoFile::EntryNumber_t lumiEntryNumber_
 
RootOutputTree lumiTree_
 
TTree * metaDataTree_
 
PoolOutputModule const * om_
 
TTree * parameterSetsTree_
 
std::map< ParentageID,
unsigned int > 
parentageIDs_
 
TTree * parentageTree_
 
BranchListIndexes const * pBranchListIndexes_
 
EventAuxiliary const * pEventAux_
 
StoredProductProvenanceVectorpEventEntryInfoVector_
 
EventSelectionIDVector const * pEventSelectionIDs_
 
LuminosityBlockAuxiliary const * pLumiAux_
 
ProcessHistoryRegistry processHistoryRegistry_
 
RunAuxiliary const * pRunAux_
 
JobReport::Token reportToken_
 
RunAuxiliary runAux_
 
IndexIntoFile::EntryNumber_t runEntryNumber_
 
RootOutputTree runTree_
 
RootOutputTreePtrArray treePointers_
 
int whyNotFastClonable_
 
TClass * wrapperBaseTClass_
 

Detailed Description

Definition at line 44 of file RootOutputFile.h.

Member Typedef Documentation

Definition at line 46 of file RootOutputFile.h.

Definition at line 47 of file RootOutputFile.h.

Definition at line 48 of file RootOutputFile.h.

Constructor & Destructor Documentation

edm::RootOutputFile::RootOutputFile ( PoolOutputModule om,
std::string const &  fileName,
std::string const &  logicalFileName 
)
explicit

Definition at line 79 of file RootOutputFile.cc.

References edm::RootOutputTree::addAuxiliary(), edm::RootOutputTree::addBranch(), edm::PoolOutputModule::auxItems(), branchesWithStoredHistory_, edm::poolNames::branchListIndexesBranchName(), edm::BranchDescription::branchName(), revisionDML::branchType(), edm::BranchTypeToAuxiliaryBranchName(), edm::BranchTypeToProductProvenanceBranchName(), edm::PoolOutputModule::catalog(), edm::PoolOutputModule::compressionAlgorithm(), edm::errors::Configuration, edm::createGlobalIdentifier(), cms::Digest::digest(), edm::PoolOutputModule::eventAutoFlushSize(), edm::poolNames::eventSelectionsBranchName(), eventTree_, Exception, fid_, file_, filePtr_, edm::BranchDescription::fullClassName(), i, edm::InEvent, edm::InLumi, edm::InRun, logicalFile_, lumiTree_, edm::RootOutputTree::makeTTree(), metaDataTree_, edm::poolNames::metaDataTreeName(), edm::PoolOutputModule::moduleLabel(), edm::BranchDescription::moduleLabel(), edm::moduleName(), edm::NumBranchTypes, om_, parameterSetsTree_, edm::poolNames::parameterSetsTreeName(), parentageTree_, edm::poolNames::parentageTreeName(), pBranchListIndexes_, pEventAux_, pEventEntryInfoVector_, pEventSelectionIDs_, pLumiAux_, edm::BranchDescription::processName(), edm::BranchDescription::productInstanceName(), pRunAux_, reportToken_, runTree_, edm::PoolOutputModule::selectedOutputItemList(), edm::RootOutputTree::setAutoFlush(), edm::sort_all(), AlCaHLTBitMon_QueryRunRegistry::string, cms::MD5Result::toString(), treePointers_, and edm::BranchDescription::wrappedName().

79  :
80  file_(fileName),
81  logicalFile_(logicalFileName),
82  reportToken_(0),
83  om_(om),
85  canFastCloneAux_(false),
86  filePtr_(openTFile(file_.c_str(), om_->compressionLevel())),
87  fid_(),
88  eventEntryNumber_(0LL),
89  lumiEntryNumber_(0LL),
90  runEntryNumber_(0LL),
92  metaDataTree_(nullptr),
93  parameterSetsTree_(nullptr),
94  parentageTree_(nullptr),
95  lumiAux_(),
96  runAux_(),
97  pEventAux_(nullptr),
99  pRunAux_(&runAux_),
102  pBranchListIndexes_(nullptr),
103  pEventSelectionIDs_(nullptr),
107  treePointers_(),
108  dataTypeReported_(false),
110  parentageIDs_(),
112  wrapperBaseTClass_(TClass::GetClass("edm::WrapperBase")) {
113 #if ROOT_VERSION_CODE >= ROOT_VERSION(5,30,0)
114  if (om_->compressionAlgorithm() == std::string("ZLIB")) {
115  filePtr_->SetCompressionAlgorithm(ROOT::kZLIB);
116  } else if (om_->compressionAlgorithm() == std::string("LZMA")) {
117  filePtr_->SetCompressionAlgorithm(ROOT::kLZMA);
118  } else {
119  throw Exception(errors::Configuration) << "PoolOutputModule configured with unknown compression algorithm '" << om_->compressionAlgorithm() << "'\n"
120  << "Allowed compression algorithms are ZLIB and LZMA\n";
121  }
122 #endif
123  if (-1 != om->eventAutoFlushSize()) {
124  eventTree_.setAutoFlush(-1*om->eventAutoFlushSize());
125  }
127  pEventAux_, om_->auxItems()[InEvent].basketSize_);
129  pEventEntryInfoVector_, om_->auxItems()[InEvent].basketSize_);
131  pEventSelectionIDs_, om_->auxItems()[InEvent].basketSize_,false);
133  pBranchListIndexes_, om_->auxItems()[InEvent].basketSize_);
134 
136  pLumiAux_, om_->auxItems()[InLumi].basketSize_);
137 
139  pRunAux_, om_->auxItems()[InRun].basketSize_);
140 
142  treePointers_[InLumi] = &lumiTree_;
143  treePointers_[InRun] = &runTree_;
144 
145  for(int i = InEvent; i < NumBranchTypes; ++i) {
146  BranchType branchType = static_cast<BranchType>(i);
147  RootOutputTree *theTree = treePointers_[branchType];
148  for(auto const& item : om_->selectedOutputItemList()[branchType]) {
149  item.product_ = nullptr;
150  BranchDescription const& desc = *item.branchDescription_;
151  theTree->addBranch(desc.branchName(),
152  desc.wrappedName(),
153  item.product_,
154  item.splitLevel_,
155  item.basketSize_,
156  item.branchDescription_->produced());
157  //make sure we always store product registry info for all branches we create
158  branchesWithStoredHistory_.insert(item.branchID());
159  }
160  }
161  // Don't split metadata tree or event description tree
165 
166  fid_ = FileID(createGlobalIdentifier());
167 
168  // For the Job Report, get a vector of branch names in the "Events" tree.
169  // Also create a hash of all the branch names in the "Events" tree
170  // in a deterministic order, except use the full class name instead of the friendly class name.
171  // To avoid extra string copies, we create a vector of pointers into the product registry,
172  // and use a custom comparison operator for sorting.
173  std::vector<std::string> branchNames;
174  std::vector<BranchDescription const*> branches;
175  branchNames.reserve(om_->selectedOutputItemList()[InEvent].size());
176  branches.reserve(om->selectedOutputItemList()[InEvent].size());
177  for(auto const& item : om_->selectedOutputItemList()[InEvent]) {
178  branchNames.push_back(item.branchDescription_->branchName());
179  branches.push_back(item.branchDescription_);
180  }
181  // Now sort the branches for the hash.
182  sort_all(branches, sorterForJobReportHash);
183  // Now, make a concatenated string.
184  std::ostringstream oss;
185  char const underscore = '_';
186  for(auto const& branch : branches) {
187  BranchDescription const& bd = *branch;
188  oss << bd.fullClassName() << underscore
189  << bd.moduleLabel() << underscore
190  << bd.productInstanceName() << underscore
191  << bd.processName() << underscore;
192  }
193  std::string stringrep = oss.str();
194  cms::Digest md5alg(stringrep);
195 
196  // Register the output file with the JobReport service
197  // and get back the token for it.
198  std::string moduleName = "PoolOutputModule";
199  Service<JobReport> reportSvc;
200  reportToken_ = reportSvc->outputFileOpened(
201  file_, logicalFile_, // PFN and LFN
202  om_->catalog(), // catalog
203  moduleName, // module class name
204  om_->moduleLabel(), // module label
205  fid_.fid(), // file id (guid)
206  std::string(), // data type (not yet known, so string is empty).
207  md5alg.digest().toString(), // branch hash
208  branchNames); // branch names being written
209  }
int i
Definition: DBlmapReader.cc:9
LuminosityBlockAuxiliary lumiAux_
std::string const & BranchTypeToAuxiliaryBranchName(BranchType const &branchType)
Definition: BranchType.cc:115
std::shared_ptr< TFile > filePtr_
std::string const & parentageTreeName()
Definition: BranchType.cc:159
std::string const & catalog() const
std::string const & moduleLabel() const
int const & compressionLevel() const
OutputItemListArray const & selectedOutputItemList() const
ProcessHistoryRegistry processHistoryRegistry_
std::string const & eventSelectionsBranchName()
Definition: BranchType.cc:243
void setAutoFlush(Long64_t size)
BranchType
Definition: BranchType.h:11
std::set< BranchID > branchesWithStoredHistory_
std::vector< EventSelectionID > EventSelectionIDVector
std::string const & parameterSetsTreeName()
Definition: BranchType.cc:251
std::string const & fileName() const
std::map< ParentageID, unsigned int > parentageIDs_
RootOutputTree eventTree_
std::vector< BranchListIndex > BranchListIndexes
std::string moduleName(Provenance const &provenance)
Definition: Provenance.cc:27
PoolOutputModule const * om_
std::string const & compressionAlgorithm() const
IndexIntoFile::EntryNumber_t eventEntryNumber_
LuminosityBlockAuxiliary const * pLumiAux_
std::string logicalFile_
int const & splitLevel() const
std::string const & metaDataTreeName()
Definition: BranchType.cc:168
static TTree * makeTTree(TFile *filePtr, std::string const &name, int splitLevel)
int const & whyNotFastClonable() const
EventSelectionIDVector const * pEventSelectionIDs_
StoredProductProvenanceVector * pEventEntryInfoVector_
void sort_all(RandomAccessSequence &s)
wrappers for std::sort
Definition: Algorithms.h:120
RootOutputTree runTree_
StoredProductProvenanceVector eventEntryInfoVector_
AuxItemArray const & auxItems() const
void addAuxiliary(std::string const &branchName, T const *&pAux, int bufSize, bool allowCloning=true)
std::vector< StoredProductProvenance > StoredProductProvenanceVector
IndexIntoFile indexIntoFile_
int const & treeMaxVirtualSize() const
IndexIntoFile::EntryNumber_t runEntryNumber_
EventAuxiliary const * pEventAux_
RunAuxiliary runAux_
std::string const & BranchTypeToProductProvenanceBranchName(BranchType const &BranchType)
Definition: BranchType.cc:131
std::string const & branchListIndexesBranchName()
Definition: BranchType.cc:247
RootOutputTreePtrArray treePointers_
BranchListIndexes const * pBranchListIndexes_
IndexIntoFile::EntryNumber_t lumiEntryNumber_
RootOutputTree lumiTree_
RunAuxiliary const * pRunAux_
JobReport::Token reportToken_
std::string createGlobalIdentifier()
edm::RootOutputFile::~RootOutputFile ( )
inline

Definition at line 51 of file RootOutputFile.h.

51 {}

Member Function Documentation

void edm::RootOutputFile::beginInputFile ( FileBlock const &  fb,
int  remainingEvents 
)

Definition at line 301 of file RootOutputFile.cc.

References assert(), edm::PoolOutputModule::basketOrder(), edm::FileBlock::BranchMismatch, edm::FileBlock::CanFastClone, canFastCloneAux_, edm::RootOutputTree::checkIfFastClonable(), edm::RootOutputTree::checkSplitLevelsAndBasketSizes(), eventTree_, Exception, file_, edm::FileBlock::fileName(), edm::PoolOutputModule::inputFileCount(), edm::match(), edm::RootOutputTree::maybeFastCloneTree(), edm::errors::MismatchedInputFiles, edm::FileBlock::NoRootInputSource, om_, edm::FileBlock::OutputMaxEventsTooSmall, edm::PoolOutputModule::overrideInputFileSplitLevels(), reportToken_, edm::FileBlock::SplitLevelMismatch, edm::FileBlock::tree(), edm::PoolOutputModule::whyNotFastClonable(), edm::FileBlock::whyNotFastClonable(), and whyNotFastClonable_.

301  {
302 
303  // Reset per input file information
305  canFastCloneAux_ = false;
306 
307  if(fb.tree() != nullptr) {
308 
309  whyNotFastClonable_ |= fb.whyNotFastClonable();
310 
311  if(remainingEvents >= 0 && remainingEvents < fb.tree()->GetEntries()) {
313  }
314 
316  if(!match) {
318  // We may be fast copying. We must disable fast copying if the split levels
319  // or basket sizes do not match.
321  } else {
322  // We are using the input split levels and basket sizes from the first input file
323  // for copied output branches. In this case, we throw an exception if any branches
324  // have different split levels or basket sizes in a subsequent input file.
325  // If the mismatch is in the first file, there is a bug somewhere, so we assert.
326  assert(om_->inputFileCount() > 1);
327  throw Exception(errors::MismatchedInputFiles, "RootOutputFile::beginInputFile()") <<
328  "Merge failure because input file " << file_ << " has different ROOT split levels or basket sizes\n" <<
329  "than previous files. To allow merging in splite of this, use the configuration parameter\n" <<
330  "overrideInputFileSplitLevels=cms.untracked.bool(True)\n" <<
331  "in every PoolOutputModule.\n";
332  }
333  }
334 
335  // Since this check can be time consuming, we do it only if we would otherwise fast clone.
337  if(!eventTree_.checkIfFastClonable(fb.tree())) {
339  }
340  }
341  // We now check if we can fast copy the auxiliary branches.
342  // We can do so only if we can otherwise fast copy,
343  // the input file has the current format (these branches are in the Events Tree),
344  // there are no newly dropped or produced products,
345  // no metadata has been dropped,
346  // ID's have not been modified,
347  // and the branch list indexes do not need modification.
348 
349  // Note: Fast copy of the EventProductProvenance branch is unsafe
350  // unless we can enforce that the parentage information for a fully copied
351  // output file will be the same as for the input file, with nothing dropped.
352  // This has never been enforced, and, withthe EDAlias feature, it may no longer
353  // work by accident.
354  // So, for now, we do not enable fast cloning of the non-product branches.
355 /*
356  Service<ConstProductRegistry> reg;
357  canFastCloneAux_ = (whyNotFastClonable_ == FileBlock::CanFastClone) &&
358  fb.fileFormatVersion().noMetaDataTrees() &&
359  !om_->hasNewlyDroppedBranch()[InEvent] &&
360  !fb.hasNewlyDroppedBranch()[InEvent] &&
361  om_->dropMetaData() == PoolOutputModule::DropNone &&
362  !reg->anyProductProduced() &&
363  !fb.modifiedIDs() &&
364  fb.branchListIndexesUnchanged();
365 */
366 
367  // Report the fast copying status.
368  Service<JobReport> reportSvc;
369  reportSvc->reportFastCopyingStatus(reportToken_, fb.fileName(), whyNotFastClonable_ == FileBlock::CanFastClone);
370  } else {
372  }
373 
375 
376  // Possibly issue warning or informational message if we haven't fast cloned.
377  if(fb.tree() != nullptr && whyNotFastClonable_ != FileBlock::CanFastClone) {
378  maybeIssueWarning(whyNotFastClonable_, fb.fileName(), file_);
379  }
380  }
bool const & overrideInputFileSplitLevels() const
bool checkSplitLevelsAndBasketSizes(TTree *inputTree) const
assert(m_qm.get())
bool checkIfFastClonable(TTree *inputTree) const
RootOutputTree eventTree_
PoolOutputModule const * om_
std::string const & basketOrder() const
int const & whyNotFastClonable() const
void maybeFastCloneTree(bool canFastClone, bool canFastCloneAux, TTree *tree, std::string const &option)
int const & inputFileCount() const
JobReport::Token reportToken_
std::string match(BranchDescription const &a, BranchDescription const &b, std::string const &fileName)
std::string const& edm::RootOutputFile::fileName ( ) const
inline

Definition at line 72 of file RootOutputFile.h.

References file_.

72 {return file_;}
void edm::RootOutputFile::fillBranches ( BranchType const &  branchType,
Principal const &  principal,
StoredProductProvenanceVector productProvenanceVecPtr,
ModuleCallingContext const *  mcc 
)
private

Definition at line 689 of file RootOutputFile.cc.

References assert(), branchesWithStoredHistory_, revisionDML::branchType(), edm::FileBlock::CanFastClone, compareJSON::const, CommonMethods::cp(), edm::PoolOutputModule::DropDroppedPrior, edm::PoolOutputModule::dropMetaData(), edm::PoolOutputModule::DropNone, edm::PoolOutputModule::DropPrior, read312RV_cfg::fastCloning, edm::Principal::getForOutput(), edm::getWrapperBasePtr(), edm::InEvent, insertAncestors(), insertProductProvenance(), hltrates_dqm_sourceclient-live_cfg::offset, om_, AlCaHLTBitMon_ParallelJobs::p, cmsRelvalreport::principal(), edm::es::produced, edm::OutputHandle::productProvenance(), edm::PoolOutputModule::selectedOutputItemList(), treePointers_, whyNotFastClonable_, edm::OutputHandle::wrapper(), and wrapperBaseTClass_.

Referenced by writeLuminosityBlock(), writeOne(), and writeRun().

693  {
694 
695  std::vector<std::unique_ptr<WrapperBase> > dummies;
696 
698 
700 
701  std::set<StoredProductProvenance> provenanceToKeep;
702 
703  // Loop over EDProduct branches, fill the provenance, and write the branch.
704  for(auto const& item : items) {
705 
706  BranchID const& id = item.branchDescription_->branchID();
707  branchesWithStoredHistory_.insert(id);
708 
709  bool produced = item.branchDescription_->produced();
710  bool keepProvenance = productProvenanceVecPtr != nullptr &&
714  bool getProd = (produced || !fastCloning ||
715  treePointers_[branchType]->uncloned(item.branchDescription_->branchName()));
716 
717  WrapperBase const* product = nullptr;
718  OutputHandle const oh = principal.getForOutput(id, getProd, mcc);
719  if(keepProvenance && oh.productProvenance()) {
720  insertProductProvenance(*oh.productProvenance(),provenanceToKeep);
721  //provenanceToKeep.insert(*oh.productProvenance());
722  EventPrincipal const& eventPrincipal = dynamic_cast<EventPrincipal const&>(principal);
723  assert(eventPrincipal.productProvenanceRetrieverPtr());
724  insertAncestors(*oh.productProvenance(), eventPrincipal, produced, provenanceToKeep, mcc);
725  }
726  product = oh.wrapper();
727  if(getProd) {
728  if(product == nullptr) {
729  // No product with this ID is in the event.
730  // Add a null product.
731  TClass* cp = TClass::GetClass(item.branchDescription_->wrappedName().c_str());
732  int offset = cp->GetBaseClassOffset(wrapperBaseTClass_);
733  void* p = cp->New();
734  std::unique_ptr<WrapperBase> dummy = getWrapperBasePtr(p, offset);
735  product = dummy.get();
736  dummies.emplace_back(std::move(dummy));
737  }
738  item.product_ = product;
739  }
740  }
741 
742  if(productProvenanceVecPtr != nullptr) productProvenanceVecPtr->assign(provenanceToKeep.begin(), provenanceToKeep.end());
743  treePointers_[branchType]->fillTree();
744  if(productProvenanceVecPtr != nullptr) productProvenanceVecPtr->clear();
745  }
DropMetaData const & dropMetaData() const
assert(m_qm.get())
OutputItemListArray const & selectedOutputItemList() const
std::set< BranchID > branchesWithStoredHistory_
PoolOutputModule const * om_
void insertAncestors(ProductProvenance const &iGetParents, EventPrincipal const &principal, bool produced, std::set< StoredProductProvenance > &oToFill, ModuleCallingContext const *)
PoolOutputModule::OutputItemList OutputItemList
eventsetup::produce::Produce produced
Definition: ESProducts.cc:20
string const
Definition: compareJSON.py:14
bool insertProductProvenance(const ProductProvenance &, std::set< StoredProductProvenance > &oToInsert)
std::unique_ptr< WrapperBase > getWrapperBasePtr(void *p, int offset)
RootOutputTreePtrArray treePointers_
void edm::RootOutputFile::finishEndFile ( )

Definition at line 612 of file RootOutputFile.cc.

References revisionDML::branchType(), filePtr_, i, edm::InEvent, edm::one::OutputModuleBase::keptProducts(), metaDataTree_, edm::NumBranchTypes, om_, parameterSetsTree_, parentageTree_, reportToken_, setBranchAliases(), MainPageGenerator::tree, treePointers_, and edm::RootOutputTree::writeTTree().

612  {
613  metaDataTree_->SetEntries(-1);
616 
618 
619  // Create branch aliases for all the branches in the
620  // events/lumis/runs trees. The loop is over all types of data
621  // products.
622  for(int i = InEvent; i < NumBranchTypes; ++i) {
623  BranchType branchType = static_cast<BranchType>(i);
625  treePointers_[branchType]->writeTree();
626  }
627 
628  // close the file -- mfp
629  // Just to play it safe, zero all pointers to objects in the TFile to be closed.
630  metaDataTree_ = parentageTree_ = nullptr;
631  for(auto& treePointer : treePointers_) {
632  treePointer->close();
633  treePointer = nullptr;
634  }
635  filePtr_->Close();
636  filePtr_.reset();
637 
638  // report that file has been closed
639  Service<JobReport> reportSvc;
640  reportSvc->outputFileClosed(reportToken_);
641 
642  }
int i
Definition: DBlmapReader.cc:9
std::shared_ptr< TFile > filePtr_
BranchType
Definition: BranchType.h:11
PoolOutputModule const * om_
SelectedProductsForBranchType const & keptProducts() const
void setBranchAliases(TTree *tree, SelectedProducts const &branches) const
static void writeTTree(TTree *tree)
RootOutputTreePtrArray treePointers_
JobReport::Token reportToken_
void edm::RootOutputFile::insertAncestors ( ProductProvenance const &  iGetParents,
EventPrincipal const &  principal,
bool  produced,
std::set< StoredProductProvenance > &  oToFill,
ModuleCallingContext const *  mcc 
)
private

Definition at line 664 of file RootOutputFile.cc.

References assert(), branchesWithStoredHistory_, edm::ProductProvenance::branchID(), edm::ProductProvenanceRetriever::branchIDToProvenance(), edm::PoolOutputModule::DropAll, edm::PoolOutputModule::DropDroppedPrior, edm::PoolOutputModule::dropMetaData(), edm::PoolOutputModule::DropNone, edm::PoolOutputModule::DropPrior, edm::EventPrincipal::getProvenance(), info(), insertProductProvenance(), om_, edm::ProductProvenance::parentage(), edm::Parentage::parents(), edm::es::produced, and edm::EventPrincipal::productProvenanceRetrieverPtr().

Referenced by fillBranches().

668  {
672  ProductProvenanceRetriever const& iMapper = *principal.productProvenanceRetrieverPtr();
673  std::vector<BranchID> const& parentIDs = iGetParents.parentage().parents();
674  for(auto const& parentID : parentIDs) {
675  branchesWithStoredHistory_.insert(parentID);
676  ProductProvenance const* info = iMapper.branchIDToProvenance(parentID);
677  if(info) {
679  principal.getProvenance(info->branchID(), mcc).product().produced()) {
680  if(insertProductProvenance(*info,oToFill) ) {
681  //haven't seen this one yet
682  insertAncestors(*info, principal, produced, oToFill, mcc);
683  }
684  }
685  }
686  }
687  }
static const TGPicture * info(bool iBackgroundIsBlack)
DropMetaData const & dropMetaData() const
assert(m_qm.get())
std::set< BranchID > branchesWithStoredHistory_
PoolOutputModule const * om_
void insertAncestors(ProductProvenance const &iGetParents, EventPrincipal const &principal, bool produced, std::set< StoredProductProvenance > &oToFill, ModuleCallingContext const *)
eventsetup::produce::Produce produced
Definition: ESProducts.cc:20
bool insertProductProvenance(const ProductProvenance &, std::set< StoredProductProvenance > &oToInsert)
bool edm::RootOutputFile::insertProductProvenance ( const ProductProvenance ,
std::set< StoredProductProvenance > &  oToInsert 
)
private

Definition at line 748 of file RootOutputFile.cc.

References edm::ProductProvenance::branchID(), edm::StoredProductProvenance::branchID_, Exception, i, edm::BranchID::id(), edm::errors::LogicError, edm::ProductProvenance::parentageID(), edm::StoredProductProvenance::parentageIDIndex_, and parentageIDs_.

Referenced by fillBranches(), and insertAncestors().

749  {
750  StoredProductProvenance toStore;
751  toStore.branchID_ = iProv.branchID().id();
752  std::set<edm::StoredProductProvenance>::iterator itFound = oToInsert.find(toStore);
753  if(itFound == oToInsert.end()) {
754  //get the index to the ParentageID or insert a new value if not already present
755  std::pair<std::map<edm::ParentageID,unsigned int>::iterator,bool> i = parentageIDs_.insert(std::make_pair(iProv.parentageID(),static_cast<unsigned int>(parentageIDs_.size())));
756  toStore.parentageIDIndex_ = i.first->second;
757  if(toStore.parentageIDIndex_ >= parentageIDs_.size()) {
759  << "RootOutputFile::insertProductProvenance\n"
760  << "The parentage ID index value " << toStore.parentageIDIndex_ << " is out of bounds. The maximum value is currently " << parentageIDs_.size()-1 << ".\n"
761  << "This should never happen.\n"
762  << "Please report this to the framework hypernews forum 'hn-cms-edmFramework@cern.ch'.\n";
763  }
764 
765  oToInsert.insert(toStore);
766  return true;
767  }
768  return false;
769  }
int i
Definition: DBlmapReader.cc:9
std::map< ParentageID, unsigned int > parentageIDs_
void edm::RootOutputFile::respondToCloseInputFile ( FileBlock const &  fb)

Definition at line 382 of file RootOutputFile.cc.

References eventTree_, lumiTree_, runTree_, and edm::RootOutputTree::setEntries().

382  {
386  }
RootOutputTree eventTree_
RootOutputTree runTree_
RootOutputTree lumiTree_
void edm::RootOutputFile::setBranchAliases ( TTree *  tree,
SelectedProducts const &  branches 
) const
private

Definition at line 645 of file RootOutputFile.cc.

References HLT_25ns14e33_v1_cff::alias, edm::BranchDescription::branchAliases(), edm::BranchDescription::branchName(), full, edm::BranchDescription::moduleLabel(), edm::BranchDescription::productInstanceName(), corrVsCorr::selection, and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by finishEndFile().

645  {
646  if(tree && tree->GetNbranches() != 0) {
647  for(auto const& selection : branches) {
648  BranchDescription const& pd = *selection;
649  std::string const& full = pd.branchName() + "obj";
650  if(pd.branchAliases().empty()) {
651  std::string const& alias =
652  (pd.productInstanceName().empty() ? pd.moduleLabel() : pd.productInstanceName());
653  tree->SetAlias(alias.c_str(), full.c_str());
654  } else {
655  for(auto const& alias : pd.branchAliases()) {
656  tree->SetAlias(alias.c_str(), full.c_str());
657  }
658  }
659  }
660  }
661  }
selection
main part
Definition: corrVsCorr.py:98
Definition: GenABIO.cc:180
bool edm::RootOutputFile::shouldWeCloseFile ( ) const

Definition at line 388 of file RootOutputFile.cc.

References filePtr_, edm::PoolOutputModule::maxFileSize(), om_, and findQualityFiles::size.

388  {
389  unsigned int const oneK = 1024;
390  Long64_t size = filePtr_->GetSize()/oneK;
391  return(size >= om_->maxFileSize());
392  }
std::shared_ptr< TFile > filePtr_
unsigned int const & maxFileSize() const
PoolOutputModule const * om_
tuple size
Write out results.
void edm::RootOutputFile::writeBranchIDListRegistry ( )

Definition at line 546 of file RootOutputFile.cc.

References assert(), b, edm::PoolOutputModule::basketSize(), edm::poolNames::branchIDListBranchName(), edm::one::OutputModuleBase::branchIDLists(), metaDataTree_, om_, and AlCaHLTBitMon_ParallelJobs::p.

546  {
547  BranchIDLists const* p = om_->branchIDLists();
548  TBranch* b = metaDataTree_->Branch(poolNames::branchIDListBranchName().c_str(), &p, om_->basketSize(), 0);
549  assert(b);
550  b->Fill();
551  }
BranchIDLists const * branchIDLists() const
int const & basketSize() const
std::vector< BranchIDList > BranchIDLists
Definition: BranchIDList.h:19
assert(m_qm.get())
PoolOutputModule const * om_
double b
Definition: hdecay.h:120
std::string const & branchIDListBranchName()
Definition: BranchType.cc:208
void edm::RootOutputFile::writeFileFormatVersion ( )

Definition at line 503 of file RootOutputFile.cc.

References assert(), b, edm::PoolOutputModule::basketSize(), edm::poolNames::fileFormatVersionBranchName(), edm::getFileFormatVersion(), metaDataTree_, and om_.

503  {
504  FileFormatVersion fileFormatVersion(getFileFormatVersion());
505  FileFormatVersion* pFileFmtVsn = &fileFormatVersion;
506  TBranch* b = metaDataTree_->Branch(poolNames::fileFormatVersionBranchName().c_str(), &pFileFmtVsn, om_->basketSize(), 0);
507  assert(b);
508  b->Fill();
509  }
int const & basketSize() const
assert(m_qm.get())
std::string const & fileFormatVersionBranchName()
Definition: BranchType.cc:218
PoolOutputModule const * om_
int getFileFormatVersion()
double b
Definition: hdecay.h:120
void edm::RootOutputFile::writeFileIdentifier ( )

Definition at line 511 of file RootOutputFile.cc.

References assert(), b, edm::PoolOutputModule::basketSize(), fid_, edm::poolNames::fileIdentifierBranchName(), metaDataTree_, and om_.

511  {
512  FileID* fidPtr = &fid_;
513  TBranch* b = metaDataTree_->Branch(poolNames::fileIdentifierBranchName().c_str(), &fidPtr, om_->basketSize(), 0);
514  assert(b);
515  b->Fill();
516  }
int const & basketSize() const
assert(m_qm.get())
PoolOutputModule const * om_
double b
Definition: hdecay.h:120
std::string const & fileIdentifierBranchName()
Definition: BranchType.cc:223
void edm::RootOutputFile::writeIndexIntoFile ( )

Definition at line 518 of file RootOutputFile.cc.

References cms::Exception::addContext(), assert(), b, edm::PoolOutputModule::basketSize(), edm::RootOutputTree::checkEntriesInReadBranches(), eventEntryNumber_, eventTree_, indexIntoFile_, edm::poolNames::indexIntoFileBranchName(), metaDataTree_, om_, edm::errors::OtherCMS, and edm::IndexIntoFile::sortVector_Run_Or_Lumi_Entries().

518  {
521  ex << "The number of entries in at least one output TBranch whose entries\n"
522  "were copied from the input does not match the number of events\n"
523  "recorded in IndexIntoFile. This might (or might not) indicate a\n"
524  "problem related to fast copy.";
525  ex.addContext("Calling RootOutputFile::writeIndexIntoFile");
526  throw ex;
527  }
529  IndexIntoFile* iifPtr = &indexIntoFile_;
530  TBranch* b = metaDataTree_->Branch(poolNames::indexIntoFileBranchName().c_str(), &iifPtr, om_->basketSize(), 0);
531  assert(b);
532  b->Fill();
533  }
int const & basketSize() const
assert(m_qm.get())
void sortVector_Run_Or_Lumi_Entries()
RootOutputTree eventTree_
PoolOutputModule const * om_
IndexIntoFile::EntryNumber_t eventEntryNumber_
std::string const & indexIntoFileBranchName()
Definition: BranchType.cc:233
bool checkEntriesInReadBranches(Long64_t expectedNumberOfEntries) const
double b
Definition: hdecay.h:120
IndexIntoFile indexIntoFile_
void edm::RootOutputFile::writeLuminosityBlock ( LuminosityBlockPrincipal const &  lb,
ModuleCallingContext const *  mcc 
)

Definition at line 439 of file RootOutputFile.cc.

References edm::IndexIntoFile::addEntry(), edm::LuminosityBlockPrincipal::aux(), fillBranches(), edm::LuminosityBlockPrincipal::id(), indexIntoFile_, edm::InLumi, lumiAux_, lumiEntryNumber_, edm::LuminosityBlockID::luminosityBlock(), edm::LuminosityBlockAuxiliary::luminosityBlock(), lumiTree_, edm::RootOutputTree::optimizeBaskets(), edm::Principal::processHistory(), edm::Principal::processHistoryID(), processHistoryRegistry_, edm::ProcessHistoryRegistry::reducedProcessHistoryID(), edm::ProcessHistoryRegistry::registerProcessHistory(), reportToken_, edm::LuminosityBlockID::run(), edm::LuminosityBlockAuxiliary::run(), and edm::LuminosityBlockAuxiliary::setProcessHistoryID().

439  {
440  // Auxiliary branch
441  // NOTE: lumiAux_ must be filled before calling fillBranches since it gets written out in that routine.
442  lumiAux_ = lb.aux();
443  // Use the updated process historyID
444  lumiAux_.setProcessHistoryID(lb.processHistoryID());
445  // Store the process history.
446  processHistoryRegistry_.registerProcessHistory(lb.processHistory());
447  // Store the reduced ID in the IndexIntoFile
448  ProcessHistoryID reducedPHID = processHistoryRegistry_.reducedProcessHistoryID(lb.processHistoryID());
449  // Add lumi to index.
452  fillBranches(InLumi, lb, nullptr, mcc);
453  lumiTree_.optimizeBaskets(10ULL*1024*1024);
454 
455  Service<JobReport> reportSvc;
456  reportSvc->reportLumiSection(reportToken_, lb.id().run(), lb.id().luminosityBlock());
457  }
void fillBranches(BranchType const &branchType, Principal const &principal, StoredProductProvenanceVector *productProvenanceVecPtr, ModuleCallingContext const *)
LuminosityBlockAuxiliary lumiAux_
bool registerProcessHistory(ProcessHistory const &processHistory)
ProcessHistoryRegistry processHistoryRegistry_
ProcessHistoryID const & reducedProcessHistoryID(ProcessHistoryID const &fullID) const
void setProcessHistoryID(ProcessHistoryID const &phid)
LuminosityBlockNumber_t luminosityBlock() const
void addEntry(ProcessHistoryID const &processHistoryID, RunNumber_t run, LuminosityBlockNumber_t lumi, EventNumber_t event, EntryNumber_t entry)
Hash< ProcessHistoryType > ProcessHistoryID
IndexIntoFile indexIntoFile_
IndexIntoFile::EntryNumber_t lumiEntryNumber_
RootOutputTree lumiTree_
void optimizeBaskets(ULong64_t size)
JobReport::Token reportToken_
void edm::RootOutputFile::writeOne ( EventPrincipal const &  e,
ModuleCallingContext const *  mcc 
)

Definition at line 394 of file RootOutputFile.cc.

References edm::IndexIntoFile::addEntry(), assert(), edm::EventPrincipal::aux(), edm::EventPrincipal::branchListIndexes(), dtTPAnalyzer_cfg::dataType, dataTypeReported_, edm::EventID::event(), edm::EventAuxiliary::event(), eventEntryNumber_, edm::EventPrincipal::eventSelectionIDs(), fillBranches(), edm::EventPrincipal::id(), indexIntoFile_, edm::InEvent, edm::EventAuxiliary::isRealData(), edm::EventAuxiliary::luminosityBlock(), om_, pBranchListIndexes_, pEventAux_, pEventEntryInfoVector_, pEventSelectionIDs_, edm::Principal::processHistory(), edm::EventAuxiliary::processHistoryID(), edm::Principal::processHistoryID(), processHistoryRegistry_, edm::ProcessHistoryRegistry::reducedProcessHistoryID(), edm::ProcessHistoryRegistry::registerProcessHistory(), reportToken_, edm::EventID::run(), edm::EventAuxiliary::run(), edm::one::OutputModuleBase::selectorConfig(), AlCaHLTBitMon_QueryRunRegistry::string, and edm::one::OutputModuleBase::wantAllEvents().

395  {
396  // Auxiliary branch
397  pEventAux_ = &e.aux();
398 
399  // Because getting the data may cause an exception to be thrown we want to do that
400  // first before writing anything to the file about this event
401  // NOTE: pEventAux_, pBranchListIndexes_, pEventSelectionIDs_, and pEventEntryInfoVector_
402  // must be set before calling fillBranches since they get written out in that routine.
403  assert(pEventAux_->processHistoryID() == e.processHistoryID());
404  pBranchListIndexes_ = &e.branchListIndexes();
405 
406  // Note: The EventSelectionIDVector should have a one to one correspondence with the processes in the process history.
407  // Therefore, a new entry should be added if and only if the current process has been added to the process history,
408  // which is done if and only if there is a produced product.
410  EventSelectionIDVector esids = e.eventSelectionIDs();
411  if (reg->anyProductProduced() || !om_->wantAllEvents()) {
412  esids.push_back(om_->selectorConfig());
413  }
414  pEventSelectionIDs_ = &esids;
416 
417  // Add the dataType to the job report if it hasn't already been done
418  if(!dataTypeReported_) {
419  Service<JobReport> reportSvc;
420  std::string dataType("MC");
421  if(pEventAux_->isRealData()) dataType = "Data";
422  reportSvc->reportDataType(reportToken_, dataType);
423  dataTypeReported_ = true;
424  }
425 
426  // Store the process history.
428  // Store the reduced ID in the IndexIntoFile
429  ProcessHistoryID reducedPHID = processHistoryRegistry_.reducedProcessHistoryID(e.processHistoryID());
430  // Add event to index
433 
434  // Report event written
435  Service<JobReport> reportSvc;
436  reportSvc->eventWrittenToFile(reportToken_, e.id().run(), e.id().event());
437  }
void fillBranches(BranchType const &branchType, Principal const &principal, StoredProductProvenanceVector *productProvenanceVecPtr, ModuleCallingContext const *)
bool isRealData() const
assert(m_qm.get())
bool registerProcessHistory(ProcessHistory const &processHistory)
RunNumber_t run() const
ProcessHistoryRegistry processHistoryRegistry_
ParameterSetID selectorConfig() const
std::vector< EventSelectionID > EventSelectionIDVector
LuminosityBlockNumber_t luminosityBlock() const
PoolOutputModule const * om_
IndexIntoFile::EntryNumber_t eventEntryNumber_
ProcessHistoryID const & reducedProcessHistoryID(ProcessHistoryID const &fullID) const
void addEntry(ProcessHistoryID const &processHistoryID, RunNumber_t run, LuminosityBlockNumber_t lumi, EventNumber_t event, EntryNumber_t entry)
Hash< ProcessHistoryType > ProcessHistoryID
EventSelectionIDVector const * pEventSelectionIDs_
StoredProductProvenanceVector * pEventEntryInfoVector_
IndexIntoFile indexIntoFile_
ProcessHistoryID const & processHistoryID() const
EventAuxiliary const * pEventAux_
BranchListIndexes const * pBranchListIndexes_
EventNumber_t event() const
JobReport::Token reportToken_
void edm::RootOutputFile::writeParameterSetRegistry ( )

Definition at line 560 of file RootOutputFile.cc.

References b, edm::PoolOutputModule::basketSize(), edm::poolNames::idToParameterSetBlobsBranchName(), edm::pset::Registry::instance(), om_, and parameterSetsTree_.

560  {
561  std::pair<ParameterSetID, ParameterSetBlob> idToBlob;
562  std::pair<ParameterSetID, ParameterSetBlob>* pIdToBlob = &idToBlob;
563  TBranch* b = parameterSetsTree_->Branch(poolNames::idToParameterSetBlobsBranchName().c_str(),&pIdToBlob,om_->basketSize(), 0);
564 
565  for(auto const& pset : *pset::Registry::instance()) {
566  idToBlob.first = pset.first;
567  idToBlob.second.pset() = pset.second.toString();
568 
569  b->Fill();
570  }
571  }
std::string const & idToParameterSetBlobsBranchName()
Definition: BranchType.cc:255
int const & basketSize() const
PoolOutputModule const * om_
double b
Definition: hdecay.h:120
static Registry * instance()
Definition: Registry.cc:16
void edm::RootOutputFile::writeParentageRegistry ( )

Definition at line 479 of file RootOutputFile.cc.

References edm::PoolOutputModule::basketSize(), Exception, edm::errors::FatalRootError, edm::ParentageRegistry::getMapped(), edm::ParentageRegistry::instance(), om_, edm::poolNames::parentageBranchName(), parentageIDs_, and parentageTree_.

479  {
480  Parentage const* desc(nullptr);
481 
482  if(!parentageTree_->Branch(poolNames::parentageBranchName().c_str(),
483  &desc, om_->basketSize(), 0))
485  << "Failed to create a branch for Parentages in the output file";
486 
487  ParentageRegistry& ptReg = *ParentageRegistry::instance();
488 
489  std::vector<ParentageID> orderedIDs(parentageIDs_.size());
490  for(auto const& parentageID : parentageIDs_) {
491  orderedIDs[parentageID.second] = parentageID.first;
492  }
493  //now put them into the TTree in the correct order
494  for(auto const& orderedID : orderedIDs) {
495  desc = ptReg.getMapped(orderedID);
496  //NOTE: some old format files have missing Parentage info
497  // so a null value of desc can't be fatal.
498  // Root will default construct an object in that case.
499  parentageTree_->Fill();
500  }
501  }
int const & basketSize() const
std::map< ParentageID, unsigned int > parentageIDs_
PoolOutputModule const * om_
std::string const & parentageBranchName()
Definition: BranchType.cc:163
static ParentageRegistry * instance()
void edm::RootOutputFile::writeProcessHistoryRegistry ( )

Definition at line 535 of file RootOutputFile.cc.

References assert(), b, edm::PoolOutputModule::basketSize(), metaDataTree_, om_, AlCaHLTBitMon_ParallelJobs::p, edm::poolNames::processHistoryBranchName(), and processHistoryRegistry_.

535  {
536  ProcessHistoryVector procHistoryVector;
537  for(auto const& ph : processHistoryRegistry_) {
538  procHistoryVector.push_back(ph.second);
539  }
540  ProcessHistoryVector* p = &procHistoryVector;
541  TBranch* b = metaDataTree_->Branch(poolNames::processHistoryBranchName().c_str(), &p, om_->basketSize(), 0);
542  assert(b);
543  b->Fill();
544  }
std::vector< ProcessHistory > ProcessHistoryVector
int const & basketSize() const
assert(m_qm.get())
ProcessHistoryRegistry processHistoryRegistry_
PoolOutputModule const * om_
std::string const & processHistoryBranchName()
Definition: BranchType.cc:198
double b
Definition: hdecay.h:120
void edm::RootOutputFile::writeProductDependencies ( )

Definition at line 604 of file RootOutputFile.cc.

References assert(), b, edm::PoolOutputModule::basketSize(), edm::one::OutputModuleBase::branchChildren(), metaDataTree_, om_, and edm::poolNames::productDependenciesBranchName().

604  {
605  BranchChildren& pDeps = const_cast<BranchChildren&>(om_->branchChildren());
606  BranchChildren* ppDeps = &pDeps;
607  TBranch* b = metaDataTree_->Branch(poolNames::productDependenciesBranchName().c_str(), &ppDeps, om_->basketSize(), 0);
608  assert(b);
609  b->Fill();
610  }
int const & basketSize() const
assert(m_qm.get())
PoolOutputModule const * om_
BranchChildren const & branchChildren() const
double b
Definition: hdecay.h:120
std::string const & productDependenciesBranchName()
Definition: BranchType.cc:178
void edm::RootOutputFile::writeProductDescriptionRegistry ( )

Definition at line 573 of file RootOutputFile.cc.

References assert(), b, edm::PoolOutputModule::basketSize(), branchesWithStoredHistory_, end, metaDataTree_, om_, parseEventContent::prod, and edm::poolNames::productDescriptionBranchName().

573  {
574  // Make a local copy of the ProductRegistry, removing any transient or pruned products.
575  typedef ProductRegistry::ProductList ProductList;
577  ProductRegistry pReg(reg->productList());
578  ProductList& pList = const_cast<ProductList &>(pReg.productList());
579  for(auto const& prod : pList) {
580  if(prod.second.branchID() != prod.second.originalBranchID()) {
581  if(branchesWithStoredHistory_.find(prod.second.branchID()) != branchesWithStoredHistory_.end()) {
582  branchesWithStoredHistory_.insert(prod.second.originalBranchID());
583  }
584  }
585  }
586  std::set<BranchID>::iterator end = branchesWithStoredHistory_.end();
587  for(ProductList::iterator it = pList.begin(); it != pList.end();) {
588  if(branchesWithStoredHistory_.find(it->second.branchID()) == end) {
589  // avoid invalidating iterator on deletion
590  ProductList::iterator itCopy = it;
591  ++it;
592  pList.erase(itCopy);
593 
594  } else {
595  ++it;
596  }
597  }
598 
599  ProductRegistry* ppReg = &pReg;
600  TBranch* b = metaDataTree_->Branch(poolNames::productDescriptionBranchName().c_str(), &ppReg, om_->basketSize(), 0);
601  assert(b);
602  b->Fill();
603  }
int const & basketSize() const
std::map< BranchKey, BranchDescription > ProductList
assert(m_qm.get())
std::set< BranchID > branchesWithStoredHistory_
PoolOutputModule const * om_
#define end
Definition: vmac.h:37
double b
Definition: hdecay.h:120
std::string const & productDescriptionBranchName()
Definition: BranchType.cc:173
void edm::RootOutputFile::writeRun ( RunPrincipal const &  r,
ModuleCallingContext const *  mcc 
)

Definition at line 459 of file RootOutputFile.cc.

References edm::IndexIntoFile::addEntry(), edm::RunPrincipal::aux(), fillBranches(), indexIntoFile_, edm::InRun, edm::RootOutputTree::optimizeBaskets(), edm::Principal::processHistory(), edm::Principal::processHistoryID(), processHistoryRegistry_, edm::ProcessHistoryRegistry::reducedProcessHistoryID(), edm::ProcessHistoryRegistry::registerProcessHistory(), reportToken_, edm::RunAuxiliary::run(), edm::RunPrincipal::run(), runAux_, runEntryNumber_, runTree_, and edm::RunAuxiliary::setProcessHistoryID().

459  {
460  // Auxiliary branch
461  // NOTE: runAux_ must be filled before calling fillBranches since it gets written out in that routine.
462  runAux_ = r.aux();
463  // Use the updated process historyID
464  runAux_.setProcessHistoryID(r.processHistoryID());
465  // Store the process history.
467  // Store the reduced ID in the IndexIntoFile
468  ProcessHistoryID reducedPHID = processHistoryRegistry_.reducedProcessHistoryID(r.processHistoryID());
469  // Add run to index.
470  indexIntoFile_.addEntry(reducedPHID, runAux_.run(), 0U, 0U, runEntryNumber_);
471  ++runEntryNumber_;
472  fillBranches(InRun, r, nullptr, mcc);
473  runTree_.optimizeBaskets(10ULL*1024*1024);
474 
475  Service<JobReport> reportSvc;
476  reportSvc->reportRunNumber(reportToken_, r.run());
477  }
void fillBranches(BranchType const &branchType, Principal const &principal, StoredProductProvenanceVector *productProvenanceVecPtr, ModuleCallingContext const *)
bool registerProcessHistory(ProcessHistory const &processHistory)
ProcessHistoryRegistry processHistoryRegistry_
ProcessHistoryID const & reducedProcessHistoryID(ProcessHistoryID const &fullID) const
void addEntry(ProcessHistoryID const &processHistoryID, RunNumber_t run, LuminosityBlockNumber_t lumi, EventNumber_t event, EntryNumber_t entry)
Hash< ProcessHistoryType > ProcessHistoryID
RootOutputTree runTree_
IndexIntoFile indexIntoFile_
IndexIntoFile::EntryNumber_t runEntryNumber_
RunAuxiliary runAux_
void setProcessHistoryID(ProcessHistoryID const &phid)
Definition: RunAuxiliary.h:36
void optimizeBaskets(ULong64_t size)
RunNumber_t run() const
Definition: RunAuxiliary.h:41
JobReport::Token reportToken_
void edm::RootOutputFile::writeThinnedAssociationsHelper ( )

Definition at line 553 of file RootOutputFile.cc.

References assert(), b, edm::PoolOutputModule::basketSize(), metaDataTree_, om_, AlCaHLTBitMon_ParallelJobs::p, edm::one::OutputModuleBase::thinnedAssociationsHelper(), and edm::poolNames::thinnedAssociationsHelperBranchName().

553  {
554  ThinnedAssociationsHelper const* p = om_->thinnedAssociationsHelper();
555  TBranch* b = metaDataTree_->Branch(poolNames::thinnedAssociationsHelperBranchName().c_str(), &p, om_->basketSize(), 0);
556  assert(b);
557  b->Fill();
558  }
int const & basketSize() const
ThinnedAssociationsHelper const * thinnedAssociationsHelper() const
assert(m_qm.get())
PoolOutputModule const * om_
double b
Definition: hdecay.h:120
std::string const & thinnedAssociationsHelperBranchName()
Definition: BranchType.cc:213

Member Data Documentation

std::set<BranchID> edm::RootOutputFile::branchesWithStoredHistory_
private
bool edm::RootOutputFile::canFastCloneAux_
private

Definition at line 106 of file RootOutputFile.h.

Referenced by beginInputFile().

bool edm::RootOutputFile::dataTypeReported_
private

Definition at line 129 of file RootOutputFile.h.

Referenced by writeOne().

StoredProductProvenanceVector edm::RootOutputFile::eventEntryInfoVector_
private

Definition at line 121 of file RootOutputFile.h.

IndexIntoFile::EntryNumber_t edm::RootOutputFile::eventEntryNumber_
private

Definition at line 109 of file RootOutputFile.h.

Referenced by writeIndexIntoFile(), and writeOne().

RootOutputTree edm::RootOutputFile::eventTree_
private
FileID edm::RootOutputFile::fid_
private

Definition at line 108 of file RootOutputFile.h.

Referenced by RootOutputFile(), and writeFileIdentifier().

std::string edm::RootOutputFile::file_
private

Definition at line 101 of file RootOutputFile.h.

Referenced by beginInputFile(), fileName(), and RootOutputFile().

std::shared_ptr<TFile> edm::RootOutputFile::filePtr_
private

Definition at line 107 of file RootOutputFile.h.

Referenced by finishEndFile(), RootOutputFile(), and shouldWeCloseFile().

IndexIntoFile edm::RootOutputFile::indexIntoFile_
private

Definition at line 112 of file RootOutputFile.h.

Referenced by writeIndexIntoFile(), writeLuminosityBlock(), writeOne(), and writeRun().

std::string edm::RootOutputFile::logicalFile_
private

Definition at line 102 of file RootOutputFile.h.

Referenced by RootOutputFile().

LuminosityBlockAuxiliary edm::RootOutputFile::lumiAux_
private

Definition at line 116 of file RootOutputFile.h.

Referenced by writeLuminosityBlock().

IndexIntoFile::EntryNumber_t edm::RootOutputFile::lumiEntryNumber_
private

Definition at line 110 of file RootOutputFile.h.

Referenced by writeLuminosityBlock().

RootOutputTree edm::RootOutputFile::lumiTree_
private

Definition at line 126 of file RootOutputFile.h.

Referenced by respondToCloseInputFile(), RootOutputFile(), and writeLuminosityBlock().

TTree* edm::RootOutputFile::metaDataTree_
private
PoolOutputModule const* edm::RootOutputFile::om_
private
TTree* edm::RootOutputFile::parameterSetsTree_
private

Definition at line 114 of file RootOutputFile.h.

Referenced by finishEndFile(), RootOutputFile(), and writeParameterSetRegistry().

std::map<ParentageID,unsigned int> edm::RootOutputFile::parentageIDs_
private

Definition at line 131 of file RootOutputFile.h.

Referenced by insertProductProvenance(), and writeParentageRegistry().

TTree* edm::RootOutputFile::parentageTree_
private

Definition at line 115 of file RootOutputFile.h.

Referenced by finishEndFile(), RootOutputFile(), and writeParentageRegistry().

BranchListIndexes const* edm::RootOutputFile::pBranchListIndexes_
private

Definition at line 123 of file RootOutputFile.h.

Referenced by RootOutputFile(), and writeOne().

EventAuxiliary const* edm::RootOutputFile::pEventAux_
private

Definition at line 118 of file RootOutputFile.h.

Referenced by RootOutputFile(), and writeOne().

StoredProductProvenanceVector* edm::RootOutputFile::pEventEntryInfoVector_
private

Definition at line 122 of file RootOutputFile.h.

Referenced by RootOutputFile(), and writeOne().

EventSelectionIDVector const* edm::RootOutputFile::pEventSelectionIDs_
private

Definition at line 124 of file RootOutputFile.h.

Referenced by RootOutputFile(), and writeOne().

LuminosityBlockAuxiliary const* edm::RootOutputFile::pLumiAux_
private

Definition at line 119 of file RootOutputFile.h.

Referenced by RootOutputFile().

ProcessHistoryRegistry edm::RootOutputFile::processHistoryRegistry_
private
RunAuxiliary const* edm::RootOutputFile::pRunAux_
private

Definition at line 120 of file RootOutputFile.h.

Referenced by RootOutputFile().

JobReport::Token edm::RootOutputFile::reportToken_
private
RunAuxiliary edm::RootOutputFile::runAux_
private

Definition at line 117 of file RootOutputFile.h.

Referenced by writeRun().

IndexIntoFile::EntryNumber_t edm::RootOutputFile::runEntryNumber_
private

Definition at line 111 of file RootOutputFile.h.

Referenced by writeRun().

RootOutputTree edm::RootOutputFile::runTree_
private

Definition at line 127 of file RootOutputFile.h.

Referenced by respondToCloseInputFile(), RootOutputFile(), and writeRun().

RootOutputTreePtrArray edm::RootOutputFile::treePointers_
private

Definition at line 128 of file RootOutputFile.h.

Referenced by fillBranches(), finishEndFile(), and RootOutputFile().

int edm::RootOutputFile::whyNotFastClonable_
private

Definition at line 105 of file RootOutputFile.h.

Referenced by beginInputFile(), and fillBranches().

TClass* edm::RootOutputFile::wrapperBaseTClass_
private

Definition at line 133 of file RootOutputFile.h.

Referenced by fillBranches().