Skip to content
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

New sipm model 810preX #15058

Merged
merged 8 commits into from Jul 15, 2016
Merged

Conversation

pdudero
Copy link
Contributor

@pdudero pdudero commented Jun 29, 2016

No description provided.

@cmsbuild
Copy link
Contributor

A new Pull Request was created by @pdudero for CMSSW_8_1_X.

It involves the following packages:

CalibCalorimetry/HcalAlgos
CalibCalorimetry/HcalPlugins
SimCalorimetry/HcalSimAlgos
SimCalorimetry/HcalSimProducers
SimGeneral/MixingModule

@ghellwig, @civanch, @cerminar, @cmsbuild, @franzoni, @mdhildreth, @mmusich, @davidlange6 can you please review it and eventually sign? Thanks.
@ghellwig, @tocheng, @wmtan this is something you requested to watch as well.
@slava77, @Degano, @smuzaffar you are the release manager for this.

cms-bot commands are list here #13028

@civanch
Copy link
Contributor

civanch commented Jun 29, 2016

@pdudero , please, provide description.

@pdudero
Copy link
Contributor Author

pdudero commented Jun 29, 2016

This is updated Hcal SiPM simulation code for 81X.

On 6/29/2016 11:14 AM, Vladimir Ivantchenko wrote:

@pdudero https://github.com/pdudero , please, provide description.


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
#15058 (comment),
or mute the thread
https://github.com/notifications/unsubscribe/AExICDGqGU6aTwTNy8u1E4uEbFpdm7Vtks5qQpoCgaJpZM4JBThX.

@kpedro88
Copy link
Contributor

This PR updates the SiPM simulation. Changes:

The parameters selected for the simulation are based on test beam data, though they may need to be updated in the future. (Some of the parameters might also be moved into the database to be set on a per-channel basis, but this is still under discussion.)

Phil, can you post a plot of the noise distribution using the simulation as it is in this PR?

attn: @abdoulline, @bsunanda, @jmmans, @pastika

@kpedro88
Copy link
Contributor

@cmsbuild please test

@cmsbuild
Copy link
Contributor

cmsbuild commented Jun 29, 2016

The tests are being triggered in jenkins.
https://cmssdt.cern.ch/jenkins/job/ib-any-integration/13774/console

@cmsbuild
Copy link
Contributor

Comparison not run due to Build errors (RelVals and Igprof tests were also skipped)

@cmsbuild
Copy link
Contributor

-1

Tested at: 4260708

You can see the results of the tests here:
https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-15058/13774/summary.html

I found follow errors while testing this PR

Failed tests: Build ClangBuild

  • Build:

I found an error when building:

>> Compiling  /build/cmsbuild/jenkins-workarea/workspace/ib-any-integration/CMSSW_8_1_X_2016-06-28-2300/src/Utilities/StaticAnalyzers/src/EDMPluginDumper.cc 
>> Compiling  /build/cmsbuild/jenkins-workarea/workspace/ib-any-integration/CMSSW_8_1_X_2016-06-28-2300/src/Utilities/StaticAnalyzers/src/FiniteMathChecker.cc 
>> Compiling  /build/cmsbuild/jenkins-workarea/workspace/ib-any-integration/CMSSW_8_1_X_2016-06-28-2300/src/Utilities/StaticAnalyzers/src/UsingNamespace.cpp 
>> Compiling  /build/cmsbuild/jenkins-workarea/workspace/ib-any-integration/CMSSW_8_1_X_2016-06-28-2300/src/Utilities/StaticAnalyzers/src/FunctionDumper.cpp 
/build/cmsbuild/jenkins-workarea/workspace/ib-any-integration/CMSSW_8_1_X_2016-06-28-2300/src/CalibCalorimetry/HcalPlugins/src/HcalHardcodeCalibrations.cc: In constructor 'HcalHardcodeCalibrations::HcalHardcodeCalibrations(const edm::ParameterSet&)':
/build/cmsbuild/jenkins-workarea/workspace/ib-any-integration/CMSSW_8_1_X_2016-06-28-2300/src/CalibCalorimetry/HcalPlugins/src/HcalHardcodeCalibrations.cc:143:16: error: 'class HcalDbHardcode' has no member named 'setLumi'
     dbHardcode.setLumi(iLumi);
                ^
