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)
 
void writeOne (EventPrincipal const &e)
 
void writeParameterSetRegistry ()
 
void writeParentageRegistry ()
 
void writeProcessConfigurationRegistry ()
 
void writeProcessHistoryRegistry ()
 
void writeProductDependencies ()
 
void writeProductDescriptionRegistry ()
 
void writeRun (RunPrincipal const &r)
 
 ~RootOutputFile ()
 

Private Member Functions

void fillBranches (BranchType const &branchType, Principal const &principal, StoredProductProvenanceVector *productProvenanceVecPtr)
 
void insertAncestors (ProductProvenance const &iGetParents, EventPrincipal const &principal, bool produced, std::set< StoredProductProvenance > &oToFill)
 
bool insertProductProvenance (const ProductProvenance &, std::set< StoredProductProvenance > &oToInsert)
 
void setBranchAliases (TTree *tree, Selections 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_
 
boost::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_
 
RunAuxiliary const * pRunAux_
 
JobReport::Token reportToken_
 
RunAuxiliary runAux_
 
IndexIntoFile::EntryNumber_t runEntryNumber_
 
RootOutputTree runTree_
 
RootOutputTreePtrArray treePointers_
 
int whyNotFastClonable_
 

Detailed Description

Definition at line 40 of file RootOutputFile.h.

Member Typedef Documentation

Definition at line 42 of file RootOutputFile.h.

Definition at line 43 of file RootOutputFile.h.

Definition at line 44 of file RootOutputFile.h.

Constructor & Destructor Documentation

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

Definition at line 66 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_, edm::hlt::Exception, fid_, file_, filePtr_, edm::BranchDescription::fullClassName(), edm::BranchDescription::getInterface(), i, edm::InEvent, edm::BranchDescription::init(), edm::InLumi, edm::InRun, logicalFile_, lumiTree_, edm::RootOutputTree::makeTTree(), metaDataTree_, edm::poolNames::metaDataTreeName(), edm::PoolOutputModule::moduleLabel(), edm::BranchDescription::moduleLabel(), 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(), cms::MD5Result::toString(), treePointers_, and edm::BranchDescription::wrappedName().

66  :
67  file_(fileName),
68  logicalFile_(logicalFileName),
69  reportToken_(0),
70  om_(om),
72  canFastCloneAux_(false),
73  filePtr_(TFile::Open(file_.c_str(), "recreate", "", om_->compressionLevel())),
74  fid_(),
75  eventEntryNumber_(0LL),
76  lumiEntryNumber_(0LL),
77  runEntryNumber_(0LL),
79  metaDataTree_(0),
81  parentageTree_(0),
82  lumiAux_(),
83  runAux_(),
84  pEventAux_(0),
86  pRunAux_(&runAux_),
94  treePointers_(),
95  dataTypeReported_(false),
96  parentageIDs_(),
98 #if ROOT_VERSION_CODE >= ROOT_VERSION(5,30,0)
99  if (om_->compressionAlgorithm() == std::string("ZLIB")) {
100  filePtr_->SetCompressionAlgorithm(ROOT::kZLIB);
101  } else if (om_->compressionAlgorithm() == std::string("LZMA")) {
102  filePtr_->SetCompressionAlgorithm(ROOT::kLZMA);
103  } else {
104  throw Exception(errors::Configuration) << "PoolOutputModule configured with unknown compression algorithm '" << om_->compressionAlgorithm() << "'\n"
105  << "Allowed compression algorithms are ZLIB and LZMA\n";
106  }
107 #endif
108  if (-1 != om->eventAutoFlushSize()) {
109  eventTree_.setAutoFlush(-1*om->eventAutoFlushSize());
110  }
112  pEventAux_, om_->auxItems()[InEvent].basketSize_);
114  pEventEntryInfoVector_, om_->auxItems()[InEvent].basketSize_);
116  pEventSelectionIDs_, om_->auxItems()[InEvent].basketSize_,false);
118  pBranchListIndexes_, om_->auxItems()[InEvent].basketSize_);
119 
121  pLumiAux_, om_->auxItems()[InLumi].basketSize_);
122 
124  pRunAux_, om_->auxItems()[InRun].basketSize_);
125 
127  treePointers_[InLumi] = &lumiTree_;
128  treePointers_[InRun] = &runTree_;
129 
130  for(int i = InEvent; i < NumBranchTypes; ++i) {
131  BranchType branchType = static_cast<BranchType>(i);
132  RootOutputTree *theTree = treePointers_[branchType];
133  for(OutputItemList::const_iterator it = om_->selectedOutputItemList()[branchType].begin(),
134  itEnd = om_->selectedOutputItemList()[branchType].end();
135  it != itEnd; ++it) {
136  it->product_ = 0;
137  BranchDescription const& desc = *it->branchDescription_;
138  desc.init();
139  theTree->addBranch(desc.branchName(),
140  desc.wrappedName(),
141  desc.getInterface(),
142  it->product_,
143  it->splitLevel_,
144  it->basketSize_,
145  it->branchDescription_->produced());
146  //make sure we always store product registry info for all branches we create
147  branchesWithStoredHistory_.insert(it->branchID());
148  }
149  }
150  // Don't split metadata tree or event description tree
154 
155  fid_ = FileID(createGlobalIdentifier());
156 
157  // For the Job Report, get a vector of branch names in the "Events" tree.
158  // Also create a hash of all the branch names in the "Events" tree
159  // in a deterministic order, except use the full class name instead of the friendly class name.
160  // To avoid extra string copies, we create a vector of pointers into the product registry,
161  // and use a custom comparison operator for sorting.
162  std::vector<std::string> branchNames;
163  std::vector<BranchDescription const*> branches;
164  branchNames.reserve(om_->selectedOutputItemList()[InEvent].size());
165  branches.reserve(om->selectedOutputItemList()[InEvent].size());
166  for(OutputItemList::const_iterator it = om_->selectedOutputItemList()[InEvent].begin(),
167  itEnd = om_->selectedOutputItemList()[InEvent].end();
168  it != itEnd; ++it) {
169  branchNames.push_back(it->branchDescription_->branchName());
170  branches.push_back(it->branchDescription_);
171  }
172  // Now sort the branches for the hash.
173  sort_all(branches, sorterForJobReportHash);
174  // Now, make a concatenated string.
175  std::ostringstream oss;
176  char const underscore = '_';
177  for(std::vector<BranchDescription const*>::const_iterator it = branches.begin(), itEnd = branches.end(); it != itEnd; ++it) {
178  BranchDescription const& bd = **it;
179  oss << bd.fullClassName() << underscore
180  << bd.moduleLabel() << underscore
181  << bd.productInstanceName() << underscore
182  << bd.processName() << underscore;
183  }
184  std::string stringrep = oss.str();
185  cms::Digest md5alg(stringrep);
186 
187  // Register the output file with the JobReport service
188  // and get back the token for it.
189  std::string moduleName = "PoolOutputModule";
190  Service<JobReport> reportSvc;
191  reportToken_ = reportSvc->outputFileOpened(
192  file_, logicalFile_, // PFN and LFN
193  om_->catalog(), // catalog
194  moduleName, // module class name
195  om_->moduleLabel(), // module label
196  fid_.fid(), // file id (guid)
197  std::string(), // data type (not yet known, so string is empty).
198  md5alg.digest().toString(), // branch hash
199  branchNames); // branch names being written
200  }
int i
Definition: DBlmapReader.cc:9
LuminosityBlockAuxiliary lumiAux_
std::string const & BranchTypeToAuxiliaryBranchName(BranchType const &branchType)
Definition: BranchType.cc:114
std::string const & parentageTreeName()
Definition: BranchType.cc:158
std::string const & catalog() const
std::string const & moduleLabel() const
int const & compressionLevel() const
OutputItemListArray const & selectedOutputItemList() const
std::string const & eventSelectionsBranchName()
Definition: BranchType.cc:237
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:245
std::string const & fileName() const
std::map< ParentageID, unsigned int > parentageIDs_
RootOutputTree eventTree_
std::vector< BranchListIndex > BranchListIndexes
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:167
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:130
std::string const & branchListIndexesBranchName()
Definition: BranchType.cc:241
RootOutputTreePtrArray treePointers_
BranchListIndexes const * pBranchListIndexes_
IndexIntoFile::EntryNumber_t lumiEntryNumber_
RootOutputTree lumiTree_
boost::shared_ptr< TFile > filePtr_
RunAuxiliary const * pRunAux_
JobReport::Token reportToken_
std::string createGlobalIdentifier()
edm::RootOutputFile::~RootOutputFile ( )
inline

Definition at line 47 of file RootOutputFile.h.

47 {}

Member Function Documentation

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

Definition at line 292 of file RootOutputFile.cc.

References edm::PoolOutputModule::basketOrder(), edm::FileBlock::branchListIndexesUnchanged(), edm::FileBlock::BranchMismatch, edm::FileBlock::CanFastClone, canFastCloneAux_, edm::RootOutputTree::checkIfFastClonable(), edm::RootOutputTree::checkSplitLevelsAndBasketSizes(), edm::PoolOutputModule::dropMetaData(), edm::PoolOutputModule::DropNone, eventTree_, edm::hlt::Exception, file_, edm::FileBlock::fileFormatVersion(), edm::FileBlock::fileName(), edm::OutputModule::hasNewlyDroppedBranch(), edm::FileBlock::hasNewlyDroppedBranch(), edm::InEvent, edm::PoolOutputModule::inputFileCount(), edm::match(), edm::RootOutputTree::maybeFastCloneTree(), edm::errors::MismatchedInputFiles, edm::FileBlock::modifiedIDs(), edm::FileFormatVersion::noMetaDataTrees(), 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_.

292  {
293 
294  // Reset per input file information
296  canFastCloneAux_ = false;
297 
298  if(fb.tree() != 0) {
299 
300  whyNotFastClonable_ |= fb.whyNotFastClonable();
301 
302  if(remainingEvents >= 0 && remainingEvents < fb.tree()->GetEntries()) {
304  }
305 
307  if(!match) {
309  // We may be fast copying. We must disable fast copying if the split levels
310  // or basket sizes do not match.
312  } else {
313  // We are using the input split levels and basket sizes from the first input file
314  // for copied output branches. In this case, we throw an exception if any branches
315  // have different split levels or basket sizes in a subsequent input file.
316  // If the mismatch is in the first file, there is a bug somewhere, so we assert.
317  assert(om_->inputFileCount() > 1);
318  throw Exception(errors::MismatchedInputFiles, "RootOutputFile::beginInputFile()") <<
319  "Merge failure because input file " << file_ << " has different ROOT split levels or basket sizes\n" <<
320  "than previous files. To allow merging in splite of this, use the configuration parameter\n" <<
321  "overrideInputFileSplitLevels=cms.untracked.bool(True)\n" <<
322  "in every PoolOutputModule.\n";
323  }
324  }
325 
326  // Since this check can be time consuming, we do it only if we would otherwise fast clone.
328  if(!eventTree_.checkIfFastClonable(fb.tree())) {
330  }
331  }
332  // We now check if we can fast copy the auxiliary branches.
333  // We can do so only if we can otherwise fast copy,
334  // the input file has the current format (these branches are in the Events Tree),
335  // there are no newly dropped or produced products,
336  // no metadata has been dropped,
337  // ID's have not been modified,
338  // and the branch list indexes do not need modification.
341  fb.fileFormatVersion().noMetaDataTrees() &&
343  !fb.hasNewlyDroppedBranch()[InEvent] &&
345  !reg->anyProductProduced() &&
346  !fb.modifiedIDs() &&
347  fb.branchListIndexesUnchanged();
348 
349  // Report the fast copying status.
350  Service<JobReport> reportSvc;
351  reportSvc->reportFastCopyingStatus(reportToken_, fb.fileName(), whyNotFastClonable_ == FileBlock::CanFastClone);
352  } else {
354  }
355 
357 
358  // Possibly issue warning or informational message if we haven't fast cloned.
359  if(fb.tree() != 0 && whyNotFastClonable_ != FileBlock::CanFastClone) {
360  maybeIssueWarning(whyNotFastClonable_, fb.fileName(), file_);
361  }
362  }
bool const & overrideInputFileSplitLevels() const
DropMetaData const & dropMetaData() const
bool checkSplitLevelsAndBasketSizes(TTree *inputTree) const
std::string match(BranchDescription const &a, BranchDescription const &b, std::string const &fileName, BranchDescription::MatchMode m)
bool checkIfFastClonable(TTree *inputTree) const
RootOutputTree eventTree_
PoolOutputModule const * om_
std::string const & basketOrder() const
int const & whyNotFastClonable() const
boost::array< bool, NumBranchTypes > const & hasNewlyDroppedBranch() const
Definition: OutputModule.h:57
void maybeFastCloneTree(bool canFastClone, bool canFastCloneAux, TTree *tree, std::string const &option)
int const & inputFileCount() const
JobReport::Token reportToken_
std::string const& edm::RootOutputFile::fileName ( ) const
inline

