CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
Functions
DumpTools.cc File Reference
#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"
#include <memory>

Go to the source code of this file.

Functions

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)
 
void dumpInitVerbose (const InitMsgView *view)
 
void dumpInitView (const InitMsgView *view)
 
void dumpStartMsg (const InitMsgView *view)
 
void printBits (unsigned char c)
 

Function Documentation

void dumpEvent ( uint8 buf)

Definition at line 195 of file DumpTools.cc.

References gather_cfg::cout, and dumpEventHeader().

196 {
197  EventMsgView eview(buf);
198 
199  dumpEventHeader(&eview);
200 
201  //const uint8* edata = eview.eventData();
202  //std::cout << "\nevent data=\n(";
203  //std::copy(&edata[0],&edata[0]+eview.eventLength(),
204  // std::ostream_iterator<char>(std::cout,""));
205  //std::cout << ")\n";
206  std::cout.flush();
207 
208 }
void dumpEventHeader(const EventMsgView *eview)
Definition: DumpTools.cc:144
tuple cout
Definition: gather_cfg.py:121
void dumpEventHeader ( const EventMsgView eview)

Definition at line 144 of file DumpTools.cc.

References EventMsgView::adler32_chksum(), EventMsgView::code(), edm::copy_all(), gather_cfg::cout, TauDecayModes::dec, EventMsgView::droppedEventsCount(), EventMsgView::event(), EventMsgView::eventLength(), EventMsgView::hltCount(), EventMsgView::hltTriggerBits(), EventMsgView::hostName(), i, EventMsgView::l1TriggerBits(), EventMsgView::lumi(), EventMsgView::origDataSize(), EventMsgView::outModId(), printBits(), EventMsgView::protocolVersion(), EventMsgView::run(), and EventMsgView::size().

Referenced by dumpEvent(), dumpEventIndex(), and dumpEventView().

145 {
146  std::cout << "code=" << eview->code() << "\n"
147  << "size=" << eview->size() << "\n"
148  << "protocolVersion=" << eview->protocolVersion() << "\n"
149  << "run=" << eview->run() << "\n"
150  << "event=" << eview->event() << "\n"
151  << "lumi=" << eview->lumi() << "\n"
152  << "origDataSize=" << eview->origDataSize() << "\n"
153  << "outModId=0x" << std::hex << eview->outModId() << std::dec << "\n"
154  << "adler32 chksum= " << eview->adler32_chksum() << "\n"
155  << "host name= " << eview->hostName() << "\n"
156  << "event length=" << eview->eventLength() << "\n"
157  << "droppedEventsCount=" << eview->droppedEventsCount() << "\n";
158 
159  std::vector<bool> l1_out;
160  eview->l1TriggerBits(l1_out);
161 
162  std::cout << "\nl1 size= " << l1_out.size() << "\n l1 bits=\n";
163  edm::copy_all(l1_out,std::ostream_iterator<bool>(std::cout," "));
164 
165  std::vector<unsigned char> hlt_out;
166  if (eview->hltCount() > 0) {hlt_out.resize(1 + (eview->hltCount()-1)/4);}
167  eview->hltTriggerBits(&hlt_out[0]);
168 
169  std::cout << "\nhlt Count:" << eview->hltCount();
170  std::cout << "\nhlt bits=\n(";
171  for(int i=(hlt_out.size()-1); i != -1 ; --i)
172  printBits(hlt_out[i]);
173  std::cout << ")\n";
174  std::cout.flush();
175 }
int i
Definition: DBlmapReader.cc:9
uint32 lumi() const
Definition: EventMessage.cc:85
void printBits(unsigned char c)
Definition: DumpTools.cc:136
void hltTriggerBits(uint8 *put_here) const
std::string hostName() const
uint32 outModId() const
Definition: EventMessage.cc:97
uint32 run() const
Definition: EventMessage.cc:73
uint32 adler32_chksum() const
Definition: EventMessage.h:99
uint32 eventLength() const
Definition: EventMessage.h:84
uint32 code() const
Definition: EventMessage.h:79
uint32 hltCount() const
Definition: EventMessage.h:97
uint32 droppedEventsCount() const
uint32 size() const
Definition: EventMessage.h:80
uint32 origDataSize() const
Definition: EventMessage.cc:91
Func copy_all(ForwardSequence &s, Func f)
wrappers for copy
Definition: Algorithms.h:24
tuple cout
Definition: gather_cfg.py:121
uint64 event() const
Definition: EventMessage.cc:79
void l1TriggerBits(std::vector< bool > &put_here) const
uint32 protocolVersion() const
Definition: EventMessage.cc:67
void dumpEventIndex ( const EventMsgView eview)

