contur.data package

Submodules

contur.data.data_objects module

class contur.data.data_objects.Analysis(row, beamid)[source]

Bases: object

Class to store information about an analysis.

Properties:

  • name full name of the analysis, including the options string if present

  • short_name as above but without the options string

  • lumi the integrated luminosity used for this analysis

  • rivet_analysis the rivet analysis object

  • poolid the unique ID of the contur pool this analysis belongs to

bibkey()[source]

return the bibtex key of this analysis

bibtex()[source]

return the bibtex of this analysis

experiment()[source]
get_pool()[source]

return the pool object associated with this analysis.

sm()[source]

return a list of the SM theory descriptions associated with this analysis (if any)

toHTML(anaindex, adatfiles=[], style='', timestamp='now')[source]

Write this analysis to an HTML file called anaindex, with link links to the graphics version of the plots in adatfiles. If adatafiles is empty, just write the description etc without links to plots.

optional stylesheet and timestamp.

to be deprecated in favour of html_utils.writeAnaHTML

class contur.data.data_objects.Beam(row)[source]

Bases: object

Class to store information about beam configurations

Properties:

  • id

  • collider short string identifying the collider

  • particle_a short string identifying the first colliding beam

  • particle_b short string identifying the second colliding beam

  • energy_a energy of first beam

  • energy_b energy of second beam

  • root_s centre-of-mass energy

class contur.data.data_objects.Experiment(row)[source]

Bases: object

Class to store information about experiments

Properties:

  • id

  • collider short string identifying the collider

class contur.data.data_objects.Pool(row)[source]

Bases: object

Class to store information about analysis pools

Properties:

  • id the short string identifying the pool

  • beamid the unique ID of the colliding beam type this pool is associated with

  • description a short human-readable description of the final state this pool contains.

class contur.data.data_objects.SMPrediction(row)[source]

Bases: object

Class to store information about SM predictions

Properties

Prediction metadata: (populated from the analysis DB)

  • id short string which, together with the analysis name, identifies this prediction

  • a_name the analysis name, including any options string

  • inspids inspire IDs of the theory references

  • origin short description of where the prediciton was obtained

  • pattern regexp. prediction applies to all measurements in this analysis whose name matches this (Only used when making the files in /Theory)

  • axis the name of the axis to take the theory from, if coming from a HEPData record. The record used will be the one where the end of the HEPData path matches this (Only used when making the files in /Theory)

  • file_name the name of the file the prediction is stored in, in the /Theory directory.

  • short_description for plot legends

  • long_description for web pages, does not need to repeat the short description

Prediction data: (Populated when the prediction data are read in from the file)

  • ao :dict: of analysis objects keyed by name

  • plotObj :dict: of plot objects keyed by name

  • corr :dict: of correlation matrices keyed by name

  • uncorr :dict: of diagonal error matrices keyed by name

  • errors :dict: of error breakdowns keyed by name

contur.data.data_access_db module

contur.data.data_access_db.find_model_point_by_params(paramList)[source]

Send a list of parameters paramList, this will return the closest model point for which results are available in the results database.

contur.data.data_access_db.find_param_point_db(paramList)[source]

Given a list of model parameters, search the results DB for the closest match, and return the associated yoda file names.

contur.data.data_access_db.generate_model_and_parameter(model_db=False)[source]

Create the model and parameter tables and populate them

if model_db is True, they are written to the central model database, otherwise they are written to the local results db (and the other tables will also be created, empty)

contur.data.data_access_db.get_model_id(run_info_path)[source]

check the model database to see if the model in run_info_path is present. if so, return its id (-1 if not found).

contur.data.data_access_db.get_model_version(dir)[source]

for a model somewhere in the tree below dir, get its version

contur.data.data_access_db.init_dadb()[source]

initialise the local results database

contur.data.data_access_db.init_mdb()[source]

Initialise the model database

contur.data.data_access_db.open_for_reading(file)[source]
contur.data.data_access_db.search_yoda_file(model_points)[source]

Sent a list of model_points, will return a list of corresponding yoda filenames.

contur.data.data_access_db.show_param_detail_db(paramList)[source]

Given a list of models parameters, search the results DB for the closest match, print some detailed info, and return the associated yoda file names.

contur.data.data_access_db.write_grid_data(conturDepot, args, yodafile=None)[source]

populate the local database with information about this run.

contur.data.build_database

class contur.data.build_database.BuildDB(dbname)[source]

Bases: object

Build database through sql file

build_db()[source]

Build database through run analyses.sql.

Parameters:

name – your database name

contur.data.static_db module

exception contur.data.static_db.InvalidPath[source]

