Fork me on GitHub

Opened 10 years ago

Closed 10 years ago

#334 closed How to (fixed)

search for a trivial example on how to loop on delphes tree

Reported by: pietro govoni Owned by:
Priority: major Milestone:
Component: Delphes miscellaneous Version: Delphes 3
Keywords: reading python simple example Cc:

Description

TO whom it may concern,

I'd like to prepare a trivial example to loop on the events of a delphes tree, and for each event to loop on the particles of that tree (or any collections), and printout a variable of each particle (like the energy).
I would like to do all of this in a single, small, code, so that I understand all the basic passages that have to be done to read the ttree, without any sophisticated external or automated classes.

Could you please point me to such an example?

Best regards,

pietro

Attachments (1)

Example1.py (1.5 KB ) - added by Pavel Demin 10 years ago.

Download all attachments as: .zip

Change History (6)

comment:1 by Pavel Demin, 10 years ago

You can find the most simple examples at

https://cp3.irmp.ucl.ac.be/projects/delphes/wiki/WorkBook/QuickTour

and in the examples macros

examples/Example1.C
examples/Example2.C
examples/Example3.C

comment:2 by pietro govoni, 10 years ago

Dear Pavel,

thanks a lot! I forgot to mention in the email that I'd like to do that in python.
Is there an equivalent of the very nice examples you provided me with?

Best regards,

pietro

by Pavel Demin, 10 years ago

Attachment: Example1.py added

comment:3 by Pavel Demin, 10 years ago

Dear Pietro,

Conversion of the C++ examples to Python/pyROOT is quite straightforward.

Attached is a Python/pyROOT script similar to Example1.C.

I'll add it to the next Delphes release.

Regards,

Pavel

comment:4 by pietro govoni, 10 years ago

Thanks Pavel!

pietro

comment:5 by Pavel Demin, 10 years ago

Resolution: fixed
Status: newclosed
Note: See TracTickets for help on using tickets.