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 next message
vogel
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.

Cheers,
Adrian


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/libpdcap.so cat foo.slcio | strings | grep '^LCEvent$' | wc -l

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

Re: Counting Events in an LCIO File [message #1560 is a reply to message #1556] Mon, 04 August 2008 08:11 Go to previous messageGo to next message
srichter
Messages: 10
Registered: January 2008
Hi Adrian!

Thanks for this nice hack!

Sebastian
Re: Counting Events in an LCIO File [message #1569 is a reply to message #1556] Thu, 04 September 2008 14:05 Go to previous messageGo to next message
jeremy
Messages: 46
Registered: March 2004
Location: SLAC
The lcio command line tool has a count command to do just this (no hacks required!).

http://confluence.slac.stanford.edu/display/ilc/LCIO+Command +Line+Tool

Example should be pretty self-explanatory. Let me know of any questions.


Jeremy McCormick, SLAC <jeremym@slac.stanford.edu>
Re: Counting Events in an LCIO File [message #1570 is a reply to message #1569] Fri, 05 September 2008 01:07 Go to previous messageGo to next message
antonio.bulgheroni
Messages: 66
Registered: January 2007
Location: INFN - Roma3

Dear Jeremy,

I'm very interested in the lcio command line tool, especially the compare command. But when I try to execute lcio I got the following error:

Exception in thread "main" java.lang.NoClassDefFoundError: hep/lcio/util/CommandLineTool


Since I'm not a Java guy I don't really know what should I do to fix it. Can you please give me some hints?

thanks

toto


----

Antonio
Re: Counting Events in an LCIO File [message #1571 is a reply to message #1570] Mon, 08 September 2008 14:04 Go to previous messageGo to next message
jeremy
Messages: 46
Registered: March 2004
Location: SLAC
You have probably not built the Java binding.

In the LCIO directory, the script build.sh will create the Java library using ant.

> ./build.sh

You should see the jar in the lib/ directory.

I'm not sure about cmake builds but I know there is a way to create the Java library.


Jeremy McCormick, SLAC <jeremym@slac.stanford.edu>
Re: Counting Events in an LCIO File [message #1572 is a reply to message #1571] Mon, 08 September 2008 23:36 Go to previous messageGo to next message
antonio.bulgheroni
Messages: 66
Registered: January 2007
Location: INFN - Roma3

The jar file was there, but a rebuild fixed the issue.

thanks!

antonio


----

Antonio
Re: Counting Events in an LCIO File [message #1576 is a reply to message #1569] Fri, 12 September 2008 10:06 Go to previous message
vogel
Messages: 83
Registered: March 2005
Location: DESY, Hamburg, Germany
Dear Jeremy,

thanks for providing the hint to the Java LCIO command line tool! However, I thought an advantage of the "hack" is that you'll need neither an LCIO installation nor Java, but only a few system tools ... (For example in order to have a quick look at files residing on a machine that is used only for mass storage.) The plain-text scan is also marginally faster, but I guess that's not a relevant argument.

Cheers,
Adrian
Previous Topic:lcio cellID1 flag set accidentally
Next Topic:stdehepjob fails on 64 bit
Goto Forum:
  

[ PDF ]

Current Time: Sat Nov 16 23:34:48 Pacific Standard Time 2019
.:: Contact :: Home ::.

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