File indexing completed on 2023-03-17 11:15:37
0001 #ifndef PerfTools_EdmEventSize_H
0002 #define PerfTools_EdmEventSize_H
0003
0004 #include <string>
0005 #include <vector>
0006 #include <iosfwd>
0007
0008 namespace perftools {
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024 class EdmEventSize {
0025 public:
0026
0027 struct Error {
0028 Error(std::string const& idescr, int icode) : descr(idescr), code(icode) {}
0029 std::string descr;
0030 int code;
0031 };
0032
0033
0034 struct BranchRecord {
0035 BranchRecord() : compr_size(0.), uncompr_size(0.) {}
0036 BranchRecord(std::string const& iname, double compr, double uncompr)
0037 : fullName(iname), name(iname), compr_size(compr), uncompr_size(uncompr) {}
0038 std::string fullName;
0039 std::string name;
0040 double compr_size;
0041 double uncompr_size;
0042 };
0043
0044 typedef std::vector<BranchRecord> Branches;
0045
0046
0047 EdmEventSize();
0048
0049 explicit EdmEventSize(std::string const& fileName, std::string const& treeName = "Events");
0050
0051
0052 void parseFile(std::string const& fileName, std::string const& treeName = "Events");
0053
0054
0055 void sortAlpha();
0056
0057
0058 void formatNames();
0059
0060
0061 void dump(std::ostream& co, bool header = true) const;
0062
0063
0064 void produceHistos(std::string const& plot, std::string const& file, int top = 0) const;
0065
0066 private:
0067 std::string m_fileName;
0068 int m_nEvents;
0069 Branches m_branches;
0070 };
0071
0072 }
0073
0074 #endif