File indexing completed on 2024-04-06 12:11:06
0001 #ifndef DaqSource_DaqFakeReader_h
0002 #define DaqSource_DaqFakeReader_h
0003
0004
0005
0006
0007
0008
0009
0010 #include "FWCore/ParameterSet/interface/ConfigurationDescriptions.h"
0011 #include "FWCore/Framework/interface/one/EDProducer.h"
0012 #include "FWCore/Framework/interface/Event.h"
0013 #include "FWCore/Framework/interface/EventSetup.h"
0014 #include "FWCore/Framework/interface/LuminosityBlock.h"
0015 #include "FWCore/Framework/interface/EventSetup.h"
0016 #include "DataFormats/Provenance/interface/EventID.h"
0017 #include "DataFormats/FEDRawData/interface/FEDRawDataCollection.h"
0018 #include <algorithm>
0019
0020 class DaqFakeReader : public edm::one::EDProducer<> {
0021 public:
0022
0023
0024
0025 DaqFakeReader(const edm::ParameterSet& pset);
0026 ~DaqFakeReader() override;
0027
0028
0029
0030
0031
0032
0033 virtual int fillRawData(edm::Event& e, FEDRawDataCollection*& data);
0034
0035 void produce(edm::Event&, edm::EventSetup const&) override;
0036
0037 static void fillDescriptions(edm::ConfigurationDescriptions& descriptions);
0038
0039 private:
0040
0041
0042
0043 void fillFEDs(const int, const int, edm::EventID& eID, FEDRawDataCollection& data, float meansize, float width);
0044 void fillTCDSFED(edm::EventID& eID, FEDRawDataCollection& data, uint32_t ls, timeval* now);
0045 virtual void beginLuminosityBlock(edm::LuminosityBlock const& iL, edm::EventSetup const& iE);
0046
0047 private:
0048
0049
0050
0051 edm::RunNumber_t runNum;
0052 edm::EventNumber_t eventNum;
0053 bool empty_events;
0054 bool fillRandom_;
0055 unsigned int meansize;
0056 unsigned int width;
0057 unsigned int injected_errors_per_million_events;
0058 unsigned int tcdsFEDID_;
0059 unsigned int modulo_error_events;
0060 unsigned int fakeLs_ = 0;
0061 };
0062
0063 #endif