00001 #ifndef GctRawToDigi_h 00002 #define GctRawToDigi_h 00003 00004 // -*- C++ -*- 00005 // 00006 // Package: GctRawToDigi 00007 // Class: GctRawToDigi 00008 // 00016 // 00017 // Original Author: Jim Brooke 00018 // Created: Wed Nov 1 11:57:10 CET 2006 00019 // $Id: GctRawToDigi.h,v 1.21.2.1 2009/04/27 14:30:56 frazier Exp $ 00020 // 00021 // 00022 00023 // system include files 00024 #include <memory> 00025 #include <ostream> 00026 #include <string> 00027 00028 // user include files 00029 #include "FWCore/Framework/interface/Frameworkfwd.h" 00030 #include "FWCore/Framework/interface/EDProducer.h" 00031 #include "FWCore/Framework/interface/Event.h" 00032 #include "FWCore/ParameterSet/interface/ParameterSet.h" 00033 #include "FWCore/ParameterSet/interface/InputTag.h" 00034 00035 #include "DataFormats/FEDRawData/interface/FEDRawData.h" 00036 00037 #include "EventFilter/GctRawToDigi/src/GctUnpackCollections.h" 00038 #include "EventFilter/GctRawToDigi/src/GctFormatTranslateBase.h" 00039 00040 00041 // ******************************************************************* 00042 // *** THE UNPACK PROCESS MUST NEVER THROW ANY KIND OF EXCEPTION! *** 00043 // ******************************************************************* 00044 00045 class GctRawToDigi : public edm::EDProducer 00046 { 00047 public: 00048 00049 explicit GctRawToDigi(const edm::ParameterSet&); 00050 ~GctRawToDigi(); 00051 00052 00053 private: // methods 00054 00055 virtual void beginJob(const edm::EventSetup&) ; 00056 virtual void produce(edm::Event&, const edm::EventSetup&); 00057 00059 00060 void unpack(const FEDRawData& d, edm::Event& e, GctUnpackCollections * const colls); 00061 00063 00064 bool autoDetectRequiredFormatTranslator(const unsigned char * data); 00065 00067 void doVerboseOutput(const GctBlockHeaderCollection& bHdrs, const GctUnpackCollections * const colls) const; 00068 00069 virtual void endJob(); 00070 00071 private: // members 00072 00074 static const unsigned MAX_BLOCKS = 256; 00075 00076 edm::InputTag inputLabel_; 00077 int fedId_; 00078 00079 // unpacking options 00080 const bool hltMode_; 00081 const bool unpackSharedRegions_; 00082 const unsigned formatVersion_; 00083 const bool verbose_; 00084 00085 // Block to Digi converter 00086 GctFormatTranslateBase * formatTranslator_; 00087 00088 unsigned unpackFailures_; 00089 }; 00090 00091 #endif