Skip to content

These scripts are used to handle the output .aida files from my Rivet analyses. There is a script to merge the aida files if there are multiple. There is a script to compile all the histograms in the aida files into a single root file. Finally there are a few scripts that handle creating presentable histograms.

Notifications You must be signed in to change notification settings

cjohnson-phys/Python_Scripts

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

N.B.: For these scripts to run your environment must source ROOT and Rivet.

Aux_Functions.py:
	This module holds a lot of the clutter that would inhibit the readability
	of the other scripts. It contains lists used for histogram titles, dataset
	names, etc... It also has the Atlas Style built in and a few other functions
	referenced by the other scripts. Anytime new datasets or histograms are
	added to the analysis they need to be added to the lists in here...

	Credit for the pyROOT implementation of the Atlas Style goes to ghl3 at
	https://github.com/ghl3/RooPlottingSuite/

Batch_Aida2Root.py:
	This script is deprecated, but could still be useful. It converts all off the
	aida files in a directory to root files (using aida2root from Rivet) then uses
	hadd (from ROOT) to merge the root files and add the histograms together. It
	then divides the histograms by the number of input root files to get an average.
	This method is slow and I haven't tested to to be sure the errors are handled
	properly

CompileRootFiles.py:
	This script grabs the root files generated by 'MergeAidaFiles.py' and compiles
	them all into a single root file called 'VBF_Systematics.root'. The directory
	names in the output root file are given in a list in the Aux_Functions.py
	module. It looks for the input root files in directories whose names are
	given in a list in Aux_Functions.py module. This script also uses pyAMI to
	get the cross-sections for the respective dataset and creates a directory
	of histograms normalized to the given cross-section. Finally it creates a
	directory for histograms normalized to their area (1/hist.Integrate('width')).
	Finally, each histogram is properly titled, as are their axes. These titles
	are defined in the Aux_Functions.py module.

Create_Hists.py:
	This script plots the signal and background for a given histogram using the
	histograms normalized to the cross-section. The input file is 'VBF_Systematics.
	root' from 'CompileRootFiles.py'. It uses the Atlas Style class in
	Aux_Functions.py to make the histograms presentable and it adjusts the 
	hist line options (width,color,...) using SetHistStyle() defined in Aux...
	This histograms are saved as pdfs in a folder named 'Plot_Comparisons'.

Find_Error_Band.py:
	This script is used to find the theoretical systematic uncertainty by 
	comparing the histograms with the shifted theoretical systematics to a
	nominal histogram. The positive and negative variations are added,
	separately, in quadrature. These errors are then plotted with
	TGraphAsymmErrors on the nominal histogram. This will find the total
	systematic uncertainy for the signal and the background samples separately.
	This script also produced a ratio plot (uncertaintly/nominal) to make
	a plot to show the relative error. Uses the Atlas Style from Aux_Functions.py. 

MergeAidaFiles.py:
	This script uses 'aidamerge.py' to average all the aida files in a directory.
	It then converts the merged.aida file into a root file using Rivet's aida2root.
	If you need the aida files to be added instead of averaged then there is an
	option for this in 'aidamerge.py'. It shouldn't be a problem to implement. The
	directories that it checks in are given in the 'dataset_names' list in the
	'Aux_Function.py' module. This script cleans up by removing the merged.aida
	file when its done so that it wouldn't be included next time you use this script.

	Credit for the 'aidamerge.py' script goes to the Rivet team at
	https://rivet.hepforge.org/ 

plot_all_hists.py:
	This is a simple script that plots a nominal signal(background) histogram along
	with a series of histograms with shifted theoretical systematics. This just
	allows you to visualize the systematic shifts so you can be sure they are 
	reasonable. It uses the histograms normalized to their cross section. 

Aux_Functions.py
Average_AMI_txt.py
Batch_Aida2Root.py
ChangeWeights_and_Merge.sh
Compare_md5.py
CompileRootFiles.py
CompileRootFiles_MergeStats.py
Count_Events_LHEF.py
Create_Hists.py
Cut_Flow_Plots.py
EvgentoRivet.sh
Find_Error_Band.py
Gen_Hists.py
Gen_Hists_VBF_Syst.py
HistogramsRatio.py
MC12_PowhegVBFW_example.py
MergeAidaFiles.py
MergeYodaFiles.py
Muon2Tau.py
PowhegFolder.py
Prepare_Syst_File.sh
README
Rename_Folder.py
Rivet.sh
SetXS_Herwigpp.py
Style.C
TopPlotter.py
Utils.C
aidamerge.py
aidamerge_alt.py
calc_XS.py
changeEventWeight.py
combineNLOtop.py
convertToHepMC.sh
histo_ratio.C
mergeLHE.py
mergePwhgWpm.sh
plot_all_hists.py
plots.py
prepareEvents.sh
removeIncEvents.py
rootlogon.C
scalup.py
splitLHE.py
top2root.py

About

These scripts are used to handle the output .aida files from my Rivet analyses. There is a script to merge the aida files if there are multiple. There is a script to compile all the histograms in the aida files into a single root file. Finally there are a few scripts that handle creating presentable histograms.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published