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" 26 class InputSourceDescription;
45 std::pair<bool, unsigned int> getEventReport(
unsigned int lumi,
bool erase);
48 bool checkNextEvent()
override;
52 void rewind_()
override;
54 void maybeOpenNewLumiSection(
const uint32_t lumiSection);
59 void readSupervisor();
60 void readWorker(
unsigned int tid);
68 void reportEventsThisLumiInSource(
unsigned int lumi,
unsigned int events);
100 unsigned int fileListIndex_ = 0;
102 unsigned int loopModeIterationInc_ = 0;
115 uint32_t eventRunNumber_ = 0;
116 uint32_t GTPEventID_ = 0;
117 uint32_t L1EventID_ = 0;
120 unsigned long eventsThisRun_ = 0;
132 bool chunkIsFree_ =
false;
134 bool startedSupervisorThread_ =
false;
142 tbb::concurrent_queue<std::unique_ptr<InputFile>>
fileQueue_;
150 bool setExceptionState_ =
false;
154 int currentFileIndex_ = -1;
159 unsigned int nStreams_ = 0;
160 unsigned int checkEvery_ = 10;
168 int fileDescriptor_ = -1;
169 uint32_t bufferInputRead_ = 0;
181 uint32_t usedSize_ = 0;
188 buf_ =
new unsigned char[size_];
191 void reset(
unsigned int newOffset,
unsigned int toRead,
unsigned int fileIndex) {
194 fileIndex_ = fileIndex;
195 readComplete_ =
false;
216 uint32_t bufferPosition_ = 0;
217 uint32_t chunkPosition_ = 0;
218 unsigned int currentChunk_ = 0;
221 unsigned int lumi = 0,
223 bool deleteFile =
true,
226 uint16_t rawHeaderSize = 0,
227 uint32_t nChunks = 0,
234 deleteFile_(deleteFile),
237 rawHeaderSize_(rawHeaderSize),
241 for (
unsigned int i = 0;
i < nChunks;
i++)
242 chunks_.push_back(
nullptr);
250 return chunks_[chunkid] !=
nullptr && chunks_[chunkid]->readComplete_;
252 bool advance(
unsigned char*& dataPosition,
const size_t size);
253 void moveToPreviousChunk(
const size_t size,
const size_t offset);
254 void rewindChunk(
const size_t size);
257 #endif // EventFilter_Utilities_FedRawDataInputSource_h
static boost::mutex mutex
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
unsigned long long uint64_t
void reset(double vett[256])