Definition at line 68 of file RootOutputFile.h.

References file_.

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

Definition at line 675 of file RootOutputFile.cc.

References 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(), i, edm::InEvent, insertAncestors(), insertProductProvenance(), om_, cmsRelvalreport::principal(), edm::es::produced, edm::OutputHandle::productProvenance(), edm::PoolOutputModule::selectedOutputItemList(), treePointers_, whyNotFastClonable_, and edm::OutputHandle::wrapper().

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

678  {
679 
680  typedef std::vector<std::pair<TClass*, void const*> > Dummies;
681  Dummies dummies;
682 
684 
686 
687  std::set<StoredProductProvenance> provenanceToKeep;
688 
689  // Loop over EDProduct branches, fill the provenance, and write the branch.
690  for(OutputItemList::const_iterator i = items.begin(), iEnd = items.end(); i != iEnd; ++i) {
691 
692  BranchID const& id = i->branchDescription_->branchID();
693  branchesWithStoredHistory_.insert(id);
694 
695  bool produced = i->branchDescription_->produced();
696  bool keepProvenance = productProvenanceVecPtr != 0 &&
700  bool getProd = (produced || !fastCloning ||
701  treePointers_[branchType]->uncloned(i->branchDescription_->branchName()));
702 
703  void const* product = 0;
704  OutputHandle const oh = principal.getForOutput(id, getProd);
705  if(keepProvenance && oh.productProvenance()) {
706  insertProductProvenance(*oh.productProvenance(),provenanceToKeep);
707  //provenanceToKeep.insert(*oh.productProvenance());
708  EventPrincipal const& eventPrincipal = dynamic_cast<EventPrincipal const&>(principal);
709  assert(eventPrincipal.branchMapperPtr());
710  insertAncestors(*oh.productProvenance(), eventPrincipal, produced, provenanceToKeep);
711  }
712  product = oh.wrapper();
713  if(getProd) {
714  if(product == 0) {
715  // No product with this ID is in the event.
716  // Add a null product.
717  TClass* cp = gROOT->GetClass(i->branchDescription_->wrappedName().c_str());
718  product = cp->New();
719  dummies.emplace_back(cp, product);
720  }
721  i->product_ = product;
722  }
723  }
724 
725  if(productProvenanceVecPtr != 0) productProvenanceVecPtr->assign(provenanceToKeep.begin(), provenanceToKeep.end());
726  treePointers_[branchType]->fillTree();
727  if(productProvenanceVecPtr != 0) productProvenanceVecPtr->clear();
728  for(Dummies::iterator it = dummies.begin(), itEnd = dummies.end(); it != itEnd; ++it) {
729  it->first->Destructor(const_cast<void *>(it->second));
730  }
731  }
int i
Definition: DBlmapReader.cc:9
DropMetaData const & dropMetaData() const
void insertAncestors(ProductProvenance const &iGetParents, EventPrincipal const &principal, bool produced, std::set< StoredProductProvenance > &oToFill)
OutputItemListArray const & selectedOutputItemList() const
std::set< BranchID > branchesWithStoredHistory_
PoolOutputModule const * om_
PoolOutputModule::OutputItemList OutputItemList
eventsetup::produce::Produce produced
Definition: ESProducts.cc:21
string const
Definition: compareJSON.py:14
bool insertProductProvenance(const ProductProvenance &, std::set< StoredProductProvenance > &oToInsert)
RootOutputTreePtrArray treePointers_
void edm::RootOutputFile::finishEndFile ( )

Definition at line 596 of file RootOutputFile.cc.

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

