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
SiPM nonlinearity, parameters from CondDB, update tau, cleanup #16315
Conversation
A new Pull Request was created by @kpedro88 (Kevin Pedro) for CMSSW_8_1_X. It involves the following packages: CalibCalorimetry/HcalAlgos @ghellwig, @civanch, @cvuosalo, @mdhildreth, @cmsbuild, @franzoni, @cerminar, @slava77, @ggovi, @mmusich, @davidlange6 can you please review it and eventually sign? Thanks. cms-bot commands are listed here #13028 |
@cmsbuild please test |
The tests are being triggered in jenkins. |
Comparison job queued. |
@smuzaffar this PR is having the issue where comparisons still say running even though the bot reports they're available, can you take a look? |
@kpedro88 if appropriate calibration payloads should be in GT for testing this PR, the autoGT change should be a part of this PR |
@kpedro88 please provide some basic plots of performance. |
@mariadalfonso is working on tests of the M2 performance. We can update autocond in this PR once the new records are inserted (@abdoulline is working on it), but this might conflict with #16301. |
I've responded via e-mail, but I don't see the message arrived there in PR thread, and the same (absence of comment sent via e-mail) happened yesterday with my rather long comment in another PR thread (#16150 RPD implementation) So I'm copy-pasting: "The appropriate tag HcalSiPMCharacteristics_2017_v5.0_mc has been submitted. Alas... now we need to bug Marco @mmusich again..." |
+1 |
@slava77 @mmusich @ggovi @davidlange6 this PR is important for pre16, and other PRs need to come on top of it |
@slava77 @mmusich @ggovi @davidlange6 I am obliged to keep nagging about this PR for pre16 |
Look so like it's had a fairly active and productive review during usual (and recent) working days.... |
It did have a productive review and now needs signatures. #16365 is needed for phase2 and conflicts with this, so needs at least a day to be rebased/tested/signed after this is merged. We also expect another PR to add ZS thresholds (still being finalized). Each PR does not exist in a vacuum, and if the Nov 1 deadline for pre16 is going to be enforced, there remains a lot of work to do. |
On 10/30/16 10:44 AM, Kevin Pedro wrote:
As usual, any basic validation plots for the full dynamic range are I'm hoping to get to this in time for pre16.
|
Well, the change since the last round was only in the SiPMParameters tag to remove dark current in HO. No HO plots show up in https://cmssdt.cern.ch/SDT/jenkins-artifacts/baseLineComparisons/CMSSW_8_1_X_2016-10-28-1100+16315/16651/validateJR/all_OldVSNew_TTbar13TeV2017wf10024p0/, which indicates the change was successful. (If we don't trust the code that identifies plots with differences to be shown in the comparison, that is a problem that should be addressed.) The HBHE plots there show minor differences compatible with the change in the sim-level saturation/recovery parameter and corresponding nonlinearity correction introduced in reco. |
On 10/30/16 11:02 AM, Kevin Pedro wrote:
Where can I see clearly that the last GT update
|
Right but complaining that updates made Friday late are not reviewed on Sunday sounds like the wrong expectation (even if Slava is indeed working) Cheers On 30 Oct 2016, at 18:53, Kevin Pedro <notifications@github.commailto:notifications@github.com> wrote: It did have a productive review and now needs signatures. #16365#16365 is needed for phase2 and conflicts with this, so needs at least a day to be rebased/tested/signed after this is merged. We also expect another PR to add ZS thresholds (still being finalized). Each PR does not exist in a vacuum, and if the Nov 1 deadline for pre16 is going to be enforced, there remains a lot of work to do. — |
https://cms-conddb.cern.ch/cmsDbBrowser/diff/Prod/gts/81X_upgrade2017_realistic_v20/81X_upgrade2017_realistic_v21 shows that only HcalSiPMParameters was changed. Using the config dumpHcalCond_test_cfg.py, I dumped I don't like working on weekends either, but I don't decide the deadlines, I just have to live with them. |
+1 |
+1
based on dijet 15 to 3 TeV sample (wf 1338 equivalent) in 2017 setup |
thanks! @ggovi the DB change is just adding |
int HcalSiPMnonlinearity::getPixelsFired(int inpes) const | ||
{ | ||
ROOT::Math::Polynomial p(a2,b1,c0,-inpes); | ||
std::vector<double> roots = p.FindRealRoots(); |
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.
calling gsl directly would likely be better in the long term (seems this function is not yet used)
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.
Yes, right now this is just left in place for future studies.
The ROOT functions do a fair amount of useful processing (it's not just a direct clone of gsl), so I would prefer to leave it this way.
@@ -164,7 +174,15 @@ void HcalSiPM::setTemperatureDependence(double dTemp) { | |||
|
|||
double HcalSiPM::cellCharge(double deltaTime) const { | |||
if (deltaTime <= 0.) return 0.; | |||
if (deltaTime > 10./theTauInv) return 1.; | |||
double result(1. - std::exp(-deltaTime*theTauInv)); | |||
if (deltaTime > 10.*theTau) return 1.; |
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 this is a performance issue, then
if (deltaTime_theTauInv > 10. ) return 1.;
double result(1. - std::exp(-deltaTime_theTauInv));
would be best
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 was just trying to avoid multiple inversions of the tau parameter. I will run igprof to check if there is a performance penalty.
onePulse(t,A2,sigma2_shape,theta2_loc,m2_scale); | ||
double HcalSiPMShape::analyticPulseShape(double t, unsigned int signalShape) const { | ||
if(signalShape==HcalShapes::ZECOTEK || signalShape==HcalShapes::HAMAMATSU){ | ||
double A1(0.08757), c1(-0.5257), t01(2.4013), s1(0.6721); |
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 document the source of these magic numbers
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.
Well, these were never documented to begin with... I just restored the HO pulse shape from earlier versions: https://github.com/cms-sw/cmssw/blob/CMSSW_8_1_0_pre8/SimCalorimetry/HcalSimAlgos/src/HcalSiPMShape.cc
I can add a note like "HO SiPM pulse shape fit from Jake Anderson ca. 2013".
@kpedro88 -three small comments that can be considered on one of the promised follow-on prs. thanks |
almost none of the ROOT overhead is actually taken advantage of in this usage. but yes, it saves you a handful of lines (at a substantial cost of operational overhead) - of course it may or may not matter depending on how this function gets used
|
right, you need my change to go back to one inversion…
|
This PR supersedes #16070 (which should be closed). One of the issues under discussion for that PR, HO SiPM parameters in the database, has already been resolved. To recap: in #15058, when the new features were added to the SiPM simulation for HE, we propagated the same parameter values to HO (but only for Run 1). There was then a bit of confusion when transferring those parameters to the database. Upon reflection, we decided these new features should be avoided for HO entirely, since they have not been tuned for it. This resets the Run 1 HO sim back to how it was before 810pre9, and the Run 2 HO sim should be unchanged now that the database conditions are fixed.
After several weeks of internal discussions, a few decisions were made about the nonlinearity implementation. The SiPM simulation already includes nonlinearity using a saturation/recovery model for pixels with recovery time constant tau. Therefore, it would be redundant to include the saturation/recovery model and apply the inverted nonlinearity correction (derived from bench data) in the simulation. For now, we have decided to stick with the saturation/recovery model. However, the code to invert the nonlinearity correction is left in place, in case of future studies.
This implies a few things:
SimCalorimetry/HcalSimAlgos/test/sipmnonlinearityanalyzer_cfg.py
.@mariadalfonso is checking the effect of the nonlinearity correction on M2 performance (hopefully it should provide some improvement at high energy).
In addition, I checked off a few other items on my todo list for the SiPM code:
5) remove
iConfig.exists()
fromHcalSimParameters
(recall this contributed to the bug/digression fixed in #15834).6) Restore the use of
doSiPMSmearing
for HO (only for 2017 and beyond, leaving the old versions as they were) with the old pulse shape (suitable for HO SiPMs). This required addingHcalMCParams
toHcalDbService
to get access to the pulse shape number on a per-channel basis.7) Remove some unused fragments in the SiPM code that had been lying around.
Note: there may be a separate PR in the near future updating some SiPM parameters, as we have been notified that the TB data used to measure the parameters was taken at V-VB = 4.4 V, while the SiPMs installed in HE will be operated at V-VB = 3 V. However, some data still needs to be analyzed for this, and it should be totally orthogonal to this PR.
The other item still coming is ZS thresholds for HE (from @lihux25), but these of course depend on any parameter changes.
@civanch, @slava77: I would appreciate a rapid review of this PR if possible. I know it has a long description, but most of the new changes are rather minor. (Also, the majority of added lines are in the new standalone tool to measure the simulated nonlinearity.)