ATLAS Offline Software
Loading...
Searching...
No Matches
ass Class Reference

make the histogram assessment part of the config More...

Collaboration diagram for ass:

Public Member Functions

 ass (node &n, bool ah=true)
void makeass (node &n, const std::string &space="", std::string path="", std::string rawpath="", bool found=false)

Private Attributes

bool m_allhists

Detailed Description

make the histogram assessment part of the config

Definition at line 629 of file hcg.cxx.

Constructor & Destructor Documentation

◆ ass()

ass::ass ( node & n,
bool ah = true )
inline

Definition at line 633 of file hcg.cxx.

633 : m_allhists(ah) {
634 (*outp) << "\n\n";
635 (*outp) << "#######################\n";
636 (*outp) << "# Histogram Assessments\n";
637 (*outp) << "#######################\n\n";
638 makeass( n );
639 }
bool m_allhists
Definition hcg.cxx:727
void makeass(node &n, const std::string &space="", std::string path="", std::string rawpath="", bool found=false)
Definition hcg.cxx:642

Member Function Documentation

◆ makeass()

void ass::makeass ( node & n,
const std::string & space = "",
std::string path = "",
std::string rawpath = "",
bool found = false )
inline

if ( n.name()=="top_level" ) print = true;

always try to remap the name

extra user specified tags

extra user specified tags

\t\t##" << n.name() << "
";

Definition at line 642 of file hcg.cxx.

642 {
643
644 static std::string savedir = "";
645
646 bool print = false;
647
648 if ( n.name()==base ) found = true;
649
650 if ( n.type()==node::DIRECTORY ) print = found;
652
653 if ( n.size() ) {
654
656
657 std::string newspacer = space;
658
659 if ( exclude.find(n.name())!=exclude.end() ) {
660 print = false;
661 return;
662 }
663
664 // if ( found && dirs.size() && dirs.find(n.name())==dirs.end() ) print = false;
665
666 if ( print ) newspacer += spacer;
667
668 std::string output_name = find(n.name());
669
670 if ( print && n.type()==node::DIRECTORY ) {
671 if ( path=="" ) path += output_name;
672 else path += delimiter + output_name;
673 if ( rawpath=="" ) rawpath += n.name();
674 else rawpath += delimiter + n.name();
675 }
676
677 if ( found && ( dirs.size() && !matchdir( path ) && !matchdir( rawpath ) ) ) return;
678
679 if ( print ) (*outp) << space << "dir " << n.name() << " {" << "\n"; // " \t\t(" << path << ")\n";
680
681 bool first_hists = true;
682
683 for ( unsigned i=0 ; i<n.size() ; i++ ) {
684 if ( n[i]->type()!=node::HISTOGRAM ) makeass( *n[i], newspacer, path, rawpath, found ) ;
685 else if ( n[i]->type()==node::HISTOGRAM ) {
686 if ( !m_allhists ) {
687 if ( first_hists ) {
688 (*outp) << space << "\t" << "hist .* {\n";
689 (*outp) << space << "\t\t" << "regex \t= 1\n";
690 (*outp) << space << "\t\t" << "algorithm \t= " << algorithm << "\n";
691 (*outp) << space << "\t\t" << "description \t= " << description << "\n";
692 (*outp) << space << "\t\t" << "output \t= " << path << "\n";
693 (*outp) << space << "\t\t" << "display \t= StatBox\n";
695 for ( unsigned it=0 ; it<tags.size() ; it++ ) (*outp) << space << "\t\t" << replace(tags[it],"=","\t=") << "\n";
696 (*outp) << space << "\t" << "}\n";
697 }
698 first_hists = false;
699 }
700 else {
701 (*outp) << space << "\t" << "hist " << n[i]->name() << " {\n";
702 (*outp) << space << "\t\t" << "algorithm \t= " << algorithm << "\n";
703 (*outp) << space << "\t\t" << "description \t= " << description << "\n";
704 (*outp) << space << "\t\t" << "output \t= " << path << "\n";
705 (*outp) << space << "\t\t" << "display \t= StatBox\n";
707 static const std::string equalStr{"="};
708 static const std::string tabEqualStr{"\t="};
709 for ( unsigned it=0 ; it<tags.size() ; it++ ) (*outp) << space << "\t\t" << replace(tags[it],equalStr,tabEqualStr) << "\n";
710 (*outp) << space << "\t" << "}\n";
711
712 // TH1* ase = (TH1*)(n[i]->object());
713 // if ( ase ) std::cerr << space << "\t\t" << "entries = " << ase->GetEntries() << "\n";
714 // if ( ase ) std::cerr << space << "\t\t" << "entries = \"" << ase->GetTitle() << "\"\n";
715
716 }
717 }
718 }
719
720 if ( print ) (*outp) << space << "}\n";
721 }
722
723 }
void print(char *figname, TCanvas *c1)
@ DIRECTORY
Definition node.h:28
@ HISTOGRAM
Definition node.h:28
bool matchdir(const std::string &s)
see whether this directory matches any of the directories we are explicitly being asked to match
Definition hcg.cxx:392
std::string description
glabal timer - how long have I taken so far?
Definition hcg.cxx:93
std::vector< std::string > tags
Definition hcg.cxx:107
std::string replace(std::string s, const std::string &s2, const std::string &s3)
Definition hcg.cxx:312
std::ostream * outp
send output to here ...
Definition hcg.cxx:78
std::string find(const std::string &s)
return a remapped string
Definition hcg.cxx:140
std::set< std::string > exclude
list of directories to be excluded
Definition hcg.cxx:100
static const std::string delimiter("/")
std::string base
Definition hcg.cxx:83
std::string algorithm
Definition hcg.cxx:87
std::map< std::string, int > dirs
list of directories to be explicitly included, together with corresponding depths of subdirectories
Definition hcg.cxx:104
path
python interpreter configuration --------------------------------------—
Definition athena.py:130
const std::string spacer
Definition spacer.h:27

Member Data Documentation

◆ m_allhists

bool ass::m_allhists
private

Definition at line 727 of file hcg.cxx.


The documentation for this class was generated from the following file: