示例#1
0
    def __init__(self,
                 year,
                 tree,
                 terms=None,
                 refantitau=True,
                 verbose=False,
                 very_verbose=False,
                 **kwargs):

        super(METRecalculation, self).__init__(**kwargs)

        self.terms = terms or set()
        self.year = year
        self.tree = tree
        self.refantitau = refantitau
        self.verbose = verbose
        self.very_verbose = very_verbose

        # Initialise your METUtility object
        # https://twiki.cern.ch/twiki/bin/viewauth/AtlasProtected/MissingETUtility
        self.tool = METUtility()

        # configure
        self.tool.configMissingET(
            year == 2012,  # is 2012
            year == 2012)  # is STVF

        if year == 2011:
            # In 2012, we always rebuild MET from AOD, so the RefMuon term is
            # not computed. However, for 2011 data, you should activate the
            # RefMuon term and fill the term.
            # These are the terms required for MET_RefFinal(_BDTMedium)
            self.tool.defineMissingET(
                True,  # RefEle
                True,  # RefGamma
                True,  # RefTau
                True,  # RefJet
                True,  # RefMuon
                True,  # MuonTotal
                True,  # Soft
            )

        # The threshold below which jets enter the SoftJets term (JES is not applied)
        #self.tool.setSoftJetCut(20e3)

        # Whether to use MUID muons (otherwise STACO).
        self.tool.setIsMuid(False)

        # Whether METUtility should scream at you over every little thing
        self.tool.setVerbosity(self.very_verbose)