<div dir="ltr"><br><div class="gmail_quote">---------- Forwarded message ----------<br>From: <b class="gmail_sendername">Alan Kaptanoglu</b> <span dir="ltr"><<a href="mailto:alank2@alumni.stanford.edu">alank2@alumni.stanford.edu</a>></span><br>Date: Mon, Oct 24, 2016 at 11:07 AM<br>Subject: Re: [Rivet] Memory error<br>To: <a href="mailto:andy.buckley@cern.ch">andy.buckley@cern.ch</a><br><br><br><div dir="ltr"><div><div>Thanks. Do I need some of the header files from the example file? I am compiling with the --with-root flag but it is not accepting my #ifndef HAVE_ROOT. Perhaps I need the AIDA namespace? I do not appear to have RivetAIDA.hh in my include directory.<br><br></div>Best,<br></div>Alan<br></div><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Oct 24, 2016 at 10:55 AM, Andy Buckley <span dir="ltr"><<a href="mailto:andy.buckley@cern.ch" target="_blank">andy.buckley@cern.ch</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Ok, thanks. Well, something like that old analysis should still be usable: just create a ROOT tree in the init(), fill in analyze(), and close/write in finalize().<br>
<br>
To do the linking against ROOT, you should be able to compile your plugin with something like rivet-buildplugin --with-root MY_ANALYSIS.cc<br>
<br>
Cheers,<br>
Andy<span><br>
<br>
<br>
On 24/10/16 09:35, Alan Kaptanoglu wrote:<br>
</span><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span>
Thanks for the replies. Exactly as David said. I would like to dump<br>
trees from rivet and use a multivariate analysis tool like tvma. I found<br>
an admittedly ancient rivet script that seems to do this but I am unsure<br>
if something like this is still supported in the newer rivet versions (I<br>
am running 2.5.1.).<br>
<a href="https://rivet.hepforge.org/trac/attachment/ticket/95/ExampleTree.cc" rel="noreferrer" target="_blank">https://rivet.hepforge.org/tra<wbr>c/attachment/ticket/95/Example<wbr>Tree.cc</a><br>
<br>
Let me know if there is something that can be done. Thanks again!<br>
<br>
Best,<br>
Alan<br>
<br>
On Sat, Oct 22, 2016 at 1:29 AM, Andy Buckley <<a href="mailto:andy.buckley@cern.ch" target="_blank">andy.buckley@cern.ch</a><br></span><span>
<mailto:<a href="mailto:andy.buckley@cern.ch" target="_blank">andy.buckley@cern.ch</a>>> wrote:<br>
<br>
    I know... not asking about whether ROOT in general has uses (!), but<br>
    what Alan specifically wanted it for. It's possible that we have<br>
    something built-in but not well-advertised...<br>
<br>
    Andy<br>
<br>
<br>
<br>
    On 21/10/16 23:02, David Bjergaard wrote:<br>
<br>
        Hi Andy,<br>
<br>
        Not to hijack the thread, but using ROOT to dump a tree of<br>
        events from a rivet<br>
        analysis is useful when you're doing exploratory analyses and<br>
        want to see how<br>
        things are correlated at the generator level.<br>
<br>
<br>
            David<br>
<br>
        Andy Buckley <<a href="mailto:andy.buckley@cern.ch" target="_blank">andy.buckley@cern.ch</a><br></span><span>
        <mailto:<a href="mailto:andy.buckley@cern.ch" target="_blank">andy.buckley@cern.ch</a>>> writes:<br>
<br>
            Exactly what it says: Rivet's configure doesn't have an<br>
            --enable-root<br>
            option. Maybe you're thinking of YODA?<br>
<br>
            You can pass linker flags for ROOT to the rivet-buildplugin<br>
            script if<br>
            you want, but we don't have any "official" support for it.<br>
<br>
            Out of interest, what ROOT features do you require?<br>
<br>
            Andy<br>
<br>
<br>
            On 21/10/16 17:28, Alan Kaptanoglu wrote:<br>
<br>
                I have tried just --enable-root as well.<br>
<br>
                On Fri, Oct 21, 2016 at 6:28 PM, Alan Kaptanoglu<br>
                <<a href="mailto:alank2@alumni.stanford.edu" target="_blank">alank2@alumni.stanford.edu</a><br>
                <mailto:<a href="mailto:alank2@alumni.stanford.edu" target="_blank">alank2@alumni.stanford<wbr>.edu</a>><br></span>
                <mailto:<a href="mailto:alank2@alumni.stanford.edu" target="_blank">alank2@alumni.stanford<wbr>.edu</a><span><br>
                <mailto:<a href="mailto:alank2@alumni.stanford.edu" target="_blank">alank2@alumni.stanford<wbr>.edu</a>>>> wrote:<br>
<br>
                    Another question, this time regarding linking rivet<br>
                with ROOT. I<br>
                    have tried adding the line --enable-root to my<br>
                configure file and<br>
                    re-installing but it complains:<br>
                    configure: WARNING: unrecognized options:<br>
                --enable-root, --with-root<br>
                    and I am unsure how to proceed.<br>
<br>
                    Best,<br>
                    Alan<br>
<br>
                    On Mon, Oct 17, 2016 at 5:38 PM, Alan Kaptanoglu<br>
                    <<a href="mailto:alank2@alumni.stanford.edu" target="_blank">alank2@alumni.stanford.edu</a><br>
                <mailto:<a href="mailto:alank2@alumni.stanford.edu" target="_blank">alank2@alumni.stanford<wbr>.edu</a>><br></span>
                <mailto:<a href="mailto:alank2@alumni.stanford.edu" target="_blank">alank2@alumni.stanford<wbr>.edu</a><span><br>
                <mailto:<a href="mailto:alank2@alumni.stanford.edu" target="_blank">alank2@alumni.stanford<wbr>.edu</a>>>> wrote:<br>
<br>
                        Thank you very much! I read that in useJetArea()<br>
                but was not<br>
                        sure how to get around it. Your line "<br>
                fj.useJetArea(new<br>
<br>
                fastjet::AreaDefinition(fastje<wbr>t::VoronoiAreaSpec()));" works<br>
                        perfectly. Passing it by value was a typo!<br>
<br>
                        Cheers,<br>
                        Alan<br>
<br>
                        On Mon, Oct 17, 2016 at 4:47 PM, Andy Buckley<br>
                        <<a href="mailto:andy.buckley@cern.ch" target="_blank">andy.buckley@cern.ch</a><br>
                <mailto:<a href="mailto:andy.buckley@cern.ch" target="_blank">andy.buckley@cern.ch</a>><br></span>
                <mailto:<a href="mailto:andy.buckley@cern.ch" target="_blank">andy.buckley@cern.ch</a><div><div class="m_3325719674156812466h5"><br>
                <mailto:<a href="mailto:andy.buckley@cern.ch" target="_blank">andy.buckley@cern.ch</a>>><wbr>> wrote:<br>
<br>
                            On 17/10/16 15:29, Alan Kaptanoglu wrote:<br>
<br>
                                Hello,<br>
<br>
                                I am trying to declare jets with area in the<br>
                                initialization section of<br>
                                my Rivet Analysis. I originally tried:<br>
<br>
                                      fastjet::GhostedAreaSpec<br>
                areaspec(2.5,1,0.01);<br>
                                      fastjet::AreaDefinition<br>
<br>
                area_def(fastjet::active_area_<wbr>explicit_ghosts,areaspec);<br>
                                      FastJets jets(vfs,<br>
                FastJets::ANTIKT, Rsmall);<br>
                                      jets.useJetArea(area_def);<br>
<br>
                jets.useInvisibles(JetAlg::ALL<wbr>_INVISIBLES);<br>
                                      jets.useMuons(JetAlg::DECAY_MU<wbr>ONS);<br>
                                      declare(jets, "jets");<br>
