-
Notifications
You must be signed in to change notification settings - Fork 4.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Introduce flag for particles generation with max energy spread #36460
Conversation
+code-checks Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-36460/27306
|
A new Pull Request was created by @lecriste (Leonardo Cristella) for master. It involves the following packages:
@SiewYan, @mkirsano, @Saptaparna, @cmsbuild, @GurpreetSinghChahal, @agrohsje, @alberto-sanchez can you please review it and eventually sign? Thanks. cms-bot commands are listed here |
please test |
double fEn; | ||
if (numParticles > 1 && fMaxEnSpread) | ||
fEn = fEnMin + ip * (fEnMax - fEnMin) / (numParticles - 1); | ||
else | ||
fEn = CLHEP::RandFlat::shoot(engine, fEnMin, fEnMax); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you explain what has been done here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@SiewYan, in case the newly introduced flag (MaxEnSpread
) is true, the energies of the generated particles are set in constant steps of the specified range (fEnMin, fEnMax)
; otherwise they are computed randomly in the specified range, as in the original code.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks, its all look good to me
+1 Summary: https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-3ecfda/21205/summary.html Comparison SummarySummary:
|
+1 |
This pull request is fully signed and it will be integrated in one of the next master IBs (tests are also fine). This pull request will now be reviewed by the release team before it's merged. @perrotta, @dpiparo, @qliphy (and backports should be raised in the release meeting by the corresponding L2) |
The update implemented here is fine. I wonder why in CloseByParticleGunProducer.cc the for (unsigned int ip = 0; ip < numParticles; ++ip) {
if (fOverlapping) {
fR = CLHEP::RandFlat::shoot(engine, tmpR - fDelta, tmpR + fDelta);
phi = CLHEP::RandFlat::shoot(engine, tmpPhi - fDelta / fR, tmpPhi + fDelta / fR);
} else
phi += fDelta / fR;
double fEn;
if (numParticles > 1 && fMaxEnSpread)
fEn = fEnMin + ip * (fEnMax - fEnMin) / (numParticles - 1);
else
fEn = CLHEP::RandFlat::shoot(engine, fEnMin, fEnMax);
int PartID = CLHEP::RandFlat::shoot(engine, 0, fPartIDs.size()); |
+code-checks Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-36460/27373
|
Pull request #36460 was updated. @SiewYan, @mkirsano, @Saptaparna, @cmsbuild, @GurpreetSinghChahal, @agrohsje, @alberto-sanchez can you please check and sign again. |
please test |
+1 Summary: https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-3ecfda/21280/summary.html Comparison SummarySummary:
|
+1 |
This pull request is fully signed and it will be integrated in one of the next master IBs (tests are also fine). This pull request will now be reviewed by the release team before it's merged. @perrotta, @dpiparo, @qliphy (and backports should be raised in the release meeting by the corresponding L2) |
+1 |
int PartID = CLHEP::RandFlat::shoot(engine, 0, fPartIDs.size()); | ||
const HepPDT::ParticleData* PData = fPDGTable->particle(HepPDT::ParticleID(abs(PartID))); | ||
double mass = PData->mass().value(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This piece appears to be causing segfaults in 12_3_0_pre2 RelVals, see #36800.
PR description:
This PR introduces the option to generate particles with the maximum spread in the energy range specified.
No changes are expected in the output as by default the option is disabled.
PR validation:
Produced a few samples and verified that the generated particle energies are the desired ones.