Add functionality of LLHplotting and energy conv & scale instant subm… - #54
Add functionality of LLHplotting and energy conv & scale instant subm…#54Po-WeiHuang wants to merge 1 commit into
Conversation
| # -newdir /home/huangp/antinullh/cfg/2p2energyscale_1p5plus | ||
| # -o /data/snoplus/weiiiiiii/antinuFit/run_selection/2p2energyscale_1p5plus | ||
| # -scale 1.015 -conv 0.045 | ||
|
|
There was a problem hiding this comment.
I think you could have the input flags be the same as for submitFixedOscJobs.py, then have different flags for the new additional options (maybe like -c or -d for old config dir, -n for new config dir, can keep -scale and -conv). That way there's no hard coded paths later when you call submitFixedOscJobs.py
| import os | ||
| import shutil | ||
| import configparser | ||
| import subprocess |
There was a problem hiding this comment.
I don't think subprocess is needed
| config = configparser.ConfigParser() | ||
|
|
||
| # Read the config file | ||
| config.read(f"{args.newdir}/fit_config.ini") # Replace with the actual file path |
There was a problem hiding this comment.
maybe it would be better for the user to enter the full fit config file path and name, then it doesn't matter if the input config isn't called fit_config.ini
| print(command) | ||
| # Run the command | ||
| os.system(command) | ||
| print("Command is now running") |
There was a problem hiding this comment.
I think it will have run by the time it prints "is now running" but ok 😄
| import argparse | ||
| def SNOPLUSSTYLE(): | ||
| #personal_path = os.path.dirname(os.path.realpath(__file__)) | ||
| personal_path = "~/Library/Times_New_Roman_Normal.ttf" |
There was a problem hiding this comment.
I think we may as well commit that file in utils?
| # Format the y-axis tick labels to be scaled | ||
| def scaled_formatter(x, pos): | ||
| #The two args are the value and tick position | ||
| #print('%1.0f' % (x/1e-5)) |
There was a problem hiding this comment.
can delete this commented print out
| profile_deltam = np.min(hist2d_avg, axis=0) # Min over theta | ||
| theta_centers = 0.5 * (xedges[:-1] + xedges[1:]) | ||
| deltam_centers = 0.5 * (yedges[:-1] + yedges[1:]) | ||
| #print(profile_theta-profile_deltam) |
There was a problem hiding this comment.
can delete this commented print out
| #plt.tight_layout() | ||
| #plt.show() | ||
| plt.savefig(os.path.join(output_dir, "OscLLH.png")) | ||
| plt.savefig(os.path.join(output_dir, "OscLLH.pdf")) |
There was a problem hiding this comment.
maybe call it like FullLLH or LLHandProjections, or something just to make it clear from the name what makes it different to the outputs of plotFixedOscLLH.C
|
I have some thoughts on the cosmetics of the output plot:
looking good though! We can call to discuss if it helps P.S How much of the code was chat-gpt 😝 |
|
Oh and can you add to the HowTo guide a bit on using these |
|
Hi Will |
Hello Will,
Two functionalities I have added here:
util/makeconfig_forrunselection.py: Changing conv and scale values and instantly submit condor jobs. This is useful for doing runlist estimation to validate what is our tolerance of scale&conv depending on fitting parameters.util/plotFixedOscLLHWhole.py: A script of plotting a magnificent image, whose upeer left and bottom right are ProfiledLLH, projected from a 2D LLH graph at bottom left. Upper right pad shows the colourmap user is using on the 2D graph. User should put theirTimes_New_Roman_Normal.ttfand replace topersonal_pathto get Times New Roman on.The plot should look similar to this: