Skip to content
Closed
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
29 changes: 29 additions & 0 deletions RecoTracker/MkFit/plugins/MkFitHitConverter.cc
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@
#include "RecoTracker/MkFit/interface/MkFitGeometry.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"

// ROOT
#include "Math/SVector.h"
#include "Math/SMatrix.h"
Expand Down Expand Up @@ -76,6 +80,8 @@ class MkFitHitConverter : public edm::global::EDProducer<> {
edm::ESGetToken<MkFitGeometry, TrackerRecoGeometryRecord> mkFitGeomToken_;
edm::EDPutTokenT<MkFitHitWrapper> wrapperPutToken_;
edm::EDPutTokenT<MkFitClusterIndexToHit> clusterIndexPutToken_;
edm::ESGetToken<SiStripQuality, SiStripQualityRcd> qualityToken_;
edm::ESGetToken<TrackerGeometry, TrackerDigiGeometryRecord> geomToken_;
const float minGoodStripCharge_;
};

Expand All @@ -91,6 +97,8 @@ MkFitHitConverter::MkFitHitConverter(edm::ParameterSet const& iConfig)
mkFitGeomToken_{esConsumes<MkFitGeometry, TrackerRecoGeometryRecord>()},
wrapperPutToken_{produces<MkFitHitWrapper>()},
clusterIndexPutToken_{produces<MkFitClusterIndexToHit>()},
qualityToken_{esConsumes()},
geomToken_{esConsumes()},
minGoodStripCharge_{static_cast<float>(
iConfig.getParameter<edm::ParameterSet>("minGoodStripCharge").getParameter<double>("value"))} {}

Expand Down Expand Up @@ -118,6 +126,27 @@ void MkFitHitConverter::produce(edm::StreamID iID, edm::Event& iEvent, const edm
MkFitHitWrapper hitWrapper{mkFitGeom.trackerInfo()};
mkfit::StdSeq::Cmssw_LoadHits_Begin(hitWrapper.eventOfHits(), {&hitWrapper.pixelHits(), &hitWrapper.outerHits()});

std::vector<mkfit::DeadVec> deadvectors(mkFitGeom.layerNumberConverter().nLayers());
const auto& siStripQuality = iSetup.getData(qualityToken_);
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 subdet = detid.subdetId();
const auto layer = ttopo.layer(detid);
const auto isStereo = ttopo.isStereo(detid);
bool isBarrel = (ttopo.side(detid) == static_cast<unsigned>(TrackerDetSide::Barrel));
bool isPlusSide = (ttopo.side(detid) == static_cast<unsigned>(TrackerDetSide::PosEndcap));
const auto ilay = mkFitGeom.layerNumberConverter().convertLayerNumber(subdet, layer, false, isStereo, isPlusSide);
//dump content of deadmodules.h in standalone setup
// std::cout << "deadvectors["<<ilay<<"].push_back({"<<surf.phiSpan().first<<","<<surf.phiSpan().second<<","
// <<(isBarrel ? surf.zSpan().first : surf.rSpan().first)<<","<<(isBarrel ? surf.zSpan().second : surf.rSpan().second)<<"});"<<std::endl;
deadvectors[ilay].push_back({surf.phiSpan().first,surf.phiSpan().second,
(isBarrel ? surf.zSpan().first : surf.rSpan().first),(isBarrel ? surf.zSpan().second : surf.rSpan().second)});
}
mkfit::StdSeq::LoadDeads(hitWrapper.eventOfHits(), deadvectors);
Copy link
Collaborator

Choose a reason for hiding this comment

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

I suppose this code would go in MkFitEventOfHitsProducer in trackreco/cmssw:mkFitIntegration.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

to be honest, I did not realize the branch I was using diverged from the main PR to central CMSSW. I am open to discuss what the best way to proceed is.

Copy link
Collaborator

Choose a reason for hiding this comment

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

I don't actually have strong opinions between this PR or #20 going in first. The changes are simple-enough to fix in #20.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Following the merge of #20 this PR should be rebased (or re-worked in MkFitEventOfHitsProducer.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I can re-work it MkFitEventOfHitsProducer. What is the correct branch to use for development and for the PR?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I have reworked the changes in MkFitEventOfHitsProducer:
CMSSW_11_2_0_mkFit_X...cerati:dead-modules-MkFitEventOfHitsProducer
I can close this PR and open a new one, please let me know. (However, looks like RecoTracker/MkFit/test/reco_cfg.py is currently broken, I am checking what is going on -- it complains about "No module named mkFitHitConverterDefault_cfi" maybe this is related to #20?)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

(was mkFitHitConverterDefault_cfi automatically created by RecoTracker/MkFit/plugins/MkFitHitConverter.cc? which has been removed in #20?)

Copy link
Collaborator

Choose a reason for hiding this comment

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

Certainly related to #20, I'll fix that, thanks. You can either force-push into your current dead-modules branch or create a new PR, whichever works.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Certainly related to #20, I'll fix that, thanks

Fixed in #25 (merged already).

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

closing this PR, see #26


MkFitClusterIndexToHit clusterIndexToHit;

auto convert = [&](auto& hits, auto& mkFitHits, auto& clusterIndexToHit, auto& clusterCharge) {
Expand Down