19 """Exception raised if when inconsistencies are detected in the UFO model."""
26 """The class from which all FeynRules classes are derived."""
30 def __init__(self, *args, **options):
31 assert len(self.require_args) == len(args)
33 for (i, name)
in enumerate(self.require_args):
34 setattr(self, name, args[i])
36 for (option, value)
in options.items():
37 setattr(self, option, value)
40 return getattr(self, name)
42 def set(self, name, value):
43 setattr(self, name, value)
46 """Return a dictionary containing all the information of the object"""
54 """ return string with the full information """
56 return '\n'.join([
'%s \t: %s' % (name, value)
for (name, value)
in
57 self.__dict__.items()])
70 for (orig, sub)
in replacements:
71 text = text.replace(orig, sub)
80 """A standard Particle"""
128 goldstoneboson=False,
146 UFOBaseClass.__init__(self, *args, **options)
149 all_particles.append(self)
161 if isinstance(propagator, dict):
164 self.
propagatorpropagator = {0: propagator, 1: propagator}
167 """ find how we draw a line if not defined
168 valid output: dashed/straight/wavy/curly/double/swavy/scurly
199 raise Exception(
'%s has no anti particle.' % self.name)
201 for (k, v)
in self.__dict__.iteritems():
204 if self.color
in [1, 8]:
205 newcolor = self.color
207 newcolor = -self.color
232 require_args = [
'name',
'nature',
'type',
'value',
'texname']
245 args = (name, nature, type, value, texname)
247 UFOBaseClass.__init__(self, *args)
249 args = (name, nature, type, value, texname)
251 global all_parameters
252 all_parameters.append(self)
254 if (lhablock
is None or lhacode
is None)
and nature ==
'external':
255 raise Exception(
'Need LHA information for external parameter "%s".'
261 all_CTparameters = []
266 require_args = [
'name',
'nature,',
'type',
'value',
'texname']
276 args = (name,
'internal', type, value, texname)
278 UFOBaseClass.__init__(self, *args)
280 args = (name,
'internal', type, value, texname)
282 self.
naturenature =
'interal'
284 global all_CTparameters
285 all_CTparameters.append(self)
295 return self.value[-x]
305 require_args = [
'name',
'particles',
'color',
'lorentz',
'couplings']
317 args = (name, particles, color, lorentz, couplings)
319 UFOBaseClass.__init__(self, *args, **opt)
321 args = (particles, color, lorentz, couplings)
324 all_vertices.append(self)
364 UFOBaseClass.__init__(self, *args, **opt)
375 global all_CTvertices
376 all_CTvertices.append(self)
384 require_args = [
'name',
'value',
'order']
386 require_args_all = [
'name',
'value',
'order',
'loop_particles',
397 args = (name, value, order)
398 UFOBaseClass.__init__(self, *args, **opt)
400 all_couplings.append(self)
403 return self.
polepole(0)
406 """ the self.value attribute can be a dictionary directly specifying the Laurent serie using normal
407 parameter or just a string which can possibly contain CTparameter defining the Laurent serie."""
409 if isinstance(self.
valuevalue, dict):
410 if -x
in self.
valuevalue.keys():
411 return self.
valuevalue[-x]
416 for param
in all_CTparameters:
417 pattern = re.compile(
r"(?P<first>\A|\*|\+|\-|\()(?P<name>"
418 + param.name +
r")(?P<second>\Z|\*|\+|\-|\))")
419 numberOfMatches = len(pattern.findall(self.
valuevalue))
420 if numberOfMatches == 1:
424 raise UFOError(
'UFO does not support yet more than one occurence of CTParameters in the couplings values.')
425 elif numberOfMatches > 1:
426 raise UFOError(
'UFO does not support yet more than one occurence of CTParameters in the couplings values.')
430 return self.
valuevalue
434 if CTparam.pole(x) ==
'ZERO':
438 def substitution(matchedObj):
439 return matchedObj.group(
'first') +
'(' + CTparam.pole(x) \
440 +
')' + matchedObj.group(
'second')
442 pattern = re.compile(
r"(?P<first>\A|\*|\+|\-|\()(?P<name>"
444 +
r")(?P<second>\Z|\*|\+|\-|\))")
445 return pattern.sub(substitution, self.
valuevalue)
453 require_args = [
'name',
'spins',
'structure']
459 structure='external',
463 args = (name, spins, structure)
464 UFOBaseClass.__init__(self, *args, **opt)
467 all_lorentz.append(self)
483 all_functions.append(self)
487 self.
exprexpr = expression
489 def __call__(self, *opt):
491 for (i, arg)
in enumerate(self.
argumentsarguments):
492 exec
'%s = %s' % (arg, opt[i])
507 perturbative_expansion=0,
511 all_orders.append(self)
524 require_args = [
'particle',
'partial_widths']
533 args = (particle, partial_widths)
534 UFOBaseClass.__init__(self, *args, **opt)
537 all_decays.append(self)
540 particle.partial_widths = partial_widths
543 all_form_factors = []
548 require_args = [
'name',
'type',
'value']
558 args = (name, type, value)
559 UFOBaseClass.__init__(self, *args, **opt)
561 global all_form_factors
562 all_form_factors.append(self)
570 require_args = [
'name',
'numerator',
'denominator']
580 args = (name, numerator, denominator)
581 UFOBaseClass.__init__(self, *args, **opt)
583 global all_propagators
584 all_propagators.append(self)
double eval(const std::vector< double > &spl, const std::vector< double > &vals, double x)
Evaluate spline (zero order or first order) in point x.