#include "IOPool/Streamer/interface/DumpTools.h"
#include "FWCore/Utilities/interface/Digest.h"
#include "FWCore/Utilities/interface/Algorithms.h"
#include <iostream>
#include <iterator>
#include "DataFormats/Streamer/interface/StreamedProducts.h"
#include "IOPool/Streamer/interface/ClassFiller.h"
#include "TBufferFile.h"
Go to the source code of this file.
Typedefs | |
typedef TBufferFile | RootBuffer |
File contains simple tools to dump Init and Event Messages on screen. | |
Functions | |
void | dumpDQMEventHeader (const DQMEventMsgView *dview) |
void | dumpDQMEventView (const DQMEventMsgView *dview) |
void | dumpEvent (uint8 *buf) |
void | dumpEventHeader (const EventMsgView *eview) |
void | dumpEventIndex (const EventMsgView *eview) |
void | dumpEventView (const EventMsgView *eview) |
void | dumpFRDEventView (const FRDEventMsgView *fview) |
void | dumpInit (uint8 *buf) |
void | dumpInitHeader (const InitMsgView *view) |
File contains simple tools to dump Init and Event Messages on screen. | |
void | dumpInitVerbose (const InitMsgView *view) |
void | dumpInitView (const InitMsgView *view) |
void | dumpStartMsg (const InitMsgView *view) |
void | printBits (unsigned char c) |
typedef TBufferFile RootBuffer |
File contains simple tools to dump Init and Event Messages on screen.
Definition at line 15 of file DumpTools.cc.
void dumpDQMEventHeader | ( | const DQMEventMsgView * | dview | ) |
Definition at line 206 of file DumpTools.cc.
References DQMEventMsgView::code(), DQMEventMsgView::compressionFlag(), GenMuonPlsPt100GeV_cfg::cout, DQMEventMsgView::eventLength(), DQMEventMsgView::eventNumberAtUpdate(), DQMEventMsgView::fuGuid(), DQMEventMsgView::fuProcessId(), DQMEventMsgView::lumiSection(), DQMEventMsgView::protocolVersion(), DQMEventMsgView::releaseTag(), DQMEventMsgView::reserved(), DQMEventMsgView::runNumber(), DQMEventMsgView::size(), DQMEventMsgView::topFolderName(), and DQMEventMsgView::updateNumber().
Referenced by dumpDQMEventView().
00208 { 00209 std::cout << "code = " << dview->code() << "\n" 00210 << "size = " << dview->size() << "\n" 00211 << "protocolVersion = " << dview->protocolVersion() << "\n" 00212 << "run = " << dview->runNumber() << "\n" 00213 << "event = " << dview->eventNumberAtUpdate() << "\n" 00214 << "lumi = " << dview->lumiSection() << "\n" 00215 << "update = " << dview->updateNumber() << "\n" 00216 << "compressionFlag = " << dview->compressionFlag() << "\n" 00217 << "fuProcessId = " << dview->fuProcessId() << "\n" 00218 << "fuGuid = 0x" << std::hex << dview->fuGuid() << std::dec << "\n" 00219 << "reserved = " << dview->reserved() << "\n" 00220 << "release = " << dview->releaseTag() << "\n" 00221 << "topFolder = " << dview->topFolderName() << "\n" 00222 << "event length = " << dview->eventLength() << "\n"; 00223 std::cout.flush();
void dumpDQMEventView | ( | const DQMEventMsgView * | dview | ) |
Definition at line 225 of file DumpTools.cc.
References count, GenMuonPlsPt100GeV_cfg::cout, dumpDQMEventHeader(), lat::endl(), DQMEventMsgView::meCount(), name, and DQMEventMsgView::subFolderNames().
00227 { 00228 std::cout << "\n>>>>> DQMEvent Message Dump (begin) >>>>>" << std::endl; 00229 dumpDQMEventHeader(dview); 00230 00231 boost::shared_ptr< std::vector<std::string> > subFolders = 00232 dview->subFolderNames(); 00233 for (uint32 idx = 0; idx < subFolders->size(); idx++) { 00234 std::string name = subFolders->at(idx); 00235 uint32 count = dview->meCount(name); 00236 std::cout << "Subfolder " << name << " has " << count 00237 << " monitor elements." << std::endl; 00238 } 00239 00240 std::cout << ">>>>> DQMEvent Message Dump (end) >>>>>" << std::endl; 00241 std::cout.flush();
Definition at line 191 of file DumpTools.cc.
References GenMuonPlsPt100GeV_cfg::cout, and dumpEventHeader().
00193 { 00194 EventMsgView eview(buf); 00195 00196 dumpEventHeader(&eview); 00197 00198 //const uint8* edata = eview.eventData(); 00199 //std::cout << "\nevent data=\n("; 00200 //std::copy(&edata[0],&edata[0]+eview.eventLength(), 00201 // std::ostream_iterator<char>(std::cout,"")); 00202 //std::cout << ")\n"; 00203 std::cout.flush(); 00204
void dumpEventHeader | ( | const EventMsgView * | eview | ) |
Definition at line 143 of file DumpTools.cc.
References EventMsgView::code(), edm::copy_all(), GenMuonPlsPt100GeV_cfg::cout, EventMsgView::event(), EventMsgView::eventLength(), EventMsgView::hltCount(), EventMsgView::hltTriggerBits(), i, EventMsgView::l1TriggerBits(), EventMsgView::lumi(), EventMsgView::origDataSize(), EventMsgView::outModId(), printBits(), EventMsgView::protocolVersion(), EventMsgView::run(), and EventMsgView::size().
Referenced by dumpEvent(), dumpEventIndex(), and dumpEventView().
00145 { 00146 std::cout << "code=" << eview->code() << "\n" 00147 << "size=" << eview->size() << "\n" 00148 << "protocolVersion=" << eview->protocolVersion() << "\n" 00149 << "run=" << eview->run() << "\n" 00150 << "event=" << eview->event() << "\n" 00151 << "lumi=" << eview->lumi() << "\n" 00152 << "origDataSize=" << eview->origDataSize() << "\n" 00153 << "outModId=0x" << std::hex << eview->outModId() << std::dec << "\n" 00154 << "event length=" << eview->eventLength() << "\n"; 00155 00156 std::vector<bool> l1_out; 00157 eview->l1TriggerBits(l1_out); 00158 00159 std::cout << "\nl1 size= " << l1_out.size() << "\n l1 bits=\n"; 00160 edm::copy_all(l1_out,std::ostream_iterator<bool>(std::cout," ")); 00161 00162 std::vector<unsigned char> hlt_out; 00163 if (eview->hltCount() > 0) {hlt_out.resize(1 + (eview->hltCount()-1)/4);} 00164 eview->hltTriggerBits(&hlt_out[0]); 00165 00166 std::cout << "\nhlt Count:" << eview->hltCount(); 00167 std::cout << "\nhlt bits=\n("; 00168 for(int i=(hlt_out.size()-1); i != -1 ; --i) 00169 printBits(hlt_out[i]); 00170 std::cout << ")\n"; 00171 std::cout.flush();
void dumpEventIndex | ( | const EventMsgView * | eview | ) |
Definition at line 185 of file DumpTools.cc.
References GenMuonPlsPt100GeV_cfg::cout, and dumpEventHeader().
00187 { 00188 dumpEventHeader(eview); 00189 std::cout.flush();
void dumpEventView | ( | const EventMsgView * | eview | ) |
Definition at line 173 of file DumpTools.cc.
References GenMuonPlsPt100GeV_cfg::cout, and dumpEventHeader().
00175 { 00176 dumpEventHeader(eview); 00177 //const uint8* edata = eview->eventData(); 00178 //std::cout << "\nevent data=\n("; 00179 //std::copy(&edata[0],&edata[0]+eview->eventLength(), 00180 // std::ostream_iterator<char>(std::cout,"")); 00181 //std::cout << ")\n"; 00182 std::cout.flush(); 00183
void dumpFRDEventView | ( | const FRDEventMsgView * | fview | ) |
Definition at line 243 of file DumpTools.cc.
References GenMuonPlsPt100GeV_cfg::cout, lat::endl(), FRDEventMsgView::event(), FRDEventMsgView::lumi(), FRDEventMsgView::run(), FRDEventMsgView::size(), and FRDEventMsgView::version().
00245 { 00246 std::cout << "\n>>>>> FRDEvent Message Dump (begin) >>>>>" << std::endl; 00247 std::cout.flush(); 00248 00249 std::cout << "size = " << fview->size() << "\n" 00250 << "version = " << fview->version() << "\n" 00251 << "run = " << fview->run() << "\n" 00252 << "lumi = " << fview->lumi() << "\n" 00253 << "event = " << fview->event() << "\n"; 00254 std::cout.flush(); 00255 00256 std::cout << ">>>>> FRDEvent Message Dump (end) >>>>>" << std::endl; 00257 std::cout.flush();
Definition at line 123 of file DumpTools.cc.
References GenMuonPlsPt100GeV_cfg::cout, InitMsgView::descLength(), and dumpInitHeader().
00125 { 00126 InitMsgView view(buf); 00127 dumpInitHeader(&view); 00128 00129 std::cout << "desc len = " << view.descLength() << "\n"; 00130 //const uint8* pos = view.descData(); 00131 //std::copy(pos,pos+view.descLength(),std::ostream_iterator<uint8>(std::cout,"")); 00132 //std::cout << "\n"; 00133 std::cout.flush();
void dumpInitHeader | ( | const InitMsgView * | view | ) |
File contains simple tools to dump Init and Event Messages on screen.
Definition at line 22 of file DumpTools.cc.
References InitMsgView::code(), edm::copy_all(), GenMuonPlsPt100GeV_cfg::cout, cms::Digest::digest(), lat::endl(), InitMsgView::hltTriggerNames(), InitMsgView::hltTriggerSelections(), InitMsgView::l1TriggerNames(), InitMsgView::outputModuleId(), InitMsgView::outputModuleLabel(), InitMsgView::processName(), InitMsgView::protocolVersion(), InitMsgView::pset(), r1, InitMsgView::releaseTag(), InitMsgView::run(), InitMsgView::size(), and cms::MD5Result::toString().
Referenced by dumpInit(), dumpInitVerbose(), dumpInitView(), and dumpStartMsg().
00024 { 00025 std::cout 00026 << "code = " << view->code() << ", " 00027 << "size = " << view->size() << "\n" 00028 << "run = " << view->run() << ", " 00029 << "proto = " << view->protocolVersion() << "\n" 00030 << "release = " << view->releaseTag() << "\n" 00031 << "processName = " << view->processName() << "\n"; 00032 if (view->protocolVersion() >= 5) { 00033 std::cout << "outModuleLabel = " << view->outputModuleLabel() << "\n"; 00034 } 00035 if (view->protocolVersion() >= 6) { 00036 std::cout << "outputModuleId=0x" << std::hex << view->outputModuleId() 00037 << std::dec << std::endl; 00038 } 00039 00040 //PSet 16 byte non-printable representation, stored in message. 00041 uint8 vpset[16]; 00042 view->pset(vpset); 00043 00044 //Lets convert it to printable hex form 00045 vpset[16]='\0'; 00046 std::string pset_str((char*) &vpset[0]); 00047 cms::Digest dig(pset_str); 00048 cms::MD5Result r1 = dig.digest(); 00049 std::string hexy = r1.toString(); 00050 std::cout << "PSetID= " << hexy << std::endl; 00051 00052 Strings vhltnames,vhltselections,vl1names; 00053 view->hltTriggerNames(vhltnames); 00054 if (view->protocolVersion() >= 5) { 00055 view->hltTriggerSelections(vhltselections); 00056 } 00057 view->l1TriggerNames(vl1names); 00058 00059 std::cout << "HLT names :- \n "; 00060 edm::copy_all(vhltnames,std::ostream_iterator<std::string>(std::cout,"\n")); 00061 00062 if (view->protocolVersion() >= 5) { 00063 std::cout << "HLT selections :- \n "; 00064 edm::copy_all(vhltselections,std::ostream_iterator<std::string>(std::cout,"\n")); 00065 } 00066 00067 std::cout << "L1 names :- \n "; 00068 edm::copy_all(vl1names,std::ostream_iterator<std::string>(std::cout,"\n")); 00069 std::cout << "\n"; 00070 std::cout.flush(); 00071
void dumpInitVerbose | ( | const InitMsgView * | view | ) |
Definition at line 92 of file DumpTools.cc.
References edm::BranchDescription::branchName(), GenMuonPlsPt100GeV_cfg::cout, InitMsgView::descData(), InitMsgView::descLength(), dumpInitHeader(), lat::endl(), edm::getTClass(), and edm::BranchDescription::init().
00094 { 00095 std::cout << ">>>>> INIT Message Dump (begin) >>>>>" << std::endl; 00096 dumpInitHeader(view); 00097 00098 TClass* desc = getTClass(typeid(SendJobHeader)); 00099 RootBuffer xbuf(TBuffer::kRead, view->descLength(), 00100 (char*)view->descData(), kFALSE); 00101 std::auto_ptr<SendJobHeader> sd((SendJobHeader*)xbuf.ReadObjectAny(desc)); 00102 00103 if (sd.get() == 0) { 00104 std::cout << "Unable to determine the product registry - " 00105 << "Registry deserialization error." << std::endl; 00106 } 00107 else { 00108 std::cout << "Branch Descriptions:" << std::endl; 00109 SendDescs const& descs = sd->descs(); 00110 SendDescs::const_iterator iDesc(descs.begin()), eDesc(descs.end()); 00111 while (iDesc != eDesc) { 00112 BranchDescription branchDesc = *iDesc; 00113 branchDesc.init(); 00114 //branchDesc.write(std::cout); 00115 std::cout << branchDesc.branchName() << std::endl; 00116 iDesc++; 00117 } 00118 } 00119 00120 std::cout << "<<<<< INIT Message Dump (end) <<<<<" << std::endl; 00121 std::cout.flush();
void dumpInitView | ( | const InitMsgView * | view | ) |
Definition at line 73 of file DumpTools.cc.
References GenMuonPlsPt100GeV_cfg::cout, InitMsgView::descLength(), and dumpInitHeader().
00075 { 00076 00077 00078 dumpInitHeader(view); 00079 std::cout << "desc len = " << view->descLength() << "\n"; 00080 //const uint8* pos = view->descData(); 00081 //std::copy(pos,pos+view->descLength(),std::ostream_iterator<uint8>(std::cout,"")); 00082 //std::cout << "\n"; 00083 std::cout.flush(); 00084
void dumpStartMsg | ( | const InitMsgView * | view | ) |
Definition at line 86 of file DumpTools.cc.
References GenMuonPlsPt100GeV_cfg::cout, and dumpInitHeader().
00088 { 00089 dumpInitHeader(view); 00090 std::cout.flush();
void printBits | ( | unsigned char | c | ) |
Definition at line 135 of file DumpTools.cc.
References GenMuonPlsPt100GeV_cfg::cout, and i.
Referenced by dumpEventHeader().
00136 { 00137 00138 for (int i = 7; i >= 0; --i) { 00139 int bit = ((c >> i) & 1); 00140 std::cout << " "<<bit; 00141 }