def testUniquePDGs(self):

        model = Model(SMparticles=SMList,BSMparticles=[])
        allPDGs = model.getValuesFor('pdg')
        #Check if for each SM PDG there is a unique particle object defined
        for pdg in allPDGs:
            p = model.getParticlesWith(pdg=pdg)
            self.assertTrue(len(p) == 1)
Exemple #2
0
                    spin=1. / 2.)

#Define list of inclusive final states:
SMfinalStates = [
    eList, muList, taList, lpList, lmList, lList, WList, tList, LpList, LmList,
    LList, jetList, anyEven
]
#Include list of exclusive final states:
SMfinalStates += SMList
#Define list of BSM final states:
BSMfinalStates = [MET, HSCP, RHadronG, RHadronQ, anyOdd, gluino, chargino]

allFinalStates = SMfinalStates + BSMfinalStates
#Avoid double counting:
for i, ptc in enumerate(allFinalStates):
    if any((ptc is p and i != j) for j, p in enumerate(allFinalStates)):
        allFinalStates.remove(ptc)

#Define a dummy model just to use the facilities for filtering particles
finalStates = Model(SMparticles=allFinalStates,
                    BSMparticles=[],
                    label='databaseParticles.py')

#Check consistency:
for label in finalStates.getValuesFor('label'):
    particles = finalStates.getParticlesWith(label=label)
    if len(particles) != 1:
        raise SModelSError(
            "%i particles defined with label %s. Particles defined in databaseParticles must have unique labels."
            % (len(particles), label))