CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
RootOutputFile.h
Go to the documentation of this file.
1 #ifndef IOPool_Output_RootOutputFile_h
2 #define IOPool_Output_RootOutputFile_h
3 
5 //
6 // Class RootOutputFile
7 //
8 // Current Author: Bill Tanenbaum
9 //
11 
12 #include <array>
13 #include <map>
14 #include <string>
15 #include <vector>
16 
17 #include "boost/shared_ptr.hpp"
18 
33 
34 class TTree;
35 class TFile;
36 
37 namespace edm {
38  class PoolOutputModule;
39 
41  public:
44  typedef std::array<RootOutputTree*, NumBranchTypes> RootOutputTreePtrArray;
45  explicit RootOutputFile(PoolOutputModule* om, std::string const& fileName,
46  std::string const& logicalFileName);
48  void writeOne(EventPrincipal const& e);
49  //void endFile();
51  void writeRun(RunPrincipal const& r);
53  void writeFileIdentifier();
54  void writeIndexIntoFile();
62 
63  void finishEndFile();
64  void beginInputFile(FileBlock const& fb, int remainingEvents);
66  bool shouldWeCloseFile() const;
67 
68  std::string const& fileName() const {return file_;}
69 
70  private:
71 
72  //-------------------------------
73  // Local types
74  //
75 
76  //-------------------------------
77  // Private functions
78 
79  void setBranchAliases(TTree* tree, Selections const& branches) const;
80 
82  Principal const& principal,
83  StoredProductProvenanceVector* productProvenanceVecPtr);
84 
85  void insertAncestors(ProductProvenance const& iGetParents,
87  bool produced,
88  std::set<StoredProductProvenance>& oToFill);
89 
91  std::set<StoredProductProvenance>& oToInsert);
92  //-------------------------------
93  // Member data
94 
95  std::string file_;
96  std::string logicalFile_;
101  boost::shared_ptr<TFile> filePtr_;
124  std::map<ParentageID,unsigned int> parentageIDs_;
125  std::set<BranchID> branchesWithStoredHistory_;
126  };
127 
128 }
129 
130 #endif
void beginInputFile(FileBlock const &fb, int remainingEvents)
LuminosityBlockAuxiliary lumiAux_
void writeProcessHistoryRegistry()
void writeOne(EventPrincipal const &e)
std::array< RootOutputTree *, NumBranchTypes > RootOutputTreePtrArray
void writeProcessConfigurationRegistry()
std::vector< OutputItem > OutputItemList
void insertAncestors(ProductProvenance const &iGetParents, EventPrincipal const &principal, bool produced, std::set< StoredProductProvenance > &oToFill)
void setBranchAliases(TTree *tree, Selections const &branches) const
bool shouldWeCloseFile() const
long long EntryNumber_t
BranchType
Definition: BranchType.h:11
std::set< BranchID > branchesWithStoredHistory_
std::vector< EventSelectionID > EventSelectionIDVector
std::string const & fileName() const
std::map< ParentageID, unsigned int > parentageIDs_
RootOutputTree eventTree_
std::vector< BranchListIndex > BranchListIndexes
void writeRun(RunPrincipal const &r)
PoolOutputModule const * om_
IndexIntoFile::EntryNumber_t eventEntryNumber_
LuminosityBlockAuxiliary const * pLumiAux_
PoolOutputModule::OutputItem OutputItem
void fillBranches(BranchType const &branchType, Principal const &principal, StoredProductProvenanceVector *productProvenanceVecPtr)
std::string logicalFile_
PoolOutputModule::OutputItemList OutputItemList
std::size_t Token
Definition: JobReport.h:43
EventSelectionIDVector const * pEventSelectionIDs_
StoredProductProvenanceVector * pEventEntryInfoVector_
eventsetup::produce::Produce produced
Definition: ESProducts.cc:21
RootOutputTree runTree_
StoredProductProvenanceVector eventEntryInfoVector_
bool insertProductProvenance(const ProductProvenance &, std::set< StoredProductProvenance > &oToInsert)
std::vector< StoredProductProvenance > StoredProductProvenanceVector
void respondToCloseInputFile(FileBlock const &fb)
IndexIntoFile indexIntoFile_
IndexIntoFile::EntryNumber_t runEntryNumber_
void writeLuminosityBlock(LuminosityBlockPrincipal const &lb)
EventAuxiliary const * pEventAux_
RunAuxiliary runAux_
void writeProductDescriptionRegistry()
RootOutputFile(PoolOutputModule *om, std::string const &fileName, std::string const &logicalFileName)
RootOutputTreePtrArray treePointers_
BranchListIndexes const * pBranchListIndexes_
IndexIntoFile::EntryNumber_t lumiEntryNumber_
RootOutputTree lumiTree_
boost::shared_ptr< TFile > filePtr_
RunAuxiliary const * pRunAux_
JobReport::Token reportToken_