-
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
BTL simulation: OOT effects #28433
BTL simulation: OOT effects #28433
Conversation
…f photon tails from earlier OOT hits
The code-checks are being triggered in jenkins. |
+code-checks Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-28433/12836
|
A new Pull Request was created by @casarsa (Massimo Casarsa) for master. It involves the following packages: DataFormats/FTLDigi @cmsbuild, @civanch, @kpedro88, @mdhildreth can you please review it and eventually sign? Thanks. cms-bot commands are listed here |
please test |
The tests are being triggered in jenkins. |
Comparison job queued. |
The changes themselves look fine. Did you check the impact on the pileup library disk size? |
Comparison is ready Comparison Summary:
|
double tL = std::get<2>(hitRef) + LightCollSlopeL_ * distL; | ||
|
||
// --- Accumulate in 15 buckets of 25ns (9 pre-samples, 1 in-time, 5 post-samples) | ||
const int iBXR = std::floor(tR / bxTime_) + 9; |
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.
magic number 9 should be named constant
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've introduced a named constant
if ((simHitIt->second).hit_info[1][0] == 0 || tR < (simHitIt->second).hit_info[1][0]) | ||
(simHitIt->second).hit_info[1][0] = tR; | ||
// --- Right side | ||
if (iBXR > 0 && iBXR < 15) { |
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.
magic number 15 should be named constant
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've replaced 15 with a named constant
if (smearTimeForOOTtails_) { | ||
float rate_oot = 0.; | ||
// Loop on earlier OOT hits | ||
for (unsigned int ibx = 0; ibx < 9; ++ibx) { |
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.
magic number 9
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.
9 has been replaced with a named constant
for (unsigned int ibx = 0; ibx < 9; ++ibx) { | ||
if ((it->second).hit_info[2 * iside][ibx] > 0.) { | ||
float npe_oot = CLHEP::RandPoissonQ::shoot(hre, (it->second).hit_info[2 * iside][ibx]); | ||
rate_oot += npe_oot * exp((it->second).hit_info[1 + 2 * iside][ibx] / ScintillatorDecayTime_) / |
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 slightly speed up the math here by storing ScintillatorDecayTimeInv_ = 1./ScintillatorDecayTime_
once and then multiplying by ScintillatorDecayTimeInv_
(rather than dividing, which is slower)
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.
Done
@@ -84,14 +84,16 @@ void BTLTileDeviceSim::getHitsResponse(const std::vector<std::tuple<int, uint32_ | |||
if (smearLightCollTime_ > 0.) | |||
toa += CLHEP::RandGaussQ::shoot(hre, 0., smearLightCollTime_); | |||
|
|||
if (toa > bxTime_ || toa < 0) //just consider BX==0 | |||
// Accumulate in 15 buckets of 25ns (9 pre-samples, 1 in-time, 5 post-samples) | |||
const int iBX = std::floor(toa / bxTime_) + 9; |
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.
magic number 9
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.
Introduced named constant.
if (toa > bxTime_ || toa < 0) //just consider BX==0 | ||
// Accumulate in 15 buckets of 25ns (9 pre-samples, 1 in-time, 5 post-samples) | ||
const int iBX = std::floor(toa / bxTime_) + 9; | ||
if (iBX < 0 || iBX > 14) |
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.
magic number 14 = 15 - 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.
Rewritten with a named constant
Comparison is ready @slava77 comparisons for the following workflows were not done due to missing matrix map:
Comparison Summary:
|
@makortel The estimate on 100 TTbar PU200 events with 11_0_X_2019-11-18-2300 w/o this PR is consistent with what you got: |
@pmeridian @parbol comments about this update? If we want it for the HLT TDR it should enter now. |
Is it possible to tune the size of the premixed library? Without MTD and without truth information, the size was previously estimated at 12.7 MB/evt (source). This change from 1 MB to 3 MB for MTD amounts to a ~15% increase in the overall library size, which is substantial. |
@casarsa Thanks! Increasing the compressed event size on disk from 1.1 MB to 3 MB is probably fine now. The total now is 45 MB, dominated by MC truth whose inclusion should become unnecessary. At that point the 3 MB/event could become something to be optimized (to compare, in 10_4_0_mtd5 HGCal consumed 8.5 MB/event (to be optimized as well), and tracker 2.8 MB/event. Run2 premixing at PU50 is 3.2 MB/event). Ok, I see @kpedro88 already asked about reducing the size. |
+upgrade |
@civanch any further comment? |
+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. @davidlange6, @slava77, @smuzaffar, @fabiocos (and backports should be raised in the release meeting by the corresponding L2) |
+1 |
@fabiocos indeed, that should be fine because phase 2 premix libraries have not been centrally generated yet |
@kpedro88 moving to a completely new release should be fine as well in my view, at the end of the day it is not a final data format but an intermediate technical one, to be discussed at least. Anyway I am afraid we have an issue with this PR and premix, as it is again crashing in the IB, I am making a cross check. |
PR description:
This PR modifies the BTL digitization to include the effects on time resolution due to the photon tails of earlier OOT hits in the same crystal. It implements the model proposed by A. Ledovskoy (slides). (@pmeridian @parbol )
The size of MTDSimHitData had to be increased in order for the information of previous BXs
for both bar sides to be available in the BTLElectronicSim. The premixing configuration has been updated accordingly. (@makortel )
PR validation:
The new code has been tested in CMSSW_11_0_X_2019-11-18-2300 with the TTbar WF 22234 (PU200):
step 2:
MemoryReport> Peak virtual size 6280.26 Mbytes
Key events increasing vsize:
[0] run: 0 lumi: 0 event: 0 vsize = 0 deltaVsize = 0 rss = 0 delta = 0
[1] run: 1 lumi: 1 event: 1 vsize = 4296.21 deltaVsize = 0 rss = 3077.83 delta = 0
[3] run: 1 lumi: 1 event: 3 vsize = 5128.21 deltaVsize = 832 rss = 3166.95 delta = 89.1211
[88] run: 1 lumi: 1 event: 88 vsize = 6280.26 deltaVsize = 640 rss = 3146.59 delta = -20.3594
[12] run: 1 lumi: 1 event: 12 vsize = 5640.25 deltaVsize = 512.008 rss = 3204.43 delta = 37.4727
[90] run: 1 lumi: 1 event: 90 vsize = 6280.26 deltaVsize = 0 rss = 3078.7 delta = -67.8984
[89] run: 1 lumi: 1 event: 89 vsize = 6280.26 deltaVsize = 0 rss = 3203.86 delta = 57.2656
[88] run: 1 lumi: 1 event: 88 vsize = 6280.26 deltaVsize = 640 rss = 3146.59 delta = -34.625
TimeReport> Time report complete in 10911.9 seconds
Time Summary:
Event Throughput: 0.00918923 ev/s
CPU Summary:
step 3
MemoryReport> Peak virtual size 10161.6 Mbytes
Key events increasing vsize:
[8] run: 1 lumi: 1 event: 8 vsize = 9139.4 deltaVsize = 32.0586 rss = 6650.14 delta = 89.9492
[3] run: 1 lumi: 1 event: 3 vsize = 9107.34 deltaVsize = 900.121 rss = 6560.19 delta = 155.914
[42] run: 1 lumi: 1 event: 42 vsize = 10161.6 deltaVsize = 1022.13 rss = 6870.45 delta = 310.262
[0] run: 0 lumi: 0 event: 0 vsize = 0 deltaVsize = 0 rss = 0 delta = 0
[0] run: 0 lumi: 0 event: 0 vsize = 0 deltaVsize = 0 rss = 0 delta = 0
[44] run: 1 lumi: 1 event: 44 vsize = 10161.6 deltaVsize = 0 rss = 6714.96 delta = -155.488
[43] run: 1 lumi: 1 event: 43 vsize = 10161.6 deltaVsize = 0 rss = 6831.04 delta = -39.4141
[42] run: 1 lumi: 1 event: 42 vsize = 10161.6 deltaVsize = 1022.13 rss = 6870.45 delta = 68.0742
TimeReport> Time report complete in 24287.1 seconds
Time Summary:
Event Throughput: 0.00414284 ev/s
CPU Summary: