CMS 3D CMS Logo

EventMsgView Class Reference

#include <IOPool/Streamer/interface/EventMessage.h>

List of all members.

Public Member Functions

uint32 code () const
uint32 event () const
const uint8eventData () const
uint32 eventLength () const
 EventMsgView (void *buf)
uint32 headerSize () const
uint32 hltCount () const
void hltTriggerBits (uint8 *put_here) const
uint32 l1Count () const
void l1TriggerBits (std::vector< bool > &put_here) const
uint32 lumi () const
uint32 origDataSize () const
uint32 outModId () const
uint32 protocolVersion () const
uint32 run () const
uint32 size () const
uint8startAddress () const

Private Attributes

uint8buf_
uint32 event_len_
uint8event_start_
HeaderView head_
uint32 hlt_bits_count_
uint8hlt_bits_start_
uint32 l1_bits_count_
uint8l1_bits_start_
bool v2Detected_


Detailed Description

Definition at line 51 of file EventMessage.h.


Constructor & Destructor Documentation

EventMsgView::EventMsgView ( void buf  ) 

Definition at line 5 of file EventMessage.cc.

References buf_, convert32(), event_len_, event_start_, Exception, hlt_bits_count_, hlt_bits_start_, l1_bits_count_, l1_bits_start_, protocolVersion(), and v2Detected_.

00005                                    :
00006   buf_((uint8*)buf),head_(buf),
00007   v2Detected_(false)
00008 { 
00009   // 29-Jan-2008, KAB - adding an explicit version number.
00010   // We'll start with 5 to match the new version of the INIT message.
00011   // We support earlier versions of the full protocol, of course, but since
00012   // we didn't have an explicit version number in the Event Message before
00013   // now, we have to limit what we can handle to versions that have the
00014   // version number included (>= 5).
00015 
00016   // 18-Jul-2008, wmtan - payload changed for version 7.
00017   // So we no longer support previous formats.
00018   if (protocolVersion() != 7) {
00019     throw cms::Exception("EventMsgView", "Invalid Message Version:")
00020       << "Only message version 7 is currently supported \n"
00021       << "(invalid value = " << protocolVersion() << ").\n"
00022       << "We support only reading and converting streamer files\n"
00023       << "using the same version of CMSSW used to created the\n"
00024       << "streamer file. This is because the streamer format is\n"
00025       << "only a temporary format, as such we do not support\n"
00026       << "backwards compatibility. If you really need a streamer\n"
00027       << "file for some reason, the work around is that you convert\n"
00028       << "the streamer file to a Root file using the CMSSW version\n"
00029       << "that created the streamer file, then convert the Root file\n"
00030       << "to a streamer file using a newer release that will produce\n"
00031       << "the version of streamer file that you desire.\n";
00032   }
00033 
00034   uint8* l1_bit_size_ptr = buf_ + sizeof(EventHeader); //Just after Header 
00035   l1_bits_count_ = convert32(l1_bit_size_ptr); 
00036   uint32 l1_sz = l1_bits_count_;
00037   //Lets detect if thats V2 message
00038   if (l1_bits_count_ == 11) {
00039           l1_sz = 1; 
00040           v2Detected_=true;
00041   }
00042 
00043   l1_bits_start_ = buf_ + sizeof(EventHeader) + sizeof(uint32); 
00044 
00045   if (v2Detected_ == false) { 
00046      if (l1_sz != 0) l1_sz = 1 + ((l1_sz-1)/8);
00047   }
00048   uint8* hlt_bit_size_ptr = l1_bits_start_ + l1_sz; 
00049   hlt_bits_count_ = convert32(hlt_bit_size_ptr); 
00050   hlt_bits_start_ = hlt_bit_size_ptr + sizeof(uint32); 
00051   uint32 hlt_sz = hlt_bits_count_;
00052   if (hlt_sz != 0) hlt_sz = 1+ ((hlt_sz-1)/4);
00053 
00054   if(v2Detected_) hlt_sz=2;
00055   event_start_ = hlt_bits_start_ + hlt_sz; 
00056   event_len_ = convert32(event_start_); 
00057   event_start_ += sizeof(char_uint32); 
00058 }


Member Function Documentation

uint32 EventMsgView::code ( void   )  const [inline]

Definition at line 57 of file EventMessage.h.

References HeaderView::code(), and head_.

