Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Moore
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Requirements
Jira
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
LHCb
Moore
Commits
9dba0d7c
Commit
9dba0d7c
authored
2 years ago
by
Rosen Matev
Browse files
Options
Downloads
Plain Diff
Merge branch 'sesen-master-patch-50891' into 'master'
Update hlt2_analysis.rst See merge request
!1513
parents
bfe82059
ffa6ab19
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!1513
Update hlt2_analysis.rst
Pipeline
#3888704
passed
2 years ago
Stage: check
Stage: build
Stage: docs
Stage: deploy
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
doc/tutorials/hlt2_analysis.rst
+11
-78
11 additions, 78 deletions
doc/tutorials/hlt2_analysis.rst
with
11 additions
and
78 deletions
doc/tutorials/hlt2_analysis.rst
+
11
−
78
View file @
9dba0d7c
...
...
@@ -104,7 +104,6 @@ familiar to you::
DecayTreeTuple,
LHCbApp,
createODIN,
HltANNSvc,
)
from DecayTreeTuple import Configuration, DecayTreeTupleTruthUtils
from PhysSelPython.Selections import (
...
...
@@ -112,79 +111,7 @@ familiar to you::
CombineSelection,
SelectionSequence,
)
from GaudiConf.reading import (
decoder,
unpackers,
mc_unpackers,
unpack_rawevent,
hlt2_decisions,
)
import json
# Helper functions to be able to read the Hlt2 data
def get_hlt2_unpackers(ann=HltANNSvc(), is_simulation=False):
"""Configures algorithms for reading HLT2 output.
This is a temporary measure until support for Run 3 HLT2 output is added to
an LHCb application.
"""
unpack_raw_event = reading.unpack_rawevent(
bank_types=['ODIN', 'DstData', 'HltDecReports'])
reading_algs = [unpack_raw_event]
mc_unpackers = []
if is_simulation:
mc_unpackers = reading.mc_unpackers()
locations = reading.make_locations(ann.PackedObjectLocations,
"/Event/HLT2")
decoder = reading.decoder(locations=locations, ann=ann)
unpackers = reading.unpackers(
locations=locations, ann=ann, mc=mc_unpackers)
reading_algs += [decoder]
reading_algs += mc_unpackers
reading_algs += unpackers
reading_algs += [createODIN()]
return reading_algs
def configure_packed_locations(tck_location):
"""Configures HltANNSvc to know about packed locations and hlt2 decision names used in Moore.
tck_location (string): Location of json file containing trigger configuration.
"""
with open(tck_location) as f:
tck = json.load(f)
ann_config = tck["HltANNSvc/HltANNSvc"]
HltANNSvc(PackedObjectLocations={
str(k): v
for k, v in ann_config["PackedObjectLocations"].items()
})
HltANNSvc(Hlt2SelectionID={
str(k): v
for k, v in ann_config["Hlt2SelectionID"].items()
})
packed_object_types = {}
if "PackedObjectTypes" in ann_config.keys():
packed_object_types = {
str(k): v
for k, v in ann_config["PackedObjectTypes"].items()
}
return HltANNSvc(
"HltANNSvc",
PackedObjectLocations=packed_object_locs,
PackedObjectTypes=packed_object_types,
)
# The output of the HLT2 line
kpi_line = AutomaticData("/Event/HLT2/Hlt2CharmD0ToKmPipLine/Particles")
# Extra pions
...
...
@@ -246,14 +173,20 @@ familiar to you::
user_algs = [selseq.sequence(), dtt_kpi, dtt_kpi_dst]
LHCbApp().TupleFile = "hlt2_example.root"
from GaudiConf.reading import do_unpacking
from Moore.tcks import load_hlt2_configuration
# Load the 'TCK' dumped from the Moore job, assuming the TCK file was named
# like the Moore output file
ann= configure_packed_locations(LHCbApp().TupleFile.replace(".root", "") +
".tck.json")
json= LHCbApp().TupleFile.replace(".root", "") + ".tck.json"
ann = load_hlt2_configuration(json, annsvc_name="HltANNSvc")
# decoding and unpacking
unpacking = do_unpacking(annsvc=ann, process='Hlt2', simulation=True)
# Configure the unpacking of data (we assume we want MC information)
# and the running of the user algorithms. The order is important.
ApplicationMgr().TopAlg =
get_hlt2_unpackers(ann=ann, is_simulation=True)
+ user_algs
ApplicationMgr().TopAlg =
[createODIN()] + unpacking
+ user_algs
These options demonstrate using the output of extra selections. If your line
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment