CMS 3D CMS Logo

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 19 of file EventHeader.h.

Constructor & Destructor Documentation

EventHeader::EventHeader ( )

Definition at line 11 of file EventHeader.cc.

References ~EventHeader().

11  :
12  fEvent( 0 ),
13  fLumiBlock( -1 ),
14  fRun( -1 ),
15  fBx( -1 ),
16  fOrbit( -1 ),
17  fAvgInstDelLumi( -999. ),
18  _Debug( false )
19 { }
int fLumiBlock
Definition: EventHeader.h:33
double fAvgInstDelLumi
Definition: EventHeader.h:37
unsigned long long fEvent
Definition: EventHeader.h:32
EventHeader::~EventHeader ( )
default

Referenced by EventHeader().

Member Function Documentation

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

Analyze the Data

Definition at line 44 of file EventHeader.cc.

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

Referenced by HLTBitAnalyzer::analyze().

44  {
45 
46  fEvent = iEvent.id().event();
47  fLumiBlock = iEvent.luminosityBlock();
48  fRun = iEvent.id().run();
49  fBx = iEvent.bunchCrossing();
50  fOrbit = iEvent.orbitNumber();
51 
52 
53  bool lumiException = false;
54  const edm::LuminosityBlock& iLumi = iEvent.getLuminosityBlock();
56  try{
57  iLumi.getByToken(lumi_Token, lumiSummary);
58  lumiSummary->isValid();
59  }
60  catch(cms::Exception&){
61  lumiException = true;
62  }
63  if(!lumiException)
64  fAvgInstDelLumi = lumiSummary->avgInsDelLumi();
65  else
66  fAvgInstDelLumi = -999.;
67 
68 
69  if (_Debug) {
70  std::cout << "EventHeader -- event = " << fEvent << std::endl;
71  std::cout << "EventHeader -- lumisection = " << fLumiBlock << std::endl;
72  std::cout << "EventHeader -- run = " << fRun << std::endl;
73  std::cout << "EventHeader -- bunch crossing = " << fBx << std::endl;
74  std::cout << "EventHeader -- orbit number = " << fOrbit << std::endl;
75  }
76 
77 }
bool getByToken(EDGetToken token, Handle< PROD > &result) const
int iEvent
Definition: GenABIO.cc:230
int fLumiBlock
Definition: EventHeader.h:33
edm::EDGetTokenT< LumiSummary > lumi_Token
Definition: EventHeader.h:41
def lumiSummary(schema, nlumils)
double fAvgInstDelLumi
Definition: EventHeader.h:37
float avgInsDelLumi() const
Definition: LumiSummary.cc:9
unsigned long long fEvent
Definition: EventHeader.h:32
bool isValid() const
Definition: LumiSummary.cc:78
void EventHeader::setup ( edm::ConsumesCollector &&  iC,
TTree *  tree 
)

Definition at line 24 of file EventHeader.cc.

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

Referenced by HLTBitAnalyzer::HLTBitAnalyzer().

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

Member Data Documentation

bool EventHeader::_Debug
private

Definition at line 40 of file EventHeader.h.

Referenced by analyze().

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

Definition at line 37 of file EventHeader.h.

Referenced by analyze(), and setup().

int EventHeader::fBx
private

Definition at line 35 of file EventHeader.h.

Referenced by analyze(), and setup().

unsigned long long EventHeader::fEvent
private

Definition at line 32 of file EventHeader.h.

Referenced by analyze(), and setup().

int EventHeader::fLumiBlock
private

Definition at line 33 of file EventHeader.h.

Referenced by analyze(), and setup().

int EventHeader::fOrbit
private

Definition at line 36 of file EventHeader.h.

Referenced by analyze(), and setup().

int EventHeader::fRun
private

Definition at line 34 of file EventHeader.h.

Referenced by analyze(), and setup().

Header EventHeader::header_

Definition at line 63 of file EventMessage.h.

Referenced by EventMsgBuilder::setEventLength().

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

Definition at line 41 of file EventHeader.h.

Referenced by analyze(), and setup().

char_uint32 EventHeader::origDataSize_

Definition at line 68 of file EventMessage.h.

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

char_uint32 EventHeader::outModId_

Definition at line 69 of file EventMessage.h.

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

uint8 EventHeader::protocolVersion_
char_uint32 EventHeader::run_