CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros 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_uint32 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
 
int 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

$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.

11  :
12  fRun( -1 ),
13  fEvent( -1 ),
14  fLumiBlock( -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:36
EventHeader::~EventHeader ( )

Definition at line 21 of file EventHeader.cc.

21  {
22 
23 }

Member Function Documentation

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

Analyze the Data

Definition at line 46 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(), runregparse::lumiSummary, edm::EventBase::orbitNumber(), and edm::EventID::run().

Referenced by HLTBitAnalyzer::analyze(), and HLTAnalyzer::analyze().

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

Definition at line 26 of file EventHeader.cc.

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

Referenced by HLTAnalyzer::HLTAnalyzer(), and HLTBitAnalyzer::HLTBitAnalyzer().

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

Member Data Documentation

bool EventHeader::_Debug
private

Definition at line 39 of file EventHeader.h.

Referenced by analyze().

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

Definition at line 36 of file EventHeader.h.

Referenced by analyze(), and setup().

int EventHeader::fBx
private

Definition at line 34 of file EventHeader.h.

Referenced by analyze(), and setup().

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

Referenced by analyze(), and setup().

int EventHeader::fRun
private

Definition at line 31 of file EventHeader.h.

Referenced by analyze(), and setup().

Header EventHeader::header_

Definition at line 61 of file EventMessage.h.

Referenced by EventMsgBuilder::setEventLength().

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

Definition at line 40 of file EventHeader.h.

Referenced by analyze(), and setup().

char_uint32 EventHeader::origDataSize_

Definition at line 66 of file EventMessage.h.

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

char_uint32 EventHeader::outModId_

Definition at line 67 of file EventMessage.h.

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

uint8 EventHeader::protocolVersion_
char_uint32 EventHeader::run_