18 #include "CLHEP/Random/RandGauss.h"
37 empty_events(
pset.getUntrackedParameter<
bool>(
"emptyEvents",
false)),
38 fillRandom_(
pset.getUntrackedParameter<
bool>(
"fillRandom",
false)),
39 meansize(
pset.getUntrackedParameter<unsigned
int>(
"meanSize", 1024)),
40 width(
pset.getUntrackedParameter<unsigned
int>(
"width", 1024)),
41 injected_errors_per_million_events(
pset.getUntrackedParameter<unsigned
int>(
"injectErrPpm", 0)),
42 tcdsFEDID_(
pset.getUntrackedParameter<unsigned
int>(
"tcdsFEDID", 1024)),
43 modulo_error_events(injected_errors_per_million_events ? 1000000 / injected_errors_per_million_events
53 srand(time_count & 0xffffffff);
55 produces<FEDRawDataCollection>();
70 auto ls =
e.luminosityBlock();
86 gettimeofday(&
now,
nullptr);
96 std::unique_ptr<FEDRawDataCollection> bare_product(fedcoll);
116 size_t size_ui =
size -
size %
sizeof(
unsigned int);
117 for (
size_t i = 0;
i < size_ui;
i +=
sizeof(
unsigned int)) {
118 *((
unsigned int*)(feddata.
data() +
i)) = (
unsigned int)rand();
121 for (
size_t i = size_ui;
i <
size;
i++) {
122 *(feddata.
data() +
i) = rand() & 0xff;
164 const_cast<uint32_t&>(bst->gpstimehigh) =
now->tv_sec;
165 const_cast<uint32_t&>(bst->gpstimelow) =
now->tv_usec;
166 const_cast<uint16_t&>(bst->lhcFillHigh) = 0;
167 const_cast<uint16_t&>(bst->lhcFillLow) = 0;
169 const_cast<uint32_t&>(
header->orbitHigh) = orbitnr & 0xffff00;
170 const_cast<uint16_t&>(
header->orbitLow) = orbitnr & 0xff;
171 const_cast<uint16_t&>(
header->bxid) = bxid;
173 const_cast<uint64_t&>(
header->eventNumber) = eID.
event();
174 const_cast<uint32_t&>(
header->lumiSection) =
ls;
191 desc.setComment(
"Injector of generated raw FED data for DAQ testing");
192 desc.addUntracked<
bool>(
"emptyEvents",
false);
193 desc.addUntracked<
bool>(
"fillRandom",
false);
194 desc.addUntracked<
unsigned int>(
"meanSize", 1024);
195 desc.addUntracked<
unsigned int>(
"width", 1024);
196 desc.addUntracked<
unsigned int>(
"injectErrPpm", 1024);
197 desc.addUntracked<
unsigned int>(
"tcdsFEDID", 1024);
198 descriptions.
add(
"DaqFakeReader",
desc);