Skip to content

Commit

Permalink
final fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
KSkwarczynski committed Jan 6, 2025
1 parent 4f6ccf6 commit 7f07aa0
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 5 deletions.
6 changes: 6 additions & 0 deletions .github/workflows/CIValidations.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ jobs:
test_7: ./bin/MatrixPlotter bin/TutorialDiagConfig.yaml MCMC_Test_drawCorr.root
test_8: bin/GetPostfitParamPlots MCMC_Test_drawCorr.root
test_9: bin/PlotLLH MCMC_Test.root
test_10: bin/PlotMCMCDiag Test_MCMC_Diag.root Test_MCMC_Diag.root

- name: NuMCMC Tools Validations
test_1: ./CIValidations/NuMCMCvalidations.sh
Expand Down Expand Up @@ -145,3 +146,8 @@ jobs:
${{ matrix.test_9 }}
fi
if [[ "${{ matrix.test_10 }}" != "empty" ]]; then
echo " "
echo "Performing test 10"
${{ matrix.test_10 }}
fi
14 changes: 9 additions & 5 deletions Diagnostics/PlotMCMCDiag.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ void MakePlot(TString fname1, TString fname2,TString fname3, TString fname4)
{
TCanvas *c1 = new TCanvas("c1"," ", 0, 0, 800,630);
gStyle->SetOptStat(0); //Set 0 to disable statystic box
//To avoid TCanvas::Print> messages
gErrorIgnoreLevel = kWarning;

TKey *key;
TFile *infile = TFile::Open(fname1.Data());
Expand All @@ -41,6 +43,7 @@ void MakePlot(TString fname1, TString fname2,TString fname3, TString fname4)
TIter next(infile->GetListOfKeys());
while ((key = static_cast<TKey*>(next()))) {
std::string dirname = std::string(key->GetName());
if (std::string(key->GetClassName()) != "TDirectoryFile") continue;
//KS: Script will work with LogL and Batched_means, you can comment it if you are interested in it
if( (dirname == "LogL") || (dirname == "Batched_means") ) continue;
//KS: Trace wo longer chains is super big, the way to avoid is to plot as png but I don't like png,
Expand All @@ -54,13 +57,12 @@ void MakePlot(TString fname1, TString fname2,TString fname3, TString fname4)
{
std::string name = std::string(subkey->GetName());
name = dirname + "/" + name;
std::cout<<name<<std::endl;

MACH3LOG_INFO("{}", name);
if (std::string(subkey->GetClassName()) != "TH1D"){continue;}
else{std::cout << "continuing along my way" << std::endl;}
else{MACH3LOG_WARN("continuing along my way for {}", dirname);}

TH1D* blarb[4];
std::cout << "Looking for " << name.c_str() << " from file " << fname1.Data() << std::endl;
MACH3LOG_INFO("Looking for {} from file {}", name.c_str(), fname1.Data());
blarb[0] = static_cast<TH1D*>(infile->Get(name.c_str())->Clone());
//KS: Some fixe params can go crazy
if(TMath::IsNaN(blarb[0]->GetBinContent(1)) ) continue;
Expand Down Expand Up @@ -125,6 +127,8 @@ void PlotAutoCorr(TString fname1, TString fname2, TString fname3, TString fname4

TCanvas *c1 = new TCanvas("c1"," ", 0, 0, 800,630);
gStyle->SetOptStat(0); //Set 0 to disable statistic box
//To avoid TCanvas::Print> messages
gErrorIgnoreLevel = kWarning;

c1->Print("Auto_Corr_PerFile.pdf[", "pdf");
for(int ik = 0; ik < Nfiles; ik++)
Expand All @@ -150,7 +154,7 @@ void PlotAutoCorr(TString fname1, TString fname2, TString fname3, TString fname4
name = dirname + "/" + name;

if (std::string(subkey->GetClassName()) != "TH1D") continue;
std::cout<<name.c_str()<<std::endl;
MACH3LOG_DEBUG("{}", name.c_str());
TH1D* blarb = static_cast<TH1D*>(infile[ik]->Get(name.c_str())->Clone());
//KS: Some fixe pramas can go crazy
if(TMath::IsNaN(blarb->GetBinContent(1))) continue;
Expand Down

0 comments on commit 7f07aa0

Please sign in to comment.