Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 12:53:36

0001 #ifndef DATAFORMATS_HCALDIGI_HCALUNPACKERREPORT_H
0002 #define DATAFORMATS_HCALDIGI_HCALUNPACKERREPORT_H 1
0003 
0004 #include <vector>
0005 #include <map>
0006 #include "DataFormats/DetId/interface/DetId.h"
0007 #include "DataFormats/HcalDetId/interface/HcalElectronicsId.h"
0008 #include "DataFormats/HcalDigi/interface/HcalCalibrationEventTypes.h"
0009 
0010 /** \class HcalUnpackerReport
0011   *  
0012   * \author J. Mans - Minnesota
0013   */
0014 class HcalUnpackerReport {
0015 public:
0016   HcalUnpackerReport();
0017   const std::vector<int>& getFedsUnpacked() const { return FEDsUnpacked_; }
0018   const std::vector<int>& getFedsError() const { return FEDsError_; }
0019   bool errorFree() const;
0020   bool anyValidHCAL() const;
0021   int unmappedDigis() const { return unmappedDigis_; }
0022   int unmappedTPDigis() const { return unmappedTPDigis_; }
0023   int spigotFormatErrors() const { return spigotFormatErrors_; }
0024   int badQualityDigis() const { return badqualityDigis_; }
0025   int totalDigis() const { return totalDigis_; }
0026   int totalTPDigis() const { return totalTPDigis_; }
0027   int totalHOTPDigis() const { return totalHOTPDigis_; }
0028   int emptyEventSpigots() const { return emptyEventSpigots_; }
0029   int OFWSpigots() const { return ofwSpigots_; }
0030   int busySpigots() const { return busySpigots_; }
0031 
0032   bool unsuppressedChannels() const { return unsuppressed_; }
0033 
0034   bool hasFedWithCalib() const { return !fedInfo_.empty(); }
0035   HcalCalibrationEventType fedCalibType(uint16_t fed) const;
0036 
0037   void setFedCalibInfo(uint16_t fed, HcalCalibrationEventType ctype);
0038 
0039   typedef std::vector<DetId> DetIdVector;
0040   typedef std::vector<HcalElectronicsId> ElectronicsIdVector;
0041 
0042   DetIdVector::const_iterator bad_quality_begin() const { return badqualityIds_.begin(); }
0043   DetIdVector::const_iterator bad_quality_end() const { return badqualityIds_.end(); }
0044   ElectronicsIdVector::const_iterator unmapped_begin() const { return unmappedIds_.begin(); }
0045   ElectronicsIdVector::const_iterator unmapped_end() const { return unmappedIds_.end(); }
0046 
0047   bool hasReportInfo(const std::string& name) const;
0048   std::string getReportInfo(const std::string& name) const;
0049   std::vector<std::string> getReportKeys() const;
0050 
0051   // setters
0052   void addUnpacked(int fed);
0053   void addError(int fed);
0054   void countDigi();
0055   void countTPDigi(bool ho = false);
0056   void countUnmappedDigi();
0057   void countUnmappedTPDigi();
0058   void countSpigotFormatError();
0059   void countBadQualityDigi();
0060   void countEmptyEventSpigot();
0061   void countOFWSpigot();
0062   void countBusySpigot();
0063   void countUnmappedDigi(const HcalElectronicsId& eid);
0064   void countUnmappedTPDigi(const HcalElectronicsId& eid);
0065   void countBadQualityDigi(const DetId& did);
0066   void setUnsuppressed(bool isSup);
0067   void setReportInfo(const std::string& name, const std::string& value);
0068 
0069 private:
0070   std::vector<int> FEDsUnpacked_;
0071   std::vector<int> FEDsError_;
0072   int unmappedDigis_, unmappedTPDigis_;
0073   int spigotFormatErrors_, badqualityDigis_;
0074   int totalDigis_, totalTPDigis_, totalHOTPDigis_;
0075   DetIdVector badqualityIds_;
0076   ElectronicsIdVector unmappedIds_;
0077   bool unsuppressed_;
0078 
0079   std::vector<std::string> reportInfo_;
0080   std::vector<uint16_t> fedInfo_;  // first is fed, second is type
0081 
0082   int emptyEventSpigots_, ofwSpigots_, busySpigots_;
0083 };
0084 
0085 #endif