DUNE / ND_CAFMaker

Code for making CAFs from ND inputs (whether 2x2+MINERvA prototype or full ND simulation)
Apache License 2.0
1 stars 11 forks source link

Bugfix: Issue 63 - Flat cafs trees not filled correctly #65

Closed noeroy closed 3 months ago

noeroy commented 4 months ago

As discussed in this issue, it seems to be an issue with ROOT when we want to write the same tree with two opened files. I've added two minimal example scripts, one with the current way we fill the CAFs (test_bad.cpp) and one with the fix I propose in this PR.

After the fix we get for the FLAT CAF:

root [0]
Attaching file test_cafs3.flat.root as _file0...
(TFile *) 0x29dd0e0
root [1] meta->Scan()
************************************************************
*    Row   *   pot.pot *   run.run * subrun.su * version.v *
************************************************************
*        0 * 1.015e+16 *         1 *         0 *         5 *
************************************************************

And for the CAF:

Attaching file test_cafs3.root as _file0...
(TFile *) 0x3a43120
root [1] meta->Scan()
************************************************************
*    Row   *   pot.pot *   run.run * subrun.su * version.v *
************************************************************
*        0 * 1.015e+16 *         1 *         0 *         5 *
************************************************************

test.txt test_bad.txt