-
Notifications
You must be signed in to change notification settings - Fork 4.6k
Update of mkFit for 12_1_0_pre2 #34921
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
Changes from 5 commits
c9dd8e6
8d21af8
fbbdad2
2b3e7b3
30567c1
91d1caf
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -4,19 +4,21 @@ | |||||||||||||||
| #include "FWCore/Framework/interface/MakerMacros.h" | ||||||||||||||||
| #include "FWCore/ParameterSet/interface/ParameterSet.h" | ||||||||||||||||
|
|
||||||||||||||||
| #include "CalibFormats/SiStripObjects/interface/SiStripQuality.h" | ||||||||||||||||
| #include "CalibTracker/Records/interface/SiStripQualityRcd.h" | ||||||||||||||||
|
|
||||||||||||||||
| #include "DataFormats/TrackerCommon/interface/TrackerDetSide.h" | ||||||||||||||||
| #include "DataFormats/TrackingRecHit/interface/TrackingRecHit.h" | ||||||||||||||||
|
|
||||||||||||||||
| #include "Geometry/CommonTopologies/interface/StripTopology.h" | ||||||||||||||||
| #include "Geometry/TrackerGeometryBuilder/interface/TrackerGeometry.h" | ||||||||||||||||
|
|
||||||||||||||||
| #include "RecoTracker/MkFit/interface/MkFitClusterIndexToHit.h" | ||||||||||||||||
| #include "RecoTracker/MkFit/interface/MkFitEventOfHits.h" | ||||||||||||||||
| #include "RecoTracker/MkFit/interface/MkFitGeometry.h" | ||||||||||||||||
| #include "RecoTracker/MkFit/interface/MkFitHitWrapper.h" | ||||||||||||||||
| #include "RecoTracker/Record/interface/TrackerRecoGeometryRecord.h" | ||||||||||||||||
|
|
||||||||||||||||
| #include "CalibFormats/SiStripObjects/interface/SiStripQuality.h" | ||||||||||||||||
| #include "CalibTracker/Records/interface/SiStripQualityRcd.h" | ||||||||||||||||
| #include "Geometry/TrackerGeometryBuilder/interface/TrackerGeometry.h" | ||||||||||||||||
| #include "DataFormats/TrackerCommon/interface/TrackerDetSide.h" | ||||||||||||||||
|
|
||||||||||||||||
| // mkFit includes | ||||||||||||||||
| #include "mkFit/HitStructures.h" | ||||||||||||||||
| #include "mkFit/MkStdSeqs.h" | ||||||||||||||||
|
|
@@ -66,7 +68,7 @@ void MkFitEventOfHitsProducer::fillDescriptions(edm::ConfigurationDescriptions& | |||||||||||||||
|
|
||||||||||||||||
| desc.add("pixelHits", edm::InputTag{"mkFitSiPixelHits"}); | ||||||||||||||||
| desc.add("stripHits", edm::InputTag{"mkFitSiStripHits"}); | ||||||||||||||||
| desc.add("useStripStripQualityDB", false)->setComment("Use SiStrip quality DB information"); | ||||||||||||||||
| desc.add("useStripStripQualityDB", true)->setComment("Use SiStrip quality DB information"); | ||||||||||||||||
|
|
||||||||||||||||
| descriptions.addWithDefaultLabel(desc); | ||||||||||||||||
| } | ||||||||||||||||
|
|
@@ -85,14 +87,52 @@ void MkFitEventOfHitsProducer::produce(edm::StreamID iID, edm::Event& iEvent, co | |||||||||||||||
| const auto& trackerGeom = iSetup.getData(geomToken_); | ||||||||||||||||
| const auto& badStrips = siStripQuality.getBadComponentList(); | ||||||||||||||||
| for (const auto& bs : badStrips) { | ||||||||||||||||
| const auto& surf = trackerGeom.idToDet(DetId(bs.detid))->surface(); | ||||||||||||||||
| const DetId detid(bs.detid); | ||||||||||||||||
| const auto& surf = trackerGeom.idToDet(detid)->surface(); | ||||||||||||||||
| bool isBarrel = (mkFitGeom.topology()->side(detid) == static_cast<unsigned>(TrackerDetSide::Barrel)); | ||||||||||||||||
| const auto ilay = mkFitGeom.mkFitLayerNumber(detid); | ||||||||||||||||
| deadvectors[ilay].push_back({surf.phiSpan().first, | ||||||||||||||||
| surf.phiSpan().second, | ||||||||||||||||
| (isBarrel ? surf.zSpan().first : surf.rSpan().first), | ||||||||||||||||
| (isBarrel ? surf.zSpan().second : surf.rSpan().second)}); | ||||||||||||||||
| const auto q1 = isBarrel ? surf.zSpan().first : surf.rSpan().first; | ||||||||||||||||
| const auto q2 = isBarrel ? surf.zSpan().second : surf.rSpan().second; | ||||||||||||||||
| if (bs.BadModule) | ||||||||||||||||
| deadvectors[ilay].push_back({surf.phiSpan().first, surf.phiSpan().second, q1, q2}); | ||||||||||||||||
| else { //assume that BadApvs are filled in sync with BadFibers | ||||||||||||||||
| auto const& topo = dynamic_cast<const StripTopology&>(trackerGeom.idToDet(detid)->topology()); | ||||||||||||||||
| int firstApv = -1; | ||||||||||||||||
| int lastApv = -1; | ||||||||||||||||
|
|
||||||||||||||||
| auto addRangeAPV = [&topo, &surf, &q1, &q2](int first, int last, mkfit::DeadVec& dv) { | ||||||||||||||||
| auto const firstPoint = surf.toGlobal(topo.localPosition(first * 128)); | ||||||||||||||||
| auto const lastPoint = surf.toGlobal(topo.localPosition((last + 1) * 128)); | ||||||||||||||||
| float phi1 = firstPoint.phi(); | ||||||||||||||||
| float phi2 = lastPoint.phi(); | ||||||||||||||||
| if (reco::deltaPhi(phi1, phi2) > 0) | ||||||||||||||||
| std::swap(phi1, phi2); | ||||||||||||||||
| LogTrace("SiStripBadComponents") | ||||||||||||||||
| << "insert bad range " << first << " to " << last << " " << phi1 << " " << phi2; | ||||||||||||||||
| dv.push_back({phi1, phi2, q1, q2}); | ||||||||||||||||
| }; | ||||||||||||||||
|
|
||||||||||||||||
| for (int apv = 0; apv < 6; ++apv) { | ||||||||||||||||
| const bool isBad = bs.BadApvs & (1 << apv); | ||||||||||||||||
| if (isBad) | ||||||||||||||||
| LogTrace("SiStripBadComponents") << "bad apv " << apv << " on " << bs.detid; | ||||||||||||||||
| if (isBad) { | ||||||||||||||||
| if (lastApv == -1) { | ||||||||||||||||
|
||||||||||||||||
| if (isBad) | |
| LogTrace("SiStripBadComponents") << "bad apv " << apv << " on " << bs.detid; | |
| if (isBad) { | |
| if (lastApv == -1) { | |
| if (isBad) { | |
| LogTrace("SiStripBadComponents") << "bad apv " << apv << " on " << bs.detid; | |
| if (lastApv == -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.
yes, the suggestion is OK, I was moving these lines a few too many times.
LogTrace does not have additional header/footer message formatting and is easier to parse than LogDebug.
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.
Updated in commit 91d1caf
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.
might the apv max number be a 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.
@pieterdavid @mmusich
do we have max APVs and n strips per APV formalized in common constants somewhere?
I tried to git grep, but all that I found was hardcoded 6 and 128.
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.
what about modules with less than 6 APVs?
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.
they are (at least) in this file: https://github.com/cms-sw/cmssw/blob/master/CalibTracker/SiStripCommon/data/SiStripDetInfo.dat.
Or you can do something like:
128 is univeral for all modules, I am not sure there's a constant somewhere.
Uh oh!
There was an error while loading. Please reload this page.
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 constants are also here (but they aren't used much in the strips code): https://github.com/cms-sw/cmssw/blob/master/DataFormats/SiStripCommon/interface/ConstantsForHardwareSystems.h#L38-L43 (6 as max number of APVs indirectly, as 2 per optical link * max 3 of these per module - it may be worth adding)
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 shouldn't matter here, if the
BadApvsis filled correctly.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.
Updated in commit 91d1caf