From 7b68acc502be1e1fc43ee28a2baa645d0fef308b Mon Sep 17 00:00:00 2001 From: Paul Date: Fri, 8 Jul 2022 16:27:26 +0200 Subject: [PATCH 1/2] Some reworks --- EventFiltering/PWGUD/DGHelpers.h | 24 +++++-- EventFiltering/PWGUD/diffractionFilter.cxx | 21 +++--- PWGUD/Core/UDHelperFunctions.h | 58 +++++++++++++++ PWGUD/DataModel/DGCandidates.h | 4 +- PWGUD/TableProducer/DGCandProducer.cxx | 15 +--- PWGUD/Tasks/DGCandAnalyzer.cxx | 5 ++ PWGUD/Tasks/diffMCQA.cxx | 83 ++++++++++------------ PWGUD/Tasks/diffQA.cxx | 52 ++++++-------- 8 files changed, 156 insertions(+), 106 deletions(-) create mode 100644 PWGUD/Core/UDHelperFunctions.h diff --git a/EventFiltering/PWGUD/DGHelpers.h b/EventFiltering/PWGUD/DGHelpers.h index 3ce16d5f575..79b6cf6eb0b 100644 --- a/EventFiltering/PWGUD/DGHelpers.h +++ b/EventFiltering/PWGUD/DGHelpers.h @@ -103,6 +103,7 @@ struct DGSelector { // no global tracks which are not vtx tracks // no vtx tracks which are not global tracks + auto rgtrwTOF = 0.; for (auto& track : tracks) { if (track.isGlobalTrack() && !track.isPVContributor()) { return 3; @@ -110,11 +111,22 @@ struct DGSelector { if (diffCuts.globalTracksOnly() && !track.isGlobalTrack() && track.isPVContributor()) { return 4; } + + // update fraction of PV tracks with TOF hit + if (track.isPVContributor() && track.hasTOF()) { + rgtrwTOF += 1.; + } + } + if (collision.numContrib() > 0) { + rgtrwTOF /= collision.numContrib(); + } + if (rgtrwTOF < diffCuts.minRgtrwTOF()) { + return 5; } // number of vertex tracks if (collision.numContrib() < diffCuts.minNTracks() || collision.numContrib() > diffCuts.maxNTracks()) { - return 5; + return 6; } // PID, pt, and eta of tracks, invariant mass, and net charge @@ -135,18 +147,18 @@ struct DGSelector { // PID if (!hasGoodPID(diffCuts, track)) { - return 6; + return 7; } // pt lvtmp.SetXYZM(track.px(), track.py(), track.pz(), mass2Use); if (lvtmp.Perp() < diffCuts.minPt() || lvtmp.Perp() > diffCuts.maxPt()) { - return 7; + return 8; } // eta if (lvtmp.Eta() < diffCuts.minEta() || lvtmp.Eta() > diffCuts.maxEta()) { - return 8; + return 9; } netCharge += track.sign(); ivm += lvtmp; @@ -155,11 +167,11 @@ struct DGSelector { // net charge if (netCharge < diffCuts.minNetCharge() || netCharge > diffCuts.maxNetCharge()) { - return 9; + return 10; } // invariant mass if (ivm.M() < diffCuts.minIVM() || ivm.M() > diffCuts.maxIVM()) { - return 10; + return 11; } // if we arrive here then the event is good! diff --git a/EventFiltering/PWGUD/diffractionFilter.cxx b/EventFiltering/PWGUD/diffractionFilter.cxx index 1a4783ec046..78f05155a2f 100644 --- a/EventFiltering/PWGUD/diffractionFilter.cxx +++ b/EventFiltering/PWGUD/diffractionFilter.cxx @@ -84,20 +84,21 @@ struct DGFilterRun3 { // 4: number of FwdTracks > 0 // 5: not all global tracks are vtx tracks // 6: not all vtx tracks are global tracks - // 7: number of vtx tracks out of range - // 8: has not good PID information - // 9: track pt out of range - // 10: track eta out of range - // 11: net charge out of range - // 12: IVM out of range + // 7: fraction of tracks with TOF hit too low + // 8: number of vtx tracks out of range + // 9: has not good PID information + // 10: track pt out of range + // 11: track eta out of range + // 12: net charge out of range + // 13: IVM out of range static constexpr std::string_view histNames[4] = {"aftercut2pi", "aftercut4pi", "aftercut2K", "aftercut4K"}; HistogramRegistry registry{ "registry", { - {histNames[0].data(), "#aftercut2pi", {HistType::kTH1F, {{12, -0.5, 11.5}}}}, - {histNames[1].data(), "#aftercut4pi", {HistType::kTH1F, {{12, -0.5, 11.5}}}}, - {histNames[2].data(), "#aftercut2K", {HistType::kTH1F, {{12, -0.5, 11.5}}}}, - {histNames[3].data(), "#aftercut4K", {HistType::kTH1F, {{12, -0.5, 11.5}}}}, + {histNames[0].data(), "#aftercut2pi", {HistType::kTH1F, {{13, -0.5, 12.5}}}}, + {histNames[1].data(), "#aftercut4pi", {HistType::kTH1F, {{13, -0.5, 12.5}}}}, + {histNames[2].data(), "#aftercut2K", {HistType::kTH1F, {{13, -0.5, 12.5}}}}, + {histNames[3].data(), "#aftercut4K", {HistType::kTH1F, {{13, -0.5, 12.5}}}}, }}; void init(InitContext&) diff --git a/PWGUD/Core/UDHelperFunctions.h b/PWGUD/Core/UDHelperFunctions.h new file mode 100644 index 00000000000..0807d900ce9 --- /dev/null +++ b/PWGUD/Core/UDHelperFunctions.h @@ -0,0 +1,58 @@ +// Copyright 2019-2020 CERN and copyright holders of ALICE O2. +// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders. +// All rights not expressly granted are reserved. +// +// This software is distributed under the terms of the GNU General Public +// License v3 (GPL Version 3), copied verbatim in the file "COPYING". +// +// In applying this license CERN does not waive the privileges and immunities +// granted to it by virtue of its status as an Intergovernmental Organization +// or submit itself to any jurisdiction. +/// +/// \brief +/// \author Paul Buehler, paul.buehler@oeaw.ac.at +/// \since 01.10.2021 + +#ifndef O2_ANALYSISUDHEPLER_H_ +#define O2_ANALYSISUDHEPLER_H_ + +#include "Framework/Logger.h" +#include "CommonConstants/LHCConstants.h" +#include "Common/DataModel/EventSelection.h" + +using namespace o2; +using namespace o2::framework; + +// ............................................................................. +// return net charge of PV tracks +template +int8_t netCharge(TCs tracks) +{ + int8_t nch = 0; + for (auto track : tracks) { + if (track.isPVContributor()) { + nch += track.sign(); + } + } + return nch; +} + +// ............................................................................. +// return fraction of PV tracks with a TOF hit +template +float rPVtrwTOF(TCs tracks, int nPVTracks) +{ + float rpvrwTOF = 0.; + for (auto& track : tracks) { + if (track.isPVContributor() && track.hasTOF()) { + rpvrwTOF += 1.; + } + } + if (nPVTracks > 0) { + rpvrwTOF /= nPVTracks; + } + return rpvrwTOF; +} + +// ----------------------------------------------------------------------------- +#endif // O2_ANALYSISUDHEPLER_H_ diff --git a/PWGUD/DataModel/DGCandidates.h b/PWGUD/DataModel/DGCandidates.h index fbe437d1d00..5c35ceb495c 100644 --- a/PWGUD/DataModel/DGCandidates.h +++ b/PWGUD/DataModel/DGCandidates.h @@ -23,11 +23,13 @@ namespace o2::aod namespace dgcand { DECLARE_SOA_COLUMN(NetCharge, netCharge, int8_t); //! Sum of track signs +DECLARE_SOA_COLUMN(RgtrwTOF, rgtrwTOF, float); //! Fraction of global tracks with TOF hit + } // namespace dgcand DECLARE_SOA_TABLE(DGCandidates, "AOD", "DGCANDIDATES", //! Table with DG candidates o2::soa::Index<>, bc::RunNumber, timestamp::Timestamp, collision::PosX, collision::PosY, collision::PosZ, - collision::NumContrib, dgcand::NetCharge); + collision::NumContrib, dgcand::NetCharge, dgcand::RgtrwTOF); using DGCandidate = DGCandidates::iterator; namespace dgtrack diff --git a/PWGUD/TableProducer/DGCandProducer.cxx b/PWGUD/TableProducer/DGCandProducer.cxx index 3662eb4ad27..55421b9e056 100644 --- a/PWGUD/TableProducer/DGCandProducer.cxx +++ b/PWGUD/TableProducer/DGCandProducer.cxx @@ -52,24 +52,13 @@ #include "Framework/AnalysisTask.h" #include "EventFiltering/PWGUD/DGHelpers.h" +#include "PWGUD/Core/UDHelperFunctions.h" #include "PWGUD/DataModel/DGCandidates.h" using namespace o2; using namespace o2::framework; using namespace o2::framework::expressions; -template -int8_t netCharge(TCs tracks) -{ - int8_t nch = 0; - for (auto track : tracks) { - if (track.isPVContributor()) { - nch += track.sign(); - } - } - return nch; -} - struct DGCandProducer { // get a DGCutparHolder @@ -120,7 +109,7 @@ struct DGCandProducer { // update DGCandidates tables outputCollisions(bc.runNumber(), bc.timestamp(), collision.posX(), collision.posY(), collision.posZ(), - collision.numContrib(), netCharge(tracks)); + collision.numContrib(), netCharge(tracks), rPVtrwTOF(tracks, collision.numContrib())); // update DGTracks tables for (auto& track : tracks) { diff --git a/PWGUD/Tasks/DGCandAnalyzer.cxx b/PWGUD/Tasks/DGCandAnalyzer.cxx index f4cde6c86f0..0c2c9f037f8 100644 --- a/PWGUD/Tasks/DGCandAnalyzer.cxx +++ b/PWGUD/Tasks/DGCandAnalyzer.cxx @@ -85,6 +85,11 @@ struct DGCandAnalyzer { return; } + // skip events with out-of-range rgtrwTOF + if (dgcand.rgtrwTOF() < diffCuts.minRgtrwTOF()) { + return; + } + // find track combinations which are compatible with anaPars.TPCnSigmas() auto nIVMs = pidsel.computeIVMs(anaPars.nCombine(), dgtracks); diff --git a/PWGUD/Tasks/diffMCQA.cxx b/PWGUD/Tasks/diffMCQA.cxx index 7b1ca1e0ce5..0471a88e6e0 100644 --- a/PWGUD/Tasks/diffMCQA.cxx +++ b/PWGUD/Tasks/diffMCQA.cxx @@ -84,16 +84,15 @@ struct DiffMCQA { // bin 8: no vtx tracks which are no global tracks // bin 9: possible ambiguous tracks // bin 10: possible ambiguous FwdTracks - // bin 11: at least one vtx tracks with TOF hit - // bin 12: all vtx tracks with TOF hit - // bin 13: number of tracks >= minimum number - // bin 14: number of tracks <= maximum number - // bin 15: minimum pt <= pt of vtx tracks <= maximum pt - // bin 16: minimum eta <= eta of vtx tracks <= maximum eta - // bin 17: net charge >= minimum net charge - // bin 18: net charge <= maximum net charge - // bin 19: IVM >= minimum IVM - // bin 20: IVM <= maximum IVM + // bin 11: fraction of PV tracks with TOF hit > minRgtrwTOF + // bin 12: number of tracks >= minimum number + // bin 13: number of tracks <= maximum number + // bin 14: minimum pt <= pt of vtx tracks <= maximum pt + // bin 15: minimum eta <= eta of vtx tracks <= maximum eta + // bin 16: net charge >= minimum net charge + // bin 17: net charge <= maximum net charge + // bin 18: IVM >= minimum IVM + // bin 19: IVM <= maximum IVM // // 3 diverent versions of histograms: // Diff1: Pythia MBR @@ -104,7 +103,7 @@ struct DiffMCQA { "registry", { // non diffractive events - {"Stat", "#Stat", {HistType::kTH1F, {{21, -0.5, 20.5}}}}, + {"Stat", "#Stat", {HistType::kTH1F, {{20, -0.5, 19.5}}}}, {"cleanFIT", "#cleanFIT", {HistType::kTH2F, {{10, -0.5, 9.5}, {2, -0.5, 1.5}}}}, {"Tracks", "#Tracks", {HistType::kTH1F, {{50, 0.5, 50.5}}}}, {"vtxTracks", "#vtxTracks", {HistType::kTH1F, {{50, 0.5, 50.5}}}}, @@ -125,7 +124,7 @@ struct DiffMCQA { {"IVMptSysDG", "#IVMptSysDG", {HistType::kTH2F, {{100, 0., 5.}, {350, 0., 3.5}}}}, {"IVMptTrkDG", "#IVMptTrkDG", {HistType::kTH2F, {{100, 0., 5.}, {350, 0., 3.5}}}}, // PYTHIA8 diffractive events - {"StatDiff1", "#StatDiff1", {HistType::kTH1F, {{21, -0.5, 20.5}}}}, + {"StatDiff1", "#StatDiff1", {HistType::kTH1F, {{20, -0.5, 19.5}}}}, {"cleanFITDiff1", "#cleanFITDiff1", {HistType::kTH2F, {{10, -0.5, 9.5}, {2, -0.5, 1.5}}}}, {"TracksDiff1", "#TracksDiff1", {HistType::kTH1F, {{50, 0.5, 50.5}}}}, {"vtxTracksDiff1", "#vtxTracksDiff1", {HistType::kTH1F, {{50, 0.5, 50.5}}}}, @@ -146,7 +145,7 @@ struct DiffMCQA { {"IVMptSysDGDiff1", "#IVMptSysDGDiff1", {HistType::kTH2F, {{100, 0., 5.}, {350, 0., 3.5}}}}, {"IVMptTrkDGDiff1", "#IVMptTrkDGDiff1", {HistType::kTH2F, {{100, 0., 5.}, {350, 0., 3.5}}}}, // GRANIITTI diffractive events - {"StatDiff2", "#StatDiff2", {HistType::kTH1F, {{21, -0.5, 20.5}}}}, + {"StatDiff2", "#StatDiff2", {HistType::kTH1F, {{20, -0.5, 19.5}}}}, {"cleanFITDiff2", "#cleanFITDiff2", {HistType::kTH2F, {{10, -0.5, 9.5}, {2, -0.5, 1.5}}}}, {"TracksDiff2", "#TracksDiff2", {HistType::kTH1F, {{50, 0.5, 50.5}}}}, {"vtxTracksDiff2", "#vtxTracksDiff2", {HistType::kTH1F, {{50, 0.5, 50.5}}}}, @@ -228,11 +227,9 @@ struct DiffMCQA { } Preslice perMcCollision = aod::mcparticle::mcCollisionId; - Preslice v0PerCollision = aod::v0::collisionId; - Preslice cascadePerCollision = aod::cascade::collisionId; void process(CC const& collision, BCs const& bct0s, - TCs& tracks, FWs& fwdtracks, ATs& ambtracks, AFTs& ambfwdtarcks, + TCs& tracks, FWs& fwdtracks, ATs& ambtracks, AFTs& ambfwdtracks, aod::FT0s& ft0s, aod::FV0As& fv0as, aod::FDDs& fdds, aod::Zdcs& zdcs, aod::Calos& calos, aod::V0s& v0s, aod::Cascades& cascades, @@ -407,9 +404,7 @@ struct DiffMCQA { } // no V0s - auto colId = collision.globalIndex(); - const auto& V0Collision = v0s.sliceBy(v0PerCollision, colId); - isDGcandidate &= (V0Collision.size() == 0); + isDGcandidate &= (v0s.size() == 0); if (isPythiaDiff) { registry.get(HIST("StatDiff1"))->Fill(4., isDGcandidate * 1.); } else if (isGraniittiDiff) { @@ -419,8 +414,7 @@ struct DiffMCQA { } // no Cascades - const auto& CascadeCollision = cascades.sliceBy(cascadePerCollision, colId); - isDGcandidate &= (CascadeCollision.size() == 0); + isDGcandidate &= (cascades.size() == 0); if (isPythiaDiff) { registry.get(HIST("StatDiff1"))->Fill(5., isDGcandidate * 1.); } else if (isGraniittiDiff) { @@ -498,34 +492,31 @@ struct DiffMCQA { } // at least one vtx track with TOF hit + isDGcandidate &= (rgtrwTOF >= diffCuts.minRgtrwTOF()); if (isPythiaDiff) { - registry.get(HIST("StatDiff1"))->Fill(11., (isDGcandidate && (rgtrwTOF > 0.)) * 1.); - registry.get(HIST("StatDiff1"))->Fill(12., (isDGcandidate && (rgtrwTOF == 1.)) * 1.); + registry.get(HIST("StatDiff1"))->Fill(11., isDGcandidate * 1.); } else if (isGraniittiDiff) { - registry.get(HIST("StatDiff2"))->Fill(11., (isDGcandidate && (rgtrwTOF > 0.)) * 1.); - registry.get(HIST("StatDiff2"))->Fill(12., (isDGcandidate && (rgtrwTOF == 1.)) * 1.); + registry.get(HIST("StatDiff2"))->Fill(11., isDGcandidate * 1.); } else { - registry.get(HIST("Stat"))->Fill(11., (isDGcandidate && (rgtrwTOF > 0.)) * 1.); - registry.get(HIST("Stat"))->Fill(12., (isDGcandidate && (rgtrwTOF == 1.)) * 1.); + registry.get(HIST("Stat"))->Fill(11., isDGcandidate * 1.); } - isDGcandidate &= (rgtrwTOF >= diffCuts.minRgtrwTOF()); // number of vertex tracks <= n isDGcandidate &= (collision.numContrib() >= diffCuts.minNTracks()); if (isPythiaDiff) { - registry.get(HIST("StatDiff1"))->Fill(13., isDGcandidate * 1.); + registry.get(HIST("StatDiff1"))->Fill(12., isDGcandidate * 1.); } else if (isGraniittiDiff) { - registry.get(HIST("StatDiff2"))->Fill(13., isDGcandidate * 1.); + registry.get(HIST("StatDiff2"))->Fill(12., isDGcandidate * 1.); } else { - registry.get(HIST("Stat"))->Fill(13., isDGcandidate * 1.); + registry.get(HIST("Stat"))->Fill(12., isDGcandidate * 1.); } isDGcandidate &= (collision.numContrib() <= diffCuts.maxNTracks()); if (isPythiaDiff) { - registry.get(HIST("StatDiff1"))->Fill(14., isDGcandidate * 1.); + registry.get(HIST("StatDiff1"))->Fill(13., isDGcandidate * 1.); } else if (isGraniittiDiff) { - registry.get(HIST("StatDiff2"))->Fill(14., isDGcandidate * 1.); + registry.get(HIST("StatDiff2"))->Fill(13., isDGcandidate * 1.); } else { - registry.get(HIST("Stat"))->Fill(14., isDGcandidate * 1.); + registry.get(HIST("Stat"))->Fill(13., isDGcandidate * 1.); } // net charge and invariant mass @@ -617,6 +608,14 @@ struct DiffMCQA { } } isDGcandidate &= goodpts; + if (isPythiaDiff) { + registry.get(HIST("StatDiff1"))->Fill(14., isDGcandidate * 1.); + } else if (isGraniittiDiff) { + registry.get(HIST("StatDiff2"))->Fill(14., isDGcandidate * 1.); + } else { + registry.get(HIST("Stat"))->Fill(14., isDGcandidate * 1.); + } + isDGcandidate &= goodetas; if (isPythiaDiff) { registry.get(HIST("StatDiff1"))->Fill(15., isDGcandidate * 1.); } else if (isGraniittiDiff) { @@ -624,7 +623,7 @@ struct DiffMCQA { } else { registry.get(HIST("Stat"))->Fill(15., isDGcandidate * 1.); } - isDGcandidate &= goodetas; + isDGcandidate &= (netCharge >= diffCuts.minNetCharge()); if (isPythiaDiff) { registry.get(HIST("StatDiff1"))->Fill(16., isDGcandidate * 1.); } else if (isGraniittiDiff) { @@ -632,7 +631,7 @@ struct DiffMCQA { } else { registry.get(HIST("Stat"))->Fill(16., isDGcandidate * 1.); } - isDGcandidate &= (netCharge >= diffCuts.minNetCharge()); + isDGcandidate &= (netCharge <= diffCuts.maxNetCharge()); if (isPythiaDiff) { registry.get(HIST("StatDiff1"))->Fill(17., isDGcandidate * 1.); } else if (isGraniittiDiff) { @@ -640,7 +639,7 @@ struct DiffMCQA { } else { registry.get(HIST("Stat"))->Fill(17., isDGcandidate * 1.); } - isDGcandidate &= (netCharge <= diffCuts.maxNetCharge()); + isDGcandidate &= (ivm.M() >= diffCuts.minIVM()); if (isPythiaDiff) { registry.get(HIST("StatDiff1"))->Fill(18., isDGcandidate * 1.); } else if (isGraniittiDiff) { @@ -648,7 +647,7 @@ struct DiffMCQA { } else { registry.get(HIST("Stat"))->Fill(18., isDGcandidate * 1.); } - isDGcandidate &= (ivm.M() >= diffCuts.minIVM()); + isDGcandidate &= (ivm.M() <= diffCuts.maxIVM()); if (isPythiaDiff) { registry.get(HIST("StatDiff1"))->Fill(19., isDGcandidate * 1.); } else if (isGraniittiDiff) { @@ -656,14 +655,6 @@ struct DiffMCQA { } else { registry.get(HIST("Stat"))->Fill(19., isDGcandidate * 1.); } - isDGcandidate &= (ivm.M() <= diffCuts.maxIVM()); - if (isPythiaDiff) { - registry.get(HIST("StatDiff1"))->Fill(20., isDGcandidate * 1.); - } else if (isGraniittiDiff) { - registry.get(HIST("StatDiff2"))->Fill(20., isDGcandidate * 1.); - } else { - registry.get(HIST("Stat"))->Fill(20., isDGcandidate * 1.); - } // update some DG histograms if (isDGcandidate) { diff --git a/PWGUD/Tasks/diffQA.cxx b/PWGUD/Tasks/diffQA.cxx index 87f5e1665ac..c7c57e158b4 100644 --- a/PWGUD/Tasks/diffQA.cxx +++ b/PWGUD/Tasks/diffQA.cxx @@ -83,20 +83,19 @@ struct DiffQA { // bin 8: no vtx tracks which are no global tracks // bin 9: possible ambiguous tracks // bin 10: possible ambiguous FwdTracks - // bin 11: at least one vtx tracks with TOF hit - // bin 12: all vtx tracks with TOF hit - // bin 13: number of tracks >= minimum number - // bin 14: number of tracks <= maximum number - // bin 15: minimum pt <= pt of vtx tracks <= maximum pt - // bin 16: minimum eta <= eta of vtx tracks <= maximum eta - // bin 17: net charge >= minimum net charge - // bin 18: net charge <= maximum net charge - // bin 19: IVM >= minimum IVM - // bin 20: IVM <= maximum IVM + // bin 11: fraction of PV tracks with TOF hit > minRgtrwTOF + // bin 12: number of tracks >= minimum number + // bin 13: number of tracks <= maximum number + // bin 14: minimum pt <= pt of vtx tracks <= maximum pt + // bin 15: minimum eta <= eta of vtx tracks <= maximum eta + // bin 16: net charge >= minimum net charge + // bin 17: net charge <= maximum net charge + // bin 18: IVM >= minimum IVM + // bin 19: IVM <= maximum IVM HistogramRegistry registry{ "registry", { - {"Stat", "#Stat", {HistType::kTH1F, {{21, -0.5, 20.5}}}}, + {"Stat", "#Stat", {HistType::kTH1F, {{20, -0.5, 19.5}}}}, {"cleanFIT", "#cleanFIT", {HistType::kTH2F, {{10, -0.5, 9.5}, {2, -0.5, 1.5}}}}, {"Tracks", "#Tracks", {HistType::kTH1F, {{50, 0.5, 50.5}}}}, {"vtxTracks", "#vtxTracks", {HistType::kTH1F, {{50, 0.5, 50.5}}}}, @@ -176,9 +175,6 @@ struct DiffQA { } } - Preslice v0PerCollision = aod::v0::collisionId; - Preslice cascadePerCollision = aod::cascade::collisionId; - void process(CC const& collision, BCs const& bct0s, TCs& tracks, FWs& fwdtracks, ATs& ambtracks, AFTs& ambfwdtarcks, aod::FT0s& ft0s, aod::FV0As& fv0as, aod::FDDs& fdds, @@ -287,14 +283,11 @@ struct DiffQA { registry.get(HIST("Stat"))->Fill(3., isDGcandidate * 1.); // no V0s - auto colId = collision.globalIndex(); - const auto& V0Collision = v0s.sliceBy(v0PerCollision, colId); - isDGcandidate &= (V0Collision.size() == 0); + isDGcandidate &= (v0s.size() == 0); registry.get(HIST("Stat"))->Fill(4., isDGcandidate * 1.); // no Cascades - const auto& CascadeCollision = cascades.sliceBy(cascadePerCollision, colId); - isDGcandidate &= (CascadeCollision.size() == 0); + isDGcandidate &= (cascades.size() == 0); registry.get(HIST("Stat"))->Fill(5., isDGcandidate * 1.); // number of forward tracks = 0 @@ -339,16 +332,15 @@ struct DiffQA { } registry.get(HIST("Stat"))->Fill(10., noAmbFwdTracks * 1.); - // at least one vtx track with TOF hit - registry.get(HIST("Stat"))->Fill(11., (isDGcandidate && (rgtrwTOF > 0.)) * 1.); - registry.get(HIST("Stat"))->Fill(12., (isDGcandidate && (rgtrwTOF == 1.)) * 1.); + // fraction of PV tracks with TOF hit isDGcandidate &= (rgtrwTOF >= diffCuts.minRgtrwTOF()); + registry.get(HIST("Stat"))->Fill(11., isDGcandidate * 1.); // number of vertex tracks <= n isDGcandidate &= (collision.numContrib() >= diffCuts.minNTracks()); - registry.get(HIST("Stat"))->Fill(13., isDGcandidate * 1.); + registry.get(HIST("Stat"))->Fill(12., isDGcandidate * 1.); isDGcandidate &= (collision.numContrib() <= diffCuts.maxNTracks()); - registry.get(HIST("Stat"))->Fill(14., isDGcandidate * 1.); + registry.get(HIST("Stat"))->Fill(13., isDGcandidate * 1.); // net charge and invariant mass bool goodetas = true; @@ -401,17 +393,17 @@ struct DiffQA { } } isDGcandidate &= goodpts; - registry.get(HIST("Stat"))->Fill(15., isDGcandidate * 1.); + registry.get(HIST("Stat"))->Fill(14., isDGcandidate * 1.); isDGcandidate &= goodetas; - registry.get(HIST("Stat"))->Fill(16., isDGcandidate * 1.); + registry.get(HIST("Stat"))->Fill(15., isDGcandidate * 1.); isDGcandidate &= (netCharge >= diffCuts.minNetCharge()); - registry.get(HIST("Stat"))->Fill(17., isDGcandidate * 1.); + registry.get(HIST("Stat"))->Fill(16., isDGcandidate * 1.); isDGcandidate &= (netCharge <= diffCuts.maxNetCharge()); - registry.get(HIST("Stat"))->Fill(18., isDGcandidate * 1.); + registry.get(HIST("Stat"))->Fill(17., isDGcandidate * 1.); isDGcandidate &= (ivm.M() >= diffCuts.minIVM()); - registry.get(HIST("Stat"))->Fill(19., isDGcandidate * 1.); + registry.get(HIST("Stat"))->Fill(18., isDGcandidate * 1.); isDGcandidate &= (ivm.M() <= diffCuts.maxIVM()); - registry.get(HIST("Stat"))->Fill(20., isDGcandidate * 1.); + registry.get(HIST("Stat"))->Fill(19., isDGcandidate * 1.); // update some DG histograms if (isDGcandidate) { From fde70d34cb6f95b01efcbd39c3a21cdf6a33e4f4 Mon Sep 17 00:00:00 2001 From: Paul Date: Fri, 8 Jul 2022 16:32:02 +0200 Subject: [PATCH 2/2] clang-format --- EventFiltering/PWGUD/DGHelpers.h | 2 +- PWGUD/DataModel/DGCandidates.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/EventFiltering/PWGUD/DGHelpers.h b/EventFiltering/PWGUD/DGHelpers.h index 79b6cf6eb0b..e6fa61a7567 100644 --- a/EventFiltering/PWGUD/DGHelpers.h +++ b/EventFiltering/PWGUD/DGHelpers.h @@ -111,7 +111,7 @@ struct DGSelector { if (diffCuts.globalTracksOnly() && !track.isGlobalTrack() && track.isPVContributor()) { return 4; } - + // update fraction of PV tracks with TOF hit if (track.isPVContributor() && track.hasTOF()) { rgtrwTOF += 1.; diff --git a/PWGUD/DataModel/DGCandidates.h b/PWGUD/DataModel/DGCandidates.h index 5c35ceb495c..9159be6eb62 100644 --- a/PWGUD/DataModel/DGCandidates.h +++ b/PWGUD/DataModel/DGCandidates.h @@ -23,7 +23,7 @@ namespace o2::aod namespace dgcand { DECLARE_SOA_COLUMN(NetCharge, netCharge, int8_t); //! Sum of track signs -DECLARE_SOA_COLUMN(RgtrwTOF, rgtrwTOF, float); //! Fraction of global tracks with TOF hit +DECLARE_SOA_COLUMN(RgtrwTOF, rgtrwTOF, float); //! Fraction of global tracks with TOF hit } // namespace dgcand DECLARE_SOA_TABLE(DGCandidates, "AOD", "DGCANDIDATES", //! Table with DG candidates