File tree Expand file tree Collapse file tree 1 file changed +15
-5
lines changed
Expand file tree Collapse file tree 1 file changed +15
-5
lines changed Original file line number Diff line number Diff line change @@ -1304,16 +1304,26 @@ def produce_fitthcovmat(
13041304 thcovmat_present = False
13051305
13061306 if use_thcovmat_if_present and thcovmat_present :
1307- # Expected path of theory covmat hardcoded
1308- covmat_path = (
1309- fit .path / "tables" / "datacuts_theory_theorycovmatconfig_theory_covmat_custom.csv"
1310- )
1311- # All possible valid files
1307+ tables_path = fit .path / "tables"
1308+ theorycovmatconfig = fit .as_input ()["theorycovmatconfig" ]
1309+ user_covmat_path = theorycovmatconfig .get ("user_covmat_path" , None )
1310+ point_prescriptions = theorycovmatconfig .get ("point_prescriptions" , None )
1311+
1312+ generic_name = "datacuts_theory_theorycovmatconfig_theory_covmat_custom.csv"
1313+ if user_covmat_path is not None :
1314+ # User covmat + point prescriptions
1315+ if point_prescriptions is not None and point_prescriptions != []:
1316+ generic_name = "datacuts_theory_theorycovmatconfig_total_theory_covmat.csv"
1317+ # Only user covmat
1318+ else :
1319+ generic_name = "datacuts_theory_theorycovmatconfig_user_covmat.csv"
1320+ covmat_path = tables_path / generic_name
13121321 if not covmat_path .exists ():
13131322 raise ConfigError (
13141323 "Fit appeared to use theory covmat in fit but the file was not at the "
13151324 f"usual location: { covmat_path } ."
13161325 )
1326+ logging .info (f"Using theory covmat in fit: { covmat_path } " )
13171327 fit_theory_covmat = ThCovMatSpec (covmat_path )
13181328 else :
13191329 fit_theory_covmat = None
You can’t perform that action at this time.
0 commit comments