CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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:
26 
28  struct Error {
29  Error(std::string const & idescr, int icode) :
30  descr(idescr), code(icode){}
32  int code;
33  };
34 
36  struct BranchRecord {
38  compr_size(0.),
39  uncompr_size(0.) {}
40  BranchRecord(std::string const & iname,
41  double compr, double uncompr) :
42  fullName(iname), name(iname),
43  compr_size(compr), uncompr_size(uncompr){}
46  double compr_size;
47  double uncompr_size;
48  };
49 
50  typedef std::vector<BranchRecord> Branches;
51 
53  EdmEventSize();
55  explicit EdmEventSize(std::string const & fileName, std::string const & treeName="Events");
56 
58  void parseFile(std::string const & fileName, std::string const & treeName="Events");
59 
61  void sortAlpha();
62 
64  void formatNames();
65 
67  void dump(std::ostream & co, bool header=true) const;
68 
70  void produceHistos(std::string const & plot, std::string const & file, int top=0) const;
71 
72  private:
74  int m_nEvents;
76 
77  };
78 
79 }
80 
81 #endif // PerfTools_EdmEventSize_H
Error(std::string const &idescr, int icode)
Definition: EdmEventSize.h:29
void dump(std::ostream &co, bool header=true) const
dump the ascii table on &quot;co&quot;
BranchRecord(std::string const &iname, double compr, double uncompr)
Definition: EdmEventSize.h:40
void parseFile(std::string const &fileName, std::string const &treeName="Events")
read file, compute branch size, sort by size
Definition: EdmEventSize.cc:81
EdmEventSize()
Constructor.
Definition: EdmEventSize.cc:73
the information for each branch
Definition: EdmEventSize.h:36
void formatNames()
transform Branch names in &quot;formatted&quot; prodcut identifiers
string top
Definition: rpc-layouts.py:8
void sortAlpha()
sort by name
std::vector< BranchRecord > Branches
Definition: EdmEventSize.h:50
void produceHistos(std::string const &plot, std::string const &file, int top=0) const
produce histograms and optionally write them in &quot;file&quot; or as &quot;plot&quot;