1 #ifndef EventFilter_Utilities_FedRawDataInputSource_h 2 #define EventFilter_Utilities_FedRawDataInputSource_h 7 #include <condition_variable> 9 #include "tbb/concurrent_queue.h" 10 #include "tbb/concurrent_vector.h" 12 #include "boost/filesystem.hpp" 28 class InputSourceDescription;
35 class FastMonitoringService;
39 class DataPointDefinition;
53 std::pair<bool,unsigned int> getEventReport(
unsigned int lumi,
bool erase);
55 virtual bool checkNextEvent()
override;
59 virtual void rewind_()
override;
61 void maybeOpenNewLumiSection(
const uint32_t lumiSection);
62 void createBoLSFile(
const uint32_t lumiSection,
bool checkIfExists);
69 void readSupervisor();
70 void readWorker(
unsigned int tid);
78 void reportEventsThisLumiInSource(
unsigned int lumi,
unsigned int events);
106 unsigned int fileListIndex_ = 0;
108 unsigned int loopModeIterationInc_ = 0;
121 uint32_t eventRunNumber_=0;
122 uint32_t GTPEventID_ = 0;
123 uint32_t L1EventID_ = 0;
126 unsigned long eventsThisRun_ = 0;
140 bool chunkIsFree_=
false;
142 bool startedSupervisorThread_ =
false;
158 bool setExceptionState_ =
false;
162 int currentFileIndex_ = -1;
167 unsigned int nStreams_ = 0;
168 unsigned int checkEvery_ = 10;
176 int fileDescriptor_ = -1;
177 uint32_t bufferInputRead_ = 0;
190 uint32_t usedSize_ = 0;
197 buf_ =
new unsigned char[size_];
200 void reset(
unsigned int newOffset,
unsigned int toRead,
unsigned int fileIndex) {
203 fileIndex_=fileIndex;
223 uint32_t bufferPosition_ = 0;
224 uint32_t chunkPosition_ = 0;
225 unsigned int currentChunk_ = 0;
238 for (
unsigned int i=0;
i<nChunks;
i++)
239 chunks_.push_back(
nullptr);
246 return chunks_[chunkid]!=
nullptr && chunks_[chunkid]->readComplete_;
248 bool advance(
unsigned char* & dataPosition,
const size_t size);
249 void moveToPreviousChunk(
const size_t size,
const size_t offset);
250 void rewindChunk(
const size_t size);
254 #endif // EventFilter_Utilities_FedRawDataInputSource_h
static boost::mutex mutex
unsigned long long uint64_t
void reset(double vett[256])