CMS 3D CMS Logo

RPCAMCRawToDigi.h
Go to the documentation of this file.
1 #ifndef EventFilter_RPCRawToDigi_RPCAMCRawToDigi_h
2 #define EventFilter_RPCRawToDigi_RPCAMCRawToDigi_h
3 
6 
10 
11 namespace edm {
13 class Event;
14 class EventSetup;
15 class ParameterSet;
16 class Run;
17 } // namespace edm
18 
19 class RPCAMCUnpacker;
20 
22  : public edm::stream::EDProducer<>
23 {
24 public:
26  ~RPCAMCRawToDigi();
27 
28  static void compute_crc16_64bit(std::uint16_t & crc, std::uint64_t const & word);
29 
31 
32  void beginRun(edm::Run const & run, edm::EventSetup const & setup) override;
33  void produce(edm::Event & event, edm::EventSetup const & setup) override;
34 
35 protected:
36  bool processCDFHeaders(int fed
37  , std::uint64_t const * & word, std::uint64_t const * & word_end
38  , std::uint16_t & crc
39  , RPCAMCLinkCounters & counters) const;
40  bool processCDFTrailers(int fed, unsigned int nwords
41  , std::uint64_t const * & word, std::uint64_t const * & word_end
42  , std::uint16_t & crc
43  , RPCAMCLinkCounters & counters) const;
44  bool processBlocks(int fed
45  , std::uint64_t const * & word, std::uint64_t const * word_end
46  , std::uint16_t & crc
47  , RPCAMCLinkCounters & counters
48  , std::map<RPCAMCLink, rpcamc13::AMCPayload> & amc_payload) const;
49 
50 protected:
52 
53  bool calculate_crc_, fill_counters_;
54 
55  std::unique_ptr<RPCAMCUnpacker> rpc_unpacker_;
56 };
57 
58 inline void RPCAMCRawToDigi::compute_crc16_64bit(std::uint16_t & crc, std::uint64_t const & word)
59 { // overcome constness problem evf::compute_crc_64bit
60  unsigned char const * uchars(reinterpret_cast<unsigned char const *>(&word));
61  for (unsigned char const * uchar = uchars + 7
62  ; uchar >= uchars ; --uchar) {
63  crc = evf::compute_crc_8bit(crc, *uchar);
64  }
65 }
66 
67 #endif // EventFilter_RPCRawToDigi_RPCAMCRawToDigi_h
static void compute_crc16_64bit(std::uint16_t &crc, std::uint64_t const &word)
edm::EDGetTokenT< FEDRawDataCollection > raw_token_
def setup(process, global_tag, zero_tesla=False)
Definition: GeneralSetup.py:1
Definition: config.py:1
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
unsigned long long uint64_t
Definition: Time.h:15
unsigned short compute_crc_8bit(unsigned short crc, unsigned char data)
Definition: CRC16.h:79
HLT enums.
std::unique_ptr< RPCAMCUnpacker > rpc_unpacker_
Definition: event.py:1
Definition: Run.h:44