LArSoft  v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
DataFlowDumper_module.cc File Reference
#include "art/Framework/Modules/ProvenanceDumper.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
 

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_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 127 of file DataFlowDumper_module.cc.

References util::begin(), and util::end().

Referenced by evd::AnalysisBaseDrawer::CalorShower(), evd::RecoBaseDrawer::Cluster2D(), evdb_tool::SpacePoint3DDrawerStandard::Draw(), evd_tool::ProtoDUNEDrawer::DrawActiveTPCoutline(), evd_tool::StandardDrawer::DrawActiveTPCoutline(), evd_tool::ProtoDUNEDrawer::DrawBoxBoundedGeoOutline(), evd_tool::StandardDrawer::DrawBoxBoundedGeoOutline(), evd::AnalysisBaseDrawer::DrawDeDx(), evd::AnalysisBaseDrawer::DrawKineticEnergy(), evd::RecoBaseDrawer::DrawProng2D(), evd::RecoBaseDrawer::DrawShower3D(), evd::RecoBaseDrawer::DrawTrack3D(), evd::RecoBaseDrawer::DrawTrackVertexAssns2D(), evd::RecoBaseDrawer::EndPoint2D(), shower::EMShowerAlg::FindOrderOfHits_(), Plot(), ProcessSingleFile(), evd::RecoBaseDrawer::Prong2D(), evd::RecoBaseDrawer::Prong3D(), evd::RecoBaseDrawer::ProngOrtho(), evd::RawDataDrawer::QueueDrawingBoxes(), lar_content::HierarchyMonitoringAlgorithm::Run(), 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().

128 {
129  static std::vector<std::string> names_seen;
130  auto it = std::find(begin(names_seen), end(names_seen), procname);
131  if (it == end(names_seen)) {
132  names_seen.push_back(procname);
133  return names_seen.size();
134  }
135  return std::distance(begin(names_seen), it) + 1;
136 }
decltype(auto) constexpr end(T &&obj)
ADL-aware version of std::end.
Definition: StdUtils.h:77
decltype(auto) constexpr begin(T &&obj)
ADL-aware version of std::begin.
Definition: StdUtils.h:69
void format_product_node ( std::string const &  fcn,
std::string const &  pin,
std::ostream &  os 
)

Definition at line 98 of file DataFlowDumper_module.cc.

Referenced by write_product_node().

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

Definition at line 148 of file DataFlowDumper_module.cc.

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

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

152 {
153  if (debug > 0) {
154  os << "# write_creator_line for provenance: " << &p << '\n';
155  }
156  write_module_id(p, os);
157  write_module_node(p, colorscheme, os);
158  write_module_id(p, os);
159  os << " -> ";
160  write_id(p, os);
161  os << ";\n";
162 }
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 85 of file DataFlowDumper_module.cc.

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

86 {
87  os << "\"b" << pid << '\"';
88 }
void write_id ( art::Provenance const &  p,
std::ostream &  os 
)

Definition at line 91 of file DataFlowDumper_module.cc.

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

92 {
93  write_id(p.productID(), os);
94 }
void write_id(art::ProductID const pid, std::ostream &os)
void write_module_id ( art::Provenance const &  p,
std::ostream &  os 
)

Definition at line 121 of file DataFlowDumper_module.cc.

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

Referenced by write_creator_line(), and write_parentage_line().

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

Definition at line 139 of file DataFlowDumper_module.cc.

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

Referenced by write_creator_line().

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

Definition at line 165 of file DataFlowDumper_module.cc.

Referenced by write_parentage_line().

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

Definition at line 171 of file DataFlowDumper_module.cc.

References write_module_id(), and write_parent_id().

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

175 {
176  if (debug > 0) {
177  os << "# write_parentage_line for provenance: " << &p << " parent "
178  << parent << '\n';
179  }
180  write_parent_id(parent, os);
181  os << " -> ";
182  write_module_id(p, os);
183  os << ";\n";
184 }
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 111 of file DataFlowDumper_module.cc.

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

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

112 {
113  if (debug > 0) {
114  os << "# write_product_node for provenance: " << &p << '\n';
115  }
116  write_id(p, os);
117  format_product_node(p.friendlyClassName(), p.productInstanceName(), os);
118 }
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)