Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 13:14:34

0001 /* -*- C++ -*- */
0002 #ifndef EventFilter_CastorRawToDigi_ZdcUnpacker_h
0003 #define EventFilter_CastorRawToDigi_ZdcUnpacker_h 1
0004 
0005 #include "DataFormats/HcalDigi/interface/ZDCDataFrame.h"
0006 #include "DataFormats/HcalDigi/interface/HcalCalibDataFrame.h"
0007 #include "DataFormats/HcalDigi/interface/HcalTriggerPrimitiveDigi.h"
0008 #include "DataFormats/HcalDigi/interface/HcalUnpackerReport.h"
0009 #include "DataFormats/FEDRawData/interface/FEDRawData.h"
0010 #include "CondFormats/HcalObjects/interface/HcalElectronicsMap.h"
0011 #include "CondFormats/CastorObjects/interface/CastorElectronicsMap.h"
0012 #include <set>
0013 #include "DataFormats/HcalDigi/interface/HcalQIESample.h"
0014 #include "EventFilter/CastorRawToDigi/interface/CastorRawCollections.h"
0015 
0016 class ZdcUnpacker {
0017 public:
0018   /// for normal data
0019   ZdcUnpacker(int sourceIdOffset, int beg, int end);
0020   void setExpectedOrbitMessageTime(int time) { expectedOrbitMessageTime_ = time; }
0021   /// For histograms, no begin and end
0022   // void unpack(const FEDRawData& raw, const ZdcElectronicsMap& emap, std::vector<HcalHistogramDigi>& histoDigis);
0023   void unpack(const FEDRawData& raw,
0024               const CastorElectronicsMap& emap,
0025               CastorRawCollections& conts,
0026               HcalUnpackerReport& report,
0027               bool silent = false);
0028   void unpackOld(const FEDRawData& raw,
0029                  const HcalElectronicsMap& emap,
0030                  CastorRawCollections& conts,
0031                  HcalUnpackerReport& report,
0032                  bool silent = false);
0033 
0034 private:
0035   int sourceIdOffset_;            ///< number to subtract from the source id to get the dcc id
0036   int startSample_;               ///< first sample from fed raw data to copy
0037   int endSample_;                 ///< last sample from fed raw data to copy (if present)
0038   int expectedOrbitMessageTime_;  ///< Expected orbit bunch time (needed to evaluate time differences)
0039   std::set<HcalElectronicsId> unknownIds_,
0040       unknownIdsTrig_;  ///< Recorded to limit number of times a log message is generated
0041   int mode_;
0042 };
0043 
0044 #endif  // ZdcUnpacker_h_included