Definition at line 189 of file DumpTools.cc.

References gather_cfg::cout, and dumpEventHeader().

190 {
191  dumpEventHeader(eview);
192  std::cout.flush();
193 }
void dumpEventHeader(const EventMsgView *eview)
Definition: DumpTools.cc:144
tuple cout
Definition: gather_cfg.py:121
void dumpEventView ( const EventMsgView eview)

Definition at line 177 of file DumpTools.cc.

References gather_cfg::cout, and dumpEventHeader().

178  {
179  dumpEventHeader(eview);
180  //const uint8* edata = eview->eventData();
181  //std::cout << "\nevent data=\n(";
182  //std::copy(&edata[0],&edata[0]+eview->eventLength(),
183  // std::ostream_iterator<char>(std::cout,""));
184  //std::cout << ")\n";
185  std::cout.flush();
186 
187 }
void dumpEventHeader(const EventMsgView *eview)
Definition: DumpTools.cc:144
tuple cout
Definition: gather_cfg.py:121
void dumpFRDEventView ( const FRDEventMsgView fview)

Definition at line 210 of file DumpTools.cc.

References gather_cfg::cout, FRDEventMsgView::event(), FRDEventMsgView::lumi(), FRDEventMsgView::run(), FRDEventMsgView::size(), and FRDEventMsgView::version().

211 {
212  std::cout << "\n>>>>> FRDEvent Message Dump (begin) >>>>>" << std::endl;
213  std::cout.flush();
214 
215  std::cout << "size = " << fview->size() << "\n"
216  << "version = " << fview->version() << "\n"
217  << "run = " << fview->run() << "\n"
218  << "lumi = " << fview->lumi() << "\n"
219  << "event = " << fview->event() << "\n";
220  std::cout.flush();
221 
222  std::cout << ">>>>> FRDEvent Message Dump (end) >>>>>" << std::endl;
223  std::cout.flush();
224 }
uint32 lumi() const
uint32 size() const
uint32 run() const
uint32 version() const
tuple cout
Definition: gather_cfg.py:121
uint64 event() const
void dumpInit ( uint8 buf)

Definition at line 124 of file DumpTools.cc.

References gather_cfg::cout, InitMsgView::descLength(), and dumpInitHeader().

125 {
126  InitMsgView view(buf);
127  dumpInitHeader(&view);
128 
129  std::cout << "desc len = " << view.descLength() << "\n";
130  //const uint8* pos = view.descData();
131  //std::copy(pos,pos+view.descLength(),std::ostream_iterator<uint8>(std::cout,""));
132  //std::cout << "\n";
133  std::cout.flush();
134 }
void dumpInitHeader(const InitMsgView *view)
Definition: DumpTools.cc:19
tuple cout
Definition: gather_cfg.py:121
void dumpInitHeader ( const InitMsgView view)

File contains simple tools to dump Init and Event Messages on screen.

Definition at line 19 of file DumpTools.cc.

