Linear Collider Forum

Home » Software Tools » LCIO » Counting Events in an LCIO File
Counting Events in an LCIO File [message #1556] Mon, 28 July 2008 14:00 Go to previous message
Messages: 83
Registered: March 2005
Location: DESY, Hamburg, Germany
Hi all,

I have no idea whether the following will be useful for anybody else, but at least it was useful for myself: in order to find out quickly how many events are contained in an LCIO file (in the slcio format, to be precise), you can run
strings foo.slcio | grep '^LCEvent$' | wc -l
However, this might only work with LCIO version 1 files, and it will only find the top-level objects LCRunHeader, LCEventHeader, and LCEvent, but no collections or any kind of contained LCObjects.


Update on 2008-08-05: For some reason, strings doesn’t seem to work with DCAP. If you want to scan LCIO files on the dCache, prepend the pipe with an ordinary cat:
LD_PRELOAD=/opt/products/lib/ cat foo.slcio | strings | grep '^LCEvent$' | wc -l

[Updated on: Tue, 05 August 2008 09:11]

Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic:lcio cellID1 flag set accidentally
Next Topic:stdehepjob fails on 64 bit
Goto Forum:

Current Time: Tue Feb 18 04:13:46 Pacific Standard Time 2020
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.1.
Copyright ©2001-2010 FUDforum Bulletin Board Software