Hi Burt,

I'm still having trouble understanding the syntax here...how do you access
the Lorentz Vector for any given member of genP4? I tried looking at these
documentation pages
(one<http://root.cern.ch/root/html522/ROOT__Math__LorentzVector_ROOT__Math__PxPyPzE4D_double___.html>and
two<http://root.cern.ch/root/html522/ROOT__Math__LorentzVector_ROOT__Math__PxPyPzE4D_double___.html#ROOT__Math__LorentzVector_ROOT__Math__PxPyPzE4D_double___:Pt>),
but that doesn't seem to help...

Thanks,
~Christi

On Sat, Feb 2, 2013 at 10:07 AM, Burt Betchart <notifications@github.com>wrote:

> In test.py:
>
> >
> >
> >  # Fill Histogram
> >
> > -#for i in tree.Row :
> > -if tree.genPdgId == 21 :
> > -    gluP4.Fill(genP4.pt())
> > -
> > -
> > +for iEvent in range(tree.GetEntries()) :
> > +    tree.GetEntry(iEvent)
> > +    gluplot.Fill(tree.genP4.pt())
>
> "genP4" is a std::vector, where LV is the Lorentz Vector type.
> std::vector<> is a template container class, which stores many of the same
> type of object sequentially. LV::pt() method is what you want, but the code
> you wrote here is calling std::vector::pt(), which doesn't exist. You can
> do that in TTree::Scan and TTree::Draw, because it takes that syntax to
> mean "call LV::pt() for each LV in the std::vector". However, you have to
> make the additional loop yourself when you write actual code. You'll
> further want to select only one item from the std::vector, which
> corresponds to the gluon of interest. Remember, "genP4" stores the LV for
> each gen particle, including the incoming protons, the pieces of the
> protons which go into the matrix element calculation, the top, antitop, *
> possible* gluon (there doesn't have to be any), and the top and antitop
> decay products.
>
> —
> Reply to this email directly or view it on GitHub<https://github.com/cerba/Senior-Thesis/pull/2/files#r2869021>.
>
>