Go to the documentation of this file.00001 #ifndef TriggerReportHelpers_H
00002 #define TriggerReportHelpers_H
00003
00004 #include "xdata/String.h"
00005 #include "xdata/UnsignedInteger32.h"
00006 #include "xdata/Table.h"
00007
00008 #include "EventFilter/Utilities/interface/MsgBuf.h"
00009 #include "EventFilter/Utilities/interface/TriggerReportDef.h"
00010
00011 #include <vector>
00012 #include <string>
00013
00014 namespace edm{
00015 class ModuleDescription;
00016 }
00017
00018 namespace evf{
00019
00020
00021 namespace fuep{
00022 class TriggerReportHelpers{
00023 public:
00024 TriggerReportHelpers()
00025 : eventsProcessed_(0)
00026 , eventsAccepted_(0)
00027 , tableFormatted_(false)
00028 , lumiSectionIndex_(0)
00029 , prescaleIndex_(0)
00030 , cache_(sizeof(TriggerReportStatic),MSQS_MESSAGE_TYPE_TRR)
00031 , adjustLsIndex_(false)
00032 {}
00033 void resetFormat(){tableFormatted_ = false;}
00034 void printReportTable();
00035 void printTriggerReport(edm::TriggerReport &);
00036 void triggerReportUpdate(edm::TriggerReport &, unsigned int, unsigned int, bool = true);
00037 void packedTriggerReportToTable();
00038 void formatReportTable(edm::TriggerReport &
00039 , std::vector<edm::ModuleDescription const*>&
00040 , std::string &pathIndexTable
00041 , bool noNukeLegenda);
00042 void fillPathIndexTable(std::string &);
00043 xdata::Table &getTable(){return triggerReportAsTable_;}
00044 xdata::Table &getTableWithNames(){return triggerReportAsTableWithNames_;}
00045 xdata::UnsignedInteger32 &getProcThisLumi(){return eventsProcessed_;}
00046 xdata::UnsignedInteger32 &getAccThisLumi(){return eventsAccepted_;}
00047 bool checkLumiSection(unsigned int ls) {return (ls == lumiSectionIndex_);}
00048 void packTriggerReport(edm::TriggerReport &, ShmOutputModuleRegistry *);
00049 void sumAndPackTriggerReport(MsgBuf &);
00050 void resetPackedTriggerReport();
00051 void adjustLsIndexForRestart(){adjustLsIndex_ = true; if(lumiSectionIndex_>1) lumiSectionIndex_--;}
00052 void resetTriggerReport();
00053 evf::MsgBuf & getPackedTriggerReport(){return cache_;}
00054 TriggerReportStatic *getPackedTriggerReportAsStruct(){return (TriggerReportStatic *)cache_->mtext;}
00055 xdata::String *getPathLegenda(){return &pathLegenda_;}
00056 void resetLumiSectionReferenceIndex(){lumiSectionIndex_=0;}
00057 void withdrawLumiSectionIncrement(){if(lumiSectionIndex_>0) lumiSectionIndex_--;}
00058 unsigned int getLumiSectionReferenceIndex(){return lumiSectionIndex_;}
00059 std::string findLabelOfModuleTypeInEndPath(edm::TriggerReport &,
00060 std::vector<edm::ModuleDescription const*>&,
00061 unsigned int,
00062 std::string);
00063 unsigned int getl1pre(unsigned int ind){return pl1pre_[ind];}
00064 unsigned int getps(unsigned int ind){return pps_[ind];}
00065 unsigned int getaccept(unsigned int ind){return paccept_[ind];}
00066 unsigned int getfailed(unsigned int ind){return pfailed_[ind];}
00067 unsigned int getexcept(unsigned int ind){return pexcept_[ind];}
00068 private:
00069
00070 xdata::UnsignedInteger32 eventsProcessed_;
00071 xdata::UnsignedInteger32 eventsAccepted_;
00072 xdata::Table triggerReportAsTable_;
00073 xdata::Table triggerReportAsTableWithNames_;
00074 xdata::String pathLegenda_;
00075 bool tableFormatted_;
00076 std::vector<int> l1pos_;
00077 std::vector<int> pspos_;
00078 std::vector<std::string> outname_;
00079 static const std::string columns[5];
00080 std::vector<std::string> paths_;
00081 std::vector<xdata::UnsignedInteger32> l1pre_;
00082 std::vector<xdata::UnsignedInteger32> ps_;
00083 std::vector<xdata::UnsignedInteger32> accept_;
00084 std::vector<xdata::UnsignedInteger32> except_;
00085 std::vector<xdata::UnsignedInteger32> failed_;
00086 std::vector<unsigned int> pl1pre_;
00087 std::vector<unsigned int> pps_;
00088 std::vector<unsigned int> paccept_;
00089 std::vector<unsigned int> pexcept_;
00090 std::vector<unsigned int> pfailed_;
00091 std::map<std::string, xdata::UnsignedInteger32> pathIndexMap_;
00092 unsigned int lumiSectionIndex_;
00093 unsigned int prescaleIndex_;
00094 edm::TriggerReport trp_;
00095 MsgBuf cache_;
00096 bool adjustLsIndex_;
00097 };
00098 }
00099 }
00100
00101
00102
00103 #endif