[Rivet] unusual segfault:11 while getting a simple jet projection

Holger Schulz holger.schulz at durham.ac.uk
Thu May 12 09:53:14 BST 2016


Hi Raghav,


Looks like you don't have a jet, i.e. ajet.size() might be 0 and
by explicitly accessing ajets[0] the segafault seems to come in.

Could you try a
if (ajets.size()==0) vetoEvent;

just before the cout?

Holger


On 12/05/16 09:21, Raghav Kunnawalkam Elayavalli wrote:
> Hi Rivet Experts,
>
> Im seeing a very weird seg fault when i get the jet projection. I 
> attached the analysis code below in [1] and the error message in [2]. 
> I cant for the life of me figure out what is causing this seg fault 
> when i have other (much more complicated) analysis which use the exact 
> same setup and those work fine.
>
> Cheers
> Raghav
>
> [1] simple code:
> // -*- C++ -*-
> #include "Rivet/Analysis.hh"
> #include "Rivet/Projections/FinalState.hh"
> #include "Rivet/Projections/FastJets.hh"
>
> namespace Rivet {
>   class JEWEL_test : public Analysis {
>   public:
>
>     JEWEL_test()
>       : Analysis("JEWEL_test")
>     {    }
>
>     void init() {
>       FinalState fs(-5.0, 5.0, 0.150*GeV);
>       addProjection(fs, "FS");
>       addProjection(FastJets(fs, FastJets::ANTIKT, 0.4), "Jets");
>       _h_njets = bookHisto1D("njets", 10, 0, 10);
>     }
>
>     void analyze(const Event& event) {
>       const double weight = event.weight();
>       Jets ajets = applyProjection<FastJets>(event, 
> "Jets").jetsByPt(30*GeV);
>       std::cout<<"ajets leading jet pT = "<<ajets[0].pT()<<std::endl;
>       _h_njets->fill(ajets.size(), weight);
>     }
>
>     void finalize() {
>       scale(_h_njets, crossSection()/picobarn/sumOfWeights());
>     }
>   private:
>     Histo1DPtr _h_njets;
>   };
>
>   DECLARE_RIVET_PLUGIN(JEWEL_test);
> }
>
> [2]: Error message:
> pb-d-128-141-166-103:ANALYSIS raghav$ rivet -a JEWEL_test ../out.hepmc
> Rivet 2.4.1 running on machine pb-d-128-141-166-103.cern.ch 
> <http://pb-d-128-141-166-103.cern.ch> (x86_64) at 2016-05-12 10:17:31
> Rivet.Analysis.Handler: WARN Analysis 'JEWEL_test' is unvalidated: be 
> careful, it may be broken!
> Reading events from '../out.hepmc'
> #--------------------------------------------------------------------------
> #                         FastJet release 3.2.0
> #                 M. Cacciari, G.P. Salam and G. Soyez
> #     A software package for jet finding and analysis at colliders
> # http://fastjet.fr
> #
> # Please cite EPJC72(2012)1896 [arXiv:1111.6097] if you use this package
> # for scientific work and optionally PLB641(2006)57 [hep-ph/0512210].
> #
> # FastJet is provided without warranty under the terms of the GNU GPLv2.
> # It uses T. Chan's closest pair algorithm, S. Fortune's Voronoi code
> # and 3rd party plugin jet algorithms. See COPYING file for details.
> #--------------------------------------------------------------------------
> ajets leading jet pT = 48.0278
> Segmentation fault: 11
>
>
>
>
> _______________________________________________
> Rivet mailing list
> Rivet at projects.hepforge.org
> https://www.hepforge.org/lists/listinfo/rivet

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.hepforge.org/lists-archive/rivet/attachments/20160512/176b1a23/attachment.html>


More information about the Rivet mailing list