Retrieve the era and global tag for a given version key.
Args:
version_key (str): The version key to look up.
Returns:
tuple: A tuple containing the global tag and era object.
Raises:
KeyError: If the version key or global tag is not found.
Definition at line 7 of file defaultPhase2ConditionsEra_cff.py.
References print().
8 """Retrieve the era and global tag for a given version key. 11 version_key (str): The version key to look up. 14 tuple: A tuple containing the global tag and era object. 17 KeyError: If the version key or global tag is not found. 20 if version_key
not in properties[
'Run4']:
21 raise KeyError(f
"Version key '{version_key}' not found in properties['Run4'].")
24 global_tag_key = properties[
'Run4'][version_key][
'GT']
25 print(f
"Global tag key from properties: {global_tag_key}")
28 global_tag_name = global_tag_key.replace(
"auto:",
"")
29 if global_tag_name
not in autoCond:
30 raise KeyError(f
"Global tag key '{global_tag_key}' not found in autoCond.")
33 era_key = properties[
'Run4'][version_key][
'Era']
34 print(f
"Constructed era key from properties: {era_key}")
35 era = getattr(eras, era_key)
37 return global_tag_key, era
38 void print(TMatrixD &m, const char *label=nullptr, bool mathematicaFormat=false)
def get_era_and_conditions(version_key)