596  {
597  metaDataTree_->SetEntries(-1);
600 
602 
603  // Create branch aliases for all the branches in the
604  // events/lumis/runs trees. The loop is over all types of data
605  // products.
606  for(int i = InEvent; i < NumBranchTypes; ++i) {
607  BranchType branchType = static_cast<BranchType>(i);
609  treePointers_[branchType]->writeTree();
610  }
611 
612  // close the file -- mfp
613  // Just to play it safe, zero all pointers to objects in the TFile to be closed.
615  for(RootOutputTreePtrArray::iterator it = treePointers_.begin(), itEnd = treePointers_.end(); it != itEnd; ++it) {
616  (*it)->close();
617  (*it) = 0;
618  }
619  filePtr_->Close();
620  filePtr_.reset();
621 
622  // report that file has been closed
623  Service<JobReport> reportSvc;
624  reportSvc->outputFileClosed(reportToken_);
625 
626  }
int i
Definition: DBlmapReader.cc:9
SelectionsArray const & keptProducts() const
Definition: OutputModule.h:56
void setBranchAliases(TTree *tree, Selections const &branches) const
BranchType
Definition: BranchType.h:11
PoolOutputModule const * om_
static void writeTTree(TTree *tree)
RootOutputTreePtrArray treePointers_
boost::shared_ptr< TFile > filePtr_
JobReport::Token reportToken_
void edm::RootOutputFile::insertAncestors ( ProductProvenance const &  iGetParents,
EventPrincipal const &  principal,
bool  produced,
std::set< StoredProductProvenance > &  oToFill 
)
private

Definition at line 650 of file RootOutputFile.cc.

References branchesWithStoredHistory_, edm::ProductProvenance::branchID(), edm::BranchMapper::branchIDToProvenance(), edm::EventPrincipal::branchMapperPtr(), 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(), and edm::es::produced.

Referenced by fillBranches().

653  {
657  BranchMapper const& iMapper = *principal.branchMapperPtr();
658  std::vector<BranchID> const& parentIDs = iGetParents.parentage().parents();
659  for(std::vector<BranchID>::const_iterator it = parentIDs.begin(), itEnd = parentIDs.end();
660  it != itEnd; ++it) {
661  branchesWithStoredHistory_.insert(*it);
662  ProductProvenance const* info = iMapper.branchIDToProvenance(*it);
663  if(info) {
665  principal.getProvenance(info->branchID()).product().produced()) {
666  if(insertProductProvenance(*info,oToFill) ) {
667  //haven't seen this one yet
668  insertAncestors(*info, principal, produced, oToFill);
669  }
670  }
671  }
672  }
673  }
DropMetaData const & dropMetaData() const
void insertAncestors(ProductProvenance const &iGetParents, EventPrincipal const &principal, bool produced, std::set< StoredProductProvenance > &oToFill)
std::set< BranchID > branchesWithStoredHistory_
PoolOutputModule const * om_
eventsetup::produce::Produce produced
Definition: ESProducts.cc:21
bool insertProductProvenance(const ProductProvenance &, std::set< StoredProductProvenance > &oToInsert)
bool edm::RootOutputFile::insertProductProvenance ( const ProductProvenance ,
std::set< StoredProductProvenance > &  oToInsert 
)
private

Definition at line 734 of file RootOutputFile.cc.

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

Referenced by fillBranches(), and insertAncestors().

735  {
736  StoredProductProvenance toStore;
737  toStore.branchID_ = iProv.branchID().id();
738  std::set<edm::StoredProductProvenance>::iterator itFound = oToInsert.find(toStore);
739  if(itFound == oToInsert.end()) {
740  //get the index to the ParentageID or insert a new value if not already present
741  std::pair<std::map<edm::ParentageID,unsigned int>::iterator,bool> i = parentageIDs_.insert(std::make_pair(iProv.parentageID(),static_cast<unsigned int>(parentageIDs_.size())));
742  toStore.parentageIDIndex_ = i.first->second;
743  oToInsert.insert(toStore);
744  return true;
745  }
746  return false;
747  }
int i
Definition: DBlmapReader.cc:9
std::map< ParentageID, unsigned int > parentageIDs_
void edm::RootOutputFile::respondToCloseInputFile ( FileBlock const &  fb)

Definition at line 364 of file RootOutputFile.cc.

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

364  {
368  }
RootOutputTree eventTree_
RootOutputTree runTree_
RootOutputTree lumiTree_
void edm::RootOutputFile::setBranchAliases ( TTree *  tree,
Selections const &  branches 
) const
private

Definition at line 629 of file RootOutputFile.cc.

References Selections::begin(), edm::BranchDescription::branchAliases(), edm::BranchDescription::branchName(), Selections::end(), full, i, edm::BranchDescription::moduleLabel(), and edm::BranchDescription::productInstanceName().

Referenced by finishEndFile().

629  {
630  if(tree && tree->GetNbranches() != 0) {
631  for(Selections::const_iterator i = branches.begin(), iEnd = branches.end();
632  i != iEnd; ++i) {
633  BranchDescription const& pd = **i;
634  std::string const& full = pd.branchName() + "obj";
635  if(pd.branchAliases().empty()) {
636  std::string const& alias =
637  (pd.productInstanceName().empty() ? pd.moduleLabel() : pd.productInstanceName());
638  tree->SetAlias(alias.c_str(), full.c_str());
639  } else {
640  std::set<std::string>::const_iterator it = pd.branchAliases().begin(), itEnd = pd.branchAliases().end();
641  for(; it != itEnd; ++it) {
642  tree->SetAlias((*it).c_str(), full.c_str());
643  }
644  }
645  }
646  }
647  }
int i
Definition: DBlmapReader.cc:9
Definition: GenABIO.cc:193
bool edm::RootOutputFile::shouldWeCloseFile ( ) const

Definition at line 370 of file RootOutputFile.cc.

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

370  {
371  unsigned int const oneK = 1024;
372  Long64_t size = filePtr_->GetSize()/oneK;
373  return(size >= om_->maxFileSize());
374  }
unsigned int const & maxFileSize() const
PoolOutputModule const * om_
boost::shared_ptr< TFile > filePtr_
tuple size
Write out results.
void edm::RootOutputFile::writeBranchIDListRegistry ( )

