BKGCAT tool not working
It seems that the BKGCAT tool is not functional. It only returns 60
for both mother and intermediate particles. The TRUE
variables, particularly TRUEID
seem reasonable
I have created scripts to show this. On Master stack
- Run Moore HLT2 script. The selection line decay descriptor matches the DecFile decay descriptor
- Run DaVinci options file
where
data.yaml
is
hlt2:
filenames:
- 'BuToD0K.dst'
qualifiers:
data_type: Upgrade
input_type: ROOT
simulation: true
conddb_tag: sim-20171127-vc-md100
dddb_tag: dddb-20171126
The decay descriptor matches that in the DecFile
Designs
- Show closed items
Activity
-
Newest first Oldest first
-
Show all activity Show comments only Show history only
- Nicole Skidmore added bug label
added bug label
- Nicole Skidmore changed the description
Compare with previous version changed the description
- Developer
Was afraid of this since I also got
60
for the mother in the example. Thought it was the sample I was using which contained only 10 events with two truth matched promptD0
. - Maintainer
Seems like we will need to expand the odd test to poke into the produced ROOT file and count for a few events properties such as these, to ensure nothing is broken.
- Maintainer
Hi @nskidmor, this triggered my attention and I looked at your options and the decay descriptors in the dec file and the HLT2 selections you refer to above. To me they do not quite agree, and differences in
D0
vsD~0
and cc versus CC are a bit puzzling. So I ran 2 tests, the first one with your options and the second with the DaVinci options updated fromD0
toD~0
:< 'B': "[B+ -> (D~0 -> K+ K-) K+]CC", < 'Kp': "[B+ -> (D~0 -> K+ K-) ^K+]CC", < 'D0': "[B+ -> ^(D~0 -> K+ K-) K+]CC", --- > 'B': "[B+ -> (D0 -> K+ K-) K+]CC", > 'Kp': "[B+ -> (D0 -> K+ K-) ^K+]CC", > 'D0': "[B+ -> ^(D0 -> K+ K-) K+]CC",
Here is what I got, respectively:
************************************************************************************************************ * Row * B_THOR_MA * B_THOR_P. * B_THOR_PT * B_THOR_PX * B_THOR_PY * B_THOR_PZ * B_THOR_E. * B_TRUEID. * ************************************************************************************************************ * 0 * 5267.9531 * 117839.64 * 7271.2579 * 7210.5 * -938.0200 * 117615.10 * 117957.34 * -521 * * 1 * 5297.6070 * 47392.968 * 8606.5153 * -7469.709 * -4274.990 * 46604.949 * 47688.132 * -521 * * 2 * 5275.1127 * 83943.204 * 4855.4807 * 4057.0700 * 2667.5600 * 83802.656 * 84108.789 * -521 * * 3 * 5254.6255 * 115023.30 * 7970.0261 * 6430.3398 * 4708.7202 * 114746.85 * 115143.26 * -521 * * 4 * 5288.6533 * 137473.34 * 6728.9873 * -814.75 * 6679.4799 * 137308.56 * 137575.03 * -521 * * 5 * 5151.4326 * 80307.415 * 13022.804 * 12958.690 * -1290.650 * 79244.476 * 80472.468 * -521 * * 6 * 5272.0957 * 379949.68 * 6472.3092 * -946.0800 * -6402.790 * 379894.56 * 379986.25 * -521 * * 7 * 5284.6952 * 60494.259 * 6833.5002 * 6642.6001 * 1603.9300 * 60107.058 * 60724.652 * -521 * * 8 * 5283.8081 * 277384.51 * 17164.106 * -12983.46 * 11226.589 * 276852.96 * 277434.84 * -521 * * 9 * 5306.1743 * 39030.832 * 4649.5826 * -3168.409 * -3402.909 * 38752.898 * 39389.863 * -521 * * 10 * 5306.2964 * 39031.517 * 4649.9119 * -3168.699 * -3403.090 * 38753.550 * 39390.558 * -521 * * 11 * 5259.0991 * 263595.93 * 11664.141 * -9164.790 * -7215.180 * 263337.75 * 263648.40 * -521 * * 12 * 5292.3951 * 51002.541 * 5940.2583 * -3686.030 * -4658.310 * 50655.429 * 51276.394 * -521 * * 13 * 5271.0962 * 401316.75 * 4700.8627 * -1895.989 * 4301.5498 * 401289.21 * 401351.37 * -521 * * 14 * 5279.8886 * 82533.180 * 5768.8505 * -5511.629 * 1703.4000 * 82331.320 * 82701.890 * -521 * * 15 * 5290.878 * 156096.15 * 5958.0933 * 3945.3601 * 4464.6401 * 155982.40 * 156185.79 * -521 * * 16 * 5285.6411 * 40715.963 * 2312.8520 * -1291.180 * -1918.890 * 40650.218 * 41057.613 * -521 * * 17 * 5287.7904 * 47655.242 * 5117.6156 * 5108.1401 * 311.27999 * 47379.660 * 47947.710 * -521 * ************************************************************************************************************ ************************************************************************************************************ * Row * B_THOR_MA * B_THOR_P. * B_THOR_PT * B_THOR_PX * B_THOR_PY * B_THOR_PZ * B_THOR_E. * B_TRUEID. * ************************************************************************************************************ * 0 * 5293.3443 * 155962.20 * 7476.9152 * 453.82000 * 7463.1298 * 155782.87 * 156052.01 * 521 * * 1 * 5274.5708 * 188365.74 * 14746.150 * -9534.099 * 11249.440 * 187787.65 * 188439.57 * 521 * * 2 * 5281.2559 * 104115.56 * 7760.1900 * -4901.399 * 6016.3798 * 103825.96 * 104249.42 * 521 * * 3 * 5276.2172 * 173544.95 * 21454.121 * 18785.339 * 10362.929 * 172213.73 * 173625.14 * 521 * * 4 * 5291.6849 * 222032.63 * 7468.1414 * -6841.279 * -2995 * 221907 * 222095.68 * 521 * * 5 * 5272.6934 * 151280.16 * 5129.5517 * 3749.1799 * -3500.850 * 151193.17 * 151372.01 * 521 * * 6 * 5282.4672 * 111174.42 * 7488.7429 * 2215.2700 * 7153.5898 * 110921.92 * 111299.85 * 521 * * 7 * 5292.1328 * 83433.791 * 4270.6714 * -328.8699 * -4257.990 * 83324.421 * 83601.460 * 521 * * 8 * 5278.2358 * 103411.16 * 9647.2975 * 8407.6601 * 4730.9199 * 102960.18 * 103545.78 * 521 * * 9 * 5242.9716 * 128759.11 * 2700.9014 * -1228.420 * 2405.3798 * 128730.78 * 128865.81 * 521 * * 10 * 5250.1380 * 34967.703 * 3125.8475 * -1314.760 * 2835.8999 * 34827.710 * 35359.640 * 521 * * 11 * 5294.2242 * 72323.949 * 9591.8962 * 9518.8701 * 1181.3499 * 71685.070 * 72517.460 * 521 * ************************************************************************************************************
So indeed you are not getting the full entries from your input file. I confirm that
D0_BKGCAT
is always 60 in both tests and my change is a separate matter. But I thought I would point it out in case there is an issue with the descriptors in the selection line makers involved. Collapse replies - Author Maintainer
Yes, I tried many different decay descriptor combinations (this is just one of them) to see if I could make sense of the BKGCAT but to no avail :( Its always 60
- Maintainer
Does this look better :-)?
root [4] DecayTree->Scan("B_THOR_P:B_TRUEP:B_THOR_PT:B_TRUEPT:B_BKGCAT:D0_TRUEID:D0_BKGCAT:D0_THOR_PT:D0_TRUEPT:Kp_BKGCAT:Kp_TRUEID") ************************************************************************************************************************************************ * Row * B_THOR_P * B_TRUEP * B_THOR_PT * B_TRUEPT * B_BKGCAT * D0_TRUEID * D0_BKGCAT * D0_THOR_P * D0_TRUEPT * Kp_BKGCAT * Kp_TRUEID * ************************************************************************************************************************************************ * 0 * 117839.64 * 117710.27 * 7271.2579 * 7270.6776 * 0 * 421 * 0 * 4036.7785 * 4019.0496 * -1 * -321 * * 1 * 47392.968 * 47249.566 * 8606.5153 * 8580.9707 * 0 * 421 * 0 * 6632.9709 * 6622.3207 * -1 * -321 * * 2 * 83943.204 * 84010.623 * 4855.4807 * 4862.7698 * 0 * 421 * 0 * 2461.9962 * 2464.3874 * -1 * -321 * * 3 * 115023.30 * 115611.90 * 7970.0261 * 8006.6671 * 0 * 421 * 0 * 7607.4869 * 7640.9086 * -1 * -321 * * 4 * 137473.34 * 137131.89 * 6728.9873 * 6723.2781 * 0 * 421 * 0 * 5088.6175 * 5095.8372 * -1 * -321 * * 5 * 80307.415 * 83100.517 * 13022.804 * 13403.874 * 50 * 421 * 50 * 11077.538 * 11467.753 * -1 * -321 * * 6 * 379949.68 * 383089.92 * 6472.3092 * 6522.2879 * 0 * 421 * 0 * 2087.5992 * 2085.7711 * -1 * -321 * * 7 * 60494.259 * 60298.791 * 6833.5002 * 6794.8050 * 0 * 421 * 0 * 6479.3035 * 6441.8206 * -1 * -321 * * 8 * 277384.51 * 277766.20 * 17164.106 * 17188.325 * 0 * 421 * 0 * 16618.991 * 16647.928 * -1 * -321 * * 9 * 39030.832 * 38836.021 * 4649.5826 * 4623.1753 * 0 * -521 * 40 * 4005.9549 * 4623.1753 * -1 * -321 * * 10 * 39031.517 * 38836.021 * 4649.9119 * 4623.1753 * 0 * 421 * 0 * 3273.2486 * 3260.7490 * -1 * -321 * * 11 * 263595.93 * 263689.40 * 11664.141 * 11685.583 * 0 * 421 * 0 * 9097.9121 * 9100.5971 * -1 * 11 * * 12 * 51002.541 * 50855.324 * 5940.2583 * 5915.3901 * 0 * 421 * 0 * 5587.2276 * 5563.2095 * -1 * -321 * * 13 * 401316.75 * 401735.88 * 4700.8627 * 4716.0084 * 0 * 421 * 0 * 4194.0217 * 4226.4735 * -1 * -321 * * 14 * 82533.180 * 82369.867 * 5768.8505 * 5753.9540 * 0 * 421 * 0 * 6244.0864 * 6230.7793 * -1 * -321 * * 15 * 156096.15 * 155751.13 * 5958.0933 * 5945.7187 * 0 * 421 * 0 * 2570.9809 * 2569.1206 * -1 * -321 * * 16 * 40715.963 * 40694.510 * 2312.8520 * 2320.6146 * 0 * 421 * 0 * 2904.3887 * 2909.9441 * -1 * -321 * * 17 * 47655.242 * 47609.829 * 5117.6156 * 5104.0211 * 0 * 421 * 0 * 1899.6281 * 1895.8804 * -1 * -321 * ************************************************************************************************************************************************
I did not dwell on background studies, just made some easy corrections to the code at this point.
- Author Maintainer
Woah!! What did you change?
- Maintainer
This is all I changed:
< root_in_tes="/Event/HLT2"): --- > root_in_tes="/Event/HLT2", > **kwargs): 41c42 < p2mctool = P2MCPFromProtoP(Locations=relations_locs) --- > p2mctool = P2MCPFromProtoP(Locations=relations_locs, RootInTES=root_in_tes, **kwargs) 43c44,46 < P2MCTool=p2mctool, vetoNeutralRedo=not redo_neutral_assoc) --- > P2MCTool=p2mctool, vetoNeutralRedo=not redo_neutral_assoc, > RootInTES=root_in_tes, > **kwargs) 48,49c51,53 < BackgroundCategoryTool=bkg_cat) < mcrel_assc = MCMatchObjP2MCRelator(RelTableLocations=relations_locs) --- > BackgroundCategoryTool=bkg_cat, > **kwargs) > mcrel_assc = MCMatchObjP2MCRelator(RelTableLocations=relations_locs, RootInTES=root_in_tes, **kwargs) 54c58,59 < BackgroundCategory=bkg_cat) --- > BackgroundCategory=bkg_cat, > **kwargs)
In short:
- There was an inconsistency in the way RootInTES was set for all classes and tools instantiated, meaning most of them did not get it set.
- RootInTES continues to be a pain and we need to get rid of it.
- The
ConfiguredMCTruthAndBkgCatAlg
tool in DaVinci needs to be slightly enhanced to be able to pass extra keyword arguments so that one can trivially run in debug/verbose mode (of course other properties may be passed). I adapted to
def ConfiguredMCTruthAndBkgCatAlg( inputs, relations_locs=["Relations/ChargedPP2MCP", "Relations/NeutralPP2MCP"], redo_neutral_assoc=False, root_in_tes="/Event/HLT2", **kwargs):
having in mind the super useful argument
ConfiguredMCTruthAndBkgCatAlg(..., OutputLevel=1)
where I freeze the fact that the OutputLevel will be set the same in all 4 classes/tools instantiated in the function, which I think is OK (otherwise one can even go as far as providing an kwarg that is a dict with keys as class/tool name and values the kwargs to pass to the given class/tools, but I reckon this is over the top as one can always avoidConfiguredMCTruthAndBkgCatAlg
and call all that is done inside separately).This should go in asap with some bits of docstring. Happy to do it later today. Unfortunately it did not make it to the release that Patrick prepared 1-ish hour ago. Hope that's not too big an issue for us developers :-).
1 1 - Developer
So the
BackgroundCategory
tool was not configured withroot_in_tes
. However, the same tool forms input to MC association (DaVinciSmartAssociator
) tool that got configured correctly, implying that internally it correctly configuresBackgroundCategory
tool.Thanks for spotting this @erodrigu ! Indeed these algorithms need modernising. Thanks in advance for sending the MR.
- Maintainer
@amathad, while browsing the code I noticed that the functor name at line https://gitlab.cern.ch/lhcb/Rec/-/blob/master/Phys/MCAssociation/src/MCTruthAndBkgCatAlg.cpp#L60 needs to be updated to the correct name committed. Better check the full docstring while at it ...
Collapse replies - Developer
Thanks! Will do...
Edited by Abhijit Mathad - Maintainer
While "on the move" I fixed this too, see Rec!2711 (merged) for bookkeeping.
- Developer
Great!
- Eduardo Rodrigues mentioned in merge request !640 (merged)
mentioned in merge request !640 (merged)
- Eduardo Rodrigues mentioned in merge request Rec!2711 (merged)
mentioned in merge request Rec!2711 (merged)
- Patrick Koppenburg added DPA-WP3 label
added DPA-WP3 label
- Patrick Koppenburg closed with merge request !640 (merged)
closed with merge request !640 (merged)
- Patrick Koppenburg mentioned in commit bb26fdd4
mentioned in commit bb26fdd4