Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:10:43

0001 #ifndef HcalRawToDigi_h
0002 #define HcalRawToDigi_h
0003 
0004 /** \class HcalRawToDigi
0005  *
0006  * HcalRawToDigi is the EDProducer subclass which runs 
0007  * the Hcal Unpack algorithm.
0008  *
0009  * \author Jeremiah Mans
0010       
0011  *
0012  * \version   1st Version June 10, 2005  
0013 
0014  *
0015  ************************************************************/
0016 
0017 #include "FWCore/Framework/interface/stream/EDProducer.h"
0018 #include "FWCore/Framework/interface/Event.h"
0019 #include "DataFormats/Common/interface/Handle.h"
0020 
0021 #include "FWCore/Framework/interface/EventSetup.h"
0022 #include "FWCore/ParameterSet/interface/ParameterSet.h"
0023 #include "FWCore/Utilities/interface/ESGetToken.h"
0024 #include "EventFilter/HcalRawToDigi/interface/HcalUnpacker.h"
0025 #include "EventFilter/HcalRawToDigi/interface/HcalDataFrameFilter.h"
0026 
0027 #include "DataFormats/FEDRawData/interface/FEDRawDataCollection.h"
0028 #include "CalibFormats/HcalObjects/interface/HcalDbService.h"
0029 #include "CalibFormats/HcalObjects/interface/HcalDbRecord.h"
0030 #include "CondFormats/DataRecord/interface/HcalElectronicsMapRcd.h"
0031 
0032 class HcalRawToDigi : public edm::stream::EDProducer<> {
0033 public:
0034   explicit HcalRawToDigi(const edm::ParameterSet& ps);
0035   ~HcalRawToDigi() override;
0036   static void fillDescriptions(edm::ConfigurationDescriptions& descriptions);
0037   void produce(edm::Event&, const edm::EventSetup&) override;
0038 
0039 private:
0040   edm::EDGetTokenT<FEDRawDataCollection> tok_data_;
0041   edm::ESGetToken<HcalDbService, HcalDbRecord> tok_dbService_;
0042   edm::ESGetToken<HcalElectronicsMap, HcalElectronicsMapRcd> tok_electronicsMap_;
0043   HcalUnpacker unpacker_;
0044   HcalDataFrameFilter filter_;
0045   std::vector<int> fedUnpackList_;
0046   const int firstFED_;
0047   const bool unpackCalib_, unpackZDC_, unpackTTP_;
0048   bool unpackUMNio_;
0049 
0050   // input configs for additional QIE10 samples
0051   std::vector<int> saveQIE10DataNSamples_;
0052   std::vector<std::string> saveQIE10DataTags_;
0053 
0054   // input configs for additional QIE11 samples
0055   std::vector<int> saveQIE11DataNSamples_;
0056   std::vector<std::string> saveQIE11DataTags_;
0057 
0058   const bool silent_, complainEmptyData_;
0059   const int unpackerMode_, expectedOrbitMessageTime_;
0060   std::string electronicsMapLabel_;
0061 
0062   // maps to easily associate nSamples to
0063   // the tag for additional qie10 and qie11 info
0064   std::unordered_map<int, std::string> saveQIE10Info_;
0065   std::unordered_map<int, std::string> saveQIE11Info_;
0066 
0067   struct Statistics {
0068     int max_hbhe, ave_hbhe;
0069     int max_ho, ave_ho;
0070     int max_hf, ave_hf;
0071     int max_tp, ave_tp;
0072     int max_tpho, ave_tpho;
0073     int max_calib, ave_calib;
0074     uint64_t n;
0075   } stats_;
0076 };
0077 
0078 #endif