Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 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
26 changes: 25 additions & 1 deletion PhysicsTools/PatAlgos/plugins/PATLostTracks.cc
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
#include "FWCore/ParameterSet/interface/ParameterSet.h"
#include "CommonTools/Utils/interface/StringCutObjectSelector.h"

#include "TLorentzVector.h"

namespace {
bool passesQuality(const reco::Track& trk, const std::vector<reco::TrackBase::TrackQuality>& allowedQuals) {
for (const auto& qual : allowedQuals) {
Expand Down Expand Up @@ -68,6 +70,8 @@ namespace pat {
const double maxDxyForNotReconstructedPrimary_;
const double maxDxySigForNotReconstructedPrimary_;
const bool useLegacySetup_;
const bool xiSelection_;
const double xiMassCut_;
};
} // namespace pat

Expand Down Expand Up @@ -100,7 +104,9 @@ pat::PATLostTracks::PATLostTracks(const edm::ParameterSet& iConfig)
.getParameter<double>("maxDxyForNotReconstructedPrimary")),
maxDxySigForNotReconstructedPrimary_(iConfig.getParameter<edm::ParameterSet>("pvAssignment")
.getParameter<double>("maxDxySigForNotReconstructedPrimary")),
useLegacySetup_(iConfig.getParameter<bool>("useLegacySetup")) {
useLegacySetup_(iConfig.getParameter<bool>("useLegacySetup")),
xiSelection_(iConfig.getParameter<double>("xiSelection")),
xiMassCut_(iConfig.getParameter<double>("xiMassCut")) {
std::vector<std::string> trkQuals(iConfig.getParameter<std::vector<std::string>>("qualsToAutoAccept"));
std::transform(
trkQuals.begin(), trkQuals.end(), std::back_inserter(qualsToAutoAccept_), reco::TrackBase::qualityByName);
Expand Down Expand Up @@ -190,10 +196,28 @@ void pat::PATLostTracks::produce(edm::StreamID, edm::Event& iEvent, const edm::E
}
}
for (const auto& v0 : *lambdas) {
double protonCharge = 0;
for (size_t dIdx = 0; dIdx < v0.numberOfDaughters(); dIdx++) {
size_t key = (dynamic_cast<const reco::RecoChargedCandidate*>(v0.daughter(dIdx)))->track().key();
if (trkStatus[key] == TrkStatus::NOTUSED)
trkStatus[key] = TrkStatus::VTX;
protonCharge += v0.daughter(dIdx)->charge() * v0.daughter(dIdx)->momentum().mag2();
}
if (xiSelection_) {
// selecting potential Xi- -> Lambda pi candidates
TLorentzVector p4Lambda;
Copy link
Contributor

Choose a reason for hiding this comment

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

please switch to a math:: Lorentz vector. Given the cost of computing eta and phi for tracks, I think that math::XYZTLorentzVector is more appropriate.

p4Lambda.SetPtEtaPhiM(v0.pt(), v0.eta(), v0.phi(), v0.mass());
for (unsigned int trkIndx = 0; trkIndx < tracks->size(); trkIndx++) {
reco::TrackRef trk(tracks, trkIndx);
if ((*trk).charge() * protonCharge < 0)
continue;
TLorentzVector p4pi;
p4pi.SetPtEtaPhiM((*trk).pt(), (*trk).eta(), (*trk).phi(), 0.13957061);
if ((p4Lambda + p4pi).M() < xiMassCut_) { // selecting potential Xi- candidates
if (trkStatus[trkIndx] == TrkStatus::NOTUSED)
trkStatus[trkIndx] = TrkStatus::VTX;
}
}
}
}
std::vector<int> mapping(tracks->size(), -1);
Expand Down
4 changes: 3 additions & 1 deletion PhysicsTools/PatAlgos/python/slimming/lostTracks_cfi.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,9 @@
minPtToStoreLowQualityProps = cms.double(0.0),
passThroughCut = cms.string("pt>2"),
pvAssignment = primaryVertexAssociation.assignment,
useLegacySetup = cms.bool(False) #When True: check only if track used to fit vertex[0] and do not store track detailed info for Pt between 0.5 and minPtToStoreProps GeV
useLegacySetup = cms.bool(False), #When True: check only if track used to fit vertex[0] and do not store track detailed info for Pt between 0.5 and minPtToStoreProps GeV
xiSelection = cms.bool(True),
xiMassCut = cms.bool(1.5)
)
from Configuration.Eras.Modifier_phase1Pixel_cff import phase1Pixel
phase1Pixel.toModify(lostTracks, covarianceVersion =1 )
Expand Down