CMS 3D CMS Logo

/data/doxygen/doxygen-1.7.3/gen/CMSSW_4_2_8/src/DataFormats/HcalDigi/interface/HcalUnpackerReport.h

Go to the documentation of this file.
00001 #ifndef DATAFORMATS_HCALDIGI_HCALUNPACKERREPORT_H
00002 #define DATAFORMATS_HCALDIGI_HCALUNPACKERREPORT_H 1
00003 
00004 #include <vector>
00005 #include <map>
00006 #include "DataFormats/DetId/interface/DetId.h"
00007 #include "DataFormats/HcalDetId/interface/HcalElectronicsId.h"
00008 #include "DataFormats/HcalDigi/interface/HcalCalibrationEventTypes.h"
00009 
00016 class HcalUnpackerReport {
00017 public:
00018   HcalUnpackerReport();
00019   const std::vector<int>& getFedsUnpacked() const { return FEDsUnpacked_; }
00020   const std::vector<int>& getFedsError() const { return FEDsError_; }
00021   bool errorFree() const;
00022   bool anyValidHCAL() const;
00023   int unmappedDigis() const { return unmappedDigis_; }
00024   int unmappedTPDigis() const { return unmappedTPDigis_; }
00025   int spigotFormatErrors() const { return spigotFormatErrors_; }
00026   int badQualityDigis() const { return badqualityDigis_; }
00027   int totalDigis() const { return totalDigis_; }
00028   int totalTPDigis() const { return totalTPDigis_; }
00029   int totalHOTPDigis() const { return totalHOTPDigis_; }
00030   bool unsuppressedChannels() const { return unsuppressed_; }
00031 
00032   bool hasFedWithCalib() const { return !fedInfo_.empty(); }
00033   HcalCalibrationEventType fedCalibType(uint16_t fed) const;
00034 
00035   void setFedCalibInfo(uint16_t fed, HcalCalibrationEventType ctype);
00036 
00037   typedef std::vector<DetId> DetIdVector;
00038   typedef std::vector<HcalElectronicsId> ElectronicsIdVector;
00039 
00040   DetIdVector::const_iterator bad_quality_begin() const { return badqualityIds_.begin(); }
00041   DetIdVector::const_iterator bad_quality_end() const { return badqualityIds_.end(); }
00042   ElectronicsIdVector::const_iterator unmapped_begin() const { return unmappedIds_.begin(); }
00043   ElectronicsIdVector::const_iterator unmapped_end() const { return unmappedIds_.end(); }
00044 
00045   bool hasReportInfo(const std::string& name) const;
00046   std::string getReportInfo(const std::string& name) const;
00047   std::vector<std::string> getReportKeys() const;
00048   
00049   // setters
00050   void addUnpacked(int fed);
00051   void addError(int fed);
00052   void countDigi();
00053   void countTPDigi(bool ho=false);
00054   void countUnmappedDigi();
00055   void countUnmappedTPDigi();
00056   void countSpigotFormatError();
00057   void countBadQualityDigi();
00058   void countUnmappedDigi(const HcalElectronicsId& eid);
00059   void countUnmappedTPDigi(const HcalElectronicsId& eid);
00060   void countBadQualityDigi(const DetId& did);
00061   void setUnsuppressed(bool isSup);
00062   void setReportInfo(const std::string& name, const std::string& value);
00063 private:
00064   std::vector<int> FEDsUnpacked_;
00065   std::vector<int> FEDsError_;
00066   int unmappedDigis_, unmappedTPDigis_;
00067   int spigotFormatErrors_, badqualityDigis_;
00068   int totalDigis_, totalTPDigis_, totalHOTPDigis_;
00069   DetIdVector badqualityIds_;
00070   ElectronicsIdVector unmappedIds_;
00071   bool unsuppressed_;
00072 
00073   std::vector<std::string> reportInfo_;
00074   std::vector<uint16_t> fedInfo_; // first is fed, second is type
00075 
00076 };
00077 
00078 #endif