<br>
                                but this definition goes out of scope so<br>
                when I ask for<br>
                                jet areas in my<br>
                                "analysis" section of my code, it<br>
                complains the jets<br>
                                have no valid jet<br>
                                area associated with them. I next tried<br>
                several versions of:<br>
<br>
                                      areaspec = new<br>
                fastjet::GhostedAreaSpec(2.5,1<wbr>,0.01);<br>
                                      area_def = new<br>
<br>
                fastjet::AreaDefinition(fastje<wbr>t::active_area_explicit_ghosts<wbr>,*areaspec);<br>
                                      FastJets jets(vfs,<br>
                FastJets::ANTIKT, Rsmall);<br>
                                      jets.useJetArea(area_def);<br>
<br>
                jets.useInvisibles(JetAlg::ALL<wbr>_INVISIBLES);<br>
                                      jets.useMuons(JetAlg::DECAY_MU<wbr>ONS);<br>
                                      declare(jets, "jets");<br>
<br>
                                where areaspec and area_def are private<br>
                members of my<br>
                                Analysis class. I<br>
                                also tried initializing these variables<br>
                in my<br>
                                constructor using<br>
                                initialization lists, as well as<br>
                declaring them global<br>
                                variables (and<br>
                                yes, to my knowledge, I am also deleting<br>
                them correctly<br>
                                if I use "new").<br>
                                In all these cases, the code runs<br>
                correctly but<br>
                                complains at the end of<br>
                                a memory error, which is attached in a<br>
                text file. Any<br>
                                idea why this is<br>
                                happening or how to fix?<br>
<br>
<br>
                            Hi Alan,<br>
<br>
                            The AreaDefinition provided to FastJets must<br>
                be a<br>
                            heap-allocated pointer whose ownership is<br>
                then taken over by<br>
                            the FastJets object: it will delete the<br>
                pointer at the end<br>
                            of the run so you shouldn't try to do that<br>
                yourself. (This<br>
                            is documented on the useJetArea() function)<br>
<br>
                            To this end I usually make sure that I don't<br>
                have a variable<br>
                            of my own pointing at that area def objects,<br>
                e.g.<br>
                             fj.useJetArea(new<br>
<br>
                fastjet::AreaDefinition(fastje<wbr>t::VoronoiAreaSpec()));<br>
<br>
                            As you noticed, if you pass in a locally<br>
                allocated object,<br>
                            it goes out of scope and you get a crash.<br>
                Although I'm not<br>
                            sure how you're able to pass it in by value<br>
                rather than by<br>
                            pointer!<br>
<br>
                            I would like, if possible, to avoid this<br>
                pointer ownership<br>
                            stuff in the FastJets interface... I'm sure<br>
                it's possible,<br>
                            just needs a bit of care and thought about<br>
                backward<br>
                            compatibility. Pointers were used<br>
                historically because we<br>
                            need the option of a null AreaDefinition,<br>
                and there's no<br>
                            such thing as a null reference in C++.<br>
<br>
                            Hope that helps,<br>
                            Andy<br>
<br>
                            --<br>
                            Dr Andy Buckley, Lecturer / Royal Society<br>
                University<br>
                            Research Fellow<br>
                            Particle Physics Expt Group, University of<br>
                Glasgow<br>
<br>
<br>
<br>
<br>
<br>
<br>
    --<br>
    Dr Andy Buckley, Lecturer / Royal Society University Research Fellow<br>
    Particle Physics Expt Group, University of Glasgow<br>
<br>
<br>
</div></div></blockquote><div class="m_3325719674156812466HOEnZb"><div class="m_3325719674156812466h5">
<br>
<br>
-- <br>
Dr Andy Buckley, Lecturer / Royal Society University Research Fellow<br>
Particle Physics Expt Group, University of Glasgow<br>
</div></div></blockquote></div><br></div>
</div></div></div><br></div>