References InitMsgView::adler32_chksum(), InitMsgView::code(), edm::copy_all(), gather_cfg::cout, TauDecayModes::dec, cms::Digest::digest(), InitMsgView::hltTriggerNames(), InitMsgView::hltTriggerSelections(), InitMsgView::hostName(), InitMsgView::l1TriggerNames(), InitMsgView::outputModuleId(), InitMsgView::outputModuleLabel(), InitMsgView::processName(), InitMsgView::protocolVersion(), InitMsgView::pset(), diffTwoXMLs::r1, InitMsgView::releaseTag(), InitMsgView::run(), InitMsgView::size(), AlCaHLTBitMon_QueryRunRegistry::string, and cms::MD5Result::toString().

Referenced by dumpInit(), dumpInitVerbose(), dumpInitView(), and dumpStartMsg().

20 {
21  std::cout
22  << "code = " << view->code() << ", "
23  << "size = " << view->size() << "\n"
24  << "run = " << view->run() << ", "
25  << "proto = " << view->protocolVersion() << "\n"
26  << "release = " << view->releaseTag() << "\n"
27  << "processName = " << view->processName() << "\n";
28  if (view->protocolVersion() >= 5) {
29  std::cout << "outModuleLabel = " << view->outputModuleLabel() << "\n";
30  }
31  if (view->protocolVersion() >= 6) {
32  std::cout << "outputModuleId=0x" << std::hex << view->outputModuleId()
33  << std::dec << std::endl;
34  }
35  if (view->protocolVersion() >= 8) {
36  std::cout << "Checksum for Registry data = " << view->adler32_chksum()
37  << " Hostname = " << view->hostName() << std::endl;
38  }
39 
40  //PSet 16 byte non-printable representation, stored in message.
41  uint8 vpset[16];
42  view->pset(vpset);
43 
44  //Lets convert it to printable hex form
45  std::string pset_str(vpset, vpset+sizeof(vpset));
46  pset_str += '\0';
47  cms::Digest dig(pset_str);
48  cms::MD5Result r1 = dig.digest();
49  std::string hexy = r1.toString();
50  std::cout << "PSetID= " << hexy << std::endl;
51 
52  Strings vhltnames,vhltselections,vl1names;
53  view->hltTriggerNames(vhltnames);
54  if (view->protocolVersion() >= 5) {
55  view->hltTriggerSelections(vhltselections);
56  }
57  view->l1TriggerNames(vl1names);
58 
59  std::cout << "HLT names :- \n ";
60  edm::copy_all(vhltnames,std::ostream_iterator<std::string>(std::cout,"\n"));
61 
62  if (view->protocolVersion() >= 5) {
63  std::cout << "HLT selections :- \n ";
64  edm::copy_all(vhltselections,std::ostream_iterator<std::string>(std::cout,"\n"));
65  }
66 
67  std::cout << "L1 names :- \n ";
68  edm::copy_all(vl1names,std::ostream_iterator<std::string>(std::cout,"\n"));
69  std::cout << "\n";
70  std::cout.flush();
71 
72 }
std::vector< std::string > Strings
Definition: MsgTools.h:18
void hltTriggerNames(Strings &save_here) const
Definition: InitMessage.cc:146
uint32 adler32_chksum() const
Definition: InitMessage.h:96
std::string releaseTag() const
Definition: InitMessage.cc:122
std::string hostName() const
Definition: InitMessage.cc:190
void l1TriggerNames(Strings &save_here) const
Definition: InitMessage.cc:160
uint32 protocolVersion() const
Definition: InitMessage.cc:110
std::string outputModuleLabel() const
Definition: InitMessage.cc:136
std::string toString() const
Definition: Digest.cc:87
unsigned char uint8
Definition: MsgTools.h:11
uint32 outputModuleId() const
Definition: InitMessage.h:82
uint32 code() const
Definition: InitMessage.h:72
Func copy_all(ForwardSequence &s, Func f)
wrappers for copy
Definition: Algorithms.h:24
std::string processName() const
Definition: InitMessage.cc:127
uint32 run() const
Definition: InitMessage.cc:104
tuple cout
Definition: gather_cfg.py:121
uint32 size() const
Definition: InitMessage.h:73
void hltTriggerSelections(Strings &save_here) const
Definition: InitMessage.cc:151
void pset(uint8 *put_here) const
Definition: InitMessage.cc:116
void dumpInitVerbose ( const InitMsgView view)

