LArSoft  v07_13_02
Liquid Argon Software toolkit - http://larsoft.org/
DataFlowDumper_module.cc File Reference
#include "art/Framework/Core/ModuleMacros.h"
#include "art/Framework/Modules/ProvenanceDumper.h"
#include "art/Persistency/Provenance/ProductMetaData.h"
#include "canvas/Persistency/Provenance/ProductID.h"
#include "canvas/Utilities/Exception.h"
#include "fhiclcpp/types/Atom.h"
#include "fhiclcpp/types/Name.h"
#include <algorithm>
#include <fstream>
#include <string>
#include <vector>

Go to the source code of this file.

Classes

class  art::DataFlow
 
struct  art::DataFlow::Config
 

Namespaces

 art
 HLT enums.
 

Typedefs

using art::DataFlowDumper = ProvenanceDumper< DataFlow >
 

Functions

void write_id (art::ProductID const pid, std::ostream &os)
 
void write_id (art::Provenance const &p, std::ostream &os)
 
void format_product_node (std::string const &fcn, std::string const &pin, std::ostream &os)
 
void write_product_node (art::Provenance const &p, std::ostream &os, int debug)
 
void write_product_node (art::ProductID const pid, std::ostream &os, int debug)
 
void write_module_id (art::Provenance const &p, std::ostream &os)
 
std::size_t color (std::string const &procname)
 
void write_module_node (art::Provenance const &p, std::string const &colorscheme, std::ostream &os)
 
void write_creator_line (art::Provenance const &p, std::string const &colorscheme, std::ostream &os, int debug)
 
void write_parent_id (art::ProductID const parent, std::ostream &os)
 
void write_parentage_line (art::Provenance const &p, art::ProductID const parent, std::ostream &os, int debug)
 

Function Documentation

std::size_t color ( std::string const &  procname)

Definition at line 154 of file DataFlowDumper_module.cc.

References evd::details::begin(), and evd::details::end().

Referenced by evd::AnalysisBaseDrawer::CalorShower(), evd::RecoBaseDrawer::Cluster2D(), evd_tool::StandardDrawer::DrawActiveTPCoutline(), evd_tool::StandardDrawer::DrawBoxBoundedGeoOutline(), evd::AnalysisBaseDrawer::DrawDeDx(), evd::AnalysisBaseDrawer::DrawKineticEnergy(), evd::RecoBaseDrawer::DrawProng2D(), evd::RecoBaseDrawer::DrawShower3D(), evd::RecoBaseDrawer::DrawSpacePoint3D(), evd::RecoBaseDrawer::DrawTrack3D(), evd::RecoBaseDrawer::DrawTrackVertexAssns2D(), evd::RecoBaseDrawer::EndPoint2D(), ProcessSingleFile(), evd::RecoBaseDrawer::Prong2D(), evd::RecoBaseDrawer::Prong3D(), evd::RecoBaseDrawer::ProngOrtho(), evd::RawDataDrawer::QueueDrawingBoxes(), evd::RecoBaseDrawer::Seed2D(), evd::RecoBaseDrawer::Seed3D(), evd::RecoBaseDrawer::SeedOrtho(), evd::RecoBaseDrawer::Slice2D(), evd::RecoBaseDrawer::Slice3D(), evd::RecoBaseDrawer::SpacePoint3D(), evd::RecoBaseDrawer::SpacePointOrtho(), evd::RecoBaseDrawer::Vertex2D(), evd::RecoBaseDrawer::VertexOrtho(), write_module_node(), evd_tool::ICARUSDrawer::~ICARUSDrawer(), and evd_tool::MicroBooNEDrawer::~MicroBooNEDrawer().

155 {
156  static std::vector<std::string> names_seen;
157  auto it = std::find(begin(names_seen), end(names_seen), procname);
158  if (it == end(names_seen)) {
159  names_seen.push_back(procname);
160  return names_seen.size();
161  }
162  return std::distance(begin(names_seen), it) + 1;
163 }
std::vector< evd::details::RawDigitInfo_t >::const_iterator begin(RawDigitCacheDataClass const &cache)
std::vector< evd::details::RawDigitInfo_t >::const_iterator end(RawDigitCacheDataClass const &cache)
void format_product_node ( std::string const &  fcn,
std::string const &  pin,
std::ostream &  os 
)

Definition at line 101 of file DataFlowDumper_module.cc.

Referenced by write_product_node().

104 {
105  os << " [label = \"" << fcn;
106  if (!pin.empty())
107  os << "/" << pin;
108  os << "\" shape = box];\n";
109 }
void write_creator_line ( art::Provenance const &  p,
std::string const &  colorscheme,
std::ostream &  os,
int  debug 
)

Definition at line 175 of file DataFlowDumper_module.cc.

References write_id(), write_module_id(), and write_module_node().

Referenced by art::DataFlow::processEventProvenance().

