art-framework-suite / art-root-io

0 stars 2 forks source link

Contained CLHEP::HepLorentzVector not readable with art_root_io 1.08.02 (ROOT 6.22/08c) #7

Open knoepfel opened 2 years ago

knoepfel commented 2 years ago

This issue has been migrated from https://cdcvs.fnal.gov/redmine/issues/26038 (FNAL account required) Originally created by @kutschke on 2021-07-13 18:58:25


Thanks for fixing the issue with CLHEP::Hep3Vector.

Today Mu2e ran its first test with art v3_09_02. The good news is reading Hep3Vector now works. The bad news is that reading HepLorentzVectors does not. Note that a HepLorentzVector has a Hep3Vector as a data member.

Here is info about about how to reproduce on any mu2egpvm

cd /mu2e/app/users/kutschke/Bugs/Hep3Vector_test setup mu2e source setup.sh # sets up an old version of Offline from /cvmfs; it uses art v3_06_03 mu2e -c printLong.fcl -n 5 -s genParticlesOnly.art >& print.log

This prints out 5 GenParticles, one for each event. This works correctly because it is old art reading a file written by old art. Here is the output, collected from the file, for the first 5 events

ind pdgId Position Momentum time ptime name 0 11 -3862.5 14.1 5648.8 87.7 6.8 -57.2 222.4 0.0 CeEndpoint 0 11 -3879.7 39.0 5626.6 88.1 -43.0 -37.6 307.2 0.0 CeEndpoint 0 11 -3872.7 -26.3 5537.6 -86.2 59.5 6.9 301.9 0.0 CeEndpoint 0 11 -3930.7 -7.3 6093.2 52.1 -42.9 80.4 193.8 0.0 CeEndpoint 0 11 -3872.7 -21.5 5893.2 -18.1 50.9 90.0 256.1 0.0 CeEndpoint

Here is the output when reading the same file using an Offline built using art v3_09_02

ind pdgId Position Momentum time ptime name 0 11 -3862.5 14.1 5648.8 0.0 0.0 0.0 222.4 0.0 CeEndpoint 0 11 -3879.7 39.0 5626.6 0.0 0.0 0.0 307.2 0.0 CeEndpoint 0 11 -3872.7 -26.3 5537.6 0.0 0.0 0.0 301.9 0.0 CeEndpoint 0 11 -3930.7 -7.3 6093.2 0.0 0.0 0.0 193.8 0.0 CeEndpoint 0 11 -3872.7 -21.5 5893.2 0.0 0.0 0.0 256.1 0.0 CeEndpoint

Note that the positions match perfectly but the 3-momentum is zeroed.

Since then we have changed how we build Offline. I can provide the new instructions if you are interested. However the last time you decided to create your own minimal reproducer. Let me know if you want the instructions or if want to work the same way as last time.

knoepfel commented 2 years ago

Comment by @kutschke on 2021-07-13 19:01:58


One other thought. I notice that the issue is one later deeper in the data product hierarchy than before. Will we need to audit our code to learn how many levels deep we have Hep3Vectors?

knoepfel commented 2 years ago

Comment by @knoepfel on 2021-07-14 12:52:02


Rob, I will attempt to create a minimal reproducer today. Stay tuned.

knoepfel commented 2 years ago

Comment by @knoepfel on 2021-07-14 13:22:24


Rob, what is the full type of the data product that contains the CLHEP::HepLorentzVectors? We don't want to get a solution for only CLHEP::HepLorentzVectors but also any classes that contain them.

knoepfel commented 2 years ago

Comment by @kutschke on 2021-07-14 15:57:29


The full type is:

 std::vector 
knoepfel commented 2 years ago

Comment by @knoepfel on 2021-07-14 17:46:21


Thanks, Rob. I have created a reproducer that demonstrates the failure for the type std::vector<GenParticle> where GenParticle contains a HepLorentzVector. Note that schema evolution for a bare CLHEP::HepLorentzVector seems to work as expected.

Philippe, to demonstrate the failure with a debug build of ROOT, please do the following on scisoftbuild01.fnal.gov:

$ cp -r /home/knoepfel/test-lorentz-vector 
$ mkdir your-build-dir
$ cd your-build-dir
$ . /test-lorentz-vector/ups/setup_for_development -d
$ buildtool -j12
$ ctest -j12
Test project /home/knoepfel/scratch/build-test-lorentz-vectors
    Start 3: with_schema_evolution_t
    Start 1: write_products_t
    Start 4: interactive_with_evolution_t.sh
1/5 Test #3: with_schema_evolution_t ..............***Failed    3.35 sec
2/5 Test #1: write_products_t .....................   Passed    3.51 sec
    Start 5: interactive_without_evolution_t.sh
    Start 2: no_schema_evolution_t
3/5 Test #2: no_schema_evolution_t ................   Passed    2.99 sec
4/5 Test #4: interactive_with_evolution_t.sh ......   Passed   11.07 sec
5/5 Test #5: interactive_without_evolution_t.sh ...   Passed   11.01 sec

80% tests passed, 1 tests failed out of 5

Label Time Summary:
DEFAULT    =  31.92 sec*proc (5 tests)
RELEASE    =  31.92 sec*proc (5 tests)

Total Test time (real) =  14.52 sec

The following tests FAILED:
          3 - with_schema_evolution_t (Failed)

The above tests are simply expanded versions of the CLHEP::Hep3Vector tests you ran a few weeks ago. Let me know if you need more information.

knoepfel commented 2 years ago

Comment by @kutschke on 2021-07-15 13:57:32


At the Mu2e meeting yesterday we decided to that legacy datasets are no longer supported for use with the recent versions of our code. There are enough planned data format changes that the subset of things you can do with new code and old datasets is rapidly shrinking. Therefore fixing this bug is no longer a priority for Mu2e. Of course we will be happy to test the bug fix as soon as it is available.