FairShip
Loading...
Searching...
No Matches
makeCascadePythia8.SignalEvents Class Reference

Public Member Functions

 __init__ (self, new_pythia, process, signal_ids, p_beam)
 next (self, beam_id, nucleon_id, p)

Public Attributes

 new_pythia = new_pythia
 process = process
 signal_ids = signal_ids
 p_beam = p_beam
dict buffers = {}

Detailed Description

Signal events in momentum bins p_beam / SIGNAL_BIN_RATIO^i, generated in batches of increasing
size, one Pythia8 instance per batch.

Definition at line 348 of file makeCascadePythia8.py.

Constructor & Destructor Documentation

◆ __init__()

makeCascadePythia8.SignalEvents.__init__ ( self,
new_pythia,
process,
signal_ids,
p_beam )

Definition at line 352 of file makeCascadePythia8.py.

352 def __init__(self, new_pythia, process, signal_ids, p_beam):
353 self.new_pythia = new_pythia
354 self.process = process
355 self.signal_ids = signal_ids
356 self.p_beam = p_beam
357 self.buffers = {}
358

Member Function Documentation

◆ next()

makeCascadePythia8.SignalEvents.next ( self,
beam_id,
nucleon_id,
p )
Return process code and signal hadrons (id, px, py, pz, E, m) in the CM frame of an event at
momentum p.

Definition at line 359 of file makeCascadePythia8.py.

359 def next(self, beam_id, nucleon_id, p):
360 """Return process code and signal hadrons (id, px, py, pz, E, m) in the CM frame of an event at
361 momentum p."""
362 p_bin = round(math.log(self.p_beam / p) / math.log(SIGNAL_BIN_RATIO))
363 buffer, n_fill = self.buffers.setdefault((beam_id, nucleon_id, p_bin), ([], 5))
364 if not buffer:
365 n_fill = min(2 * n_fill, 1000)
366 self.buffers[beam_id, nucleon_id, p_bin] = (buffer, n_fill)
367 pythia = self.new_pythia(
368 [self.process, *cm_beam_settings(beam_id, nucleon_id, self.p_beam / SIGNAL_BIN_RATIO**p_bin)]
369 )
370 for _ in range(n_fill):
371 next_event(pythia)
372 event = pythia.event
373 hadrons = [
374 event[i] for i in range(event.size()) if event[i].idAbs() in self.signal_ids and event[i].isFinal()
375 ]
376 buffer.append(
377 (pythia.infoPython().code(), [(h.id(), h.px(), h.py(), h.pz(), h.e(), h.m()) for h in hadrons])
378 )
379 return buffer.pop()
380
381
382# safety limit on the inclusive events tried for one charm signal event; near the 34 GeV threshold
383# about 1 in 3e5 inelastic events contains charm

Member Data Documentation

◆ buffers

dict makeCascadePythia8.SignalEvents.buffers = {}

Definition at line 357 of file makeCascadePythia8.py.

◆ new_pythia

makeCascadePythia8.SignalEvents.new_pythia = new_pythia

Definition at line 353 of file makeCascadePythia8.py.

◆ p_beam

makeCascadePythia8.SignalEvents.p_beam = p_beam

Definition at line 356 of file makeCascadePythia8.py.

◆ process

makeCascadePythia8.SignalEvents.process = process

Definition at line 354 of file makeCascadePythia8.py.

◆ signal_ids

makeCascadePythia8.SignalEvents.signal_ids = signal_ids

Definition at line 355 of file makeCascadePythia8.py.


The documentation for this class was generated from the following file: