[Rivet] Bug in Rivet?

Andy Buckley andy.buckley at cern.ch
Tue Apr 12 09:04:24 BST 2016


On 12/04/16 03:20, Dag Gillberg wrote:
> Hi Andy,
>
> I'm writing Rivet code (yay! fun!).
> And I want to build jets out of stable particles that are hadrons or
> from hadron decay.
> So I do:
>      if ( PID::isHadron(p.pdgId()) || p.fromHadron() )
>
> Now, as a cross check, I printed out particles that failed this, and I
> see a ton of strange baryons fail:
> Warning: found unexpected particle!
>    (pT,eta,phi,m) = (0.9,-2.0,2.0,1), ID = 3122
> Warning: found unexpected particle!
>    (pT,eta,phi,m) = (0.5,-4.3,1.9,1), ID = -3122
> Warning: found unexpected particle!
>    (pT,eta,phi,m) = (0.9,-2.2,3.9,1), ID = 3122
>
> These are Lambda particles.
> They all fail this line in isBaryon:
>
> if (_digit(nq2,pid) < _digit(nq3,pid)) return false;
>
> since the second digit (1) is smaller than the third (2)
> ( not sure what this condition is based on though..)
> But a Lambda is certainly a Baryon..
> So this must be a bug, right?


Hi Dag,

Yes, you're right: I had tried to tighten up my implementation of PID 
checks in the MCUtils package, following the PDG scheme definition, but 
missed that for baryons there are exceptions to the ordering.

I fixed this a while ago in MCUtils but had forgotten to sync the fixes 
into Rivet. I'm not sure how it managed to not show up in our release 
validation -- we should look into that.

Anyway I've done the sync now, and the fixed header file (from 
include/Rivet/Tools) is attached -- are you able to patch, or do you 
rely on a pre-built copy of Rivet? Since it's a bug with real physics 
implications, I'm tempted to get a patch release out asap.

Thanks for the report!

Now a couple of unrelated comments on your code snippet ;-)

>        Particles hadrons_notFromHiggs;
>        FourMomentum sum(0,0,0,0);
>        for ( const GenParticle *ptcl :
> Rivet::particles(event.genEvent()) ) {
>          Particle p(ptcl);
>          if (!p.isStable()) continue;

Since you only want stable particles, rather than loop over HepMC 
GenParticles, convert them to Rivet Particles, and ignore the non-stable 
ones the "Rivet way" is to set up a FinalState projection:

// In init()
addProjection(FinalState(), "FS")

// In apply()
const Particles& particles = applyProjection<FinalState>(event, 
"FS").particles();
for (const Particle& p : particles) {
   ...

I am trying to move some core intelligence out of the projections and 
into standalone functions (or maybe Event methods) to make it easier to 
do many things without projections if wanted, though -- the main benefit 
of projections is automatic caching, but that's not always the most 
important thing.

Cheers,
Andy

-- 
Dr Andy Buckley, Lecturer / Royal Society University Research Fellow
Particle Physics Expt Group, University of Glasgow
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ParticleIdUtils.hh
Type: text/x-c++hdr
Size: 26360 bytes
Desc: not available
URL: <https://www.hepforge.org/lists-archive/rivet/attachments/20160412/35b9b4d4/attachment.hh>


More information about the Rivet mailing list