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: 10 additions & 1 deletion PWGDQ/TableProducer/tableMaker.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -1120,6 +1120,7 @@ struct TableMaker {
for (const auto& muonId : fwdtrackIndices) { // start loop over tracks
auto muon = muonId.template fwdtrack_as<TMuons>();
trackFilteringTag = static_cast<uint64_t>(0);
int realignRemoveFlag = 0;
if constexpr (static_cast<bool>(TMuonRealignFillMap)) {
// Update muon information using realigned tracks
if (static_cast<int>(muon.trackType()) > 2) {
Expand All @@ -1128,6 +1129,7 @@ struct TableMaker {
if (muonRealignSelected.size() == 1) {
for (const auto& muonRealign : muonRealignSelected) {
VarManager::FillTrack<TMuonRealignFillMap>(muonRealign);
realignRemoveFlag = muonRealign.isRemovable();
}
} else {
LOGF(fatal, "Inconsistent size of realigned muon track candidates.");
Expand All @@ -1151,7 +1153,7 @@ struct TableMaker {
trackTempFilterMap |= (uint8_t(1) << i);
}

if (!trackTempFilterMap) { // does not pass the cuts
if (!trackTempFilterMap || realignRemoveFlag) { // does not pass the cuts
nDel++;
} else { // it passes the cuts and will be saved in the tables
newEntryNb[muon.index()] = muon.index() - nDel;
Expand All @@ -1174,11 +1176,13 @@ struct TableMaker {
if (static_cast<int>(muon.trackType()) > 2) {
// Update only MCH or MCH-MID tracks with realigned information
auto muonRealignSelected = tracksMuonRealign.sliceBy(fwdtrackRealignPerMuon, muonId.fwdtrackId());
int realignRemoveFlag = 0;
if (muonRealignSelected.size() == 1) {
for (const auto& muonRealign : muonRealignSelected) {
LOGF(debug, "Muon original - collisionId:%d x:%g y:%g z:%g phi:%g tgl:%g signed1pt:%g pt:%g p:%g eta:%g chi2:%g", muon.collisionId(), muon.x(), muon.y(), muon.z(), muon.phi(), muon.tgl(), muon.signed1Pt(), muon.pt(), muon.p(), muon.eta(), muon.chi2());
LOGF(debug, "Muon realigned - collisionId:%d x:%g y:%g z:%g phi:%g tgl:%g signed1pt:%g pt:%g p:%g eta:%g chi2:%g", muonRealign.collisionId(), muonRealign.x(), muonRealign.y(), muonRealign.z(), muonRealign.phi(), muonRealign.tgl(), muonRealign.signed1Pt(), muonRealign.pt(), muonRealign.p(), muonRealign.eta(), muonRealign.chi2());
VarManager::FillTrack<TMuonRealignFillMap>(muonRealign);
realignRemoveFlag = muonRealign.isRemovable();

// recalculte pDca for global muon tracks
VarManager::FillTrackCollision<TMuonRealignFillMap>(muonRealign, collision);
Expand All @@ -1187,6 +1191,11 @@ struct TableMaker {
VarManager::FillPropagateMuon<TMuonRealignFillMap>(muonRealign, collision);
}
}

if (realignRemoveFlag) {
continue;
}

} else {
LOGF(fatal, "Inconsistent size of realigned muon track candidates.");
}
Expand Down
18 changes: 16 additions & 2 deletions PWGDQ/TableProducer/tableMaker_withAssoc.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ struct TableMaker {
o2::parameters::GRPObject* fGrpMagRun2 = nullptr; // for run 2, we access the GRPObject from GLO/GRP/GRP
o2::parameters::GRPMagField* fGrpMag = nullptr; // for run 3, we access GRPMagField from GLO/Config/GRPMagField

AnalysisCompositeCut* fEventCut; //! Event selection cut
AnalysisCompositeCut* fEventCut; //! Event selection cut
std::vector<AnalysisCompositeCut*> fTrackCuts; //! Barrel track cuts
std::vector<AnalysisCompositeCut*> fMuonCuts; //! Muon track cuts

Expand Down Expand Up @@ -400,7 +400,7 @@ struct TableMaker {
}
}

DefineHistograms(histClasses); // define all histograms
DefineHistograms(histClasses); // define all histograms
// Additional histogram via the JSON configurable
TString addHistsStr = fConfigHistOutput.fConfigAddJSONHistograms.value;
if (fConfigHistOutput.fConfigQA && addHistsStr != "") {
Expand Down Expand Up @@ -1160,17 +1160,24 @@ struct TableMaker {
if (static_cast<int>(muon.trackType()) > 2) {
// refill kinematic info and recalculate propagation in case of using realigned muons
auto muonRealignSelected = muonsRealign.sliceBy(fwdtrackRealignPerMuon, assoc.fwdtrackId());
int realignRemoveFlag = 0;
if (muonRealignSelected.size() == 1) {
for (const auto& muonRealign : muonRealignSelected) {
// refill muon information with realigned tracks
VarManager::FillTrack<TMuonRealignFillMap>(muonRealign);
realignRemoveFlag = muonRealign.isRemovable();

if (fConfigVariousOptions.fPropMuon) {
VarManager::FillPropagateMuon<TMuonRealignFillMap>(muonRealign, collision);
}

VarManager::FillTrackCollision<TMuonRealignFillMap>(muonRealign, collision);
}

if (realignRemoveFlag) {
continue;
}

} else {
LOGF(fatal, "Inconsistent size of realigned muon track candidates.");
}
Expand Down Expand Up @@ -1260,17 +1267,24 @@ struct TableMaker {
if (static_cast<int>(muon.trackType()) > 2) {
// refill kinematic info and recalculate propagation in case of using realigned muons
auto muonRealignSelected = muonsRealign.sliceBy(fwdtrackRealignPerMuon, muon.globalIndex());
int realignRemoveFlag = 0;
if (muonRealignSelected.size() == 1) {
for (const auto& muonRealign : muonRealignSelected) {
// refill muon information with realigned tracks
VarManager::FillTrack<TMuonRealignFillMap>(muonRealign);
realignRemoveFlag = muonRealign.isRemovable();

if (fConfigVariousOptions.fPropMuon) {
VarManager::FillPropagateMuon<TMuonRealignFillMap>(muonRealign, collision);
}

VarManager::FillTrackCollision<TMuonRealignFillMap>(muonRealign, collision);
}

if (realignRemoveFlag) {
continue;
}

} else {
LOGF(fatal, "Inconsistent size of realigned muon track candidates.");
}
Expand Down