44std::pair< std::string, std::string >
getTypeAndVars(
const TObject* resHelper ) {
45 const std::string name{ resHelper->GetName() };
46 const std::string keyWord{
"Helper" };
47 const size_t pos = name.find( keyWord );
48 const size_t pos2 = pos + keyWord.size();
49 return { name.substr( 0, pos ), name.substr( pos2 ) };
115 auto theCWD = gDirectory;
118 auto *keys = dir->GetListOfKeys();
119 for (
auto *
const key : *keys){
121 TDirectory* theDir =
dynamic_cast<TDirectory*
>(dir->Get(key->GetName()));
128 std::unique_ptr<TObject> gotIt(dir->Get(key->GetName()));
139int pproc_file(
const std::string& p_infile,
const std::string& methodStr ) {
144 std::unique_ptr<TFile> infile(TFile::Open(p_infile.c_str(),
"UPDATE"));
145 if (!infile || infile->IsZombie()) {
146 std::cerr <<
"could not open input file "<<p_infile<<
" for updating "<< std::endl;
151 using methodMap_t = std::unordered_map<
153 methodMap_t methodMap = {
160 methodMap_t::const_iterator mitr = methodMap.find( methodStr );
161 if( mitr == methodMap.end() ) {
162 std::cerr <<
"Error: Method " << methodStr <<
163 " not found. Using iterRMS by default." << std::endl;
166 theMethod = mitr->second;
void makeResolutions(const TH2 *h_input2D, TH1 *hwidth, TH1 *hmean, TH1 *hproj[], bool saveProjections, IDPVM::ResolutionHelper::methods theMethod=IDPVM::ResolutionHelper::iterRMS_convergence)
extract 1D resolution plots from a 2D "residual vs observable" histogram.
std::pair< std::string, std::string > getTypeAndVars(const TObject *resHelper)
int postProcessHistos(TObject *resHelper, IDPVM::ResolutionHelper &theHelper, IDPVM::ResolutionHelper::methods &theMethod)
TH1 * cloneExisting(const std::string &name)
int pproc_file(const std::string &p_infile, const std::string &methodStr)
bool isResolutionHelper(TObject *entry)
std::pair< std::string, std::string > getPullAndResoNames(const std::string &type)
bool file_exists(const string &p_name)
int postProcessDir(TDirectory *dir, IDPVM::ResolutionHelper &theHelper, IDPVM::ResolutionHelper::methods &theMethod)