CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Public Member Functions | Public Attributes | Private Attributes
EventHeader Class Reference

#include <EventHeader.h>

Public Member Functions

void analyze (edm::Event const &iEvent, TTree *tree)
 
 EventHeader ()
 
void setup (edm::ConsumesCollector &&iC, TTree *tree)
 
 ~EventHeader ()
 

Public Attributes

char_uint32 droppedEventsCount_
 
char_uint64 event_
 
Header header_
 
char_uint32 lumi_
 
char_uint32 origDataSize_
 
char_uint32 outModId_
 
uint8 protocolVersion_
 
char_uint32 run_
 

Private Attributes

bool _Debug
 
double fAvgInstDelLumi
 
int fBx
 
unsigned long long fEvent
 
int fLumiBlock
 
int fOrbit
 
int fRun
 
edm::EDGetTokenT< LumiSummarylumi_Token
 

Detailed Description

Event Message Represented here

Protocol Versions 1-4: code 1 | size 4 | run 4 | event 4 | lumi 4 | reserved 4 | l1_count 4| l1bits l1_count/8 | hlt_count 4| hltbits hlt_count/4 | eventdatalength 4 | eventdata blob {variable}

Protocol Version 5: code 1 | size 4 | protocol version 1 | run 4 | event 4 | lumi 4 | origDataSize 4 | outModId 4 | l1_count 4| l1bits l1_count/8 | hlt_count 4| hltbits hlt_count/4 | eventdatalength 4 | eventdata blob {variable}

Protocol Version 6: // no change here, only INIT msg change code 1 | size 4 | protocol version 1 | run 4 | event 4 | lumi 4 | origDataSize 4 | outModId 4 | l1_count 4| l1bits l1_count/8 | hlt_count 4| hltbits hlt_count/4 | eventdatalength 4 | eventdata blob {variable}

Protocol Version 7: // no change here, only data blob changes code 1 | size 4 | protocol version 1 | run 4 | event 4 | lumi 4 | origDataSize 4 | outModId 4 | l1_count 4| l1bits l1_count/8 | hlt_count 4| hltbits hlt_count/4 | eventdatalength 4 | eventdata blob {variable}

Protocol Version 8: // add in checksum of data blob changes code 1 | size 4 | protocol version 1 | run 4 | event 4 | lumi 4 | origDataSize 4 | outModId 4 | l1_count 4| l1bits l1_count/8 | hlt_count 4| hltbits hlt_count/4 | adler32_chksum 4 | host name length 1 | host name {Fixed size} eventdatalength 4 | eventdata blob {variable}

Protocol Version 9: // add dropped events counter code 1 | size 4 | protocol version 1 | run 4 | event 4 | lumi 4 | origDataSize 4 | outModId 4 | droppedEventsCount 4 | l1_count 4 | l1bits l1_count/8 | hlt_count 4 | hltbits hlt_count/4 | adler32_chksum 4 | host name length 1 | host name {Fixed size} eventdatalength 4 | eventdata blob {variable}

Protocol Version 10: identical to version 9, but incremented to keep in sync with init msg version

Protocol Version 11: identical to version 10, except event changed from 4 bytes to 8 bytes

$Date: November 2006 $Revision:

Author
V. Rekovic - UMinn

Definition at line 18 of file EventHeader.h.

Constructor & Destructor Documentation

EventHeader::EventHeader ( )

Definition at line 11 of file EventHeader.cc.

12  : fEvent(0), fLumiBlock(-1), fRun(-1), fBx(-1), fOrbit(-1), fAvgInstDelLumi(-999.), _Debug(false) {}
int fLumiBlock
Definition: EventHeader.h:31
double fAvgInstDelLumi
Definition: EventHeader.h:35
unsigned long long fEvent
Definition: EventHeader.h:30
EventHeader::~EventHeader ( )
default

Member Function Documentation

void EventHeader::analyze ( edm::Event const &  iEvent,
TTree *  tree 
)

Analyze the Data

Definition at line 36 of file EventHeader.cc.

References _Debug, edm::EventBase::bunchCrossing(), gather_cfg::cout, edm::EventID::event(), fAvgInstDelLumi, fBx, fEvent, fLumiBlock, fOrbit, fRun, edm::LuminosityBlock::getByToken(), edm::Event::getLuminosityBlock(), edm::EventBase::id(), edm::HandleBase::isValid(), lumi_Token, edm::EventBase::luminosityBlock(), edm::EventBase::orbitNumber(), and edm::EventID::run().

Referenced by HLTBitAnalyzer::analyze().

36  {
37  fEvent = iEvent.id().event();
38  fLumiBlock = iEvent.luminosityBlock();
39  fRun = iEvent.id().run();
40  fBx = iEvent.bunchCrossing();
41  fOrbit = iEvent.orbitNumber();
42 
43  bool lumiException = false;
44  const edm::LuminosityBlock& iLumi = iEvent.getLuminosityBlock();
45  edm::Handle<LumiSummary> lumiSummary;
46  try {
47  iLumi.getByToken(lumi_Token, lumiSummary);
48  lumiSummary->isValid();
49  } catch (cms::Exception&) {
50  lumiException = true;
51  }
52  if (!lumiException)
53  fAvgInstDelLumi = lumiSummary->avgInsDelLumi();
54  else
55  fAvgInstDelLumi = -999.;
56 
57  if (_Debug) {
58  std::cout << "EventHeader -- event = " << fEvent << std::endl;
59  std::cout << "EventHeader -- lumisection = " << fLumiBlock << std::endl;
60  std::cout << "EventHeader -- run = " << fRun << std::endl;
61  std::cout << "EventHeader -- bunch crossing = " << fBx << std::endl;
62  std::cout << "EventHeader -- orbit number = " << fOrbit << std::endl;
63  }
64 }
bool getByToken(EDGetToken token, Handle< PROD > &result) const
int iEvent
Definition: GenABIO.cc:224
int fLumiBlock
Definition: EventHeader.h:31
edm::EDGetTokenT< LumiSummary > lumi_Token
Definition: EventHeader.h:39
bool isValid() const
Definition: HandleBase.h:70
double fAvgInstDelLumi
Definition: EventHeader.h:35
unsigned long long fEvent
Definition: EventHeader.h:30
tuple cout
Definition: gather_cfg.py:144
void EventHeader::setup ( edm::ConsumesCollector &&  iC,
TTree *  tree 
)

Definition at line 17 of file EventHeader.cc.

References fAvgInstDelLumi, fBx, fEvent, fLumiBlock, fOrbit, fRun, edm::InLumi, HLT_FULL_cff::InputTag, and lumi_Token.

Referenced by HLTBitAnalyzer::HLTBitAnalyzer().

17  {
18  fEvent = 0;
19  fLumiBlock = -1;
20  fRun = -1;
21  fBx = -1;
22  fOrbit = -1;
23  fAvgInstDelLumi = -999.;
24 
25  HltTree->Branch("Event", &fEvent, "Event/l");
26  HltTree->Branch("LumiBlock", &fLumiBlock, "LumiBlock/I");
27  HltTree->Branch("Run", &fRun, "Run/I");
28  HltTree->Branch("Bx", &fBx, "Bx/I");
29  HltTree->Branch("Orbit", &fOrbit, "Orbit/I");
30  HltTree->Branch("AvgInstDelLumi", &fAvgInstDelLumi, "AvgInstDelLumi/D");
31 
33 }
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
int fLumiBlock
Definition: EventHeader.h:31
edm::EDGetTokenT< LumiSummary > lumi_Token
Definition: EventHeader.h:39
double fAvgInstDelLumi
Definition: EventHeader.h:35
unsigned long long fEvent
Definition: EventHeader.h:30

Member Data Documentation

bool EventHeader::_Debug
private

Definition at line 38 of file EventHeader.h.

Referenced by analyze().

char_uint32 EventHeader::droppedEventsCount_
char_uint64 EventHeader::event_
double EventHeader::fAvgInstDelLumi
private

Definition at line 35 of file EventHeader.h.

Referenced by analyze(), and setup().

int EventHeader::fBx
private

Definition at line 33 of file EventHeader.h.

Referenced by analyze(), and setup().

unsigned long long EventHeader::fEvent
private

Definition at line 30 of file EventHeader.h.

Referenced by analyze(), and setup().

int EventHeader::fLumiBlock
private

Definition at line 31 of file EventHeader.h.

Referenced by analyze(), and setup().

int EventHeader::fOrbit
private

Definition at line 34 of file EventHeader.h.

Referenced by analyze(), and setup().

int EventHeader::fRun
private

Definition at line 32 of file EventHeader.h.

Referenced by analyze(), and setup().

Header EventHeader::header_

Definition at line 62 of file EventMessage.h.

Referenced by EventMsgBuilder::setEventLength().

char_uint32 EventHeader::lumi_
edm::EDGetTokenT<LumiSummary> EventHeader::lumi_Token
private

Definition at line 39 of file EventHeader.h.

Referenced by analyze(), and setup().

char_uint32 EventHeader::origDataSize_

Definition at line 67 of file EventMessage.h.

Referenced by EventMsgView::origDataSize(), and EventMsgBuilder::setOrigDataSize().

char_uint32 EventHeader::outModId_

Definition at line 68 of file EventMessage.h.

Referenced by EventMsgBuilder::EventMsgBuilder(), and EventMsgView::outModId().

uint8 EventHeader::protocolVersion_
char_uint32 EventHeader::run_