File indexing completed on 2025-01-12 23:41:43
0001 #ifndef DaqSource_DTHFakeReader_h
0002 #define DaqSource_DTHFakeReader_h
0003
0004
0005
0006
0007
0008
0009 #include "FWCore/ParameterSet/interface/ConfigurationDescriptions.h"
0010 #include "FWCore/Framework/interface/one/EDProducer.h"
0011 #include "FWCore/Framework/interface/Event.h"
0012 #include "FWCore/Framework/interface/EventSetup.h"
0013 #include "FWCore/Framework/interface/LuminosityBlock.h"
0014 #include "FWCore/Framework/interface/EventSetup.h"
0015 #include "DataFormats/Provenance/interface/EventID.h"
0016 #include "DataFormats/FEDRawData/interface/FEDRawDataCollection.h"
0017 #include "EventFilter/Utilities/interface/DTHHeaders.h"
0018 #include <algorithm>
0019
0020 namespace evf {
0021
0022 class DTHFakeReader : public edm::one::EDProducer<> {
0023 public:
0024 DTHFakeReader(const edm::ParameterSet& pset);
0025 ~DTHFakeReader() override {}
0026
0027 void produce(edm::Event&, edm::EventSetup const&) override;
0028
0029 static void fillDescriptions(edm::ConfigurationDescriptions& descriptions);
0030
0031 private:
0032
0033 void fillRawData(edm::Event& e, FEDRawDataCollection*& data);
0034
0035 uint32_t fillSLRFED(unsigned char* buf,
0036 const uint32_t sourceId,
0037 edm::EventNumber_t eventId,
0038 const uint32_t orbitId,
0039 uint32_t size,
0040 uint32_t& accum_crc32c);
0041 uint32_t fillFED(
0042 unsigned char* buf, const int sourceId, edm::EventNumber_t eventId, uint32_t size, uint32_t& accum_crc32c);
0043
0044 virtual void beginLuminosityBlock(edm::LuminosityBlock const& iL, edm::EventSetup const& iE);
0045
0046 private:
0047 bool fillRandom_;
0048 unsigned int meansize_;
0049 unsigned int width_;
0050 unsigned int injected_errors_per_million_events_;
0051 std::vector<unsigned int> sourceIdList_;
0052 unsigned int modulo_error_events_;
0053 unsigned int fakeLs_ = 0;
0054 };
0055 }
0056
0057 #endif