DUNE / dune-tms

DUNE ND Temporary Muon Spectrometer
0 stars 1 forks source link

U vs V differences in certain truth info branches #99

Closed jdkio closed 2 months ago

jdkio commented 5 months ago

The code in TMS_TreeWriter got a bit messed up when u and v differences were added. It original code read

VertexIdOfMostEnergyInEvent = event.GetVertexIdOfMostVisibleEnergy();
VisibleEnergyFromVertexInSlice = event.GetVisibleEnergyFromVertexInSlice();
TotalVisibleEnergyFromVertex = event.GetTotalVisibleEnergyFromVertex();
VisibleEnergyFromOtherVerticesInSlice = event.GetVisibleEnergyFromOtherVerticesInSlice();
VertexVisibleEnergyFractionInSlice = VisibleEnergyFromVertexInSlice / TotalVisibleEnergyFromVertex;
PrimaryVertexVisibleEnergyFraction = VisibleEnergyFromVertexInSlice / (VisibleEnergyFromOtherVerticesInSlice + VisibleEnergyFromVertexInSlice);

But now it's:

VertexIdOfMostEnergyInEvent = event.GetVertexIdOfMostVisibleEnergy();
VisibleEnergyFromUVertexInSlice = event.GetVisibleEnergyFromUVertexInSlice();
TotalVisibleEnergyFromVertex = event.GetTotalVisibleEnergyFromVertex();
VisibleEnergyFromVVerticesInSlice = event.GetVisibleEnergyFromVVerticesInSlice();
VertexVisibleEnergyFractionInSlice = VisibleEnergyFromUVertexInSlice / TotalVisibleEnergyFromVertex;
PrimaryVertexVisibleEnergyFraction = VisibleEnergyFromUVertexInSlice / (VisibleEnergyFromVVerticesInSlice + VisibleEnergyFromUVertexInSlice);

PrimaryVertexVisibleEnergyFraction should be equal to the total energy in the slice from the "primary vertex" / all energy of the slice. VertexVisibleEnergyFractionInSlice should be equal to all energy in slice from the primary vertex / total energy from the primary vertex. I don't think that's true anymore. This code is very specific to measuring the quality of the time slicer and so it doesn't care about U vs V differences. I tried looking at it but couldn't figure out what changes I need to make to get the right behavior

AsaNehm commented 5 months ago

Thanks for pointing this out. When I switched from One and Other to U and V, I searched the code for uses of 'One' and 'Other' and the part 'FromOtherVerticesInSlice' was found as well and I replaced it not thinking about whether I actually changed this initially (just too much stuff to replace). I think what needs to be changed are the two VisibleEnergy lines. Please try to restore them to the original