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

Update of mkFit for 12_1_0_pre2 #34921

Merged
merged 6 commits into from
Aug 25, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions Configuration/ProcessModifiers/python/trackingMkFit_cff.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@
trackingMkFitCommon,
trackingMkFitInitialStepPreSplitting,
trackingMkFitInitialStep,
trackingMkFitLowPtQuadStep,
# trackingMkFitLowPtQuadStep, # to be enabled later
trackingMkFitHighPtTripletStep,
trackingMkFitLowPtTripletStep,
# trackingMkFitLowPtTripletStep, # to be enabled later
trackingMkFitDetachedQuadStep,
# trackingMkFitDetachedTripletStep, # to be enabled later
# trackingMkFitPixelPairStep, # to be enabled later
# trackingMkFitMixedTripletStep, # to be enabled later
trackingMkFitPixelLessStep,
trackingMkFitTobTecStep,
# trackingMkFitPixelLessStep, # to be enabled later
# trackingMkFitTobTecStep, # to be enabled later
)
4 changes: 3 additions & 1 deletion RecoTracker/MkFit/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ $ runTheMatrix.py -l <workflow(s)> --apply 2 --command "--procModifiers tracking
* *maxCandsPerSeed:* maximum number of concurrent track candidates per given seed
* *maxHolesPerCand:* maximum number of allowed holes on a candidate
* *maxConsecHoles:* maximum number of allowed consecutive holes on a candidate
* *chi2Cut:* chi2 cut for accepting a new hit
* *chi2Cut_min:* minimum chi2 cut for accepting a new hit
* *chi2CutOverlap:* chi2 cut for accepting an overlap hit
* *pTCutOverlap:* pT cut below which the overlap hits are not picked up

Expand Down Expand Up @@ -81,3 +81,5 @@ $ runTheMatrix.py -l <workflow(s)> --apply 2 --command "--procModifiers tracking
* *c_dp_sf:* additional scaling factor for dphi cut
* *c_dq_[012]:* dr (endcap) / dz (barrel) selection window cut (= [0]*1/pT + [1]*std::fabs(theta-pi/2) + [2])
* *c_dq_sf:* additional scaling factor for dr (endcap) / dz (barrel) cut
* *c_c2_[012]:* chi2 cut for accepting new hit (= [0]*1/pT + [1]*std::fabs(theta-pi/2) + [2])
* *c_c2_sf:* additional scaling factor for chi2 cut
4 changes: 4 additions & 0 deletions RecoTracker/MkFit/plugins/BuildFile.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
<library file="*.cc" name="RecoTrackerMkFitPlugins">
<use name="CalibFormats/SiStripObjects"/>
<use name="CalibTracker/Records"/>
<use name="DataFormats/Common"/>
<use name="DataFormats/SiStripCluster"/>
<use name="DataFormats/SiStripCommon"/>
<use name="DataFormats/SiPixelCluster"/>
<use name="DataFormats/TrackCandidate"/>
<use name="DataFormats/TrackReco"/>
Expand All @@ -10,6 +13,7 @@
<use name="DataFormats/TrajectorySeed"/>
<use name="FWCore/Framework"/>
<use name="FWCore/ParameterSet"/>
<use name="Geometry/CommonTopologies"/>
<use name="Geometry/Records"/>
<use name="Geometry/TrackerGeometryBuilder"/>
<use name="RecoTracker/MkFit"/>
Expand Down
63 changes: 52 additions & 11 deletions RecoTracker/MkFit/plugins/MkFitEventOfHitsProducer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,22 @@
#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/SiStripCommon/interface/ConstantsForHardwareSystems.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"
Expand Down Expand Up @@ -66,7 +69,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);
}
Expand All @@ -85,14 +88,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 * sistrip::STRIPS_PER_APV));
auto const lastPoint = surf.toGlobal(topo.localPosition((last + 1) * sistrip::STRIPS_PER_APV));
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});
};

const int nApvs = topo.nstrips() / sistrip::STRIPS_PER_APV;
for (int apv = 0; apv < nApvs; ++apv) {
const bool isBad = bs.BadApvs & (1 << apv);
if (isBad) {
LogTrace("SiStripBadComponents") << "bad apv " << apv << " on " << bs.detid;
if (lastApv == -1) {
firstApv = apv;
lastApv = apv;
} else if (lastApv + 1 == apv)
lastApv++;

if (apv + 1 == nApvs)
addRangeAPV(firstApv, lastApv, deadvectors[ilay]);
} else if (firstApv != -1) {
addRangeAPV(firstApv, lastApv, deadvectors[ilay]);
//and reset
firstApv = -1;
lastApv = -1;
}
}
}
}
mkfit::StdSeq::LoadDeads(*eventOfHits, deadvectors);
}
Expand Down