|
RAPIDO
Repeatable Analysis Programming for Interpretability, Durability, and Organization
|
#include <cutflow.h>
Public Member Functions | |
| Cutflow () | |
| Cutflow (std::string new_name) | |
| Cutflow (std::string new_name, Cut *new_root) | |
| ~Cutflow () | |
| void | setRoot (Cut *new_root) |
| void | insert (std::string target_cut_name, Cut *new_cut, Direction direction) |
| void | insert (Cut *target_cut, Cut *new_cut, Direction direction) |
| void | replace (std::string target_cut_name, Cut *new_cut) |
| void | replace (Cut *target_cut, Cut *new_cut) |
| void | remove (std::string target_cut_name) |
| void | remove (Cut *target_cut) |
| virtual bool | run () |
| bool | run (Cut *target_cut) |
| bool | run (std::string target_cut_name) |
| std::vector< bool > | run (std::vector< Cut * > target_cuts) |
| std::vector< bool > | run (std::vector< std::string > target_cuts) |
| bool | isProgeny (std::string parent_cut_name, std::string target_cut_name, Direction direction) |
| bool | isProgeny (Cut *parent_cut, Cut *target_cut, Direction direction) |
| Cut * | findTerminus (std::string starting_cut_name) |
| Cut * | findTerminus (Cut *starting_cut) |
| void | print (bool show_timing=false) |
| void | write (std::string output_dir="") |
| void | writeCSV (std::string output_dir="") |
| void | writeMermaid (std::string output_dir="", std::string orientation="TD") |
| void | setDebugLambda (std::function< void(Cut *)> new_debugger) |
Public Attributes | |
| std::string | name |
| Utilities::Variables | globals |
Protected Member Functions | |
| Cut * | getCut (std::string cut_name) |
| bool | recursiveSearchProgeny (Cut *cut, Cut *target_cut) |
| Cut * | recursiveFindTerminus (Cut *cut) |
| void | recursivePrint (std::string tabs, Cut *cut, Direction direction, bool show_timing=false) |
| void | recursiveWrite (Cut *cut, std::ofstream &ofstream, std::string output_cflow) |
| void | recursiveWriteCSV (std::string output_dir, Cut *cut, Direction direction, int csv_idx, Utilities::CSVFiles csv_files) |
| void | recursiveWriteMermaid (Cut *cut, std::ofstream &ofstream, std::string output_mmd) |
| virtual bool | recursiveEvaluate (Cut *cut) |
| void | recursiveDelete (Cut *cut) |
Protected Attributes | |
| Cut * | root |
| std::map< std::string, Cut * > | cut_record |
| std::function< void(Cut *)> | debugger |
| bool | debugger_is_set |
An analysis represented as a binary search tree (i.e. analysis = tree, cut = node)
| Cutflow::Cutflow | ( | ) |
Cutflow object default constructor
| Cutflow::Cutflow | ( | std::string | new_name | ) |
| Cutflow::Cutflow | ( | std::string | new_name, |
| Cut * | new_root ) |
Cutflow object overload constructor
| new_name | name of cutflow |
| new_root | pointer to cut object to use as root node |
| Cutflow::~Cutflow | ( | ) |
Cutflow object destructor
Find the rightmost terminal leaf from a given node
| starting_cut | cut from which to start search |
| Cut * Cutflow::findTerminus | ( | std::string | starting_cut_name | ) |
Find the rightmost terminal leaf from a given node
| starting_cut_name | cut from which to start search |
|
protected |
(PROTECTED) Retrieve cut object from cut record
| cut_name | cut name |
Insert a new node AFTER a given node
| target_cut | pointer to target node |
| new_cut | pointer to new node |
| direction | direction (Left/false, Right/true) |
| void Cutflow::insert | ( | std::string | target_cut_name, |
| Cut * | new_cut, | ||
| Direction | direction ) |
Insert a new node AFTER a given node
| target_cut_name | target node name |
| new_cut | pointer to new node |
| direction | direction (Left/false, Right/true) |
Check if a given cut is amongst the progeny of another cut on a certain side of its family tree
| parent_cut | pointer to cut whose progeny will be searched |
| target_cut | pointer to target descendant cut to look for |
| direction | side of the family tree to search (Left/false, Right/true) |
| bool Cutflow::isProgeny | ( | std::string | parent_cut_name, |
| std::string | target_cut_name, | ||
| Direction | direction ) |
Check if a given cut is amongst the progeny of another cut on a certain side of its family tree
| parent_cut_name | name of cut whose progeny will be searched |
| target_cut_name | name of target descendant cut to look for |
| direction | side of the family tree to search (Left/false, Right/true) |
| void Cutflow::print | ( | bool | show_timing = false | ) |
Print cutflow
| show_timing | toggle timing information in printout |
|
protected |
(PROTECTED) Recursively delete cuts in the cutflow
| cut | pointer to current cut |
|
protectedvirtual |
(PROTECTED) Recursively evaulate cuts in the cutflow
| cut | pointer to current cut |
Reimplemented in Histflow.
(PROTECTED) Recursively search for the rightmost terminal leaf from a given node
| cut | pointer to current cut |
|
protected |
(PROTECTED) Recursively print cuts
| tabs | string with the prefix tabs for current cut |
| cut | pointer to current cut |
| direction | direction of cut relative to parent |
| show_timing | toggle timing information in printout |
(PROTECTED) Recursively search for the target cut amongst a given cut's descendants
| cut | pointer to current cut |
| target_cut | pointer to target cut |
|
protected |
(PROTECTED) Recursively write RAPIDO cutflow file
| cut | pointer to current cut |
| ofstream | std::ofsteam object for RAPIDO .cflow file |
| output_cflow | name of .cflow file |
|
protected |
(PROTECTED) Recursively write cutflow level to CSV file(s)
| output_dir | target directory for output CSV files |
| cut | pointer to current cut |
| direction | direction of cut relative to parent |
| csv_idx | index of target CSV file |
| csv_files | Utilities::CSVFile object containing for all currently opened CSV files |
|
protected |
(PROTECTED) Recursively write cutflow to a Mermaid (.mmd) file
| cut | pointer to current cut |
| ofstream | std::ofstream object for .mmd file |
| output_mmd | name of .mmd file |
| void Cutflow::remove | ( | Cut * | target_cut | ) |
Remove a given node from the cutflow; will not work with the root node if it has both a left and right child
| target_cut | pointer to target node |
| void Cutflow::remove | ( | std::string | target_cut_name | ) |
Remove a given node from the cutflow; will not work with the root node if it has both a left and right child
| target_cut_name | target node name |
Replace a given node with a new node
| target_cut | pointer to target node |
| new_cut | pointer to new node |
| void Cutflow::replace | ( | std::string | target_cut_name, |
| Cut * | new_cut ) |
Replace a given node with a new node
| target_cut_name | target node name |
| new_cut | pointer to new node |
|
virtual |
Run cutflow until any terminus
| bool Cutflow::run | ( | Cut * | target_cut | ) |
Run cutflow until a target terminal cut
| target_cut | pointer to target cut |
| bool Cutflow::run | ( | std::string | target_cut_name | ) |
Run cutflow and check if a target terminal cut has passed
| target_cut_name | name of target cut |
| std::vector< bool > Cutflow::run | ( | std::vector< Cut * > | target_cuts | ) |
Run cutflow and check if any target terminal cut in a given set has passed
| target_cuts | std::vector of pointers to target cuts |
| std::vector< bool > Cutflow::run | ( | std::vector< std::string > | target_cuts | ) |
Run cutflow and check if any target terminal cut in a given set has passed
| target_cuts | std::vector of target cut names |
| void Cutflow::setDebugLambda | ( | std::function< void(Cut *)> | new_debugger | ) |
Set debug function
| new_debugger | lambda function that will be run before every cut |
| void Cutflow::setRoot | ( | Cut * | new_root | ) |
Set root node of cutflow object
| new_root | pointer to cut object to use as new root node |
| void Cutflow::write | ( | std::string | output_dir = "" | ) |
Write RAPIDO cutflow file
| output_dir | target directory for output cutflow files (optional) |
| void Cutflow::writeCSV | ( | std::string | output_dir = "" | ) |
Print all cutflow paths to separate CSV files {output_dir}/{name}_{terminal_cut}.csv
| output_dir | target directory for output CSV files (optional) |
| void Cutflow::writeMermaid | ( | std::string | output_dir = "", |
| std::string | orientation = "TD" ) |
Print cutflow to a Mermaid flowchart
| output_dir | target directory for output .mmd file (optional) |
| orientation | desired orientation of graph: TD or LR (optional) |
|
protected |
(PROTECTED) Map ("record") of all cuts in cutflow
|
protected |
(PROTECTED) Lambda function that runs before every cut for debugging purposes
|
protected |
(PROTECTED) Flag indicating that a debugger lambda function has been set
| Utilities::Variables Cutflow::globals |
Dynamic list of variables to track across object scope (i.e. psuedo-members)
| std::string Cutflow::name |
Name of cutflow
|
protected |
(PROTECTED) Pointer to cut that is used as the root node