Print

Print


Thanks Sho...

> Looking at the JEVIO code, the number in EvioEvent.getEventNumber() is a sequence number that the EVIO reader generates and is not part of the data; the first event in a file is always 1, the second is always 2, etc.

So then it seems I was mistaken.  It sounds like we should continue using the number from the event ID bank if getEventNumber() just returns a sequence number generated by the reader "on the fly".

I haven't changed this so EvioToLcio is still using the event ID bank.

-----Original Message-----
From: Sho Uemura [mailto:[log in to unmask]] 
Sent: Friday, May 29, 2015 4:16 PM
To: McCormick, Jeremy I.
Cc: Nathan Baltzell; hps-software; Serguei Boiarinov
Subject: RE: event building

Let's not decide which number is "correct" until we know what they are and where they come from? Here's what I know.

Looking at the JEVIO code, the number in EvioEvent.getEventNumber() is a sequence number that the EVIO reader generates and is not part of the data; the first event in a file is always 1, the second is always 2, etc. 
If a run spans multiple files, the sequence number resets to 1 at the start of each file. If we were to skim the EVIO files and write only a subset of events to new EVIO files, the skimmed events would not retain their sequence numbers.

The first int in the 0xc000 bank is a number assigned by something in CODA. (The CODA manual calls this bank the "event ID bank" and this number the "event number," and says it's supposed to start at 1 and count up throughout the run. We see runs where it does not start at 1.) Not all events have this bank (for example, the various "run control events" don't have it), but all physics events should have it. Obviously, it's part of the data and part of the event.

On Thu, 28 May 2015, McCormick, Jeremy I. wrote:

> Hi, Nathan.
>
>> What is an "eventID" bank?   Is it an EVIO bank?
>
> The event ID bank is a regular EVIO bank of ints added by the DAQ with some event information in it.
>
> It has int data with the following info....
>
> {event number, trigger code, readout status}
>
> In at least one case that I saw, the event number did not appear to be correct, in that it was out of sequence from the other events.
>
> So I'm wondering here if using EvioEvent.getEventNumber() would be more reliable.
>
>> If so, what is its tag #?
>
> That's defined in EvioEventConstants.java.
>
> public static final int EVENTID_BANK_TAG = 0xC000;
>
> A more serious issue to investigate is that the event ID bank *never* matches the number from using getEventNumber() directly, e.g. if I add a debug printout to the method....
>
> WARNING: EVIO event number 6 does not match 11 from event ID bank
> WARNING: EVIO event number 7 does not match 12 from event ID bank
> WARNING: EVIO event number 8 does not match 13 from event ID bank
> WARNING: EVIO event number 9 does not match 14 from event ID bank
> WARNING: EVIO event number 10 does not match 15 from event ID bank
> WARNING: EVIO event number 11 does not match 16 from event ID bank
> WARNING: EVIO event number 12 does not match 17 from event ID bank
> WARNING: EVIO event number 13 does not match 18 from event ID bank 
> [...]
> WARNING: EVIO event number 208721 does not match 208322 from event ID 
> bank
> WARNING: EVIO event number 208722 does not match 208323 from event ID 
> bank
> WARNING: EVIO event number 208723 does not match 208421 from event ID 
> bank
>
> By the end of processing this one file, these two values are ~300 event numbers out of sync with each other.  Notice also that the event ID goes from 208323 to 208421 between a single event!
>
> So I'm not sure why that's the case, but I'm guessing that using EvioEvent.getEventNumber() is more reliable here.  But I wasn't sure if it was a good idea to commit that change without discussing first what is supposed to be happening here with this event ID bank.
>
> --Jeremy
>
> -----Original Message-----
> From: Nathan Baltzell [mailto:[log in to unmask]]
> Sent: Thursday, May 28, 2015 2:01 PM
> To: McCormick, Jeremy I.
> Cc: hps-software
> Subject: Re: event building
>
> Are you saying the event numbers are out of order in the raw EVIO data?
>
> What is an "eventID" bank?   Is it an EVIO bank?  If so, what is its tag #?
>
>
> On May 28, 2015, at 16:47, McCormick, Jeremy I. <[log in to unmask]> wrote:
>
>> Hi,
>>
>> I'm seeing something a bit strange in EvioToLcio.  It seems that when processing one of the files from 5772 I spot at least one out of order event '10' in the data stream which occurs after several hundred thousand events have been processed.  So the event number seems incorrect or out of sequence.
>>
>> Then looking at the event builder code (LCSimTestRunEventBuilder), I see that instead of using EvioEvent.getEventNumber() to set the output LCSim event number, the event ID bank is being used directly for this information.  But I don't think this is necessary, as the EVIO events are always parsed before they are sent to the event builder, which means the event number should be set already.
>>
>> I am wondering if sometimes this event number coming from the event ID bank could be wrong or out of sequence for some reason like a DAQ error.  If not, I don't understand what I'm seeing here with this strange out of order event number in the data stream.  Probably there are others too lurking in there (just spotted the one in the huge log file).
>>
>> When I replace this code using the event ID bank by reading from the EVIO event, this gets cleaned up and I don't see the out of sequence event numbers.  In this case, the LCSim output events match up 1-to-1 with the EVIO data.  I think that's better.  So can I commit this change?  Or is there some reason to prefer reading directly from the event ID bank?
>>
>> Also, there's this code in there for handling the case when the event ID bank does not exist at all, which I think is a bit problemmatic....
>>
>> if (eventID == null) {
>>    logger.warning("No event ID bank found");
>>    eventID = new int[3];
>> }
>>
>> In this case, the event number on the LCSim event is set to zero!  
>> I'm not sure that makes any sense, and maybe instead it should be a 
>> fatal error causing that event to be skipped if there is no event 
>> bank in it.  (That would also mean you don't know the trigger code or 
>> readout status either so the event is likely unusable if it is a 
>> physics events.)
>>
>> --Jeremy
>>
>> #####################################################################
>> ###
>> Use REPLY-ALL to reply to list
>>
>> To unsubscribe from the HPS-SOFTWARE list, click the following link:
>> https://listserv.slac.stanford.edu/cgi-bin/wa?SUBED1=HPS-SOFTWARE&A=1
>
> ######################################################################
> ##
> Use REPLY-ALL to reply to list
>
> To unsubscribe from the HPS-SOFTWARE list, click the following link:
> https://listserv.slac.stanford.edu/cgi-bin/wa?SUBED1=HPS-SOFTWARE&A=1
>

########################################################################
Use REPLY-ALL to reply to list

To unsubscribe from the HPS-SOFTWARE list, click the following link:
https://listserv.slac.stanford.edu/cgi-bin/wa?SUBED1=HPS-SOFTWARE&A=1