eic / eic-smear

fast simulation tool originally developed by the BNL EIC task force
GNU General Public License v3.0
2 stars 11 forks source link

Cross Section Info missing in BuildTree() result #2

Closed kkauder closed 4 years ago

kkauder commented 4 years ago

As reported by Joe Osborn, output trees from the BuildTree function don’t have objects corresponding to nEvents or crossSection as used in https://wiki.bnl.gov/eic/index.php/Simulations#How_to_get_a_cross_section

Initial diagnosis is that they should but something is off in serialization.

kkauder commented 4 years ago

Tagging @osbornjd so he can follow

kkauder commented 4 years ago

Well. It happens here (and similar for djangoh etc.) https://github.com/eic/eic-smear/blob/6358651e9caf4fcfd2d66e7f10f9b3920ee6a827/src/erhic/File.cxx#L77-L78

git blame doesn't immediately show the reason for this behavior. Digging deeper.

kkauder commented 4 years ago

That method is off (the last Write() will never get called), but it's not the main problem. The method just never gets called. I suspect that it needs the logfile together with the text file to actually create a log reader object, since only the logfile has the needed information. More of a documentation issue.

kkauder commented 4 years ago

Calling with the logfile explicitly as the fourth argument, like

BuildTree("out.txt",".",-1,"logfile.log")

indeed creates

  KEY: TObjString   crossSection;1  Collectable string class
  KEY: TObjString   nEvents;1   Collectable string class

So, the main issue is one of documenting this fact. Nevertheless, the bug found in the process will lead to nTrials not recorded. Will fix that as well.

osbornjd commented 4 years ago

Just to confirm, I can also see the crossSection and nEvents when using the suggested logfile fix.

kkauder commented 4 years ago

@osbornjd Joe, for the time being, you can just use nEvents. The wiki is blurry on the difference between trials and events. I will follow up, but all existing pythia logs I checked have nEvents==nTrials

osbornjd commented 4 years ago

Perfect, I will do that then. Thanks for the bug help!