trackreco / mkFit

Vectorized, Parallelized Tracking
https://trackreco.github.io/
Apache License 2.0
17 stars 15 forks source link

write/read beam spot in a standalone setup #364

Closed slava77 closed 2 years ago

slava77 commented 2 years ago

The file version is updated to v6. The read/write code should be backward compatible with the older versions 4 (before the masks) and 5.

I made a test file 11834.0_TTbar_14TeV+2021/AVE_50_BX01_25ns/memoryFile.fv6.default.211007-652f30c.bin but I did not try to run the standalone validation on this yet.

mmasciov commented 2 years ago

@slava77 will be testing it in the coming hours, and will post here a validation.

mmasciov commented 2 years ago

I have done couple of tests, printing beamspot information in "quality_filter_layers" from standalone validation (using 11834.0_TTbar_14TeV+2021/AVE_50_BX01_25ns/memoryFile.fv6.default.211007-652f30c.bin, after PR #364) and from within CMSSW (after PR #364 and PR trackreco/cmssw#54), getting different answers:

[In mkFit/MkStdSeqs.cc: void quality_filter_layers(TrackVec & tracks, const BeamSpot &bspot) { std::cout << std::endl << "Beamspot: " << bspot.x << " " << bspot.y << " " << bspot.z << " " << bspot.sigmaZ << " " << bspot.beamWidthX << " " << bspot.beamWidthY << " " << bspot.dxdz << " " << bspot.dydz <<std::endl << std::endl;]

--> Beamspot information does not appear to be correctly written and/or read in standalone setup.

slava77 commented 2 years ago

@mmasciov please try with memoryFile.fv6.default.211008-a7daaeb.bin and an update in this PR.

osschar commented 2 years ago

Strange ... sorry about this :(

mmasciov commented 2 years ago

@mmasciov please try with memoryFile.fv6.default.211008-a7daaeb.bin and an update in this PR.

Just for history: this seems not sufficient to fix the issue in the standalone setup.

slava77 commented 2 years ago

After looking closer on the writer side, there is one bug on the trackingNtuple side: bsp_z is buggy and contains bs.x.

This, however doesn't solve the problem with the bin file read/write.

.. not sure I want to dig deeper now, perhaps we can save this by hardcoding the Run3 MC default in the default construction of the BeamSpot?

slava77 commented 2 years ago

Based on one event check, the writing part is correct.

There is apparently a shift of 2 words during reading in a setup where the CMSSW tracks are skipped. @mmasciov please check one more time (either of the .bin files should be OK)

mmasciov commented 2 years ago

@slava77 Thanks! Now we can get the correct beamspot information in standalone: Beamspot: 0.0107569 0.0417208 0.0107569 3.35973 0.000796955 0.000812358 0 0

I believe this is therefore ready to be merged.

slava77 commented 2 years ago

to match this PR final commit, I made a limited update to the .bin files: memoryFile.fv6.default.211008-c6b7c67.bin

These totals seemed to be good enough for all of the validation purposes and even most of the throughput benchmarks. A PR to update the baseline inputs is coming soon.