Skip to content
Snippets Groups Projects
Commit 46fdccd2 authored by Tamara Vazquez Schroeder's avatar Tamara Vazquez Schroeder
Browse files

Merge branch 'cherry-pick-824c9e72 [formerly 8c5fde1f52]-21.0' into '21.0'

Sweeping !11641 from 21.1-dev to 21.0.
Improve somewhat the histogram fetching

See merge request atlas/athena!11674

Former-commit-id: c29231a828d2393e414aa2f336e413ab77696d3e
parents 92f4ac8b 72a17d61
No related branches found
No related tags found
No related merge requests found
...@@ -53,25 +53,26 @@ ...@@ -53,25 +53,26 @@
bool fulldbg = false; bool fulldbg = false;
/// get a histogram given a path, and an optional initial directory
/// if histogram is not found, then check for dir/name
template<typename T=TH1F> template<typename T=TH1F>
T* Get( TFile& f, const std::string& name, const std::string& dir, std::vector<std::string>* saved=0 ) { T* Get( TFile& f, const std::string& name, const std::string& dir="", std::vector<std::string>* saved=0 ) {
T* h = (T*)f.Get( name.c_str() ); T* h = (T*)f.Get( name.c_str() );
if ( h ) { if ( h || dir=="" || name.find(dir)!=std::string::npos ) {
std::cout << "Get() name " << name << std::endl; std::cout << "Get() name " << name << " :: " << h << std::endl;
if ( saved ) saved->push_back( name ); if ( saved ) saved->push_back( name );
} }
else { else {
if ( dir=="" ) return h;
std::cout << "Get() name " << (dir+"/"+name) << std::endl;
h = (T*)f.Get( (dir+"/"+name).c_str() ); h = (T*)f.Get( (dir+"/"+name).c_str() );
if ( h ) { std::cout << "Get() name " << (dir+"/"+name) << " :: " << h << std::endl;
if ( saved ) saved->push_back( dir+"/"+name ); if ( saved ) {
} if ( h ) saved->push_back( dir+"/"+name );
else { else saved->push_back( name );
if ( saved ) saved->push_back( name );
} }
} }
return h; return h;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment