LALBurst 2.0.7.1-eeff03c
lalburst.snglcoinc.coincgen_doubles.get_coincs Class Reference

Detailed Description

This class defines the coincidence test.

An instance is initialized with a sequence of events, and is a callable object. When the instance is called with a single event from some other instrument, a time offset to apply to that event (relative to the events in this list) and a time coincidence window, the return value must be a (possibly empty) sequence of the initial events that are coincident with that given event.

The sequence of events with which the instance is initialized is passed in time order.

It is not required that the implementation be subclassed from this. This placeholder implementation is merely provided to document the required interface.

A minimal example:

class get_coincs(object): def init(self, events): self.events = events def call(self, event_a, offset_a, coinc_window): return [event_b for event_b in self.events if abs(event_a.time + offset_a - event_b.time) < coinc_window]

This is performance-critical code and a naive implementation such as the one above will likely be found to be inadequate. Expect to implement this code in C for best results.

Definition at line 614 of file snglcoinc.py.

Inherits object.

Public Member Functions

def __init__ (self, events)
 Prepare to search a collection of events for coincidences with other single events. More...
 
def __call__ (self, event_a, offset_a, coinc_window)
 Return a sequence of the events from those passed to .__init__() that are coincident with event_a. More...
 

Constructor & Destructor Documentation

◆ __init__()

def lalburst.snglcoinc.coincgen_doubles.get_coincs.__init__ (   self,
  events 
)

Prepare to search a collection of events for coincidences with other single events.

events is a time-ordered iterable of events. It is recommended that any additional indexing required to improve search performance be performed in this method.

Definition at line 624 of file snglcoinc.py.

Member Function Documentation

◆ __call__()

def lalburst.snglcoinc.coincgen_doubles.get_coincs.__call__ (   self,
  event_a,
  offset_a,
  coinc_window 
)

Return a sequence of the events from those passed to .__init__() that are coincident with event_a.

The sequence need not be in time order. The object returned by this method must be iterable and support being passed to bool() to test if it is empty.

offset_a is the time shift to be added to the time of event_a before comparing to the times of events passed to .__init__(). This behaviour is to support the construction of time shifted coincidences.

coinc_window is the maximum time, in seconds, separating coincident events from the shifted time of event_a. Here, this is the interval that defines the coincidence test between the two detectors, not the bound on all such intervals used by the singlesqueue object to determine the interval for which n-tuple candidates can be constructed.

Definition at line 649 of file snglcoinc.py.