Bases: Exception

contur.data.static_db.getNormInfo(h)
Parameters:

h – (string) histogram path.

Returns:

  • isScaled - does this histogram need to be scaled to turn it into a differential cross section?

  • scaleFactor - the scale factor, if so (=1 otherwise)

  • nev_differential - factor for converting “number of events per something” plots (searches) into number of events. See analysis.sql for detailed description.

contur.data.static_db.get_analyses(analysisid=None, poolid=None, beam=None, filter=True)[source]

Return a list of analysis objects

If no pool, beam or id supplied, return all valid analyses in the current config.

If analysisid is supplied, return only analyses with an id containing it

If poolid supplied, return only analyses associated with that pool

If beamid supplied, return only analyses associated with that beam

If more than one of the above supplied, they are ANDed.

Depending on the filter flag, the analyses will be filtered according to the current configuation or not.

Optional inputs: analysisid string, Beam object, poolid string, filter boolean.

contur.data.static_db.get_beam_names(poolid=None, allow_all=False)[source]

Get the list of known beam names, specific to the named pool if given

contur.data.static_db.get_beams(poolid=None)[source]

Get the list of known beam configurations, specific to the named pool if given

contur.data.static_db.get_correlation_name(path)[source]
contur.data.static_db.get_covariance_name(path)[source]
contur.data.static_db.get_experiments(collider=None, beam=None)[source]

Get the list of known pool names, specific to a beam id (7/8/13TeV) if given

contur.data.static_db.get_pool(path=None, poolid=None)[source]

Given a pool id only, return the pool object.

Given only the yoda path of a histogram, return the pool object it belongs to. Should work whether the analysis part of the path contains the option or not, since any given histo has a specific pool.

Given both, check for consistency and return the pool object or None, depending

Given neither, return None

contur.data.static_db.get_pools(beamid=None)[source]

Get the list of known pool names, specific to a beam id (7/8/13TeV) if given

contur.data.static_db.get_sm_theory(ana=None)[source]

Return a list of the SM theory predictions, if any, for the input analysis name. Otherwise return False.

contur.data.static_db.hasBVeto(ana)[source]

Does this analysis have measurements with a b-jet-veto problem?

contur.data.static_db.hasHiggsWW(ana)[source]

Does this analysis have Higgs -> WW measurements?

contur.data.static_db.hasHiggsgg(ana)[source]

Does this analysis have Higgs -> photons measurements?

contur.data.static_db.hasMETRatio(ana)

Does this analysis have missing-energy ratio measurements?

contur.data.static_db.hasNuTrue(ana)[source]

Does this analysis have measurements with a truth-neutrino problem?

contur.data.static_db.hasRatio(ana)[source]

Does this analysis have ratio measurements?

contur.data.static_db.hasSearches(ana)[source]

Does this analysis have search measurements?

contur.data.static_db.init_dbs()[source]

The principle function to read the database and populate dictionaries using the data. it is invoked by the first access request.

contur.data.static_db.isMETRatio(h)

Is this a missing energy ratio plot?

contur.data.static_db.isNorm(h)[source]
Parameters:

h – (string) histogram path.

Returns:

  • isScaled - does this histogram need to be scaled to turn it into a differential cross section?

  • scaleFactor - the scale factor, if so (=1 otherwise)

  • nev_differential - factor for converting “number of events per something” plots (searches) into number of events. See analysis.sql for detailed description.

contur.data.static_db.isRatio(h)[source]

Is this a ratio plot? :param h: (string) yoda histogram path

contur.data.static_db.isSearch(h)[source]

Is this a search event-count plot?

Parameters:

h – (string) yoda histogram path

contur.data.static_db.is_soft(h)[source]

Is this a soft QCD plot :param h: (string) yoda histogram path

contur.data.static_db.is_tracks_only(h)[source]

Is this a plot which only uses tracks? :param h: (string) yoda histogram path

class contur.data.static_db.listdict[source]

Bases: dict

Dictionary which returns an empty list if the key is missing.

contur.data.static_db.obsFinder(h)[source]

Get meta dat (analysis, integrated luminosity, poolid, subpoolid) for a valid contur histogram. Else return INVALID.

Parameters:

h – (string) yoda histogram path

contur.data.static_db.passes_lists(ana, tag)[source]

Check the blacklist/whitelist status of the histogram name tag within analysis name ana. Only works if ana is the full analysis name, including options.

contur.data.static_db.theoryComp(h)[source]

If this histogram always requires a SM theory comparison, return True.

Parameters:

h – (string) yoda histogram path

contur.data.static_db.validHisto(h, filter=True)[source]

