00001 #include <iostream> 00002 #include <sstream> 00003 #include <istream> 00004 #include <fstream> 00005 #include <iomanip> 00006 #include <stdlib.h> 00007 #include <string.h> 00008 00009 #include "HLTrigger/HLTanalyzers/interface/EventHeader.h" 00010 00011 EventHeader::EventHeader() { 00012 00013 //set parameter defaults 00014 _Debug=false; 00015 } 00016 00017 EventHeader::~EventHeader() { 00018 00019 } 00020 00021 /* Setup the analysis to put the branch-variables into the tree. */ 00022 void EventHeader::setup(TTree* HltTree) { 00023 00024 fRun = -1; 00025 fEvent = -1; 00026 00027 HltTree->Branch("Run",&fRun,"Run/I"); 00028 HltTree->Branch("Event",&fEvent,"Event/I"); 00029 00030 } 00031 00032 /* **Analyze the event** */ 00033 void EventHeader::analyze(edm::Event const& iEvent, TTree* HltTree) { 00034 00035 fRun = iEvent.id().run(); 00036 fEvent = iEvent.id().event(); 00037 00038 if (_Debug) { 00039 00040 std::cout << "EventHeader -- run = " << fRun << std::endl; 00041 std::cout << "EventHeader -- event = " << fEvent << std::endl; 00042 00043 } 00044 00045 }