Definition at line 541 of file RootOutputFile.cc.

References b, edm::PoolOutputModule::basketSize(), edm::poolNames::branchIDListBranchName(), edm::detail::ThreadSafeIndexedRegistry< T, E >::data(), edm::detail::ThreadSafeIndexedRegistry< T, E >::instance(), metaDataTree_, om_, and AlCaHLTBitMon_ParallelJobs::p.

541  {
543  TBranch* b = metaDataTree_->Branch(poolNames::branchIDListBranchName().c_str(), &p, om_->basketSize(), 0);
544  assert(b);
545  b->Fill();
546  }
int const & basketSize() const
PoolOutputModule const * om_
static ThreadSafeIndexedRegistry * instance()
double b
Definition: hdecay.h:120
collection_type & data()
Provide access to the contained collection.
std::string const & branchIDListBranchName()
Definition: BranchType.cc:207
void edm::RootOutputFile::writeFileFormatVersion ( )

Definition at line 482 of file RootOutputFile.cc.

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

482  {
483  FileFormatVersion fileFormatVersion(getFileFormatVersion());
484  FileFormatVersion* pFileFmtVsn = &fileFormatVersion;
485  TBranch* b = metaDataTree_->Branch(poolNames::fileFormatVersionBranchName().c_str(), &pFileFmtVsn, om_->basketSize(), 0);
486  assert(b);
487  b->Fill();
488  }
int const & basketSize() const
std::string const & fileFormatVersionBranchName()
Definition: BranchType.cc:212
PoolOutputModule const * om_
int getFileFormatVersion()
double b
Definition: hdecay.h:120
void edm::RootOutputFile::writeFileIdentifier ( )

Definition at line 490 of file RootOutputFile.cc.

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

490  {
491  FileID* fidPtr = &fid_;
492  TBranch* b = metaDataTree_->Branch(poolNames::fileIdentifierBranchName().c_str(), &fidPtr, om_->basketSize(), 0);
493  assert(b);
494  b->Fill();
495  }
int const & basketSize() const
PoolOutputModule const * om_
double b
Definition: hdecay.h:120
std::string const & fileIdentifierBranchName()
Definition: BranchType.cc:217
void edm::RootOutputFile::writeIndexIntoFile ( )

Definition at line 497 of file RootOutputFile.cc.

References cms::Exception::addContext(), 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().

497  {
500  ex << "The number of entries in at least one output TBranch whose entries\n"
501  "were copied from the input does not match the number of events\n"
502  "recorded in IndexIntoFile. This might (or might not) indicate a\n"
503  "problem related to fast copy.";
504  ex.addContext("Calling RootOutputFile::writeIndexIntoFile");
505  throw ex;
506  }
508  IndexIntoFile* iifPtr = &indexIntoFile_;
509  TBranch* b = metaDataTree_->Branch(poolNames::indexIntoFileBranchName().c_str(), &iifPtr, om_->basketSize(), 0);
510  assert(b);
511  b->Fill();
512  }
int const & basketSize() const
void sortVector_Run_Or_Lumi_Entries()
RootOutputTree eventTree_
PoolOutputModule const * om_
IndexIntoFile::EntryNumber_t eventEntryNumber_
std::string const & indexIntoFileBranchName()
Definition: BranchType.cc:227
bool checkEntriesInReadBranches(Long64_t expectedNumberOfEntries) const
double b
Definition: hdecay.h:120
IndexIntoFile indexIntoFile_
void edm::RootOutputFile::writeLuminosityBlock ( LuminosityBlockPrincipal const &  lb)

Definition at line 418 of file RootOutputFile.cc.

References edm::IndexIntoFile::addEntry(), edm::LuminosityBlockPrincipal::aux(), edm::detail::ThreadSafeRegistry< KEY, T, E >::extra(), fillBranches(), indexIntoFile_, edm::InLumi, edm::detail::ThreadSafeRegistry< KEY, T, E >::instance(), lumiAux_, lumiEntryNumber_, edm::LuminosityBlockAuxiliary::luminosityBlock(), lumiTree_, edm::RootOutputTree::optimizeBaskets(), edm::Principal::processHistoryID(), edm::LuminosityBlockAuxiliary::run(), and edm::LuminosityBlockAuxiliary::setProcessHistoryID().

418  {
419  // Auxiliary branch
420  // NOTE: lumiAux_ must be filled before calling fillBranches since it gets written out in that routine.
421  lumiAux_ = lb.aux();
422  // Use the updated process historyID
423  lumiAux_.setProcessHistoryID(lb.processHistoryID());
424  // Store the reduced ID in the IndexIntoFile
425  ProcessHistoryID reducedPHID = ProcessHistoryRegistry::instance()->extra().reduceProcessHistoryID(lb.processHistoryID());
426  // Add lumi to index.
429  fillBranches(InLumi, lb, 0);
430  lumiTree_.optimizeBaskets(10ULL*1024*1024);
431  }
LuminosityBlockAuxiliary lumiAux_
static ThreadSafeRegistry * instance()
void fillBranches(BranchType const &branchType, Principal const &principal, StoredProductProvenanceVector *productProvenanceVecPtr)
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)
void edm::RootOutputFile::writeOne ( EventPrincipal const &  e)

Definition at line 376 of file RootOutputFile.cc.

References edm::IndexIntoFile::addEntry(), edm::EventPrincipal::aux(), edm::EventPrincipal::branchListIndexes(), dtTPAnalyzer_cfg::dataType, dataTypeReported_, edm::EventID::event(), edm::EventAuxiliary::event(), eventEntryNumber_, edm::EventPrincipal::eventSelectionIDs(), edm::detail::ThreadSafeRegistry< KEY, T, E >::extra(), fillBranches(), edm::EventPrincipal::id(), indexIntoFile_, edm::InEvent, edm::detail::ThreadSafeRegistry< KEY, T, E >::instance(), edm::EventAuxiliary::isRealData(), edm::EventAuxiliary::luminosityBlock(), om_, pBranchListIndexes_, pEventAux_, pEventEntryInfoVector_, pEventSelectionIDs_, edm::EventAuxiliary::processHistoryID(), edm::Principal::processHistoryID(), reportToken_, edm::EventID::run(), edm::EventAuxiliary::run(), edm::OutputModule::selectorConfig(), and edm::OutputModule::wantAllEvents().

376  {
377  // Auxiliary branch
378  pEventAux_ = &e.aux();
379 
380  // Because getting the data may cause an exception to be thrown we want to do that
381  // first before writing anything to the file about this event
382  // NOTE: pEventAux_, pBranchListIndexes_, pEventSelectionIDs_, and pEventEntryInfoVector_
383  // must be set before calling fillBranches since they get written out in that routine.
384  assert(pEventAux_->processHistoryID() == e.processHistoryID());
385  pBranchListIndexes_ = &e.branchListIndexes();
386 
387  // Note: The EventSelectionIDVector should have a one to one correspondence with the processes in the process history.
388  // Therefore, a new entry should be added if and only if the current process has been added to the process history,
389  // which is done if and only if there is a produced product.
391  EventSelectionIDVector esids = e.eventSelectionIDs();
392  if (reg->anyProductProduced() || !om_->wantAllEvents()) {
393  esids.push_back(om_->selectorConfig());
394  }
395  pEventSelectionIDs_ = &esids;
397 
398  // Add the dataType to the job report if it hasn't already been done
399  if(!dataTypeReported_) {
400  Service<JobReport> reportSvc;
401  std::string dataType("MC");
402  if(pEventAux_->isRealData()) dataType = "Data";
403  reportSvc->reportDataType(reportToken_, dataType);
404  dataTypeReported_ = true;
405  }
406 
407  // Store the reduced ID in the IndexIntoFile
408  ProcessHistoryID reducedPHID = ProcessHistoryRegistry::instance()->extra().reduceProcessHistoryID(e.processHistoryID());
409  // Add event to index
412 
413  // Report event written
414  Service<JobReport> reportSvc;
415  reportSvc->eventWrittenToFile(reportToken_, e.id().run(), e.id().event());
416  }
bool isRealData() const
static ThreadSafeRegistry * instance()
RunNumber_t run() const
std::vector< EventSelectionID > EventSelectionIDVector
LuminosityBlockNumber_t luminosityBlock() const
bool wantAllEvents() const
Definition: OutputModule.h:68
PoolOutputModule const * om_
IndexIntoFile::EntryNumber_t eventEntryNumber_
void fillBranches(BranchType const &branchType, Principal const &principal, StoredProductProvenanceVector *productProvenanceVecPtr)
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_
ParameterSetID selectorConfig() const
Definition: OutputModule.h:86
void edm::RootOutputFile::writeParameterSetRegistry ( )

Definition at line 548 of file RootOutputFile.cc.

References b, edm::PoolOutputModule::basketSize(), edm::detail::ThreadSafeRegistry< KEY, T, E >::begin(), edm::detail::ThreadSafeRegistry< KEY, T, E >::end(), edm::poolNames::idToParameterSetBlobsBranchName(), edm::detail::ThreadSafeRegistry< KEY, T, E >::instance(), om_, and parameterSetsTree_.

548  {
549  std::pair<ParameterSetID, ParameterSetBlob> idToBlob;
550  std::pair<ParameterSetID, ParameterSetBlob>* pIdToBlob = &idToBlob;
551  TBranch* b = parameterSetsTree_->Branch(poolNames::idToParameterSetBlobsBranchName().c_str(),&pIdToBlob,om_->basketSize(), 0);
552 
554  itEnd = pset::Registry::instance()->end();
555  it != itEnd;
556  ++it) {
557  idToBlob.first = it->first;
558  idToBlob.second.pset() = it->second.toString();
559 
560  b->Fill();
561  }
562  }
std::string const & idToParameterSetBlobsBranchName()
Definition: BranchType.cc:249
int const & basketSize() const
static ThreadSafeRegistry * instance()
PoolOutputModule const * om_
collection_type::const_iterator const_iterator
double b
Definition: hdecay.h:120
void edm::RootOutputFile::writeParentageRegistry ( )

Definition at line 448 of file RootOutputFile.cc.

References edm::PoolOutputModule::basketSize(), edm::hlt::Exception, edm::errors::FatalRootError, edm::detail::ThreadSafeRegistry< KEY, T, E >::getMapped(), edm::detail::ThreadSafeRegistry< KEY, T, E >::insertMapped(), edm::detail::ThreadSafeRegistry< KEY, T, E >::instance(), om_, edm::poolNames::parentageBranchName(), parentageIDs_, and parentageTree_.