Tests a histogram path to see if it is a valid contur histogram for this run (taking into account the run time flags). :arg h: the full path of a yoda analysis object :type: String

if invalid, return False. Otherwise return the full name of the analysis object the histogram belongs to.

contur.data.build_covariance module

class contur.data.build_covariance.CovarianceBuilder(orig_ao, ao, aos, isScaled, scaleFactor, apply_min=True, ignore_corrs=False)[source]

Bases: object

ao Yoda AO apply_min: apply the minimum number of systematic uncertainties criteria when determining whether or not to use the error breakdown for correlations.

Class to handle retrieval of annotations/errors from YODA objects

buildCovFromBreakdown(orig_ao, ignore_corrs)[source]

Get the covariance, calculated by YODA from the error breakdown

buildCovFromErrorBar()[source]

Build the diagonal covariance from error bars

getErrorBreakdown()[source]

return the breakdown of (symmetrised) uncertainties

read_cov_matrix(isScaled, aos)[source]

read the covariance matrix from another AO and return it.

contur.data.sm_theory_builders module

contur.data.sm_theory_builders.do_ATLAS_2012_I1199269(prediction)[source]

ATLAS 7TeV diphotons, 2gamma NNLO prediction read from paper S. Catani, L. Cieri, D. de Florian, G. Ferrera, and M. Grazzini, Diphoton production at hadron colliders: a fully-differential QCD calculation at NNLO, Phys. Rev. Lett. 108 (2012) 072001, [arXiv:1110.2375].

contur.data.sm_theory_builders.do_ATLAS_2015_I1408516(prediction)[source]

ATLAS 8TeV Drell-Yan phi* and pT distributions Predictions from Bizon et al arXiv:1805.05916

contur.data.sm_theory_builders.do_ATLAS_2016_I1457605(prediction)[source]

Photon+jet NNLO Calculation from arXiv:1904.01044 Xuan Chen, Thomas Gehrmann, Nigel Glover, Marius Hoefer, Alexander Huss

contur.data.sm_theory_builders.do_ATLAS_2016_I1467454(prediction)[source]
contur.data.sm_theory_builders.do_ATLAS_2016_I1494075(prediction, mode_flag)[source]

ATLAS 8 TeV 4l/2l2nu Newly written rivet routine, verified with events generated by Powheg+Pythia 8

contur.data.sm_theory_builders.do_ATLAS_2017_I1591327(prediction)[source]

ATLAS 8TeV diphotons, Matrix prediction prediction read from Predictions for the isolated diphoton production through NNLO in QCD and comparison to the 8 TeV ATLAS data Bouzid Boussaha, Farida Iddir, Lahouari Semlala arXiv:1803.09176 2gamma from S. Catani, L. Cieri, D. de Florian, G. Ferrera, and M. Grazzini, Diphoton production at hadron colliders: a fully-differential QCD calculation at NNLO, Phys. Rev. Lett. 108 (2012) 072001, [arXiv:1110.2375].

contur.data.sm_theory_builders.do_ATLAS_2017_I1645627(prediction)[source]
contur.data.sm_theory_builders.do_ATLAS_2019_I1718132(prediction, mode_flag)[source]

ATLAS dilepton–dijet events in proton–proton collisions at COM energy of 13TeV. 3 modes: electron-electron, muon-muon and electron-muon

contur.data.sm_theory_builders.do_ATLAS_2019_I1725190(prediction)[source]

ATLAS 13 TeV DY Run 2 search Fit to SM from the paper.

contur.data.sm_theory_builders.do_ATLAS_2019_I1764342(prediction)[source]

ATLAS 13 TeV ll+photons There’s a version of this in HEPData with no uncertainties. Rerun by Xilin Wang to include scale uncertainties, which are calculated here from the RAW rivet weights output.

contur.data.sm_theory_builders.do_ATLAS_2021_I1852328(prediction)[source]

ATLAS 13 TeV WW+jet the prediction is for the b-veto, so we need to scale it for the difference (taken from the difference in the data) y05 multiplied by the ratio y02/y01

contur.data.sm_theory_builders.do_ATLAS_2022_I2037744(prediction)[source]
contur.data.sm_theory_builders.do_CMS_2017_I1467451(prediction)[source]
CMS 8TeV H->WW pT distribution

Predictions from the paper

contur.data.sm_theory_builders.read_csv(rawdir, hname)[source]
contur.data.sm_theory_builders.read_from_csv_files(analysis, histo_list, prediction)[source]

Generic function to read SM prediction from a set of CSV files (usually digitised from the paper)

contur.data.sm_theory_builders.write_csv(rawdir, hname, x, y)[source]

Module contents