[Rivet] [Rivet-svn] rivet: protect ancestors method against null genParticle

Jonathan Butterworth J.Butterworth at ucl.ac.uk
Mon Nov 27 13:16:03 GMT 2017


Hiya,

I guess it might, yes. I noticed this protection is in place on some 
other methods already, so rivet particles can have NULL genParticles. So 
I supposed it was a good idea to add it anyway. But that might be why it 
only just surfaced... maybe?

Cheers,
Jon

On 27/11/2017 09:35, David Grellscheid wrote:
> Hi Jon,
>
> Could this be related to the "constituent particle" changes Andy has
> made? I don't know how the association with the corresponding HepMC
> particle is handled in that case. I suspect that there's no longer a
> 1-to-1 mapping between the two.
>
>   David
>
>
> On 25/11/17 10:30, Rivet Mercurial wrote:
>> details:   https://rivet.hepforge.org/hg/rivet/rev/8d3ee1377c2e
>> branches:
>> changeset: 6156:8d3ee1377c2e
>> user:      Jon Butterworth <j.butterworth at cern.ch>
>> date:      Sat Nov 25 10:18:46 2017 +0000
>> description:
>> protect ancestors method against null genParticle
>>
>> diffs (14 lines):
>>
>> --- a/src/Core/Particle.cc	Fri Nov 24 14:48:42 2017 +0000
>> +++ b/src/Core/Particle.cc	Sat Nov 25 10:18:46 2017 +0000
>> @@ -63,6 +63,11 @@
>>
>>    vector<Particle> Particle::ancestors(const Cut& c, bool physical_only) const {
>>      vector<Particle> rtn;
>> +
>> +    // this case needed protecting against (at least for the latest Herwig... not sure why
>> +    // it didn't show up earlier
>> +    if (genParticle() == NULL) return rtn;
>> +
>>      /// @todo Remove this const mess crap when HepMC doesn't suck
>>      GenVertexPtr gv = const_cast<GenVertexPtr>( genParticle()->production_vertex() );
>>      if (gv == NULL) return rtn;
>> _______________________________________________
>> Rivet-svn mailing list
>> Rivet-svn at projects.hepforge.org
>> https://www.hepforge.org/lists/listinfo/rivet-svn
>>
> _______________________________________________
> Rivet mailing list
> Rivet at projects.hepforge.org
> https://www.hepforge.org/lists/listinfo/rivet
>

-- 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Prof. Jonathan Butterworth,              http://www.hep.ucl.ac.uk/~jmb/
Head, Physics and Astronomy Department            Tel: +44 20 7679 3444
University College London                 Gower St, London WC1E 6BT, UK
ATLAS, CERN                                       Tel: +41 22 76  72340
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


More information about the Rivet mailing list