00001 #ifndef EventFilter_RPCRawToDigi_RPCRawDataCounts_H 00002 #define EventFilter_RPCRawToDigi_RPCRawDataCounts_H 00003 00004 #include <map> 00005 #include <vector> 00006 #include <string> 00007 #include "TH1F.h" 00008 00009 class RPCRawDataCounts { 00010 public: 00011 enum ReadoutError { NoProblem = 0, 00012 HeaderCheckFail = 1, 00013 InconsitentFedId = 2, 00014 TrailerCheckFail = 3, 00015 InconsistentDataSize = 4, 00016 InvalidLB = 5, 00017 EmptyPackedStrips = 6, 00018 InvalidDetId = 7, 00019 InvalidStrip = 8 }; 00020 RPCRawDataCounts() {} 00021 ~RPCRawDataCounts() { } 00022 void addRecordType(int fed, int type, int weight=1); 00023 void addReadoutError(int error, int weight=1); 00024 void operator+= (const RPCRawDataCounts& ); 00025 std::string print() const; 00026 00027 void recordTypeVector(int fedid, std::vector<double>& out) const; 00028 void readoutErrorVector(std::vector<double>& out) const; 00029 00030 TH1F * recordTypeHisto(int fedid) const; 00031 TH1F * readoutErrorHisto() const; 00032 00033 static std::string readoutErrorName(const ReadoutError & code); 00034 00035 private: 00036 std::map<int, std::vector<int> > theRecordTypes; 00037 std::map<int,int> theReadoutErrors; 00038 }; 00039 #endif