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
Introduction of Lorentz Angle correction in Phase 2 CPE #16392
Introduction of Lorentz Angle correction in Phase 2 CPE #16392
Conversation
A new Pull Request was created by @lowette (Steven Lowette) for CMSSW_8_1_X. It involves the following packages: RecoLocalTracker/Phase2TrackerRecHits @cmsbuild, @cvuosalo, @slava77, @davidlange6 can you please review it and eventually sign? Thanks. cms-bot commands are listed here #13028 |
@@ -77,11 +77,11 @@ void Phase2TrackerRecHits::produce(edm::StreamID sid, edm::Event& event, const e | |||
// Container for the clusters that will be produced for this modules | |||
Phase2TrackerRecHit1DCollectionNew::FastFiller rechits(*outputRecHits, DSViter.detId()); | |||
|
|||
for (auto clustIt : DSViter) { | |||
ClusterParameterEstimator< Phase2TrackerCluster1D >::LocalValues lv = cpe->localParameters(clustIt, *geomDetUnit); | |||
for (edmNew::DetSet<Phase2TrackerCluster1D>::const_iterator clustIt = DSViter.begin(); clustIt != DSViter.end(); ++clustIt) { |
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.
was this change from auto and range loop really necessary?
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 not the cluster link wasn't stored properly, the Ref below would point to something random (and cause segfaults if accessed). Maybe there are better ways to do this, but the "auto clustIt" out of the box, with then "&clustIt" when making the Ref just doesn't work.
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.
Maybe the range loop should have const auto&
(i.e. reference instead of copy)?
(same comment for auto DSViter
on line 70 above)
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.
@lowette: How does this version of the code work? Doesn't DSViter
get a copy of each element of *clusters
? Then how does makeRefTo
in line 84 make sense of comparing the vector of Phase2TrackerCluster1D
in clusters
to the copy of that vector in DSViter
?
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.
It would seem safer to make line 70:
for (const auto &DSViter : *clusters) {
and line 80:
for (const auto &clustIt : DSViter) {
so there's no copying, and then &clustIt
would point back into clusters
, so the original versions of line 81 and 84 could be used.
In this case, the names of DSViter
and clustIt
should be changed, because neither of them are iterators. DSViter
could be called clusterDetSet
, and clustIt
could be called clusterRef
.
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.
Ok, this works, though clusterRef is maybe confusing too, since it is a concrete type (if I got it correctly; "auto" was introduced after I switched to <5% coding).
I hope there was some advantage of changing this, so that I (and you) did not waste time changing something that was working anyway.
@cmsbuild please test |
The tests are being triggered in jenkins. |
+1 The following merge commits were also included on top of IB + this PR after doing git cms-merge-topic: |
Comparison job queued. |
parameters = cms.PSet() | ||
parameters = cms.PSet( | ||
LorentzAngle_DB = cms.bool(False), | ||
TanLorentzAnglePerTesla = cms.double(0.07) |
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.
shouldn't it be 0.07 for pixel and 0.106 for strips ? it is at least how it is defined in the digitzer https://github.com/cms-sw/cmssw/blob/CMSSW_8_1_X/SimTracker/SiPhase2Digitizer/python/phase2TrackerDigitizer_cfi.py
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.
The pixel LA is 0.106 [https://github.com/cms-sw/cmssw/blob/CMSSW_8_1_X/SimTracker/SiPhase2Digitizer/python/phase2TrackerDigitizer_cfi.py#L43], while long pixel [https://github.com/cms-sw/cmssw/blob/CMSSW_8_1_X/SimTracker/SiPhase2Digitizer/python/phase2TrackerDigitizer_cfi.py#L79], strip in PS [https://github.com/cms-sw/cmssw/blob/CMSSW_8_1_X/SimTracker/SiPhase2Digitizer/python/phase2TrackerDigitizer_cfi.py#L115], and strips in 2S [https://github.com/cms-sw/cmssw/blob/CMSSW_8_1_X/SimTracker/SiPhase2Digitizer/python/phase2TrackerDigitizer_cfi.py#L151] are all 0.07.
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.
ok thanks , but then I see that here the Strip CPE is defined in this PR , what is the status/plans for Pixel CPE in PS ?
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.
ok maybe I'm confused and you are treating both cases (2S and PS ) modules here ? [I'm maybe fooled by names like Phase2StripCPE which could actually be phase2OTCPE ] ?
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, both P in PS, S in PS, and S in 2S are covered.
True, phase2OTCPE would be much better. Several of the file names in that package are not well chosen... If the powers that be prefer, this can of course be changed, but maybe now is not the best moment.
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, I agree with @lowette. Changing names can propagate problems in different part of the code. In this moment we have just one CPE for both with a name that is for sure nor descriptive either optimal, but I would suggest to change it when we will have both CPE for P and S separately..
return (100 + topo->tecRing(detid)); | ||
} else { | ||
return 999; | ||
} |
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 Remind me why we need this TID, TOB TIB etc.. structure in this phase2 file ?
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.
In Phase2, such as in Run2 and Phase1, the Pixel/StripSubdetectors name are still the same. In this moment, for Phase2 just 4 of them are used: PixelBarrel, PixelEndcap, TOB, TID.
@lowette Regarding specifically this part of the code, I would suggest to use just the function layer()
which should return the correct number of the layer/disk. You can check it out here. Actually I can also see that there are two functions that do exactly what you ask here, but I would strongly suggest to not use them. @boudoul do you know why they where added? @venturia, do you agree that the TrackerTopology
is not the class that they should be or it was maybe your suggestion? I might miss 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.
I agree that those methods in TrackerTopology can be source of confusion and pain in future. Whatever depends on the geometry has to be in TrackerGeometry and not in TrackerTopology.
I also agree that TrackerTopology::layer() has to be used in this case.
I also suggest to use the enumerators like StripSubdetector::TIB as less as possible. They do not contain anymore any information about the actual geometry of the subdetector: they are just integers from 1 to 6. They have to be used only to decide which TrackerTopology method has to be called (as it is correctly done in this case but it is not needed because of the generic layer() method). If you have to know what is the subdetector you should use the methods in TrackerGeometry here: https://github.com/cms-sw/cmssw/blob/CMSSW_8_1_X/Geometry/TrackerGeometryBuilder/interface/TrackerGeometry.h#L81
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 switch to use side() and layer() now.
Can you make a more sensitive title, something like introduction of Lorentz Angle correction in Phase2 CPE |
@ebrondol: Could you please provide some tracking validation results for this PR? |
Dear @cvuosalo , I put the different comparison between with the new CPE and old CPE here for ttbar and 4muons. I do not see any difference in the eff/fakerates plots as well as other distribution that I have checked. The only distribution that significantly changes is the chi2 distribution, where the behavior as a function of eta seems to be better as expected, while the new shape of the overall chi2 distribution is not completely clear to me. It seems now that the uncertainty are now overestimated. @delaere @lowette |
Pull request #16392 was updated. @cmsbuild, @cvuosalo, @slava77, @davidlange6 can you please check and sign again. |
…istinguish between pixel and strip sensors.
Pull request #16392 was updated. @cmsbuild, @cvuosalo, @slava77, @davidlange6 can you please check and sign again. |
Ok, I managed to find back my code changes and inserted them again. From my side I'm done. I hope things are fine again now. |
@cmsbuild please test |
The tests are being triggered in jenkins. |
+1 The following merge commits were also included on top of IB + this PR after doing git cms-merge-topic: |
Comparison job queued. |
Comparison is ready Alternative comparison was/were failed for workflow(s): |
Comparison job queued. |
Comparison is ready Alternative comparison was/were failed for workflow(s): |
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, @smuzaffar |
+1 |
This PR is made using @ebrondol 's developments in ebrondol:phase2_movingToCPEwithLA, with on top the inclusion in the Phase2 OT CPE of Lorentz Angle corrections.
Validation of the LA correction was shown in the Phase2 simulation meeting on 28 Oct.
Notifying also @delaere @boudoul