JeffersonLab / HDGeant4

Geant4 simulation for the GlueX experiment
4 stars 4 forks source link

Request for event number in random seed debug info #163

Closed nsjarvis closed 4 years ago

nsjarvis commented 4 years ago

Please could you add the event number to the debug info? At present it looks like

G4WT8 > 30 events simulated G4WT8 > New event with starting seeds 451288386, 2032757268 G4WT12 > New event with starting seeds 492724997, 1046442215 G4WT11 > New event with starting seeds 682661657, 1457193133 G4WT6 > New event with starting seeds 1461699092, 1161379364

Counting the events isn't too bad in this example, if they are allocated sequentially, but the event I am really looking for is less easy to find, between 900 and 1000.

rjones30 commented 4 years ago

Naomi,

That would have to be a different message. This New Event message is sent at the beginning of the event, before the event number is known. The event number is assigned at the end of the event, after all of the tracking is done and the hits have been collected. This is so that the events are written to the file in order of event number, and one cannot tell at the beginning of tracking how long any given event is going to take. Unfortunately if I postpone the message until the end of the event then you will never see the message on an event that crashes. Here is a snippet of python that will let you find the event number corresponding to a particular seed. Just open an interactive python shell and type the following lines.

seed1=1461699092 import hddm_s for r in hddm_s.istream("my_simfile.hddm"): if r.getRandoms()[0].seed1 == seed1: print "event number is", r.getPhysicsEvent().eventNo

-Richard

On Sun, Jul 5, 2020 at 5:32 PM nsjarvis notifications@github.com wrote:

Please could you add the event number to the debug info? At present it looks like

G4WT8 > 30 events simulated G4WT8 > New event with starting seeds 451288386, 2032757268 G4WT12 > New event with starting seeds 492724997, 1046442215 G4WT11 > New event with starting seeds 682661657, 1457193133 G4WT6 > New event with starting seeds 1461699092, 1161379364

Counting the events isn't too bad in this example, if they are allocated sequentially, but the event I am really looking for is less easy to find, between 900 and 1000.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/JeffersonLab/HDGeant4/issues/163, or unsubscribe https://github.com/notifications/unsubscribe-auth/AB3YKWBSJQ5W6YWDS5SSS5DR2DWNVANCNFSM4ORBWIWQ .

rjones30 commented 4 years ago

I found a way to do this without reordering the sequence. It should work as expected. PR has been posted.

nsjarvis commented 4 years ago

Thank you.