<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=Windows-1252">
</head>
<body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">
Hi Holger, 
<div class=""><br class="">
</div>
<div class="">I just realized what i was doing. The veto wasnt the issue since it did print the correct jet pT. due to the type cast of the fastjet vs jets i think. </div>
<div class="">I needed to have </div>
<div class="">
<div class="">      const FastJets& Ajets = applyProjection<FastJets>(event, "Jets");</div>
<div class="">      const Jets ajets = Ajets.jetsByPt(30*GeV);</div>
</div>
<div class="">instead of</div>
<div class="">      Jets ajets = applyProjection<FastJets>(event, "Jets").jetsByPt(30*GeV);</div>
<div class=""><br class="">
</div>
<div class="">So now it does what its supposed to do. </div>
<div class=""><br class="">
</div>
<div class="">Cheers,</div>
<div class="">Raghav</div>
<div class=""><br class="">
</div>
<div class=""><br class="">
<div>
<blockquote type="cite" class="">
<div class="">On May 12, 2016, at 10:53 AM, Holger Schulz <<a href="mailto:holger.schulz@durham.ac.uk" class="">holger.schulz@durham.ac.uk</a>> wrote:</div>
<br class="Apple-interchange-newline">
<div class="">
<div bgcolor="#FFFFFF" text="#000000" class="">
<p class="">Hi Raghav,<br class="">
</p>
<p class=""><br class="">
</p>
<p class="">Looks like you don't have a jet, i.e. ajet.size() might be 0 and<br class="">
by explicitly accessing ajets[0] the segafault seems to come in.<br class="">
<br class="">
Could you try a<br class="">
if (ajets.size()==0) vetoEvent;</p>
<p class="">just before the cout?</p>
<p class="">Holger</p>
<p class=""><br class="">
</p>
<div class="moz-cite-prefix">On 12/05/16 09:21, Raghav Kunnawalkam Elayavalli wrote:<br class="">
</div>
<blockquote cite="mid:022071CC-9801-4E23-A707-261EB530A3E1@cern.ch" type="cite" class="">
Hi Rivet Experts, 
<div class=""><br class="">
</div>
<div class="">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. </div>
<div class=""><br class="">
</div>
<div class="">Cheers</div>
<div class="">Raghav</div>
<div class=""><br class="">
</div>
<div class="">[1] simple code: </div>
<div class="">
<div class="">// -*- C++ -*-</div>
<div class="">#include "Rivet/Analysis.hh"</div>
<div class="">#include "Rivet/Projections/FinalState.hh"</div>
<div class="">#include "Rivet/Projections/FastJets.hh"</div>
<div class=""><br class="">
</div>
<div class="">namespace Rivet {</div>
<div class="">  </div>
<div class="">  class JEWEL_test : public Analysis {</div>
<div class="">  public:</div>
<div class=""><br class="">
</div>
<div class="">    JEWEL_test()</div>
<div class="">      : Analysis("JEWEL_test")</div>
<div class="">    {    }</div>
<div class=""><br class="">
</div>
<div class="">    void init() {</div>
<div class="">      FinalState fs(-5.0, 5.0, 0.150*GeV);</div>
<div class="">      addProjection(fs, "FS");</div>
<div class="">      addProjection(FastJets(fs, FastJets::ANTIKT, 0.4), "Jets");</div>
<div class="">      _h_njets = bookHisto1D("njets", 10, 0, 10);</div>
<div class="">    }</div>
<div class=""><br class="">
</div>
<div class="">    void analyze(const Event& event) {</div>
<div class="">      const double weight = event.weight();</div>
<div class="">      Jets ajets = applyProjection<FastJets>(event, "Jets").jetsByPt(30*GeV);</div>
<div class="">      std::cout<<"ajets leading jet pT = "<<ajets[0].pT()<<std::endl;</div>
<div class="">      _h_njets->fill(ajets.size(), weight);</div>
<div class="">    }</div>
<div class=""><br class="">
</div>
<div class="">    void finalize() {</div>
<div class="">      scale(_h_njets, crossSection()/picobarn/sumOfWeights());</div>
<div class="">    }</div>
<div class="">  private:</div>
<div class="">    Histo1DPtr _h_njets;</div>
<div class="">  };</div>
<div class=""><br class="">
</div>
<div class="">  DECLARE_RIVET_PLUGIN(JEWEL_test);</div>
<div class="">}</div>
</div>
<div class=""><br class="">
</div>
<div class="">[2]: Error message: </div>
<div class="">
<div style="margin: 0px; font-size: 10px; line-height: normal;
          font-family: Monaco; color: rgb(217, 209, 173);
          background-color: rgb(0, 0, 0);" class="">
