8 #ifdef RAW_EVENT_SOURCE_FROM_BU_IS_READY
18 #include "FWCore/Sources/interface/ExternalInputSource.h"
38 namespace errorstreamsource{
44 class RawEventSourceFromBU :
public edm::ExternalInputSource
50 virtual ~RawEventSourceFromBU();
54 void setRunAndEventInfo();
59 std::cout <<
"RawEventSourceFromBU: begin run " << std::endl;
71 std::vector<std::string>::const_iterator itFileName_;
74 unsigned int fileLumi_;
89 : ExternalInputSource(pset,desc)
92 produces<FEDRawDataCollection>();
97 RawEventSourceFromBU::~RawEventSourceFromBU()
110 std::cout <<
"RawEventSourceFromBU beginjob " << std::endl;
118 void RawEventSourceFromBU::setRunAndEventInfo()
123 uint32_t lumiNumber(1);
124 uint32_t evtNumber(0);
126 while(!fin_.is_open()){
133 status = fin_.read((
char*)&
runNumber,
sizeof(uint32_t));
136 status = fin_.read((
char*)&
runNumber,
sizeof(uint32_t));
139 status = fin_.read((
char*)&lumiNumber,
sizeof(uint32_t));
141 status = fin_.read((
char*)&evtNumber,
sizeof(uint32_t));
148 return setRunAndEventInfo();
151 <<
" does not correspond to the one from directory " <<
run()
153 if(lumiNumber != (fileLumi_))
throw cms::Exception(
"LogicError")<<
"Ls number from readin file - " << lumiNumber
154 <<
" does not correspond to the one from directory " << fileLumi_-1
156 setLuminosityBlockNumber_t(lumiNumber);
157 setEventNumber(evtNumber);
165 unsigned int totalEventSize = 0;
166 if (!fin_.is_open())
return false;
170 uint32_t fedSize[1024];
171 fin_.read((
char*)fedSize,1024*
sizeof(uint32_t));
172 for (
unsigned int i=0;
i<1024;
i++) {
174 totalEventSize += fedSize[
i];
180 char *
event =
new char[totalEventSize];
181 fin_.read(
event,totalEventSize);
182 while(totalEventSize>0) {
188 totalEventSize -= (fedsize - 8);
195 time = (time << 32) + gpsl;
200 memcpy(fedData.
data(),
event+totalEventSize,fedsize);
210 bool RawEventSourceFromBU::openFile()
216 if(lockstate < 0)
return false;
227 unsigned int nextLs = fileLumi_+1;
232 if(lockstate < 0)
return false;
238 std::cout <<
"waiting for file to be released by bu for ls " << fileLumi_ << std::endl;
248 std::cout <<
" is open " << fin_.is_open() << std::endl;
unsigned int getgpshigh(const unsigned char *)
void evm_board_setformat(size_t size)
void resize(size_t newsize)
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
#define FED_EVSZ_EXTRACT(a)
How EventSelector::AcceptEvent() decides whether to accept an event for output otherwise it is excluding the probing of A single or multiple positive and the trigger will pass if any such matching triggers are PASS or EXCEPTION[A criterion thatmatches no triggers at all is detected and causes a throw.] A single negative with an expectation of appropriate bit checking in the decision and the trigger will pass if any such matching triggers are FAIL or EXCEPTION A wildcarded negative criterion that matches more than one trigger in the trigger but the state exists so we define the behavior If all triggers are the negative crieriion will lead to accepting the event(this again matches the behavior of"!*"before the partial wildcard feature was incorporated).The per-event"cost"of each negative criterion with multiple relevant triggers is about the same as!*was in the past
unsigned long long TimeValue_t
const unsigned char * data() const
Return a const pointer to the beginning of the data buffer.
constexpr unsigned int gtpEvmId_
unsigned int getgpslow(const unsigned char *)