File indexing completed on 2024-04-06 12:10:45
0001 #ifndef EventFilter_L1GlobalTriggerRawToDigi_L1GTDigiToRaw_h
0002 #define EventFilter_L1GlobalTriggerRawToDigi_L1GTDigiToRaw_h
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020 #include <memory>
0021
0022
0023 #include "FWCore/Framework/interface/Frameworkfwd.h"
0024 #include "FWCore/Framework/interface/stream/EDProducer.h"
0025
0026 #include "FWCore/Framework/interface/Event.h"
0027 #include "FWCore/Framework/interface/MakerMacros.h"
0028
0029 #include "FWCore/ParameterSet/interface/ParameterSet.h"
0030 #include "FWCore/Utilities/interface/InputTag.h"
0031 #include "FWCore/Utilities/interface/typedefs.h"
0032 #include "FWCore/Utilities/interface/ESGetToken.h"
0033
0034 #include "DataFormats/L1GlobalTrigger/interface/L1GlobalTriggerReadoutRecord.h"
0035 #include "CondFormats/L1TObjects/interface/L1GtBoardMaps.h"
0036 #include "CondFormats/DataRecord/interface/L1GtBoardMapsRcd.h"
0037
0038
0039 class FEDRawDataCollection;
0040 class L1MuGMTReadoutRecord;
0041 class L1MuGMTReadoutCollection;
0042
0043 class L1GtfeWord;
0044 class L1GtFdlWord;
0045 class L1GtPsbWord;
0046
0047
0048 class L1GTDigiToRaw : public edm::stream::EDProducer<> {
0049 public:
0050
0051 explicit L1GTDigiToRaw(const edm::ParameterSet&);
0052
0053 private:
0054
0055 void produce(edm::Event&, const edm::EventSetup&) override;
0056
0057
0058
0059
0060 void packHeader(unsigned char*, edm::Event&);
0061
0062
0063
0064
0065 void packGTFE(const edm::EventSetup&, unsigned char*, L1GtfeWord&, cms_uint16_t activeBoardsGtValue);
0066
0067
0068 void packFDL(const edm::EventSetup&, unsigned char*, L1GtFdlWord&);
0069
0070
0071
0072 void packPSB(const edm::EventSetup&, unsigned char*, L1GtPsbWord&);
0073
0074
0075 unsigned int packGmtCollection(unsigned char* ptrGt, L1MuGMTReadoutCollection const* digis);
0076
0077
0078 unsigned int packGMT(L1MuGMTReadoutRecord const&, unsigned char*);
0079 unsigned int flipPtQ(unsigned int);
0080
0081
0082 void packTrailer(unsigned char*, unsigned char*, int);
0083
0084 private:
0085
0086
0087 int m_daqGtFedId;
0088
0089
0090 const edm::EDGetTokenT<L1GlobalTriggerReadoutRecord> m_daqGtInputToken;
0091
0092
0093 const edm::EDGetTokenT<L1MuGMTReadoutCollection> m_muGmtInputToken;
0094 const edm::InputTag m_daqGtInputTag;
0095 const edm::InputTag m_muGmtInputTag;
0096
0097
0098 const edm::ESGetToken<L1GtBoardMaps, L1GtBoardMapsRcd> m_l1GtBMToken;
0099
0100
0101 cms_uint16_t m_activeBoardsMaskGt;
0102
0103
0104 int m_totalBxInEvent;
0105
0106
0107
0108 int m_minBxInEvent;
0109
0110
0111
0112 int m_maxBxInEvent;
0113
0114 private:
0115
0116 int m_verbosity;
0117 bool m_isDebugEnabled;
0118 };
0119
0120 #endif