<div dir="ltr"><div><div>Thanks everybody, I figured it out. <br><br></div>Best wishes,<br></div>Alan<br></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Oct 24, 2016 at 3:33 PM, 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">Also, there's no need for a WITH_ROOT preprocessor variable if you're writing your own ROOT-using analysis. rivet-buildplugin doesn't provide any such variable, and we removed it from the Rivet core along with the move from AIDA -> YODA a few years ago.<span class="HOEnZb"><font color="#888888"><br>
<br>
Andy</font></span><div><div class="h5"><br>
<br>
<br>
On 24/10/16 13:29, David Bjergaard wrote:<br>
</div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class="h5">
Hi Alan,<br>
<br>
The AIDA framework was replaced with Yoda, so you may have to tweak some of<br>
those headers/remove them if you are using root to just dump the tree.<br>
<br>
David<br>
<br>
<br>
Alan Kaptanoglu <<a href="mailto:alank2@alumni.stanford.edu" target="_blank">alank2@alumni.stanford.edu</a>> writes:<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
---------- Forwarded message ----------<br>
From: Alan Kaptanoglu <<a href="mailto:alank2@alumni.stanford.edu" target="_blank">alank2@alumni.stanford.edu</a>><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" target="_blank">andy.buckley@cern.ch</a><br>
<br>
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<br>
need the AIDA namespace? I do not appear to have RivetAIDA.hh in my include directory.<br>
<br>
Best,<br>
Alan<br>
<br>
On Mon, Oct 24, 2016 at 10:55 AM, Andy Buckley <<a href="mailto:andy.buckley@cern.ch" target="_blank">andy.buckley@cern.ch</a>> wrote:<br>
<br>
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<br>
<br>
On 24/10/16 09:35, Alan Kaptanoglu wrote:<br>
<br>
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/tr<wbr>ac/attachment/ticket/95/Exampl<wbr>eTree.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>
<mailto:<a href="mailto:andy.buckley@cern.ch" target="_blank">andy.buckley@cern.ch</a>><wbr>> 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>
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>
David<br>
<br>
Andy Buckley <<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>><wbr>> 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>
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.stanfor<wbr>d.edu</a>><br>
<mailto:<a href="mailto:alank2@alumni.stanford.edu" target="_blank">alank2@alumni.stanfor<wbr>d.edu</a><br>
<mailto:<a href="mailto:alank2@alumni.stanford.edu" target="_blank">alank2@alumni.stanfor<wbr>d.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.stanfor<wbr>d.edu</a>><br>
<mailto:<a href="mailto:alank2@alumni.stanford.edu" target="_blank">alank2@alumni.stanfor<wbr>d.edu</a><br>
<mailto:<a href="mailto:alank2@alumni.stanford.edu" target="_blank">alank2@alumni.stanfor<wbr>d.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(fastj<wbr>et::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>
<mailto:<a href="mailto:andy.buckley@cern.ch" target="_blank">andy.buckley@cern.ch</a><br>
<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_<wbr>area_explicit_ghosts,areaspec)<wbr>;<br>
FastJets jets(vfs,<br>
FastJets::ANTIKT, Rsmall);<br>
jets.useJetArea(area_def);<br>
<br>
jets.useInvisibles(JetAlg::AL<wbr>L_INVISIBLES);<br>
jets.useMuons(JetAlg::DECAY_M<wbr>UONS);<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,<wbr>1,0.01);<br>
area_def = new<br>
<br>
fastjet::AreaDefinition(fastj<wbr>et::active_area_explicit_ghost<wbr>s,*areaspec);<br>
FastJets jets(vfs,<br>
FastJets::ANTIKT, Rsmall);<br>
jets.useJetArea(area_def);<br>
<br>
jets.useInvisibles(JetAlg::AL<wbr>L_INVISIBLES);<br>
jets.useMuons(JetAlg::DECAY_M<wbr>UONS);<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>
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(fastj<wbr>et::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>
Dr Andy Buckley, Lecturer / Royal Society University Research Fellow<br>
Particle Physics Expt Group, University of Glasgow<br>
<br>
--<br>
Dr Andy Buckley, Lecturer / Royal Society University Research Fellow<br>
Particle Physics Expt Group, University of Glasgow<br>
</blockquote></div></div>
______________________________<wbr>_________________<span class=""><br>
Rivet mailing list<br>
<a href="mailto:Rivet@projects.hepforge.org" target="_blank">Rivet@projects.hepforge.org</a><br>
<a href="https://www.hepforge.org/lists/listinfo/rivet" rel="noreferrer" target="_blank">https://www.hepforge.org/lists<wbr>/listinfo/rivet</a><br>
<br>
</span></blockquote>
<br><div class="HOEnZb"><div class="h5">
<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>