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
Clean up L1TTrackMatch producers [11_1_X] #30982
Conversation
A new Pull Request was created by @kpedro88 (Kevin Pedro) for CMSSW_11_1_X. It involves the following packages: L1Trigger/L1TTrackMatch @cmsbuild, @rekovic, @benkrikler, @kpedro88 can you please review it and eventually sign? Thanks. cms-bot commands are listed here
|
please test |
The tests are being triggered in jenkins.
|
+1 |
Comparison job queued. |
Comparison is ready Comparison Summary:
|
+upgrade |
@silviodonato if there will be another 11_1_X patch to include #30979, it would be good to include this one also |
int match_trk_idx = matches.at(imatch); | ||
if (match_trk_idx < 0) | ||
continue; // this muon was not matched to any candidate | ||
|
||
// take properties of the track | ||
const L1TTTrackType& matchTk = (*l1tksH.product())[match_trk_idx]; | ||
const auto& p3 = matchTk.momentum(); | ||
const auto& tkv3 = matchTk.POCA(); | ||
float p4e = sqrt(mu_mass * mu_mass + p3.mag2()); | ||
math::XYZTLorentzVector l1tkp4(p3.x(), p3.y(), p3.z(), p4e); | ||
|
||
edm::Ptr<L1TTTrackType> l1tkPtr(l1tksH, match_trk_idx); | ||
edm::Ref<RegionalMuonCandBxCollection> l1muRef(muonH, imatch); | ||
|
||
float trkisol = -999; | ||
TkMuon l1tkmu(l1tkp4, l1muRef, l1tkPtr, trkisol); | ||
l1tkmu.setTrackCurvature(matchTk.rInv()); | ||
l1tkmu.setTrkzVtx((float)tkv3.z()); | ||
l1tkmu.setMuonDetector(detector); | ||
tkMuons.push_back(l1tkmu); | ||
} | ||
return; | ||
} | ||
|
||
void L1TkMuonProducer::build_tkMuons_from_idxs(TkMuonCollection& tkMuons, | ||
const std::vector<int>& matches, | ||
const edm::Handle<L1TTTrackCollectionType>& l1tksH, | ||
int detector) const { | ||
for (uint imatch = 0; imatch < matches.size(); ++imatch) { | ||
int match_trk_idx = matches.at(imatch); |
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.
@kpedro88 could you comment about this deletion? Thanks
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.
There were two functions that only differed by one line. Since a default-constructed edm::Handle
is invalid, I unified the functions by checking if the corresponding argument is valid (a few lines below this). This reduces code duplication.
merge |
backport of #30970
This will make TDR production more efficient on multiple threads by eliminating stalls from legacy producers.