<span style="font-variant-ligatures: no-common-ligatures" class="">pb-d-128-141-166-103:ANALYSIS raghav$ rivet -a JEWEL_test ../out.hepmc </span></div>
<div style="margin: 0px; font-size: 10px; line-height: normal;
          font-family: Monaco; color: rgb(217, 209, 173);
          background-color: rgb(0, 0, 0);" class="">
<span style="font-variant-ligatures: no-common-ligatures" class="">Rivet 2.4.1 running on machine
<a moz-do-not-send="true" href="http://pb-d-128-141-166-103.cern.ch/" class="">pb-d-128-141-166-103.cern.ch</a> (x86_64) at 2016-05-12 10:17:31</span></div>
<div style="margin: 0px; font-size: 10px; line-height: normal;
          font-family: Monaco; color: rgb(217, 209, 173);
          background-color: rgb(0, 0, 0);" class="">
<span style="font-variant-ligatures: no-common-ligatures;
            color: #afad24" class="">Rivet.Analysis.Handler: WARN </span><span style="font-variant-ligatures: no-common-ligatures" class=""> Analysis 'JEWEL_test' is unvalidated: be careful, it may
 be broken!</span></div>
<div style="margin: 0px; font-size: 10px; line-height: normal;
          font-family: Monaco; color: rgb(217, 209, 173);
          background-color: rgb(0, 0, 0);" class="">
<span style="font-variant-ligatures: no-common-ligatures" class="">Reading events from '../out.hepmc'</span></div>
<div style="margin: 0px; font-size: 10px; line-height: normal;
          font-family: Monaco; color: rgb(217, 209, 173);
          background-color: rgb(0, 0, 0);" class="">
<span style="font-variant-ligatures: no-common-ligatures" class="">#--------------------------------------------------------------------------</span></div>
<div style="margin: 0px; font-size: 10px; line-height: normal;
          font-family: Monaco; color: rgb(217, 209, 173);
          background-color: rgb(0, 0, 0);" class="">
<span style="font-variant-ligatures: no-common-ligatures" class="">#                         FastJet release 3.2.0</span></div>
<div style="margin: 0px; font-size: 10px; line-height: normal;
          font-family: Monaco; color: rgb(217, 209, 173);
          background-color: rgb(0, 0, 0);" class="">
<span style="font-variant-ligatures: no-common-ligatures" class="">#                 M. Cacciari, G.P. Salam and G. Soyez                  </span></div>
<div style="margin: 0px; font-size: 10px; line-height: normal;
          font-family: Monaco; color: rgb(217, 209, 173);
          background-color: rgb(0, 0, 0);" class="">
<span style="font-variant-ligatures: no-common-ligatures" class="">#     A software package for jet finding and analysis at colliders      </span></div>
<div style="margin: 0px; font-size: 10px; line-height: normal;
          font-family: Monaco; color: rgb(217, 209, 173);
          background-color: rgb(0, 0, 0);" class="">
<span style="font-variant-ligatures: no-common-ligatures" class="">#                          
<a moz-do-not-send="true" href="http://fastjet.fr/" class="">http://fastjet.fr</a>                           </span></div>
<div style="margin: 0px; font-size: 10px; line-height: normal;
          font-family: Monaco; color: rgb(217, 209, 173);
          background-color: rgb(0, 0, 0);" class="">
