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
[HGCAL] Closeby Particle gun - uniform eta generation #36554
Conversation
+code-checks Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-36554/27492
|
A new Pull Request was created by @waredjeb (Wahid Redjeb) 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 |
@cmsbuild please test |
+1 Summary: https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-bd6456/21406/summary.html Comparison SummarySummary:
|
fEnMax = pgun_params.getParameter<double>("EnMax"); | ||
fEnMin = pgun_params.getParameter<double>("EnMin"); | ||
fMaxEnSpread = pgun_params.getParameter<bool>("MaxEnSpread"); | ||
fEtaMax = pgun_params.getParameter<double>("MinEta"); | ||
fEtaMin = pgun_params.getParameter<double>("MaxEta"); |
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.
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! I fixed the names and added a description of the bug introduced
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.
if (!fControlledByEta) { | ||
fR = CLHEP::RandFlat::shoot(engine, fRMin, fRMax); | ||
} else { | ||
fEta = CLHEP::RandFlat::shoot(engine, fEtaMin, fEtaMax); |
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.
Not fundamental, but fEta
could have been more conveniently defined as a local variable only inside this scope...
fEnMax = pgun_params.getParameter<double>("EnMax"); | ||
fEnMin = pgun_params.getParameter<double>("EnMin"); | ||
fMaxEnSpread = pgun_params.getParameter<bool>("MaxEnSpread"); | ||
fEtaMax = pgun_params.getParameter<double>("MaxEta"); |
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.
Since you are (also) cleaning, the same style could be used for all Min/Max parameters: here EtaMin
/ EtaMax
(and below also PhiMin
/ PhiMax
)
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.
Hi! I tried to change from MinEta
/MaxEta
to EtaMin
/EtaMax
, I modified also the _cfi.py
files, but when I try to test the workflow, I get
----- Begin Fatal Exception 28-Dec-2021 13:07:11 CET-----------------------
An exception of category 'Configuration' occurred while
[0] Constructing the EventProcessor
[1] Constructing module: class=CloseByParticleGunProducer label='generator'
Exception Message:
MissingParameter: Parameter 'MinEta' not found.
----- End Fatal Exception -------------------------------------------------
Same thing with Phi
.
Am I missing something?
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.
@waredjeb the message says that it looks from a "MinEta" parameter which is not able to find in the configuration. This makes me think that you did not modify in your patch the fillDescriptions method with the new parameter' names
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.
@perrotta The point is that there is not a fillDescription in the CloseByParticleGunProducer
, that's why I modified the cfi.py
manually
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.
Ah, ok. Then you did not modify the pgun_params.getParameter<double>("MinEta")
call in the .cc code (or you did it but you did not recompile before testing)
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.
I found the problem, I had to change the parameter name in IOMC/ParticleGuns/src/BaseFlatGunProducer.cc
as well.
@@ -25,9 +25,12 @@ CloseByParticleGunProducer::CloseByParticleGunProducer(const ParameterSet& pset) | |||
ParameterSet defpset; |
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 defpset
doesn't look to be used anywhere, and it can be removed
fEtaMax = pgun_params.getParameter<double>("MaxEta"); | ||
fEtaMin = pgun_params.getParameter<double>("MinEta"); | ||
fRMax = pgun_params.getParameter<double>("RMax"); | ||
fRMin = pgun_params.getParameter<double>("RMin"); |
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.
fEtaMax = pgun_params.getParameter<double>("MaxEta"); | |
fEtaMin = pgun_params.getParameter<double>("MinEta"); | |
fRMax = pgun_params.getParameter<double>("RMax"); | |
fRMin = pgun_params.getParameter<double>("RMin"); | |
if (fControlledByEta) { | |
fEtaMax = pgun_params.getParameter<double>("EtaMax"); | |
fEtaMin = pgun_params.getParameter<double>("EtaMin"); | |
if (fEtaMax <= fEtaMin) | |
LogError("CloseByParticleGunProducer") << " Please fix EtaMin and EtaMax values in the configuration"; | |
} else { | |
fRMax = pgun_params.getParameter<double>("RMax"); | |
fRMin = pgun_params.getParameter<double>("RMin"); | |
if (fRMax <= fRMin) | |
LogError("CloseByParticleGunProducer") << " Please fix RMin and RMax values in the configuration"; | |
} |
could avoid mistakes while configuring
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.
Please also remove the useless << endl
at the end of the two LogDebug
statements in this code
+code-checks Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-36554/27580
|
Pull request #36554 was updated. @SiewYan, @mkirsano, @Saptaparna, @cmsbuild, @GurpreetSinghChahal, @agrohsje, @alberto-sanchez can you please check and sign again. |
please test |
-1 Failed Tests: RelVals RelVals-INPUT RelVals
RelVals-INPUT
Expand to see more relval errors ... |
+1 Summary: https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-bd6456/21736/summary.html Comparison SummarySummary:
|
Since this PR is modifying the behaviour of the |
ping.... |
test parameters:
|
@cmsbuild please test |
+1 Summary: https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-bd6456/22049/summary.html Comparison Summary@slava77 comparisons for the following workflows were not done due to missing matrix map:
Summary:
|
The special workflow |
+1 @rovere , thank you for the test. I looked into the log file, its fine by me. |
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 |
ControlledByEta
flag isTrue
, eta is generated in the range[MinEta,MaxEta]
and R is computed from eta. Otherwise, the generation is controlled by R and R is sampled in the range[RMin, RMax]
PartID
should be taken randomly fromfPartIDs
, instead was sampled between [0,fPardIDs.size()
].