Exemple #1
0
    def testParticleList(self):
        l1 = MultiParticle(label='plist', particles=[p1, p2])
        lList = finalStates.getParticlesWith(label='l')[0]

        self.assertEqual(l1.label, 'plist')
        self.assertNotEqual(l1, lList)
        self.assertTrue(l1 == p1)
        self.assertTrue(l1.pdg == [None, 1000021] or l1.pdg == [1000021, None])
Exemple #2
0
    def testInclusiveParticle(self):
        anything = Particle(label='anything')
        l1 = MultiParticle(label='plist', particles=[p1, p2, p4])
        anyEven = finalStates.getParticlesWith(label='*')[0]
        anyOdd = finalStates.getParticlesWith(label='anyOdd')[0]
        lList = finalStates.getParticlesWith(label='l')[0]

        self.assertTrue(isinstance(p1, Particle))
        self.assertTrue(p1 == anything)
        self.assertTrue(anything == p1)
        self.assertTrue(anything == l1)
        self.assertTrue(l1 == anything)
        self.assertTrue(anything == lList)
        self.assertTrue(lList == anything)

        self.assertTrue(anything == anyEven)
        self.assertTrue(anything == anyOdd)
        self.assertFalse(anyOdd == anyEven)
        self.assertFalse(anyEven == anyOdd)
Exemple #3
0
    def __init__(self,
                 topoList,
                 sqrts=None,
                 sigmacut=0 * fb,
                 groupFilters=filtersDefault,
                 groupFactors=factorsDefault,
                 groupdDescriptions=descriptionDefault,
                 smFinalStates=None,
                 bsmFinalSates=None):
        """
        Inititalize the object.

        :param topoList: TopologyList object used to select elements from.
        :param sqrts: Value (with units) for the center of mass energy used to compute the missing cross sections.
                     If not specified the largest value available will be used.
        :param sigmacut: Minimum cross-section/weight value (after applying the reweight factor)
                       for an element to be included. The value should in fb (unitless)
        :param groupFilters: Dictionary containing the groups' labels and the method for selecting
                            elements.
        :param groupFactors: Dictionary containing the groups' labels and the method for reweighting
                            cross sections.
        :param groupdDescriptions: Dictionary containing the groups' labels and strings describing the group
                                  (used for printout)
        :param smFinalStates: List of (inclusive) Particle or MultiParticle objects used for grouping Z2-even
                             particles when creating GeneralElements.
        :param bsmFinalSates: List of (inclusive) Particle or MultiParticle objects used for grouping Z2-odd
                             particles when creating GeneralElements.
        """

        #Sanity checks:
        if not isinstance(groupFilters, dict):
            raise SModelSError(
                "groupFilters input should be a Dictionary and not %s" %
                type(groupFilters))
        if not isinstance(groupFactors, dict):
            raise SModelSError(
                "groupFactors input should be a Dictionary and not %s" %
                type(groupFactors))
        if sorted(groupFilters.keys()) != sorted(groupFactors.keys()):
            raise SModelSError(
                "Keys in groupFilters and groupFactors do not match")
        if any(not hasattr(gFilter, '__call__')
               for gFilter in groupFilters.values()):
            raise SModelSError("Group filters must be callable methods")

        if smFinalStates is None:
            #Define multiparticles for conveniently grouping SM final states
            taList = MultiParticle('ta', [ta, taC])
            lList = MultiParticle('l', [e, mu, eC, muC])
            WList = MultiParticle('W', [W, WC])
            tList = MultiParticle('t', [t, tC])
            jetList = MultiParticle('jet', [q, c, g, pion])
            nuList = nu
            smFinalStates = [WList, lList, tList, taList, nuList, jetList]
        if bsmFinalSates is None:
            #Define inclusive BSM states to group/label the last BSM states:
            bsmFinalStates = bsmDefault

        if sqrts is None:
            sqrts = max(
                [xsec.info.sqrts for xsec in topoList.getTotalWeight()])
        else:
            sqrts = sqrts

        #Store the relevant element cross-sections to improve performance:
        for el in topoList.getElements():
            xsec = el.weight.getXsecsFor(sqrts)
            if xsec:
                el._totalXsec = xsec[0].value.asNumber(fb)
            else:
                el._totalXsec = 0.

        self.groups = []
        #Create each uncovered group and get the topologies from topoList
        for gLabel, gFilter in groupFilters.items():
            #Initialize the uncovered topology list:
            uncoveredTopos = UncoveredGroup(
                label=gLabel,
                elementFilter=gFilter,
                reweightFactor=groupFactors[gLabel],
                smFinalStates=smFinalStates,
                bsmFinalStates=bsmFinalStates,
                sqrts=sqrts,
                sigmacut=sigmacut.asNumber(fb))
            if groupdDescriptions and gLabel in groupdDescriptions:
                uncoveredTopos.description = groupdDescriptions[gLabel]
            else:
                uncoveredTopos.description = gLabel
            #Fill the list with the elements in topoList:
            uncoveredTopos.getToposFrom(topoList)
            self.groups.append(uncoveredTopos)
Exemple #4
0
##Description for each group (optional and only used for printing):
##(if not defined, the group label will be used instead)
descriptionDefault = {
    'missing (prompt)': 'missing topologies with prompt decays',
    'missing (displaced)': 'missing topologies with displaced decays',
    #                 'missing (long cascade)' : 'missing topologies with long cascade decays',
    'missing (all)': 'missing topologies',
    'outsideGrid (all)': 'topologies outside the grid'
}

##Default final BSM states for grouping topologies:
#Used to construct BSM final states:
MET = Particle(label='MET', Z2parity=-1, eCharge=0, colordim=1)
HSCPp = Particle(label='HSCP+', Z2parity=-1, eCharge=+1, colordim=1)
HSCPm = Particle(label='HSCP-', Z2parity=-1, eCharge=-1, colordim=1)
HSCP = MultiParticle(label='HSCP', particles=[HSCPp, HSCPm])

RHadronG = Particle(label='RHadronG', Z2parity=-1, eCharge=0, colordim=8)
RHadronU = Particle(label='RHadronU', Z2parity=-1, eCharge=2. / 3., colordim=3)
RHadronD = Particle(label='RHadronD',
                    Z2parity=-1,
                    eCharge=-1. / 3.,
                    colordim=3)
RHadronQ = MultiParticle(label='RHadronQ',
                         particles=[
                             RHadronU,
                             RHadronU.chargeConjugate(), RHadronD,
                             RHadronD.chargeConjugate()
                         ])
bsmDefault = [MET, HSCP, RHadronG, RHadronQ]
Exemple #5
0
                eCharge=0,
                colordim=1,
                spin=1. / 2,
                totalwidth=0. * GeV)
nuta = Particle(Z2parity=1,
                label='nuta',
                pdg=16,
                mass=0. * MeV,
                eCharge=0,
                colordim=1,
                spin=1. / 2,
                totalwidth=0. * GeV)
###Group all neutrinos into a single particle:
nu = MultiParticle('nu', [
    nue, numu, nuta,
    nue.chargeConjugate(),
    numu.chargeConjugate(),
    nuta.chargeConjugate()
])
##-----------------------------------------------------------------------------------------------------------------------------

##Light quarks:
d = Particle(Z2parity=1,
             label='d',
             pdg=1,
             mass=0. * MeV,
             eCharge=(-1. / 3.),
             colordim=3,
             spin=1. / 2,
             totalwidth=0. * GeV)
u = Particle(Z2parity=1,
             label='u',
Exemple #6
0
#Higgs
H1p = Particle(Z2parity=1, label='H1+', pdg=37, eCharge=+1, colordim=1, spin=0)
H2p = Particle(Z2parity=1, label='H2+', pdg=47, eCharge=+1, colordim=1, spin=0)
H3p = Particle(Z2parity=1, label='H3+', pdg=57, eCharge=+1, colordim=1, spin=0)
H2 = Particle(Z2parity=1, label='H2', pdg=35, eCharge=0, colordim=1, spin=0, _isInvisible=False)
H3 = Particle(Z2parity=1, label='H3', pdg=45, eCharge=0, colordim=1, spin=0, _isInvisible=False)
H4 = Particle(Z2parity=1, label='H4', pdg=55, eCharge=0, colordim=1, spin=0, _isInvisible=False)
A1 = Particle(Z2parity=1, label='A1', pdg=36, eCharge=0, colordim=1, spin=0, _isInvisible=False)
A2 = Particle(Z2parity=1, label='A2', pdg=46, eCharge=0, colordim=1, spin=0, _isInvisible=False)
A3 = Particle(Z2parity=1, label='A3', pdg=56, eCharge=0, colordim=1, spin=0, _isInvisible=False)

#Sgluons
sgluon1 = Particle(Z2parity=-1, label='sgluon1', pdg=3000021, eCharge=0, colordim=8, spin=1./2)
sgluon1 = Particle(Z2parity=-1, label='sgluon2', pdg=3000022, eCharge=0, colordim=8, spin=1./2)


squarks = [sdl,sul,sdr,sur] + [ssl,scl,ssr,scr] + [sb1,st1,sb2,st2]
sleptons = [sel,snel,ser] + [smul,snmul,smur] + [sta1,sntal,sta2]
inos = [gluino1,gluino2] + [n1,n2,n3,n4,n5,n6] + [c1,c2,c3] + [gravitino]

rOdd = squarks + sleptons + inos
rOddC = [p.chargeConjugate() for p in rOdd]  #Define the charge conjugates

higgs = [H1p,H2p,H3p,H2,H3,H4,A1,A2,A3]
higgsC = [p.chargeConjugate() for p in higgs]

#Generic BSM particles:

BSMList = rOdd + rOddC + higgs + higgsC
BSMparticleList = MultiParticle('BSM', BSMList)
Exemple #7
0
                eCharge=0,
                colordim=1,
                spin=1. / 2,
                totalwidth=0. * GeV)
nuta = Particle(Z2parity=1,
                label='nuta',
                pdg=16,
                mass=0. * MeV,
                eCharge=0,
                colordim=1,
                spin=1. / 2,
                totalwidth=0. * GeV)
###Group all neutrinos into a single particle:
nu = MultiParticle('nu', [
    nue, numu, nuta,
    nue.chargeConjugate(),
    numu.chargeConjugate(),
    nuta.chargeConjugate()
])
##-----------------------------------------------------------------------------------------------------------------------------

##Light quarks:
d = Particle(Z2parity=1,
             label='d',
             pdg=1,
             mass=0. * MeV,
             eCharge=(-1. / 3.),
             colordim=3,
             spin=1. / 2,
             totalwidth=0. * GeV)
u = Particle(Z2parity=1,
             label='u',