<span style="font-variant-ligatures: no-common-ligatures" class="">#<span class="Apple-tab-span" style="white-space:pre">
</span>                                                                     </span></div>
<div style="margin: 0px; font-size: 10px; line-height: normal;
          font-family: Monaco; color: rgb(217, 209, 173);
          background-color: rgb(0, 0, 0);" class="">
<span style="font-variant-ligatures: no-common-ligatures" class=""># Please cite EPJC72(2012)1896 [arXiv:1111.6097] if you use this package</span></div>
<div style="margin: 0px; font-size: 10px; line-height: normal;
          font-family: Monaco; color: rgb(217, 209, 173);
          background-color: rgb(0, 0, 0);" class="">
<span style="font-variant-ligatures: no-common-ligatures" class=""># for scientific work and optionally PLB641(2006)57 [hep-ph/0512210].   </span></div>
<div style="margin: 0px; font-size: 10px; line-height: normal;
          font-family: Monaco; color: rgb(217, 209, 173);
          background-color: rgb(0, 0, 0);" class="">
<span style="font-variant-ligatures: no-common-ligatures" class="">#                                                                       </span></div>
<div style="margin: 0px; font-size: 10px; line-height: normal;
          font-family: Monaco; color: rgb(217, 209, 173);
          background-color: rgb(0, 0, 0);" class="">
<span style="font-variant-ligatures: no-common-ligatures" class=""># FastJet is provided without warranty under the terms of the GNU GPLv2.</span></div>
<div style="margin: 0px; font-size: 10px; line-height: normal;
          font-family: Monaco; color: rgb(217, 209, 173);
          background-color: rgb(0, 0, 0);" class="">
<span style="font-variant-ligatures: no-common-ligatures" class=""># It uses T. Chan's closest pair algorithm, S. Fortune's Voronoi code</span></div>
<div style="margin: 0px; font-size: 10px; line-height: normal;
          font-family: Monaco; color: rgb(217, 209, 173);
          background-color: rgb(0, 0, 0);" class="">
<span style="font-variant-ligatures: no-common-ligatures" class=""># and 3rd party plugin jet algorithms. See COPYING file for details.</span></div>
<div style="margin: 0px; font-size: 10px; line-height: normal;
          font-family: Monaco; color: rgb(217, 209, 173);
          background-color: rgb(0, 0, 0);" class="">
<span style="font-variant-ligatures: no-common-ligatures" class="">#--------------------------------------------------------------------------</span></div>
<div style="margin: 0px; font-size: 10px; line-height: normal;
          font-family: Monaco; color: rgb(217, 209, 173);
          background-color: rgb(0, 0, 0);" class="">
<span style="font-variant-ligatures: no-common-ligatures" class="">ajets leading jet pT = 48.0278</span></div>
<div style="margin: 0px; font-size: 10px; line-height: normal;
          font-family: Monaco; color: rgb(217, 209, 173);
          background-color: rgb(0, 0, 0);" class="">
<span style="font-variant-ligatures: no-common-ligatures" class="">Segmentation fault: 11</span></div>
</div>
<div class=""><span style="font-variant-ligatures:
          no-common-ligatures" class=""><br class="">
</span></div>
<div class=""><br class="">
</div>
<br class="">
<fieldset class="mimeAttachmentHeader"></fieldset> <br class="">
<pre wrap="" class="">_______________________________________________
Rivet mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Rivet@projects.hepforge.org">Rivet@projects.hepforge.org</a>
<a class="moz-txt-link-freetext" href="https://www.hepforge.org/lists/listinfo/rivet">https://www.hepforge.org/lists/listinfo/rivet</a></pre>
</blockquote>
<br class="">
</div>
</div>
</blockquote>
</div>
<br class="">
</div>
</body>
</html>