/build/cmsbuild/jenkins-workarea/workspace/ib-any-integration/CMSSW_8_1_X_2016-06-28-2300/src/CalibCalorimetry/HcalPlugins/src/HcalHardcodeCalibrations.cc:144:16: error: 'class HcalDbHardcode' has no member named 'setLumiOffset'
     dbHardcode.setLumiOffset(iConfig.getParameter("iLumiOffset"));
                ^

  • Clang:

I found a compilation error while trying to compile with clang:
I used this command:
scram b vclean && scram build -k -j 16 USER_CXXFLAGS='-fsyntax-only' COMPILER='llvm compile'

>> Compiling edm plugin /build/cmsbuild/jenkins-workarea/workspace/ib-any-integration/CMSSW_8_1_X_2016-06-28-2300/src/SimCalorimetry/HcalSimAlgos/test/HcalDigitizerTest.cc 
>> Compiling  /build/cmsbuild/jenkins-workarea/workspace/ib-any-integration/CMSSW_8_1_X_2016-06-28-2300/src/SimCalorimetry/HcalSimAlgos/test/HcalTimeSlewTest.cpp 
>> Compiling  /build/cmsbuild/jenkins-workarea/workspace/ib-any-integration/CMSSW_8_1_X_2016-06-28-2300/src/SimCalorimetry/HcalSimAlgos/test/HcalShapeIntegratorTest.cpp 
1 warning generated.
>> Compiling  /build/cmsbuild/jenkins-workarea/workspace/ib-any-integration/CMSSW_8_1_X_2016-06-28-2300/src/SimCalorimetry/HcalSimAlgos/test/HPDIonFeedbackTest.cpp 
/build/cmsbuild/jenkins-workarea/workspace/ib-any-integration/CMSSW_8_1_X_2016-06-28-2300/src/CalibCalorimetry/HcalPlugins/src/HcalHardcodeCalibrations.cc:143:16: error: no member named 'setLumi' in 'HcalDbHardcode'
    dbHardcode.setLumi(iLumi);
    ~~~~~~~~~~ ^
/build/cmsbuild/jenkins-workarea/workspace/ib-any-integration/CMSSW_8_1_X_2016-06-28-2300/src/CalibCalorimetry/HcalPlugins/src/HcalHardcodeCalibrations.cc:144:16: error: no member named 'setLumiOffset' in 'HcalDbHardcode'
    dbHardcode.setLumiOffset(iConfig.getParameter("iLumiOffset"));
    ~~~~~~~~~~ ^


@kpedro88
Copy link
Contributor

@pdudero needs some more cleanup in HcalHardcodeCalibrations...

@cmsbuild
Copy link
Contributor

Pull request #15058 was updated. @ghellwig, @civanch, @cerminar, @cmsbuild, @franzoni, @mdhildreth, @mmusich, @davidlange6 can you please check and sign again.

@kpedro88
Copy link
Contributor

@cmsbuild please test

@cmsbuild
Copy link
Contributor

cmsbuild commented Jun 29, 2016

The tests are being triggered in jenkins.
https://cmssdt.cern.ch/jenkins/job/ib-any-integration/13778/console

@cmsbuild
Copy link
Contributor

cmsbuild commented Jul 1, 2016

@cmsbuild
Copy link
Contributor

cmsbuild commented Jul 1, 2016

Comparison is ready
https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-15058/13853/summary.html

The workflows 140.53, 4.22 have different files in step1_dasquery.log than the ones found in the baseline. You may want to check and retrigger the tests if necessary. You can check it in the "files" directory in the results of the comparisons

@civanch
Copy link
Contributor

civanch commented Jul 3, 2016

@pdudero , there are few places where math fuctions intensively used: HcalSiPM::Borel, HcalSiPMHitResponse::Y11TimeResponse.

It seems that if you substitute exp(x)_pow(t,y) by exp(x + log(t)_y) the code will be faster. Also if the code inside HcalDbHadrcode.cc is used very frequently I would replace computational of exp, log of integer agruments by a lookup table (one solution exist within Geant4 but here the library cannot depend on it, however, similar utility class may be provided for CMSSW).