Referenced by edm::StreamerInputSource::deserializeEvent(), dumpEventHeader(), and edmtestp::TestFileReader::readEvents().

00057 { return head_.code(); }

uint32 EventMsgView::event (  )  const

Definition at line 72 of file EventMessage.cc.

References buf_, convert32(), EventHeader::event_, and h.

Referenced by edm::StreamerInputSource::deserializeEvent(), dumpEventHeader(), stor::SMProxyServer::eventdataWebPage(), stor::StorageManager::eventdataWebPage(), stor::EvtMsgRingBuffer::pop_front(), stor::EventServer::processEvent(), and edmtestp::TestFileReader::readEvents().

00073 {
00074   EventHeader* h = (EventHeader*)buf_;
00075   return convert32(h->event_);
00076 }

const uint8* EventMsgView::eventData (  )  const [inline]

Definition at line 60 of file EventMessage.h.

References event_start_.

Referenced by edm::StreamerInputSource::deserializeEvent(), stor::EvtMsgRingBuffer::push_back(), and StreamerOutputFile::write().

00060 { return event_start_; }

uint32 EventMsgView::eventLength (  )  const [inline]

Definition at line 62 of file EventMessage.h.

References event_len_.

Referenced by edm::StreamerInputSource::deserializeEvent(), dumpEventHeader(), stor::EvtMsgRingBuffer::pop_front(), and stor::EvtMsgRingBuffer::push_back().

00062 { return event_len_; }

uint32 EventMsgView::headerSize (  )  const [inline]

Definition at line 63 of file EventMessage.h.

References buf_, and event_start_.

Referenced by stor::EvtMsgRingBuffer::push_back(), StreamerOutputFile::write(), StreamerOutputIndexFile::write(), and StreamerOutputFile::writeEventHeader().

00063 {return event_start_-buf_;}

uint32 EventMsgView::hltCount (  )  const [inline]

Definition at line 74 of file EventMessage.h.

References hlt_bits_count_.

Referenced by edm::EventStreamService::acceptEvent(), dumpEventHeader(), and stor::ConsumerPipe::wantsEvent().

00074 {return hlt_bits_count_;}

void EventMsgView::hltTriggerBits ( uint8 put_here  )  const

Definition at line 105 of file EventMessage.cc.

References edmNew::copy(), hlt_bits_count_, hlt_bits_start_, and v2Detected_.

Referenced by edm::EventStreamService::acceptEvent(), edm::StreamerFileWriter::doOutputEvent(), dumpEventHeader(), and stor::ConsumerPipe::wantsEvent().

00106 {
00107   uint32 hlt_sz = hlt_bits_count_;
00108   if (hlt_sz != 0) hlt_sz = 1 + ((hlt_sz-1)/4);
00109 
00110   if(v2Detected_) hlt_sz=2;
00111 
00112   std::copy(hlt_bits_start_,hlt_bits_start_ + hlt_sz,
00113             put_here);
00114 }

uint32 EventMsgView::l1Count (  )  const [inline]

Definition at line 75 of file EventMessage.h.

References l1_bits_count_.

00075 {return l1_bits_count_;}

void EventMsgView::l1TriggerBits ( std::vector< bool > &  put_here  )  const

Definition at line 96 of file EventMessage.cc.

References i, l1_bits_count_, and l1_bits_start_.

Referenced by dumpEventHeader().

00097 {
00098   put_here.clear();
00099   put_here.resize(l1_bits_count_);
00100 
00101   for(std::vector<bool>::size_type i = 0; i < l1_bits_count_; ++i)
00102     put_here[i] = (bool)(l1_bits_start_[i/8] & (1<<((i&0x07))));
00103 }

uint32 EventMsgView::lumi (  )  const

Definition at line 78 of file EventMessage.cc.

References buf_, convert32(), h, and EventHeader::lumi_.

Referenced by edm::StreamerInputSource::deserializeEvent(), dumpEventHeader(), and edm::EventStreamService::nextEvent().

00079 {
00080   EventHeader* h = (EventHeader*)buf_;
00081   return convert32(h->lumi_);
00082 }

uint32 EventMsgView::origDataSize (  )  const

Definition at line 84 of file EventMessage.cc.

References buf_, convert32(), h, and EventHeader::origDataSize_.

Referenced by edm::StreamerInputSource::deserializeEvent(), and dumpEventHeader().

00085 {
00086   EventHeader* h = (EventHeader*)buf_;
00087   return convert32(h->origDataSize_);
00088 }

uint32 EventMsgView::outModId (  )  const

Definition at line 90 of file EventMessage.cc.

References buf_, convert32(), h, and EventHeader::outModId_.

Referenced by dumpEventHeader(), edm::ServiceManager::manageEventMsg(), stor::EventServer::processEvent(), edmtestp::TestFileReader::readEvents(), and stor::ConsumerPipe::wantsEvent().

00091 {
00092   EventHeader* h = (EventHeader*)buf_;
00093   return convert32(h->outModId_);
00094 }

uint32 EventMsgView::protocolVersion (  )  const

Definition at line 60 of file EventMessage.cc.

References buf_, h, and EventHeader::protocolVersion_.

Referenced by dumpEventHeader(), and EventMsgView().

00061 {
00062   EventHeader* h = (EventHeader*)buf_;
00063   return h->protocolVersion_;
00064 }

uint32 EventMsgView::run ( void   )  const

Definition at line 66 of file EventMessage.cc.

References buf_, convert32(), h, and EventHeader::run_.

Referenced by edm::StreamerInputSource::deserializeEvent(), dumpEventHeader(), edm::EventStreamService::nextEvent(), and edmtestp::TestFileReader::readEvents().

00067 {
00068   EventHeader* h = (EventHeader*)buf_;
00069   return convert32(h->run_);
00070 }

uint32 EventMsgView::size ( void   )  const [inline]

Definition at line 58 of file EventMessage.h.

References head_, and HeaderView::size().

Referenced by edm::StreamerInputSource::deserializeEvent(), dumpEventHeader(), stor::SMProxyServer::eventdataWebPage(), stor::StorageManager::eventdataWebPage(), edm::ServiceManager::manageEventMsg(), stor::EventServer::processEvent(), stor::ConsumerPipe::pushEvent(), edmtestp::TestFileReader::readEvents(), stor::ConsumerPipe::wantsEvent(), StreamerOutputFile::write(), and edm::EventOutputService::writeEvent().

00058 { return head_.size(); }

uint8* EventMsgView::startAddress (  )  const [inline]

Definition at line 61 of file EventMessage.h.

References buf_.

Referenced by stor::SMProxyServer::eventdataWebPage(), stor::StorageManager::eventdataWebPage(), edm::ServiceManager::manageEventMsg(), stor::EventServer::processEvent(), stor::ConsumerPipe::pushEvent(), edmtestp::TestFileReader::readEvents(), StreamerOutputIndexFile::write(), and StreamerOutputFile::writeEventHeader().

00061 { return buf_; }


Member Data Documentation

uint8* EventMsgView::buf_ [private]

Definition at line 78 of file EventMessage.h.

Referenced by event(), EventMsgView(), headerSize(), lumi(), origDataSize(), outModId(), protocolVersion(), run(), and startAddress().

uint32 EventMsgView::event_len_ [private]

Definition at line 86 of file EventMessage.h.

Referenced by eventLength(), and EventMsgView().

uint8* EventMsgView::event_start_ [private]

Definition at line 85 of file EventMessage.h.

Referenced by eventData(), EventMsgView(), and headerSize().

HeaderView EventMsgView::head_ [private]

Definition at line 79 of file EventMessage.h.

Referenced by code(), and size().

uint32 EventMsgView::hlt_bits_count_ [private]

Definition at line 82 of file EventMessage.h.

Referenced by EventMsgView(), hltCount(), and hltTriggerBits().

uint8* EventMsgView::hlt_bits_start_ [private]

Definition at line 81 of file EventMessage.h.

Referenced by EventMsgView(), and hltTriggerBits().

uint32 EventMsgView::l1_bits_count_ [private]

Definition at line 84 of file EventMessage.h.

Referenced by EventMsgView(), l1Count(), and l1TriggerBits().

uint8* EventMsgView::l1_bits_start_ [private]

Definition at line 83 of file EventMessage.h.

Referenced by EventMsgView(), and l1TriggerBits().

bool EventMsgView::v2Detected_ [private]

Definition at line 87 of file EventMessage.h.

Referenced by EventMsgView(), and hltTriggerBits().


The documentation for this class was generated from the following files:
Generated on Tue Jun 9 18:20:26 2009 for CMSSW by  doxygen 1.5.4