def getComment(analysis, path=None): """ Get the comment of an analysis. """ logger.warning("getComment is deprecated") return smsHelpers.getMetaInfoField(analysis, "comment", path)
def isPrivate(analysis, path=None): """ Check if analysis is flagged as private. """ field = smsHelpers.getMetaInfoField(analysis, "private", path) if field == None: return False return bool(int(field))
def getPAS(analysis, path=None): """ Get the PAS of an analysis. """ logger.warning("getPAS is deprecated") return smsHelpers.getMetaInfoField(analysis, "pas", path)
def getJournal(analysis, path=None): """ Get the journal of an analysis. """ logger.warning("getJournal is deprecated") return smsHelpers.getMetaInfoField(analysis, "journal", path)
def getJournal(analysis, path=None): """ Get the journal of an analysis. """ logger.warning ("getJournal is deprecated") return smsHelpers.getMetaInfoField(analysis, "journal", path)
def isPrivate(analysis, path=None): """ Check if analysis is flagged as private. """ field=smsHelpers.getMetaInfoField(analysis, "private", path) if field==None: return False return bool(int(field))
def getURL(analysis, path=None): """ Get the URL of an analysis. """ logger.warning("getURL is deprecated") return smsHelpers.getMetaInfoField(analysis, "url", path)
def getURL(analysis, path=None): """ Get the URL of an analysis. """ logger.warning ("getURL is deprecated") return smsHelpers.getMetaInfoField(analysis, "url", path)
def getComment(analysis, path=None): """ Get the comment of an analysis. """ logger.warning ("getComment is deprecated") return smsHelpers.getMetaInfoField(analysis, "comment", path)
def getSqrts(analysis, path=None): """ get the center-of-mass energy of the analysis. """ sqrts = smsHelpers.getMetaInfoField(analysis, "sqrts", path) try: return float(sqrts) * TeV except ValueError: try: return eval(sqrts) except: pass return sqrts
def getLumi(analysis, path=None): """ Get the integrated luminosity for an analysis. """ lumifb = smsHelpers.getMetaInfoField(analysis, "lumi", path) try: return float(lumifb) / fb except ValueError: try: return eval(lumifb) except: pass return lumifb
def getaxes(analysis, topology=None, path=None): """Get information about the histogram axes for an analysis. For each topology list of dictionary, each dictionary corresponds to one histogram. The key axes gives string (mx-my), the key mz gives information on other masses, if you supply a topology, returns list for this topology only. """ if not _exists(analysis, topology=None): return None try: st = smsHelpers.getMetaInfoField(analysis, "axes", path) except MetaInfoError: logger.error("Meta info field 'axes' does not exist in %s.", analysis) st = None if not st: if not topology: # Cannot return default without info on topology return None # If there is no information about the axes, return the default return [{'axes': 'M1-M0', 'mz': None}] st = st.split(',') d = {} for i in range(len(st)): l = st[i].split(':') nm = l[0].replace(" ", "") d[nm] = [] m = l[1].split('-') for j in range(len(m)): n = m[j].split() if len(n) == 2: d[nm].append({'axes': n[0] + '-' + n[1], 'mz': None}) else: d[nm].append({'axes': n.pop(0) + '-' + n.pop(0), 'mz': n}) if topology: topology = topology.replace(" ", "") if not d or not topology in d: # Return None, if topology does not exist return None else: return d[topology] return d
def isSuperseded (analysis, path=None): """ check if analysis is superseded, if yes, return analysis name of newer analysis """ return smsHelpers.getMetaInfoField (analysis, "superseded_by", path)
def hasURL(analysis, path=None): """ Check if URL of an analysis exists.""" logger.warning("hasURL is deprecated") return smsHelpers.getMetaInfoField(analysis, "url", path)
def isSuperseded(analysis, path=None): """ check if analysis is superseded, if yes, return analysis name of newer analysis """ return smsHelpers.getMetaInfoField(analysis, "superseded_by", path)