CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_3_10_patch1/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   int emptyEventSpigots() const { return emptyEventSpigots_; }
00031   int OFWSpigots() const { return ofwSpigots_; }
00032   int busySpigots() const { return busySpigots_; }
00033 
00034   bool unsuppressedChannels() const { return unsuppressed_; }
00035 
00036   bool hasFedWithCalib() const { return !fedInfo_.empty(); }
00037   HcalCalibrationEventType fedCalibType(uint16_t fed) const;
00038 
00039   void setFedCalibInfo(uint16_t fed, HcalCalibrationEventType ctype);
00040 
00041   typedef std::vector<DetId> DetIdVector;
00042   typedef std::vector<HcalElectronicsId> ElectronicsIdVector;
00043 
00044   DetIdVector::const_iterator bad_quality_begin() const { return badqualityIds_.begin(); }
00045   DetIdVector::const_iterator bad_quality_end() const { return badqualityIds_.end(); }
00046   ElectronicsIdVector::const_iterator unmapped_begin() const { return unmappedIds_.begin(); }
00047   ElectronicsIdVector::const_iterator unmapped_end() const { return unmappedIds_.end(); }
00048 
00049   bool hasReportInfo(const std::string& name) const;
00050   std::string getReportInfo(const std::string& name) const;
00051   std::vector<std::string> getReportKeys() const;
00052   
00053   // setters
00054   void addUnpacked(int fed);
00055   void addError(int fed);
00056   void countDigi();
00057   void countTPDigi(bool ho=false);
00058   void countUnmappedDigi();
00059   void countUnmappedTPDigi();
00060   void countSpigotFormatError();
00061   void countBadQualityDigi();
00062   void countEmptyEventSpigot();
00063   void countOFWSpigot();
00064   void countBusySpigot();
00065   void countUnmappedDigi(const HcalElectronicsId& eid);
00066   void countUnmappedTPDigi(const HcalElectronicsId& eid);
00067   void countBadQualityDigi(const DetId& did);
00068   void setUnsuppressed(bool isSup);
00069   void setReportInfo(const std::string& name, const std::string& value);
00070 private:
00071   std::vector<int> FEDsUnpacked_;
00072   std::vector<int> FEDsError_;
00073   int unmappedDigis_, unmappedTPDigis_;
00074   int spigotFormatErrors_, badqualityDigis_;
00075   int totalDigis_, totalTPDigis_, totalHOTPDigis_;
00076   DetIdVector badqualityIds_;
00077   ElectronicsIdVector unmappedIds_;
00078   bool unsuppressed_;
00079 
00080   std::vector<std::string> reportInfo_;
00081   std::vector<uint16_t> fedInfo_; // first is fed, second is type
00082 
00083   int emptyEventSpigots_,ofwSpigots_,busySpigots_;
00084 };
00085 
00086 #endif