179 {
180  if (debug > 0) {
181  os << "# write_creator_line for provenance: " << &p << '\n';
182  }
183  write_module_id(p, os);
184  write_module_node(p, colorscheme, os);
185  write_module_id(p, os);
186  os << " -> ";
187  write_id(p, os);
188  os << ";\n";
189 }
void write_module_node(art::Provenance const &p, std::string const &colorscheme, std::ostream &os)
void write_module_id(art::Provenance const &p, std::ostream &os)
DebugStuff debug
Definition: DebugStruct.cxx:4
void write_id(art::ProductID const pid, std::ostream &os)
void write_id ( art::ProductID const  pid,
std::ostream &  os 
)

Definition at line 88 of file DataFlowDumper_module.cc.

Referenced by write_creator_line(), write_id(), and write_product_node().

89 {
90  os << "\"b" << pid << '\"';
91 }
void write_id ( art::Provenance const &  p,
std::ostream &  os 
)

Definition at line 94 of file DataFlowDumper_module.cc.

References art::Provenance::productID(), and write_id().

95 {
96  write_id(p.productID(), os);
97 }
void write_id(art::ProductID const pid, std::ostream &os)
void write_module_id ( art::Provenance const &  p,
std::ostream &  os 
)

Definition at line 148 of file DataFlowDumper_module.cc.

References art::Provenance::moduleLabel(), and art::Provenance::processName().

Referenced by write_creator_line(), and write_parentage_line().

149 {
150  os << '\"' << p.moduleLabel() << '/' << p.processName() << '\"';
151 }
void write_module_node ( art::Provenance const &  p,
std::string const &  colorscheme,
std::ostream &  os 
)

Definition at line 166 of file DataFlowDumper_module.cc.

References color(), and art::Provenance::processName().

Referenced by write_creator_line().

169 {
170  os << " [ colorscheme=" << colorscheme << " color=" << color(p.processName())
171  << " style=filled ];\n";
172 }
std::size_t color(std::string const &procname)
void write_parent_id ( art::ProductID const  parent,
std::ostream &  os 
)

Definition at line 192 of file DataFlowDumper_module.cc.

Referenced by write_parentage_line().

193 {
194  os << 'b' << parent;
195 }
void write_parentage_line ( art::Provenance const &  p,
art::ProductID const  parent,
std::ostream &  os,
int  debug 
)

Definition at line 198 of file DataFlowDumper_module.cc.

References write_module_id(), and write_parent_id().

Referenced by art::DataFlow::processEventProvenance().

202 {
203  if (debug > 0) {
204  os << "# write_parentage_line for provenance: " << &p << " parent "
205  << parent << '\n';
206  }
207  write_parent_id(parent, os);
208  os << " -> ";
209  write_module_id(p, os);
210  os << ";\n";
211 }
void write_module_id(art::Provenance const &p, std::ostream &os)
DebugStuff debug
Definition: DebugStruct.cxx:4
void write_parent_id(art::ProductID const parent, std::ostream &os)
void write_product_node ( art::Provenance const &  p,
std::ostream &  os,
int  debug 
)

Definition at line 114 of file DataFlowDumper_module.cc.

References format_product_node(), art::Provenance::friendlyClassName(), art::Provenance::productInstanceName(), and write_id().

Referenced by art::DataFlow::processEventProvenance().

115 {
116  if (debug > 0) {
117  os << "# write_product_node for provenance: " << &p << '\n';
118  }
119  write_id(p, os);
120  format_product_node(p.friendlyClassName(), p.productInstanceName(), os);
121 }
DebugStuff debug
Definition: DebugStruct.cxx:4
void write_id(art::ProductID const pid, std::ostream &os)
void format_product_node(std::string const &fcn, std::string const &pin, std::ostream &os)
void write_product_node ( art::ProductID const  pid,
std::ostream &  os,
int  debug 
)

Definition at line 124 of file DataFlowDumper_module.cc.

References evd::details::begin(), evd::details::end(), format_product_node(), art::ProductMetaData::instance(), and write_id().

125 {
126  if (debug > 0) {
127  os << "# write_product_node for pid: " << pid << '\n';
128  }
129  // Access to the productList is cheap, so not really worth caching.
130  auto const& pmd = art::ProductMetaData::instance();
131  auto const& plist = pmd.productList(); // note this is a map
132  // The mapped_type in the map contains all the information we want,
133  // but we have to do a linear search through the map to find the one
134  // with the right ProductID.
135  auto it = std::find_if(begin(plist), end(plist), [&pid](auto const& keyval) {
136  return keyval.second.productID() == pid;
137  });
138  if (it == plist.end()) {
139  os << "#Missing information for product with id " << pid << '\n';
140  return;
141  }
142  write_id(pid, os);
144  it->second.friendlyClassName(), it->second.productInstanceName(), os);
145 }
DebugStuff debug
Definition: DebugStruct.cxx:4
static ProductMetaData const & instance()
std::vector< evd::details::RawDigitInfo_t >::const_iterator begin(RawDigitCacheDataClass const &cache)
void write_id(art::ProductID const pid, std::ostream &os)
std::vector< evd::details::RawDigitInfo_t >::const_iterator end(RawDigitCacheDataClass const &cache)
void format_product_node(std::string const &fcn, std::string const &pin, std::ostream &os)