Skip to content
Snippets Groups Projects

dummy lines using Relation Tables algorithms.

Merged Tara Nanut Petric requested to merge tnanut_testRT into master
All threads resolved!
@@ -59,12 +59,66 @@ def photons_line(name="Hlt2Generic_Photons", prescale=1):
@register_line_builder(all_lines)
def filtered_photons_line(name="Hlt2Generic_FilteredPhotons", prescale=1):
photons = make_photons()
code = require_all(F.P > 40 * GeV, F.IS_PHOTON > 0.9, F.IS_NOT_H > 0.3,
F.SHOWER_SHAPE > 500)
code = require_all(F.P > 40 * GeV, F.IS_PHOTON > 0.5, F.IS_NOT_H > 0.3,
F.SHOWER_SHAPE < 1500)
line_alg = ParticleFilter(Input=photons, Cut=F.FILTER(code))
return Hlt2Line(name=name, prescale=prescale, algs=[line_alg])
# Dummy line, testing the algorithms in Rec creating and cutting on multiple relation tables
from PyConf.Algorithms import (
LHCb__Phys__RelationTables__FilterRelTables as FilterRelTables,
LHCb__Phys__RelationTables__MakeRelTables as MakeRelTables,
)
@register_line_builder(all_lines)
def mRT_photons_line(name="Hlt2Generic_mRTPhotons", prescale=1):
def tr(**outputs):
return {"OutputLocation": [v for (k, v) in outputs.items()]}
ai = ["IsPhoton", "ShowerShape", "IsNotH"]
tables = MakeRelTables(
InputParticles=make_photons(),
AdditionalInfo=ai,
outputs={prop: None
for prop in ai},
output_transform=tr).outputs
predicateCut = ( (F.COLUMN(ColumnLabel=tables["IsPhoton"].location) > 0.5) \
& (F.COLUMN(ColumnLabel=tables["ShowerShape"].location) < 1500) \
& (F.COLUMN(ColumnLabel=tables["IsNotH"].location) >0.3) \
)
photons = FilterRelTables(InputTables = [ dh for dh in tables.values()], \
RelCuts = predicateCut).OutputLocation
code = require_all(F.P > 40 * GeV)
line_alg = ParticleFilter(photons, F.FILTER(code))
return Hlt2Line(name=name, prescale=prescale, algs=[line_alg])
# Dummy line, testing the algorithms in Rec creating and cutting on single relation tables
from PyConf.Algorithms import (
LHCb__Phys__RelationTables__FilterRelTable as FilterRelTable,
LHCb__Phys__RelationTables__AiToRelTable as AiToRelTable,
)
@register_line_builder(all_lines)
def sRT_photons_line(name="Hlt2Generic_sRTPhotons", prescale=1):
relTab = AiToRelTable(
InputParticles=make_photons(),
AdditionalInfo="ShowerShape").OutputLocation
predicateCut = (F.IDENTITY < 1500)
photons = FilterRelTable(
InputTable=relTab, Predicate=predicateCut).OutputLocation
code = require_all(
F.P > 40 * GeV,
F.IS_PHOTON > 0.5,
F.IS_NOT_H > 0.3,
)
line_alg = ParticleFilter(photons, F.FILTER(code))
return Hlt2Line(name=name, prescale=prescale, algs=[line_alg])
#From Hlt2Conf/lines/monitoring/pi0_line.py
@register_line_builder(all_lines)
def pi0_to_gammagamma_line(name="Hlt2Generic_Pi0ToGammaGamma", prescale=1):
Loading