6 std::vector<int>
const& numSources,
11 buPaths_.emplace_back(baseDirP / runDirP);
15 buNumSources_ = numSources;
20 std::vector<std::string> additionalFiles;
24 for (
int j = 1;
j < buNumSources_[0];
j++) {
27 return std::make_pair(
true, additionalFiles);
33 for (
size_t i = 0;
i < buPaths_.size();
i++) {
38 additionalFiles.push_back(newPath.generic_string());
42 for (
int j = 1;
j < buNumSources_[
i];
j++) {
43 additionalFiles.push_back(newPath.generic_string() +
"_" +
std::to_string(
j));
46 return std::make_pair(
true, additionalFiles);
54 gettimeofday(&stv,
nullptr);
60 uint32_t hdrEventID = currOrbit_;
65 aux.setProcessHistoryID(daqSource_->processHistoryID());
66 daqSource_->makeEventWrapper(eventPrincipal,
aux);
72 for (
const auto& pair : sourceValidOrbitPair_) {
73 fillSDSRawDataCollection(*
rawData, (
char*)events_[pair.second]->payload(), events_[pair.second]->eventSize());
78 daqProvenanceHelpers_[0]->branchDescription(),
std::move(edp), daqProvenanceHelpers_[0]->dummyProvenance());
91 size_t orbitSize = len -
pos;
97 fedData.
resize(orbitSize, 4);
99 memcpy(fedData.
data(), buff +
pos, orbitSize);
106 daqProvenanceHelpers_.clear();
107 daqProvenanceHelpers_.emplace_back(std::make_shared<const edm::DaqProvenanceHelper>(
109 return daqProvenanceHelpers_;
113 blockCompleted_ =
false;
119 for (
const auto& pair : sourceValidOrbitPair_) {
120 dataBlockAddrs_[pair.first] += events_[pair.second]->size();
129 sourceValidOrbitPair_.clear();
130 currOrbit_ = 0xFFFFFFFF;
135 for (
int i = 0;
i < numFiles_;
i++) {
136 if (dataBlockAddrs_[
i] >= dataBlockMaxAddrs_[
i]) {
137 completedBlocks_[
i] =
true;
142 events_.emplace_back(std::make_unique<FRDEventMsgView>(dataBlockAddrs_[
i]));
143 if (dataBlockAddrs_[
i] + events_.back()->size() > dataBlockMaxAddrs_[
i])
145 <<
" event id:" << events_.back()->event() <<
" lumi:" << events_.back()->lumi()
146 <<
" run:" << events_.back()->run() <<
" of size:" << events_.back()->size()
147 <<
" bytes does not fit into the buffer or has corrupted header";
150 if ((events_.back()->event() < currOrbit_) && (!completedBlocks_[
i])) {
151 currOrbit_ = events_.back()->event();
157 bool allBlocksCompleted =
true;
159 for (
int i = 0;
i < numFiles_;
i++) {
160 if (completedBlocks_[
i]) {
164 if (events_[evt_idx]->
event() != currOrbit_) {
171 sourceValidOrbitPair_.emplace_back(std::make_pair(
i, evt_idx));
172 allBlocksCompleted =
false;
178 if (allBlocksCompleted) {
179 blockCompleted_ =
true;
181 return !allBlocksCompleted;
void makeDirectoryEntries(std::vector< std::string > const &baseDirs, std::vector< int > const &numSources, std::string const &runDir) override
void fillSDSRawDataCollection(SDSRawDataCollection &rawData, char *buff, size_t len)
bool nextEventView() override
std::vector< std::shared_ptr< const edm::DaqProvenanceHelper > > & makeDaqProvenanceHelpers() override
static std::string to_string(const XMLCh *ch)
void put(BranchDescription const &bd, std::unique_ptr< WrapperBase > edp, ProductProvenance const &productProvenance) const
std::string getChecksumError() const override
unsigned long long TimeValue_t
std::pair< bool, std::vector< std::string > > defineAdditionalFiles(std::string const &primaryName, bool fileListMode) const override
void resize(size_t newsize, size_t wordsize=8)
const unsigned char * data() const
Return a const pointer to the beginning of the data buffer.
bool checksumValid() override
void readEvent(edm::EventPrincipal &eventPrincipal) override