def _build_all_particles(self):
        particles_list = []
        for output in self._outputs:
            thispart=[]
            possibleparts = (part for part in output[1] if 't' not in part)
            for part in possibleparts:
                try:
                    partarray = ExtraInfoFetcher.getParticleByComposition(part)
                    thispart.append(partarray)
                except:
                    print ('Not found', part)
                    thispart.append(None)
            if [] not in thispart and len(thispart)>1:
                particles_list.append([output[0],thispart])
        new_particle_list = []
        for item in particles_list:
            [new_particle_list.append([item[0],[x,y]]) for (x,y) in product(item[1][0],item[1][1])]

        newer_particle_list = []
        init_charge = self._part1.charge + self._part2.charge
        for item in new_particle_list:
            final_charge = ParticleDataSource.getCharge(item[1][0]) + ParticleDataSource.getCharge(item[1][1])
            if final_charge ==  init_charge:
                newer_particle_list .append(item)

        self._particle_list = newer_particle_list
 def _build_quarktransformation(self):
     quark_list = self._setUnderCoverList(Inelastic2BodyFile.quarks)
     quark_transformation= {}
     for type in Inelastic2BodyFile.bosons[0]:
         quark_transformation[type]={}
         charge = ParticleDataSource.getCharge(type)
         for q in quark_list:
             newcharge = q.charge + charge
             if newcharge < 1 and newcharge > -1:
                 quark_transformation[type][q.name]=self.search_by_charge(newcharge)
     self._quarktransformation = quark_transformation
Exemple #3
0
 def getParticlesfromDecay(self, decay):
     selected_particles = []
     for partchannel in self._allDecaysinDB:
         for channel in partchannel.decayChannels.getChannel(decay):
             if all([
                     set(decay) == channel.nameSet, channel.BR > 0.,
                     ParticleDataSource.getCharge(
                         partchannel.name) == channel.totalCharge,
                     partchannel.name in AllDecays.typical_particles
             ]):
                 if channel.isLeptonNeutrino():
                     if partchannel.name in ['W+', 'W-']:
                         selected_particles.append(
                             AllDecays.OriginOptions(
                                 partchannel.name, channel.BR))
                 else:
                     selected_particles.append(
                         AllDecays.OriginOptions(partchannel.name,
                                                 channel.BR))
     return selected_particles
Exemple #4
0
 def totalCharge(self):
     charge = 0.
     for name in self.names:
         charge += ParticleDataSource.getCharge(name)
     return charge
 def getcharge(name):
     return ParticleDataSource.getCharge(name)
 def _set_charge(self):
     self._charge = ParticleDataSource.getCharge(self._name)