Definition at line 93 of file DumpTools.cc.

References edm::BranchDescription::branchName(), gather_cfg::cout, InitMsgView::descData(), InitMsgView::descLength(), dumpInitHeader(), edm::getTClass(), edm::BranchDescription::init(), and sd.

94 {
95  std::cout << ">>>>> INIT Message Dump (begin) >>>>>" << std::endl;
96  dumpInitHeader(view);
97 
98  TClass* desc = getTClass(typeid(SendJobHeader));
99  TBufferFile xbuf(TBuffer::kRead, view->descLength(),
100  (char*)view->descData(), kFALSE);
101  std::auto_ptr<SendJobHeader> sd((SendJobHeader*)xbuf.ReadObjectAny(desc));
102 
103  if (sd.get() == 0) {
104  std::cout << "Unable to determine the product registry - "
105  << "Registry deserialization error." << std::endl;
106  }
107  else {
108  std::cout << "Branch Descriptions:" << std::endl;
109  SendDescs const& descs = sd->descs();
110  SendDescs::const_iterator iDesc(descs.begin()), eDesc(descs.end());
111  while (iDesc != eDesc) {
112  BranchDescription branchDesc = *iDesc;
113  branchDesc.init();
114  //branchDesc.write(std::cout);
115  std::cout << branchDesc.branchName() << std::endl;
116  iDesc++;
117  }
118  }
119 
120  std::cout << "<<<<< INIT Message Dump (end) <<<<<" << std::endl;
121  std::cout.flush();
122 }
std::string const & branchName() const
void dumpInitHeader(const InitMsgView *view)
Definition: DumpTools.cc:19
const uint8 * descData() const
Definition: InitMessage.h:93
std::vector< BranchDescription > SendDescs
TClass * getTClass(const std::type_info &ti)
Definition: ClassFiller.cc:78
double sd
tuple cout
Definition: gather_cfg.py:121
uint32 descLength() const
Definition: InitMessage.h:92
void dumpInitView ( const InitMsgView view)

Definition at line 74 of file DumpTools.cc.

References gather_cfg::cout, InitMsgView::descLength(), and dumpInitHeader().

75 {
76 
77 
78  dumpInitHeader(view);
79  std::cout << "desc len = " << view->descLength() << "\n";
80  //const uint8* pos = view->descData();
81  //std::copy(pos,pos+view->descLength(),std::ostream_iterator<uint8>(std::cout,""));
82  //std::cout << "\n";
83  std::cout.flush();
84 
85 }
void dumpInitHeader(const InitMsgView *view)
Definition: DumpTools.cc:19
tuple cout
Definition: gather_cfg.py:121
uint32 descLength() const
Definition: InitMessage.h:92
void dumpStartMsg ( const InitMsgView view)

Definition at line 87 of file DumpTools.cc.

References gather_cfg::cout, and dumpInitHeader().

88 {
89  dumpInitHeader(view);
90  std::cout.flush();
91 }
void dumpInitHeader(const InitMsgView *view)
Definition: DumpTools.cc:19
tuple cout
Definition: gather_cfg.py:121
void printBits ( unsigned char  c)

Definition at line 136 of file DumpTools.cc.

References gather_cfg::cout, and i.

Referenced by dumpEventHeader().

136  {
137 
138  for (int i = 7; i >= 0; --i) {
139  int bit = ((c >> i) & 1);
140  std::cout << " "<<bit;
141  }
142 }
int i
Definition: DBlmapReader.cc:9
tuple cout
Definition: gather_cfg.py:121