13 const shared_ptr<Process> &process):
14 FigureComponent(event_scan, process),
15 out_((
CodeToPlainText(event_scan.name_+
"_SCAN_"+process->name_)+
".txt").c_str()),
16 full_cut_(event_scan.cut_ && process->cut_),
18 val_vectors_(event_scan.columns_.size()),
34 for(
size_t icol = 0; icol < scan.
columns_.size(); ++icol){
37 if(max_size < 1) max_size = 1;
49 if(max_size > 0 && !(
row_ & 0x7)){
50 out_ <<
" Row Instance";
52 out_ <<
' ' << setw(w) << col.Name().substr(0,scan.
width_);
57 for(
size_t instance = 0; instance < max_size; ++instance){
58 out_ << setw(9) <<
row_ <<
' ' << setw(8) << instance;
59 for(
size_t icol = 0; icol < scan.
columns_.size(); ++icol){
67 out_ <<
' ' << setw(w) <<
' ';
74 if(max_size > 0) ++
row_;
78 out_.precision(precision);
83 const vector<NamedFunc> &columns,
84 const vector<shared_ptr<Process> > &processes,
92 for(
const auto& proc: processes){
98 const std::string & ){
99 for(
const auto &scan:
scans_){
105 set<const Process *> processes;
106 for(
const auto &scan:
scans_){
107 processes.insert(scan->process_.get());
113 for(
const auto &scan:
scans_){
114 if(scan->process_.get() == process)
return scan.get();
127 scan->Precision(precision);
unsigned precision_
Decimal places to print.
std::set< const Process * > GetProcesses() const final
std::string CodeToPlainText(std::string code)
unsigned Precision() const
Abstract base class for access to ntuple variables.
ScalarType GetScalar(const Baby &b) const
Evaluate scalar function with b as argument.
Combines a callable function taking a Baby and returning a scalar or vector with its string represent...
bool IsScalar() const
Check if scalar function is valid.
void RecordEvent(const Baby &baby) final
FigureComponent * GetComponent(const Process *process) final
void Print(double luminosity, const std::string &subdir) final
std::vector< NamedFunc::VectorType > val_vectors_
Values for each column (to avoid creating new vectors each event)
std::ofstream out_
File to which results are printed.
VectorType GetVector(const Baby &b) const
Evaluate vector function with b as argument.
void Precision(unsigned precision)
NamedFunc cut_
Cut restricting printed events/objects.
NamedFunc::VectorType cut_vector_
Cut results (to avoid creating new vector each event)
std::vector< std::unique_ptr< SingleScan > > scans_
One scan for each process.
unsigned width_
Width of column in characters. Determined from precision.
bool IsVector() const
Check if vectorr function is valid.
std::string name_
Name of scan for saving to file.
std::vector< NamedFunc > columns_
Variables to print.
NamedFunc full_cut_
Cached scan&&process cut.