448  {
449  Parentage const* desc(0);
450 
451  if(!parentageTree_->Branch(poolNames::parentageBranchName().c_str(),
452  &desc, om_->basketSize(), 0))
454  << "Failed to create a branch for Parentages in the output file";
455 
456 
457  //NOTE: for some reason the empty Parentage is not added to the registry some of the time
459  ptReg.insertMapped(Parentage());
460 
461  std::vector<ParentageID> orderedIDs(parentageIDs_.size());
462  for(std::map<ParentageID,unsigned int>::const_iterator it = parentageIDs_.begin(),
463  itEnd = parentageIDs_.end();
464  it != itEnd;
465  ++it) {
466  orderedIDs[it->second]=it->first;
467  }
468  //now put them into the TTree in the correct order
469  for(std::vector<ParentageID>::const_iterator it = orderedIDs.begin(),
470  itEnd = orderedIDs.end();
471  it != itEnd;
472  ++it) {
473  desc = ptReg.getMapped(*it);
474  if (0!=desc) {
475  //NOTE: some old format files have missing Parentage info
476  // so this can't be fatal.
477  parentageTree_->Fill();
478  }
479  }
480  }
int const & basketSize() const
static ThreadSafeRegistry * instance()
edm::detail::ThreadSafeRegistry< edm::ParentageID, edm::Parentage > ParentageRegistry
std::map< ParentageID, unsigned int > parentageIDs_
PoolOutputModule const * om_
std::string const & parentageBranchName()
Definition: BranchType.cc:162
void edm::RootOutputFile::writeProcessConfigurationRegistry ( )

Definition at line 514 of file RootOutputFile.cc.

References b, edm::PoolOutputModule::basketSize(), edm::detail::ThreadSafeRegistry< KEY, T, E >::data(), alignCSCRings::e, i, edm::detail::ThreadSafeRegistry< KEY, T, E >::instance(), metaDataTree_, om_, AlCaHLTBitMon_ParallelJobs::p, edm::poolNames::processConfigurationBranchName(), and edm::sort_all().

514  {
516  Map const& procConfigMap = ProcessConfigurationRegistry::instance()->data();
517  ProcessConfigurationVector procConfigVector;
518  for(Map::const_iterator i = procConfigMap.begin(), e = procConfigMap.end(); i != e; ++i) {
519  procConfigVector.push_back(i->second);
520  }
521  sort_all(procConfigVector);
522  ProcessConfigurationVector* p = &procConfigVector;
523  TBranch* b = metaDataTree_->Branch(poolNames::processConfigurationBranchName().c_str(), &p, om_->basketSize(), 0);
524  assert(b);
525  b->Fill();
526  }
int i
Definition: DBlmapReader.cc:9
int const & basketSize() const
static ThreadSafeRegistry * instance()
ProcessConfigurationRegistry::vector_type ProcessConfigurationVector
std::map< key_type, value_type > collection_type
PoolOutputModule const * om_
void sort_all(RandomAccessSequence &s)
wrappers for std::sort
Definition: Algorithms.h:120
double b
Definition: hdecay.h:120
std::string const & processConfigurationBranchName()
Definition: BranchType.cc:202
collection_type & data()
Provide access to the contained collection.
void edm::RootOutputFile::writeProcessHistoryRegistry ( )

Definition at line 528 of file RootOutputFile.cc.

References b, edm::PoolOutputModule::basketSize(), edm::detail::ThreadSafeRegistry< KEY, T, E >::data(), alignCSCRings::e, i, edm::detail::ThreadSafeRegistry< KEY, T, E >::instance(), metaDataTree_, om_, AlCaHLTBitMon_ParallelJobs::p, and edm::poolNames::processHistoryBranchName().

528  {
530  Map const& procHistoryMap = ProcessHistoryRegistry::instance()->data();
531  ProcessHistoryVector procHistoryVector;
532  for(Map::const_iterator i = procHistoryMap.begin(), e = procHistoryMap.end(); i != e; ++i) {
533  procHistoryVector.push_back(i->second);
534  }
535  ProcessHistoryVector* p = &procHistoryVector;
536  TBranch* b = metaDataTree_->Branch(poolNames::processHistoryBranchName().c_str(), &p, om_->basketSize(), 0);
537  assert(b);
538  b->Fill();
539  }
int i
Definition: DBlmapReader.cc:9
int const & basketSize() const
static ThreadSafeRegistry * instance()
std::map< key_type, value_type > collection_type
PoolOutputModule const * om_
ProcessHistoryRegistry::vector_type ProcessHistoryVector
std::string const & processHistoryBranchName()
Definition: BranchType.cc:197
double b
Definition: hdecay.h:120
collection_type & data()
Provide access to the contained collection.
void edm::RootOutputFile::writeProductDependencies ( )

Definition at line 588 of file RootOutputFile.cc.

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

588  {
589  BranchChildren& pDeps = const_cast<BranchChildren&>(om_->branchChildren());
590  BranchChildren* ppDeps = &pDeps;
591  TBranch* b = metaDataTree_->Branch(poolNames::productDependenciesBranchName().c_str(), &ppDeps, om_->basketSize(), 0);
592  assert(b);
593  b->Fill();
594  }
int const & basketSize() const
PoolOutputModule const * om_
BranchChildren const & branchChildren() const
Definition: OutputModule.h:66
double b
Definition: hdecay.h:120
std::string const & productDependenciesBranchName()
Definition: BranchType.cc:177
void edm::RootOutputFile::writeProductDescriptionRegistry ( )

Definition at line 564 of file RootOutputFile.cc.

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

564  {
565  // Make a local copy of the ProductRegistry, removing any transient or pruned products.
566  typedef ProductRegistry::ProductList ProductList;
568  ProductRegistry pReg(reg->productList());
569  ProductList& pList = const_cast<ProductList &>(pReg.productList());
570  std::set<BranchID>::iterator end = branchesWithStoredHistory_.end();
571  for(ProductList::iterator it = pList.begin(); it != pList.end();) {
572  if(branchesWithStoredHistory_.find(it->second.branchID()) == end) {
573  // avoid invalidating iterator on deletion
574  ProductList::iterator itCopy = it;
575  ++it;
576  pList.erase(itCopy);
577 
578  } else {
579  ++it;
580  }
581  }
582 
583  ProductRegistry* ppReg = &pReg;
584  TBranch* b = metaDataTree_->Branch(poolNames::productDescriptionBranchName().c_str(), &ppReg, om_->basketSize(), 0);
585  assert(b);
586  b->Fill();
587  }
int const & basketSize() const
std::map< BranchKey, BranchDescription > ProductList
std::set< BranchID > branchesWithStoredHistory_
PoolOutputModule const * om_
#define end
Definition: vmac.h:38
double b
Definition: hdecay.h:120
std::string const & productDescriptionBranchName()
Definition: BranchType.cc:172
void edm::RootOutputFile::writeRun ( RunPrincipal const &  r)

