Opened 13 years ago
Closed 12 years ago
#45 closed How to (fixed)
ROOT Analysis code with friend TTree's
Reported by: | muanza | Owned by: | |
---|---|---|---|
Priority: | major | Milestone: | |
Component: | Delphes code | Version: | all recent versions (> 1.8) |
Keywords: | Cc: | muanza@… |
Description
Hello,
I'd like to use MC truth infos from the GEN TTree within an analysis code based upon a MakeClass defined on the Analysis TTree.
I have no experience with friend TTree's, so I'd like to know if someone has a running example.
Thanks
Regards, Steve
Attachments (1)
Change History (5)
by , 13 years ago
Attachment: | AddFriendExample.cpp added |
---|
comment:1 by , 13 years ago
comment:3 by , 13 years ago
Hello Pavel,
Thanks for this working example. Now I manage to access simultaneoulsy to the different TTrees.
I think this ticket can be closed.
Regards, Steve
comment:4 by , 12 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
Note:
See TracTickets
for help on using tickets.
Hi Steve,
Do you really need to use MakeClass? If it's so, I'm afraid we don't have any example showing how to use MakeClass and AddFriend.
Otherwise, there is a basic example in the ExRootAnalysis repository that uses ExRootTreeReader and AddFriend:
https://server06.fynu.ucl.ac.be/projects/ExRootAnalysis/browser/trunk/test/AddFriendExample.C
You can find in the attachment a version of this script adapted to the Delphes ROOT tree format.
You can compile and run this example using the following commands:
Alternatively, there is an example that comes with the Delphes code that show how to analyze reconstructed and generated objects without using AddFriend. It uses 3 ExRootTreeReader objects to read Analysis, GEN and Trigger trees in parallel. Here is a list of relevant files:
Regards,
Pavel