CMS 3D CMS Logo

EdmEventSize.h
Go to the documentation of this file.
1 #ifndef PerfTools_EdmEventSize_H
2 #define PerfTools_EdmEventSize_H
3 
4 #include <string>
5 #include <vector>
6 #include <iosfwd>
7 
8 namespace perftools {
9 
24  class EdmEventSize {
25  public:
27  struct Error {
28  Error(std::string const& idescr, int icode) : descr(idescr), code(icode) {}
30  int code;
31  };
32 
34  struct BranchRecord {
35  BranchRecord() : compr_size(0.), uncompr_size(0.) {}
36  BranchRecord(std::string const& iname, double compr, double uncompr)
37  : fullName(iname), name(iname), compr_size(compr), uncompr_size(uncompr) {}
40  double compr_size;
41  double uncompr_size;
42  };
43 
44  typedef std::vector<BranchRecord> Branches;
45 
47  EdmEventSize();
49  explicit EdmEventSize(std::string const& fileName, std::string const& treeName = "Events");
50 
52  void parseFile(std::string const& fileName, std::string const& treeName = "Events");
53 
55  void sortAlpha();
56 
58  void formatNames();
59 
61  void dump(std::ostream& co, bool header = true) const;
62 
64  void produceHistos(std::string const& plot, std::string const& file, int top = 0) const;
65 
66  private:
68  int m_nEvents;
69  Branches m_branches;
70  };
71 
72 } // namespace perftools
73 
74 #endif // PerfTools_EdmEventSize_H
Error(std::string const &idescr, int icode)
Definition: EdmEventSize.h:28
void dump(std::ostream &co, bool header=true) const
dump the ascii table on "co"
BranchRecord(std::string const &iname, double compr, double uncompr)
Definition: EdmEventSize.h:36
void parseFile(std::string const &fileName, std::string const &treeName="Events")
read file, compute branch size, sort by size
Definition: EdmEventSize.cc:79
EdmEventSize()
Constructor.
Definition: EdmEventSize.cc:73
the information for each branch
Definition: EdmEventSize.h:34
void formatNames()
transform Branch names in "formatted" prodcut identifiers
void sortAlpha()
sort by name
std::vector< BranchRecord > Branches
Definition: EdmEventSize.h:44
void produceHistos(std::string const &plot, std::string const &file, int top=0) const
produce histograms and optionally write them in "file" or as "plot"