Skip to content

Commit

Permalink
Cherry-pick #1
Browse files Browse the repository at this point in the history
  • Loading branch information
mmasciov committed Oct 29, 2021
1 parent a2cd98c commit 63e30ce
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 6 deletions.
6 changes: 2 additions & 4 deletions RecoTracker/MkFit/plugins/MkFitGeometryESProducer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,8 @@ void MkFitGeometryESProducer::fillDescriptions(edm::ConfigurationDescriptions& d
std::unique_ptr<MkFitGeometry> MkFitGeometryESProducer::produce(const TrackerRecoGeometryRecord& iRecord) {
auto trackerInfo = std::make_unique<mkfit::TrackerInfo>();
mkfit::createPhase1TrackerGeometry(*trackerInfo, false);
return std::make_unique<MkFitGeometry>(iRecord.get(geomToken_),
iRecord.get(trackerToken_),
iRecord.get(ttopoToken_),
std::move(trackerInfo));
return std::make_unique<MkFitGeometry>(
iRecord.get(geomToken_), iRecord.get(trackerToken_), iRecord.get(ttopoToken_), std::move(trackerInfo));
}

DEFINE_FWK_EVENTSETUP_MODULE(MkFitGeometryESProducer);
4 changes: 2 additions & 2 deletions RecoTracker/MkFit/plugins/MkFitOutputConverter.cc
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,7 @@ TrackCandidateCollection MkFitOutputConverter::convertCandidates(const MkFitOutp
CurvilinearTrajectoryError(cov));
if (!fts.curvilinearError().posDef()) {
edm::LogInfo("MkFitOutputConverter") << "Curvilinear error not pos-def\n"
<< fts.curvilinearError().matrix() << "\ncandidate ignored";
<< fts.curvilinearError().matrix() << "\ncandidate ignored";
continue;
}

Expand All @@ -299,7 +299,7 @@ TrackCandidateCollection MkFitOutputConverter::convertCandidates(const MkFitOutp
: backwardFit(fts, recHits, propagatorAlong, propagatorOpposite, hitCloner, lastHitInvalid, lastHitChanged);
if (!tsosDet.first.isValid()) {
edm::LogInfo("MkFitOutputConverter")
<< "Backward fit of candidate " << candIndex << " failed, ignoring the candidate";
<< "Backward fit of candidate " << candIndex << " failed, ignoring the candidate";
continue;
}

Expand Down
27 changes: 27 additions & 0 deletions Validation/RecoTrack/plugins/TrackingNtuple.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1203,6 +1203,13 @@ class TrackingNtuple : public edm::one::EDAnalyzer<edm::one::SharedResources> {
std::vector<float> see_stateTrajPx;
std::vector<float> see_stateTrajPy;
std::vector<float> see_stateTrajPz;
std::vector<float> see_stateTrajGlbX;
std::vector<float> see_stateTrajGlbY;
std::vector<float> see_stateTrajGlbZ;
std::vector<float> see_stateTrajGlbPx;
std::vector<float> see_stateTrajGlbPy;
std::vector<float> see_stateTrajGlbPz;
std::vector<std::vector<float>> see_stateCurvCov;
std::vector<int> see_q;
std::vector<unsigned int> see_nValid;
std::vector<unsigned int> see_nPixel;
Expand Down Expand Up @@ -2900,6 +2907,26 @@ void TrackingNtuple::fillSeeds(const edm::Event& iEvent,
see_stateTrajPy.push_back(mom.y());
see_stateTrajPz.push_back(mom.z());

///the following is useful for analysis in global coords at seed hit surface
TransientTrackingRecHit::RecHitPointer lastRecHit = theTTRHBuilder.build(&*(seed.recHits().end() - 1));
TrajectoryStateOnSurface tsos =
trajectoryStateTransform::transientState(seed.startingState(), lastRecHit->surface(), &theMF);
auto const& stateGlobal = tsos.globalParameters();
see_stateTrajGlbX.push_back(stateGlobal.position().x());
see_stateTrajGlbY.push_back(stateGlobal.position().y());
see_stateTrajGlbZ.push_back(stateGlobal.position().z());
see_stateTrajGlbPx.push_back(stateGlobal.momentum().x());
see_stateTrajGlbPy.push_back(stateGlobal.momentum().y());
see_stateTrajGlbPz.push_back(stateGlobal.momentum().z());
if (addSeedCurvCov_) {
auto const& stateCcov = tsos.curvilinearError().matrix();
std::vector<float> cov(15);
auto covP = cov.begin();
for (auto const val : stateCcov)
*(covP++) = val; //row-major
see_stateCurvCov.push_back(std::move(cov));
}

see_trkIdx.push_back(-1); // to be set correctly in fillTracks
if (includeTrackingParticles_) {
see_simTrkIdx.push_back(tpIdx);
Expand Down

0 comments on commit 63e30ce

Please sign in to comment.