Definition at line 433 of file RootOutputFile.cc.

References edm::IndexIntoFile::addEntry(), edm::RunPrincipal::aux(), edm::detail::ThreadSafeRegistry< KEY, T, E >::extra(), fillBranches(), indexIntoFile_, edm::InRun, edm::detail::ThreadSafeRegistry< KEY, T, E >::instance(), edm::RootOutputTree::optimizeBaskets(), edm::Principal::processHistoryID(), edm::RunAuxiliary::run(), runAux_, runEntryNumber_, runTree_, and edm::RunAuxiliary::setProcessHistoryID().

433  {
434  // Auxiliary branch
435  // NOTE: runAux_ must be filled before calling fillBranches since it gets written out in that routine.
436  runAux_ = r.aux();
437  // Use the updated process historyID
438  runAux_.setProcessHistoryID(r.processHistoryID());
439  // Store the reduced ID in the IndexIntoFile
440  ProcessHistoryID reducedPHID = ProcessHistoryRegistry::instance()->extra().reduceProcessHistoryID(r.processHistoryID());
441  // Add run to index.
442  indexIntoFile_.addEntry(reducedPHID, runAux_.run(), 0U, 0U, runEntryNumber_);
443  ++runEntryNumber_;
444  fillBranches(InRun, r, 0);
445  runTree_.optimizeBaskets(10ULL*1024*1024);
446  }
static ThreadSafeRegistry * instance()
void fillBranches(BranchType const &branchType, Principal const &principal, StoredProductProvenanceVector *productProvenanceVecPtr)
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

Member Data Documentation

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

Definition at line 100 of file RootOutputFile.h.

Referenced by beginInputFile().

bool edm::RootOutputFile::dataTypeReported_
private

Definition at line 123 of file RootOutputFile.h.

Referenced by writeOne().

StoredProductProvenanceVector edm::RootOutputFile::eventEntryInfoVector_
private

Definition at line 115 of file RootOutputFile.h.

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

Definition at line 103 of file RootOutputFile.h.

Referenced by writeIndexIntoFile(), and writeOne().

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

Definition at line 102 of file RootOutputFile.h.

Referenced by RootOutputFile(), and writeFileIdentifier().

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

Definition at line 95 of file RootOutputFile.h.

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

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

Definition at line 101 of file RootOutputFile.h.

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

IndexIntoFile edm::RootOutputFile::indexIntoFile_
private

Definition at line 106 of file RootOutputFile.h.

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

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

Definition at line 96 of file RootOutputFile.h.

Referenced by RootOutputFile().

LuminosityBlockAuxiliary edm::RootOutputFile::lumiAux_
private

Definition at line 110 of file RootOutputFile.h.

Referenced by writeLuminosityBlock().

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

Definition at line 104 of file RootOutputFile.h.

Referenced by writeLuminosityBlock().

RootOutputTree edm::RootOutputFile::lumiTree_
private

Definition at line 120 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 108 of file RootOutputFile.h.

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

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

Definition at line 124 of file RootOutputFile.h.

Referenced by insertProductProvenance(), and writeParentageRegistry().

TTree* edm::RootOutputFile::parentageTree_
private

Definition at line 109 of file RootOutputFile.h.

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

BranchListIndexes const* edm::RootOutputFile::pBranchListIndexes_
private

Definition at line 117 of file RootOutputFile.h.

Referenced by RootOutputFile(), and writeOne().

EventAuxiliary const* edm::RootOutputFile::pEventAux_
private

Definition at line 112 of file RootOutputFile.h.

Referenced by RootOutputFile(), and writeOne().

StoredProductProvenanceVector* edm::RootOutputFile::pEventEntryInfoVector_
private

Definition at line 116 of file RootOutputFile.h.

Referenced by RootOutputFile(), and writeOne().

EventSelectionIDVector const* edm::RootOutputFile::pEventSelectionIDs_
private

Definition at line 118 of file RootOutputFile.h.

Referenced by RootOutputFile(), and writeOne().

LuminosityBlockAuxiliary const* edm::RootOutputFile::pLumiAux_
private

Definition at line 113 of file RootOutputFile.h.

Referenced by RootOutputFile().

RunAuxiliary const* edm::RootOutputFile::pRunAux_
private

Definition at line 114 of file RootOutputFile.h.

Referenced by RootOutputFile().

JobReport::Token edm::RootOutputFile::reportToken_
private

Definition at line 97 of file RootOutputFile.h.

Referenced by beginInputFile(), finishEndFile(), RootOutputFile(), and writeOne().

RunAuxiliary edm::RootOutputFile::runAux_
private

Definition at line 111 of file RootOutputFile.h.

Referenced by writeRun().

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

Definition at line 105 of file RootOutputFile.h.

Referenced by writeRun().

RootOutputTree edm::RootOutputFile::runTree_
private

Definition at line 121 of file RootOutputFile.h.

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

RootOutputTreePtrArray edm::RootOutputFile::treePointers_
private

Definition at line 122 of file RootOutputFile.h.

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

int edm::RootOutputFile::whyNotFastClonable_
private

Definition at line 99 of file RootOutputFile.h.

Referenced by beginInputFile(), and fillBranches().