CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
EventHeader.cc
Go to the documentation of this file.
1 #include <iostream>
2 #include <sstream>
3 #include <istream>
4 #include <fstream>
5 #include <iomanip>
6 #include <stdlib.h>
7 #include <string.h>
8 
10 
12 
13  //set parameter defaults
14  _Debug=false;
15 }
16 
18 
19 }
20 
21 /* Setup the analysis to put the branch-variables into the tree. */
22 void EventHeader::setup(TTree* HltTree) {
23 
24  fRun = -1;
25  fEvent = -1;
26  fLumiBlock=-1;
27  fBx = -1;
28  fOrbit = -1;
29 
30  HltTree->Branch("Run", &fRun, "Run/I");
31  HltTree->Branch("Event", &fEvent, "Event/I");
32  HltTree->Branch("LumiBlock", &fLumiBlock, "LumiBlock/I");
33  HltTree->Branch("Bx", &fBx, "Bx/I");
34  HltTree->Branch("Orbit", &fOrbit, "Orbit/I");
35 }
36 
37 /* **Analyze the event** */
38 void EventHeader::analyze(edm::Event const& iEvent, TTree* HltTree) {
39 
40  fRun = iEvent.id().run();
41  fEvent = iEvent.id().event();
42  fLumiBlock = iEvent.luminosityBlock();
43  fBx = iEvent.bunchCrossing();
44  fOrbit = iEvent.orbitNumber();
45 
46  if (_Debug) {
47  std::cout << "EventHeader -- run = " << fRun << std::endl;
48  std::cout << "EventHeader -- event = " << fEvent << std::endl;
49  std::cout << "EventHeader -- lumisection = " << fLumiBlock << std::endl;
50  std::cout << "EventHeader -- bunch crossing = " << fBx << std::endl;
51  std::cout << "EventHeader -- orbit number = " << fOrbit << std::endl;
52  }
53 
54 }
RunNumber_t run() const
Definition: EventID.h:42
EventNumber_t event() const
Definition: EventID.h:44
void analyze(edm::Event const &iEvent, TTree *tree)
Definition: EventHeader.cc:38
int bunchCrossing() const
Definition: EventBase.h:62
edm::LuminosityBlockNumber_t luminosityBlock() const
Definition: EventBase.h:59
int iEvent
Definition: GenABIO.cc:243
void setup(TTree *tree)
Definition: EventHeader.cc:22
int fLumiBlock
Definition: EventHeader.h:29
int orbitNumber() const
Definition: EventBase.h:63
edm::EventID id() const
Definition: EventBase.h:56
tuple cout
Definition: gather_cfg.py:41