@kpedro88
Copy link
Contributor

kpedro88 commented Jul 3, 2016

@civanch

The results of HcalSiPM::Borel() are cached in a hash table to reduce the number of computations:
https://github.com/pdudero/cmssw/blob/d84254eb3e77295c102aded6badde0cc91dbe1fa/SimCalorimetry/HcalSimAlgos/src/HcalSiPM.cc#L74
but the change you suggest could still be useful. @pdudero, can you implement this and make sure it gives the same result? (And also in the HcalSiPMHitRespones::Y11TimePDF() function, though it should be noted we haven't actually changed this function.)

I don't see any use of exp or log in HcalDbHardcode or HcalHardcodeCalibrations...

@pdudero
Copy link
Contributor Author

pdudero commented Jul 4, 2016

@civanch, @kpedro88,
Is log really that much faster than pow? Regardless, I am not inclined to change HcalSiPM::Borel for the following reasons:

  1. As Kevin pointed out, the hash table is cached.
  2. You will note that exp(X)*pow(t,Y) = (exp(X + log(t)Y) is used for values (n-k)>=100.
  3. Values below 100 (which are the most commonly used, for channels with only noise) use the precise, canonical formulation for the Borel distribution and ALL are calculated once upon initialization, which is when the crosstalk parameter is set; see
    https://github.com/pdudero/cmssw/blob/newSiPMmodel810preX/SimCalorimetry/HcalSimAlgos/src/HcalSiPM.cc#L154-L157

@civanch
Copy link
Contributor

civanch commented Jul 5, 2016

@pdudero, concerning pow - I would guess it is equivalent exp+log, this seeseems not an issue now. Concerning pointers - have you use following signature:
std::unique_ptr uptr(new my class);
uptr.get()->my method();

@kpedro88
Copy link
Contributor

kpedro88 commented Jul 6, 2016

@civanch as far as I can tell, the only pointer used anywhere in this PR is CLHEP::HepRandomEngine* engine, and that is clearly not managed by any of this code. Did you have any specific places where code should be changed?

@civanch
Copy link
Contributor

civanch commented Jul 6, 2016

+1
after recent PR updates I cannot find out the place any more..

@kpedro88
Copy link
Contributor

kpedro88 commented Jul 6, 2016

@mmusich can you take a quick look? In your domain, just some minor changes in HcalHardcode stuff

@abdoulline
Copy link

@mmusich
Marco, after all the issues fixed and corrections made, I believe this PR deserves to be approved to help us to prepare a realistic MC for 2017.

@mmusich
Copy link
Contributor

mmusich commented Jul 7, 2016

+1

@cmsbuild
Copy link
Contributor

cmsbuild commented Jul 7, 2016

This pull request is fully signed and it will be integrated in one of the next CMSSW_8_1_X IBs (tests are also fine). This pull request requires discussion in the ORP meeting before it's merged. @slava77, @davidlange6, @Degano, @smuzaffar

@bsunanda
Copy link
Contributor

bsunanda commented Jul 7, 2016

@davidlange6 David could you integrate this at your earliest convenience so that we can start validating 2017 simulation chain?

if (logb >= -20) { // protect against underflow
b=(dk/dn);
if ((n-k)<100)
b *= (exp(-ldn)*pow(ldn,dnk))/TMath::Factorial(n-k);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@pdudero what is a typical value of dunk? (Eg most often 2-3 or much larger?

@pdudero
Copy link
Contributor Author

pdudero commented Jul 14, 2016

@davidlange6 , I could talk about the MPV of the distribution, but I suspect that's not what you're asking. In terms of how the function is used, it isn't very useful to ask the question. The function is used to calculate lookup tables of the CDFs, the lowest 100 of them at initialization, and the rest on the fly. So for a given "n", "k" is scanned over a range determined by an epsilon cutoff. Then a value is chosen out of the table by throwing a trial from a flat random distribution over the CDF.

@davidlange6
Copy link
Contributor

+1
ok - that answers my question...thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

8 participants