Fork me on GitHub

Opened 6 years ago

Closed 6 years ago

#335 closed Bug (fixed)

Pythia8 mother/daughter indexing offset

Reported by: kpeders1 Owned by:
Priority: minor Milestone:
Component: Delphes miscellaneous Version: Delphes 3
Keywords: Pythia mother daughter index Cc:

Description

Hello,

I am feeding particles from Pythia into Delphes. I based my main() on the example main() supplied in Delphes/readers ("DelphesPythia8.cpp").

It appears that Pythia8 no longer uses 1-s based indexing in its event record (index 0 is now the system line), but the example main() subtracts 1 from every mother/daughter index when it creates the new Candidate. This wouldn't be a problem if it was not storing the system line particle (pythia->event[0]) in the allParticles array, but it is.

I discovered this because I couldn't access the correct mother in a DelphesModule? I have written. Example line:

Candidate* mother = static_cast<Candidate*>(allParticles->At(daughter->M1))

I have removed the index conversion (storing the exact index returned by Pythia in the Candidate) and now my code works as anticipated.

Am I using the indices different than anticipated?

Keith Pedersen

Change History (3)

comment:1 Changed 6 years ago by kpeders1

Hello,

I thought I would include the lines I was referring to that do the index conversion. The following lines are from the original "DelphesPythia8.cpp":

candidate->M1 = particle.mother1() - 1;
candidate->M2 = particle.mother2() - 1;
candidate->D1 = particle.daughter1() - 1;
candidate->D2 = particle.daughter2() - 1;

And here is how I modified them.

candidate->M1 = particle.mother1();
candidate->M2 = particle.mother2();
candidate->D1 = particle.daughter1();
candidate->D2 = particle.daughter2();

Note: a similar solution would be to keep the original setter lines but modify the loop to start at index 1, since index 0 is the system line.

Keith Pedersen

comment:2 Changed 6 years ago by pavel

Dear Keith,

Thank you for finding this problem.

I've fixed DelphesPythia8.cpp and PileUpMergerPythia8.cc by modifying the loop to start at index 1.

This fix will be in the next release.

Regards,

Pavel

comment:3 Changed 6 years ago by pavel

  • Resolution set to fixed
  • Status changed from new to closed
Note: See TracTickets for help on using tickets.