1 #ifndef IOPool_Streamer_RawEventOutputModuleForBU_h
2 #define IOPool_Streamer_RawEventOutputModuleForBU_h
16 #include "boost/shared_array.hpp"
19 template <
class Consumer>
57 template <
class Consumer>
59 edm::OutputModule(ps),
60 templateConsumer_(new Consumer(ps)),
61 label_(ps.getUntrackedParameter<std::
string>(
"ProductLabel",
"source")),
62 instance_(ps.getUntrackedParameter<std::
string>(
"ProductInstance",
"")),
63 numEventsPerFile_(ps.getUntrackedParameter<unsigned int>(
"numEventsPerFile",100)),
73 template <
class Consumer>
76 template <
class Consumer>
80 if(totevents>0 && totevents%numEventsPerFile_==0){
84 templateConsumer_->initialize(destinationDir,filename,ls);
91 event.getByLabel(label_, instance_, fedBuffers);
94 int expectedSize = (4 + 1024) *
sizeof(
uint32);
97 expectedSize += singleFED.
size();
102 totsize += expectedSize;
104 boost::shared_array<unsigned char> workBuffer(
new unsigned char[expectedSize + 256]);
113 fedsize[
idx] = singleFED.
size();
115 memcpy(bufPtr,fedsize,1024 *
sizeof(
uint32));
119 if (singleFED.
size() > 0) {
120 memcpy(bufPtr, singleFED.
data(), singleFED.
size());
121 bufPtr += singleFED.
size()/4;
127 writtensize+=
msg.size();
129 if (templateConsumer_->sharedMode())
130 templateConsumer_->doOutputEvent(workBuffer);
132 templateConsumer_->doOutputEvent(
msg);
135 template <
class Consumer>
139 templateConsumer_->start();
142 template <
class Consumer>
145 templateConsumer_->stop();
148 template <
class Consumer>
153 templateConsumer_->initialize(destinationDir,filename,ls.
id().
luminosityBlock());
157 ::gettimeofday(&now,0);
158 long long elapsedusec = (now.tv_sec - startOfLastLumi.tv_sec)*1000000+now.tv_usec-startOfLastLumi.tv_usec;
163 writtenSizeLast=writtensize;
164 ::gettimeofday(&startOfLastLumi,0);
168 ::gettimeofday(&startOfLastLumi,0);
173 template <
class Consumer>
EventNumber_t event() const
virtual void beginRun(edm::RunPrincipal const &, edm::ModuleCallingContext const *)
virtual void write(edm::EventPrincipal const &e, edm::ModuleCallingContext const *)
~RawEventOutputModuleForBU()
unsigned long long writtensize
edm::LuminosityBlockNumber_t luminosityBlock() const
LuminosityBlockNumber_t luminosityBlock() const
RawEventOutputModuleForBU(edm::ParameterSet const &ps)
size_t size() const
Lenght of the data buffer in bytes.
unsigned long long totsize
virtual void writeLuminosityBlock(const edm::LuminosityBlockPrincipal &, edm::ModuleCallingContext const *)
unsigned long long writtenSizeLast
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
virtual void beginLuminosityBlock(edm::LuminosityBlockPrincipal const &, edm::ModuleCallingContext const *)
virtual void endLuminosityBlock(edm::LuminosityBlockPrincipal const &, edm::ModuleCallingContext const *)
tuple idx
DEBUGGING if hasattr(process,"trackMonIterativeTracking2012"): print "trackMonIterativeTracking2012 D...
LuminosityBlockNumber_t luminosityBlock() const
virtual void endRun(edm::RunPrincipal const &, edm::ModuleCallingContext const *)
unsigned int numEventsPerFile_
virtual void writeRun(const edm::RunPrincipal &, edm::ModuleCallingContext const *)
const unsigned char * data() const
Return a const pointer to the beginning of the data buffer.
std::auto_ptr< Consumer > templateConsumer_
LuminosityBlockID id() const