I am running for a large number of events and have selected a fraction of them which have 2 jet pairs which look promising for reconstruction of a candidate particle I am looking for. If there are 2 jet pairs in an event, I would like to take the sum up the 4-momenta of the jets in each pair to get a new 4-momentum and then form the scalar product of the 4 momenta of the two pairs to get an invariant mass.
I am aware that there is a ROOT page for TLorentzVectors but I don’t know how this all works in context: I have previously been able to use a formula for invariant mass which did not use 4-momenta. Can I just type TLorentzVector(jet1)+TLorentzVector(jet2) to get the 4-momentum of a jet pair and then form the scalar product from there?
Unfortunately either way does not work for me, if I try to add the jets as TLorentzVectors directly it produces an error message. As a last resort, could I maybe write code to extract the relevant momentum/energy components from the jets and then add and multiply until I have the scalar product which is equivalent to the invariant mass?
I imagine you have a TTree where your data are stored.
Now one of the branch of the tree is of type TLorentzVector? If not you have to build the TLorentzVector by yourself, after you have declared the TLorentzVector you can set also transverse momentum, rapidity and phi angle, TLorentzVector::SetPtEtaPhiE()
I think I will have to define a new TLorentzVector for each jet such it has the energy and momentum components which can be summed. For example, could I declare jetTL1, jetTL2, jetTL3, jetTL4 and fill them by hand using SetPx etc?
I’ve tried this, but when I try to add jetTL1 to jetTL2 to be able to calculate the invariant mass, it says that they are both not declared in this scope.
If I just type jetTL1, how would it know that I am referring to jet1 as the ones which needs the components to be extracted from it?