test
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 <memory>
18 
35 
36 class TTree;
37 class TFile;
38 class TClass;
39 
40 namespace edm {
41  class ModuleCallingContext;
42  class PoolOutputModule;
43 
44 
46  public:
49  typedef std::array<edm::propagate_const<RootOutputTree*>, NumBranchTypes> RootOutputTreePtrArray;
51  std::string const& logicalFileName);
53  void writeOne(EventPrincipal const& e, ModuleCallingContext const*);
54  //void endFile();
56  void writeRun(RunPrincipal const& r, ModuleCallingContext const*);
58  void writeFileIdentifier();
59  void writeIndexIntoFile();
67 
68  void finishEndFile();
69  void beginInputFile(FileBlock const& fb, int remainingEvents);
71  bool shouldWeCloseFile() const;
72 
73  std::string const& fileName() const {return file_;}
74 
75  private:
76 
77  //-------------------------------
78  // Local types
79  //
80 
81  //-------------------------------
82  // Private functions
83 
84  void setBranchAliases(TTree* tree, SelectedProducts const& branches) const;
85 
87  Principal const& principal,
88  StoredProductProvenanceVector* productProvenanceVecPtr,
89  ModuleCallingContext const*);
90 
91  void insertAncestors(ProductProvenance const& iGetParents,
93  bool produced,
94  std::set<StoredProductProvenance>& oToFill,
95  ModuleCallingContext const*);
96 
98  std::set<StoredProductProvenance>& oToInsert);
99 
100  std::shared_ptr<TFile const> filePtr() const {return get_underlying_safe(filePtr_);}
101  std::shared_ptr<TFile>& filePtr() {return get_underlying_safe(filePtr_);}
104 
105  //-------------------------------
106  // Member data
107 
138  std::map<ParentageID,unsigned int> parentageIDs_;
139  std::set<BranchID> branchesWithStoredHistory_;
141  };
142 
143 }
144 
145 #endif
void fillBranches(BranchType const &branchType, Principal const &principal, StoredProductProvenanceVector *productProvenanceVecPtr, ModuleCallingContext const *)
void beginInputFile(FileBlock const &fb, int remainingEvents)
LuminosityBlockAuxiliary lumiAux_
std::shared_ptr< TFile > & filePtr()
void writeProcessHistoryRegistry()
void writeRun(RunPrincipal const &r, ModuleCallingContext const *)
void writeOne(EventPrincipal const &e, ModuleCallingContext const *)
std::vector< OutputItem > OutputItemList
edm::propagate_const< TTree * > metaDataTree_
ProcessHistoryRegistry processHistoryRegistry_
StoredProductProvenanceVector *& pEventEntryInfoVector()
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
void writeThinnedAssociationsHelper()
std::map< ParentageID, unsigned int > parentageIDs_
std::shared_ptr< TFile const > filePtr() const
RootOutputTree eventTree_
std::vector< BranchListIndex > BranchListIndexes
edm::propagate_const< PoolOutputModule * > om_
IndexIntoFile::EntryNumber_t eventEntryNumber_
void insertAncestors(ProductProvenance const &iGetParents, EventPrincipal const &principal, bool produced, std::set< StoredProductProvenance > &oToFill, ModuleCallingContext const *)
LuminosityBlockAuxiliary const * pLumiAux_
PoolOutputModule::OutputItem OutputItem
edm::propagate_const< std::shared_ptr< TFile > > filePtr_
std::array< edm::propagate_const< RootOutputTree * >, NumBranchTypes > RootOutputTreePtrArray
std::string logicalFile_
std::shared_ptr< T > & get_underlying_safe(propagate_const< std::shared_ptr< T >> &iP)
PoolOutputModule::OutputItemList OutputItemList
edm::propagate_const< TClass * > wrapperBaseTClass_
std::size_t Token
Definition: JobReport.h:107
EventSelectionIDVector const * pEventSelectionIDs_
edm::propagate_const< TTree * > parameterSetsTree_
eventsetup::produce::Produce produced
Definition: ESProducts.cc:20
edm::propagate_const< StoredProductProvenanceVector * > pEventEntryInfoVector_
void setBranchAliases(TTree *tree, SelectedProducts const &branches) const
RootOutputTree runTree_
StoredProductProvenanceVector eventEntryInfoVector_
edm::propagate_const< TTree * > parentageTree_
bool insertProductProvenance(const ProductProvenance &, std::set< StoredProductProvenance > &oToInsert)
std::vector< StoredProductProvenance > StoredProductProvenanceVector
void respondToCloseInputFile(FileBlock const &fb)
IndexIntoFile indexIntoFile_
IndexIntoFile::EntryNumber_t runEntryNumber_
EventAuxiliary const * pEventAux_
RunAuxiliary runAux_
std::vector< BranchDescription const * > SelectedProducts
void writeProductDescriptionRegistry()
StoredProductProvenanceVector const * pEventEntryInfoVector() const
RootOutputFile(PoolOutputModule *om, std::string const &fileName, std::string const &logicalFileName)
RootOutputTreePtrArray treePointers_
BranchListIndexes const * pBranchListIndexes_
void writeLuminosityBlock(LuminosityBlockPrincipal const &lb, ModuleCallingContext const *)
IndexIntoFile::EntryNumber_t lumiEntryNumber_
RootOutputTree lumiTree_
RunAuxiliary const * pRunAux_
JobReport::Token reportToken_