Esempio n. 1
0
def all_first_hits_of_coincidences(coincidence_type=None):
    result = get_or_create_session().query(Coincidence,
                                           Hit).join(Event).join(Photon)
    if coincidence_type is not None:
        result = result.filter(Coincidence.type == coincidence_type)
    result = result.join(Hit).filter(Hit.index == 0)
    return result
Esempio n. 2
0
def all_hits_group_by_photon(limit=10):
    return get_or_create_session().query(Photon.hits).limit(limit).all()
Esempio n. 3
0
def hits_generator():
    get_or_create_session().query(Photon.hits)
Esempio n. 4
0
def all_photon():
    return get_or_create_session().query(Photon)
Esempio n. 5
0
def phton_hits_with_first_hit(limit=None):
    q = (get_or_create_session().query(Photon, Hit)
         .filter(Hit.photon_id == Photon.id).filter(Hit.index == 0))
    if limit is not None:
        q = q.limit(limit)
    return q
Esempio n. 6
0
def nb_photon():
    return get_or_create_session().query(Photon).count()
Esempio n. 7
0
def nb_hits():
    return get_or_create_session().query(Hit).count()
Esempio n. 8
0
def bind_path(path):
    return get_or_create_session(path)