Skip to content
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
11 changes: 5 additions & 6 deletions PWGDQ/Core/MuonMatchingMlResponse.h
Original file line number Diff line number Diff line change
Expand Up @@ -263,8 +263,8 @@ class MlResponseMFTMuonMatch : public MlResponse<TypeOutputScore>
return inputFeature;
}

template <typename T1, typename T2, typename T3, typename C1, typename U>
float returnFeatureGlob(uint8_t idx, T1 const& muonglob, T2 const& muon, T3 const& mft, C1 const& mftcov, U const& collision)
template <typename T1, typename T2, typename T3, typename U>
float returnFeatureGlob(uint8_t idx, T1 const& muonglob, T2 const& muon, T3 const& mft, U const& collision)
{
float inputFeature = 0.;
switch (idx) {
Expand All @@ -285,7 +285,6 @@ class MlResponseMFTMuonMatch : public MlResponse<TypeOutputScore>
CHECK_AND_FILL_MUONGLOB_TRACK(Rabs, rAtAbsorberEnd);
// Below are dummy files to remove warning of unused parameters
CHECK_AND_FILL_MFTMUON_COLLISION(posZ);
CHECK_AND_FILL_MFT_COV(cXXMFT, cXX);
}
return inputFeature;
}
Expand Down Expand Up @@ -325,12 +324,12 @@ class MlResponseMFTMuonMatch : public MlResponse<TypeOutputScore>
return inputFeatures;
}

template <typename T1, typename T2, typename T3, typename C1, typename U>
std::vector<float> getInputFeaturesGlob(T1 const& muonglob, T2 const& muon, T3 const& mft, C1 const& mftcov, U const& collision)
template <typename T1, typename T2, typename T3, typename U>
std::vector<float> getInputFeaturesGlob(T1 const& muonglob, T2 const& muon, T3 const& mft, U const& collision)
{
std::vector<float> inputFeatures;
for (const auto& idx : MlResponse<TypeOutputScore>::mCachedIndices) {
float inputFeature = returnFeatureGlob(idx, muonglob, muon, mft, mftcov, collision);
float inputFeature = returnFeatureGlob(idx, muonglob, muon, mft, collision);
inputFeatures.emplace_back(inputFeature);
}
return inputFeatures;
Expand Down
10 changes: 7 additions & 3 deletions PWGDQ/TableProducer/tableMakerMC_withAssoc.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
#include "TList.h"

#include <cstdint>
#include <iostream>

Check failure on line 56 in PWGDQ/TableProducer/tableMakerMC_withAssoc.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[include-iostream]

Do not include iostream. Use O2 logging instead.
#include <map>
#include <memory>
#include <string>
Expand Down Expand Up @@ -122,7 +122,7 @@
void PrintBitMap(TMap map, int nbits)
{
for (int i = 0; i < nbits; i++) {
cout << ((map & (TMap(1) << i)) > 0 ? "1" : "0");

Check failure on line 125 in PWGDQ/TableProducer/tableMakerMC_withAssoc.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[logging]

Use O2 logging (LOG, LOGF, LOGP).
}
}

Expand Down Expand Up @@ -506,17 +506,17 @@
/*if ((std::abs(mctrack.pdgCode())>400 && std::abs(mctrack.pdgCode())<599) ||
(std::abs(mctrack.pdgCode())>4000 && std::abs(mctrack.pdgCode())<5999) ||
(mcflags > 0)) {
cout << ">>>>>>>>>>>>>>>>>>>>>>> track idx / pdg / process / status code / HEPMC status / primary : "

Check failure on line 509 in PWGDQ/TableProducer/tableMakerMC_withAssoc.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[logging]

Use O2 logging (LOG, LOGF, LOGP).
<< mctrack.globalIndex() << " / " << mctrack.pdgCode() << " / "
<< mctrack.getProcess() << " / " << mctrack.getGenStatusCode() << " / " << mctrack.getHepMCStatusCode() << " / " << mctrack.isPhysicalPrimary() << endl;
cout << ">>>>>>>>>>>>>>>>>>>>>>> track bitmap: ";

Check failure on line 512 in PWGDQ/TableProducer/tableMakerMC_withAssoc.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[logging]

Use O2 logging (LOG, LOGF, LOGP).
PrintBitMap(mcflags, 16);
cout << endl;

Check failure on line 514 in PWGDQ/TableProducer/tableMakerMC_withAssoc.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[logging]

Use O2 logging (LOG, LOGF, LOGP).
if (mctrack.has_mothers()) {
for (auto& m : mctrack.mothersIds()) {
if (m < mcTracks.size()) { // protect against bad mother indices
auto aMother = mcTracks.rawIteratorAt(m);
cout << "<<<<<< mother idx / pdg: " << m << " / " << aMother.pdgCode() << endl;

Check failure on line 519 in PWGDQ/TableProducer/tableMakerMC_withAssoc.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[logging]

Use O2 logging (LOG, LOGF, LOGP).
}
}
}
Expand All @@ -526,7 +526,7 @@

if (d < mcTracks.size()) { // protect against bad daughter indices
auto aDaughter = mcTracks.rawIteratorAt(d);
cout << "<<<<<< daughter idx / pdg: " << d << " / " << aDaughter.pdgCode() << endl;

Check failure on line 529 in PWGDQ/TableProducer/tableMakerMC_withAssoc.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[logging]

Use O2 logging (LOG, LOGF, LOGP).
}
}
}
Expand Down Expand Up @@ -939,12 +939,16 @@
if (static_cast<int>(muon.trackType()) < 2) {
auto muonID = muon.matchMCHTrackId();
auto muontrack = muon.template matchMCHTrack_as<TMuons>();
auto muonprop = VarManager::PropagateMuon(muontrack, collision, VarManager::kToMatching);
auto mfttrack = muon.template matchMFTTrack_as<TMFTTracks>();
auto const& mfttrackcov = mfCovs.rawIteratorAt(map_mfttrackcovs[mfttrack.globalIndex()]);
o2::track::TrackParCovFwd mftprop = VarManager::PropagateFwd(mfttrack, mfttrackcov, VarManager::GetMatchingPlane());
o2::track::TrackParCovFwd mftprop = VarManager::FwdToTrackPar(mfttrack, mfttrackcov);
o2::dataformats::GlobalFwdTrack muonprop = VarManager::FwdToTrackPar(muontrack, muontrack);
if (fConfigVariousOptions.fzMatching.value < 0.) {
mftprop = VarManager::PropagateFwd(mfttrack, mfttrackcov, fConfigVariousOptions.fzMatching.value);
muonprop = VarManager::PropagateMuon(muontrack, collision, VarManager::kToMatching);
}
std::vector<float> output;
std::vector<float> inputML = matchingMlResponse.getInputFeaturesGlob(muon, muonprop, mftprop, mfttrackcov, collision);
std::vector<float> inputML = matchingMlResponse.getInputFeaturesGlob(muon, muonprop, mftprop, collision);
matchingMlResponse.isSelectedMl(inputML, 0, output);
float score = output[0];
if (mCandidates.find(muonID) == mCandidates.end()) {
Expand Down Expand Up @@ -1311,8 +1315,8 @@
mothers.push_back(fLabelsMap.find(m)->second);
}
} else {
cout << "Mother label (" << m << ") exceeds the McParticles size (" << mcParticles.size() << ")" << endl;

Check failure on line 1318 in PWGDQ/TableProducer/tableMakerMC_withAssoc.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[logging]

Use O2 logging (LOG, LOGF, LOGP).
cout << " Check the MC generator" << endl;

Check failure on line 1319 in PWGDQ/TableProducer/tableMakerMC_withAssoc.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[logging]

Use O2 logging (LOG, LOGF, LOGP).
}
}
}
Expand Down Expand Up @@ -1358,7 +1362,7 @@
void DefineHistograms(TString histClasses)
{
std::unique_ptr<TObjArray> objArray(histClasses.Tokenize(";"));
for (Int_t iclass = 0; iclass < objArray->GetEntries(); ++iclass) {

Check failure on line 1365 in PWGDQ/TableProducer/tableMakerMC_withAssoc.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[root/entity]

Replace ROOT entities with equivalents from standard C++ or from O2.
TString classStr = objArray->At(iclass)->GetName();
if (fConfigHistOutput.fConfigQA) {
fHistMan->AddHistClass(classStr.Data());
Expand Down
10 changes: 7 additions & 3 deletions PWGDQ/TableProducer/tableMaker_withAssoc.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -1193,12 +1193,16 @@ struct TableMaker {
if (static_cast<int>(muon.trackType()) < 2) {
auto muonID = muon.matchMCHTrackId();
auto muontrack = muon.template matchMCHTrack_as<TMuons>();
auto muonprop = VarManager::PropagateMuon(muontrack, collision, VarManager::kToMatching);
auto mfttrack = muon.template matchMFTTrack_as<TMFTTracks>();
auto const& mfttrackcov = mfCovs.rawIteratorAt(map_mfttrackcovs[mfttrack.globalIndex()]);
o2::track::TrackParCovFwd mftprop = VarManager::PropagateFwd(mfttrack, mfttrackcov, VarManager::GetMatchingPlane());
o2::track::TrackParCovFwd mftprop = VarManager::FwdToTrackPar(mfttrack, mfttrackcov);
o2::dataformats::GlobalFwdTrack muonprop = VarManager::FwdToTrackPar(muontrack, muontrack);
if (fConfigVariousOptions.fzMatching.value < 0.) {
mftprop = VarManager::PropagateFwd(mfttrack, mfttrackcov, fConfigVariousOptions.fzMatching.value);
muonprop = VarManager::PropagateMuon(muontrack, collision, VarManager::kToMatching);
}
std::vector<float> output;
std::vector<float> inputML = matchingMlResponse.getInputFeaturesGlob(muon, muonprop, mftprop, mfttrackcov, collision);
std::vector<float> inputML = matchingMlResponse.getInputFeaturesGlob(muon, muonprop, mftprop, collision);
matchingMlResponse.isSelectedMl(inputML, 0, output);
float score = output[0];
if (mCandidates.find(muonID) == mCandidates.end()) {
Expand Down
Loading