Fork me on GitHub

Opened 7 years ago

Last modified 7 years ago

#1294 new Bug

how to find distance between two jets ?

Reported by: Goko Owned by:
Priority: minor Milestone:
Component: Delphes code Version: Delphes 3
Keywords: Cc:

Description

Hello everyone,

I want to find distance between two jets.
I found MeanSqDeltaR in WorkBook/RootTreeDescription.
But ı dont know how to use it.
Can you please give the simplest example ?

Thank you.

Change History (4)

comment:1 by Michele Selvaggi, 7 years ago

see examples/Example1.py.
You can change it to the following:

if branchJet.GetEntries() > 1:
    jet0 = branchJet.At(0)
    jet1 = branchJet.At(1)

dR = jet0.P4().DeltaR(jet1.P4())

comment:2 by Goko, 7 years ago

Thank you so much for your help.

With Example1.py it works very well.
I printed all DeltaR values and filled histo with this values.
But my Analyzer is C++. It's going to take time to write my analyzer again in python.
Can you help me to do this in C++ ?
Because i modified Example2.C to create myAnalyzer.C
if i would add DeltaR to my analzyer it would be great.

Thank you so much.

comment:3 by Michele Selvaggi, 7 years ago

do the same:

jet[0]->P4().DeltaR(jet[1]->P4())

comment:4 by Goko, 7 years ago

Thank you so much mselvaggi.
This solved my problem.

Note: See TracTickets for help on using tickets.