Opened 10 years ago
Closed 10 years ago
#335 closed Bug (fixed)
Pythia8 mother/daughter indexing offset
Reported by: | Keith Pedersen | 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 by , 10 years ago
comment:2 by , 10 years ago
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 by , 10 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
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":
And here is how I modified them.
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