DaVinci example to show how to get charged particles in a DaVinci script
Simple example showing how to get charged particles in a DaVinci script. This script was suggested by Sascha.
Workaround for #99
Merge request reports
Activity
assigned to @sstahl
added DPA-WP3 label
- Resolved by Guillaume Max Pietrzyk
- Resolved by Guillaume Max Pietrzyk
22 process = 'HLT2' 23 line = 'Hlt2TrackEff_Velo2Long_B2JpsiK_MuonProbe_VELO' #Just an example 24 25 from RecoConf.reconstruction_objects import reconstruction, upfront_reconstruction 26 with reconstruction.bind(from_file=True, spruce=True): 27 long_muons = make_long_muons() 28 long_electrons = make_long_electrons_with_brem() 29 long_kaons = make_long_kaons() 30 long_pions = make_long_pions() 31 unpack_data = upfront_reconstruction() 32 33 filter_line = add_filter("HDRFilter_Bu2JpsiK", 34 f"HLT_PASS('{line}')") 35 36 algs = { 37 "B02JpsiK": [filter_line] + unpack_data + [long_muons, long_electrons, long_kaons, long_pions], @gpietrzy, did you then remove the line? Then resolve to flag that. Mutatis mutandis for the rest of the threads, thanks.
added 1 commit
- 32c1776d - Update DaVinciExamples/python/DaVinciExamples/tupling/option_davinci_tupling_eventparticles.py
Hello @gpietrzy, thank you for the effort. It's always good to see contributions.
Let me make "a couple" of comments aside the points already made.
-
As you know we are only going to deal with the v2 event model, eventually. At this point in time I think we should really work on examples that show / hint at that, as much as possible but within the constraints we have. I see that you are showing how to use the old model charged particles, and it should be changed. Even if there's still work to be finalised - true pretty much in every corner of your software stack -, you can work towards such an example. At the WP3 meeting yesterday we were told by @ahennequ that we're not far from being able to persist v2, I meant part of it, so nice if this example can serve as a "guinea pig" IMO. It will probably even help @ahennequ checking matters and potentially improve things. (Yes, this means one would need to create a test file.)
-
BTW, what's your use case to get hold of charged particles in DaVinci? Is that for example to combine with some line candidates to try and make more complex decays/resonances? Or maybe some specific study?
-
These days we're working on getting all examples and tutorials dynamically displayed in the DaVinci docs, see !814 (merged) in particular. As such, you will also need to have a little header docstring with a few special keywords so that the magic takes place (see one of the examples).
-
I get confused by the several
reconstruction
helpers that exist around. We do have a global bind in DaVinci, see https://gitlab.cern.ch/lhcb/DaVinci/-/blob/master/Phys/DaVinci/python/DaVinci/LbExec.py#L70-98, which makes me wonder why a special binding seems needed here.
-
-
We will move to the new event model in steps, but it's clear we won't change before taking data this year. This is crucial functionality that is needed to process the data already for 2022, and cannot be postponed further. We also agreed with the folks working on the event model that we push these missing algorithms with the v1 model, and then make the step to translate it to v2 later (as then it can also be seen what functionality is needed)
-
That's one example, or isolation, flavour-tagging, etc... Let's also not forget that for the TURCAL data it's clear that we should be able to have access to running the reconstruction, particle creation and combinations in DaVinci - as you know very well.
-
-
True, and that should be improved over time.
Edited by Laurent Dufour-
Let me answer some of the points as I asked @gpietrzy to add the test.
The test demonstrates how to get particles from
standard_particles.py
in DaVinci from persistreco as the description says. From that point on people could use the particles in combiners or directly tuple them but this is covered already in other tests. I assume we agree that usingstandard_particles.py
in DaVinci is a feature that should be supported.These are also the particles used in all Hlt2 and Sprucing lines at the moment. In that sense the test is exactly doing what you ask for adding a test for a feature which should be supported (regardless of the event model). To me, implementing this with Particle v2 is out of the scope for a "normal" user at the moment. I am extremely happy that @gpietrzy went the extra mile and tries to implement a test after I helped him debugging it on mattermost.
Regarding point 4, you are right that this is confusing and ideally only one bind should be necessary. Unfortunately that is not the case and I was surprised too. I also asked to add the test so that this is documented and can be improved over time when someone has time to address it.
Edited by Sascha StahlYes one should be able to use standard particles in DaVinci. Having a test is paramount.
@ahennequ can comment on the timescale for getting v2 tracks persistable. But yes, if that's not very soon then we need to be pragmatic and have an example with v1. I would ask, though, that this is made clear in the docstring so that people do not get confused when we move to v2 and have similar examples.
Yep, as I said above, it is great to see colleagues add an example and/or test, not just creating issues. After all, we're quite understaffed, unfortunately, and cannot do it all.
- Resolved by Sascha Stahl
- Resolved by Sascha Stahl
@sstahl To be clear this test is not running any reconstruction? It is simply showing how to access the persistreco locations in DV and then run particle builders?
If so it is unfortunate that we have to use
reconstruction.bind(from_file=True, spruce=True)
but, as you say, this use-case needs to be addressed properly and, in the mean time, this test should go in
mentioned in issue #99
added 11 commits
- a2ef7d42 - Fix example job on 2022 data commissioning
- 6e4c8f08 - Test for FunTupleEvent
- 21939575 - Cleanup DV example exploiting isolation variables
- 189d60c8 - DaVinciTutorials tests - add ntuple content checks
- 8244a040 - Update References for: LHCb!3970 (merged) based on lhcb-master-mr/7100
- 67015d67 - Update References for: Rec!3320 (merged) based on lhcb-master-mr/7096
- 6e2a85fd - Update tag to include mat contraction conditions files
- 98b587ff - DaVinci tests - enhance ntuple content checks and please QMTest
- 946727eb - change
- ba62f88d - Problems with git
- d5e239dc - Added files for testing
Toggle commit listI can certainly try and review this week. Now, I see 3 little to-dos missing:
- A rebase is needed and I see conflicts simply by looking at the diffs, e.g. appearance of tests for FunTupleEvent, which have nothing to do with this MR.
- I forgot by now if action is needed there but there are 5 unresolved threads.
- Reviewers and labels are missing.
Have you seen these exchanges on your work @gpietrzy ?
mentioned in merge request Rec!3385 (merged)