diff --git a/Common/Core/trackUtilities.h b/Common/Core/trackUtilities.h index 5d76f786eb8..e67e0f82d6f 100644 --- a/Common/Core/trackUtilities.h +++ b/Common/Core/trackUtilities.h @@ -14,9 +14,11 @@ /// /// \author Vít Kučera , CERN -#ifndef O2_ANALYSIS_TRACKUTILITIES_H_ -#define O2_ANALYSIS_TRACKUTILITIES_H_ +#ifndef COMMON_CORE_TRACKUTILITIES_H_ +#define COMMON_CORE_TRACKUTILITIES_H_ +#include // std::move +#include "CommonConstants/MathConstants.h" #include "ReconstructionDataFormats/Track.h" #include "ReconstructionDataFormats/Vertex.h" #include "Common/Core/RecoDecay.h" @@ -128,4 +130,26 @@ void getPxPyPz(T const& trackPars, U& pVec) pVec[2] = pt * trackPars.getTgl(); } -#endif // O2_ANALYSIS_TRACKUTILITIES_H_ +/// Calculates DCA XYZ of a track w.r.t. the primary vertex and its uncertainty if required. +/// \param track track from a table containing `o2::aod::TracksCov, o2::aod::TracksDCA`. +/// \param sigmaDcaXYZ2 pointer to the sigma^2 of the impact parameter in XYZ to be calculated +/// \return impact parameter in XYZ of the track w.r.t the primary vertex +template +float getDcaXYZ(T const& track, float* sigmaDcaXYZ2 = nullptr) +{ + float dcaXY = track.dcaXY(); + float dcaZ = track.dcaZ(); + float dcaXYZ = std::sqrt(dcaXY * dcaXY + dcaZ * dcaZ); + if (sigmaDcaXYZ2) { + if (dcaXYZ < o2::constants::math::Almost0) { + *sigmaDcaXYZ2 = o2::constants::math::VeryBig; // Protection against division by zero + } else { + float dFdxy = 2.f * dcaXY / dcaXYZ; + float dFdz = 2.f * dcaZ / dcaXYZ; + *sigmaDcaXYZ2 = track.cYY() * dFdxy * dFdxy + track.cZZ() * dFdz * dFdz + 2.f * track.cZY() * dFdxy * dFdz; + } + } + return dcaXYZ; +} + +#endif // COMMON_CORE_TRACKUTILITIES_H_ diff --git a/Common/TableProducer/qVectorsTable.cxx b/Common/TableProducer/qVectorsTable.cxx index 52f74cf1f3e..c8f946ca38c 100644 --- a/Common/TableProducer/qVectorsTable.cxx +++ b/Common/TableProducer/qVectorsTable.cxx @@ -66,9 +66,9 @@ struct qVectorsTable { struct : ConfigurableGroup { Configurable cfgURL{"cfgURL", "http://alice-ccdb.cern.ch", "Address of the CCDB to browse"}; - Configurable nolaterthan{"ccdb-no-later-than", - std::chrono::duration_cast(std::chrono::system_clock::now().time_since_epoch()).count(), - "Latest acceptable timestamp of creation for the object"}; + Configurable nolaterthan{"ccdb-no-later-than", + std::chrono::duration_cast(std::chrono::system_clock::now().time_since_epoch()).count(), + "Latest acceptable timestamp of creation for the object"}; } cfgCcdbParam; Configurable cfgCentEsti{"cfgCentEsti", diff --git a/Common/Tasks/ft0Qa.cxx b/Common/Tasks/ft0Qa.cxx index cf5ff2805f2..367dfc7f3a1 100644 --- a/Common/Tasks/ft0Qa.cxx +++ b/Common/Tasks/ft0Qa.cxx @@ -405,7 +405,7 @@ struct ft0QaTask { histos.fill(HIST("hBcCounterAll"), 1); - float multFV0A = 0.f; + // float multFV0A = 0.f; float multFT0A = 0.f; float multFT0C = 0.f; float multFT0M = 0.f; @@ -503,12 +503,12 @@ struct ft0QaTask { } } - if (bc.has_fv0a()) { - auto fv0a = bc.fv0a(); - for (auto amplitude : fv0a.amplitude()) { - multFV0A += amplitude; - } - } + // if (bc.has_fv0a()) { + // auto fv0a = bc.fv0a(); + // for (auto amplitude : fv0a.amplitude()) { + // multFV0A += amplitude; + // } + // } } PROCESS_SWITCH(ft0QaTask, processBCs, "per-BC analysis", true); diff --git a/DPG/Tasks/AOTEvent/lumiQa.cxx b/DPG/Tasks/AOTEvent/lumiQa.cxx index f499b2071e3..ce52550a629 100644 --- a/DPG/Tasks/AOTEvent/lumiQa.cxx +++ b/DPG/Tasks/AOTEvent/lumiQa.cxx @@ -14,6 +14,8 @@ #include "Framework/AnalysisDataModel.h" #include "CCDB/BasicCCDBManager.h" #include "Framework/HistogramRegistry.h" +#include "DataFormatsParameters/GRPLHCIFData.h" +#include "DataFormatsFT0/Digit.h" #include "TList.h" #include "TH1.h" @@ -26,6 +28,8 @@ struct LumiQaTask { HistogramRegistry histos{"Histos", {}, OutputObjHandlingPolicy::AnalysisObject}; int lastRunNumber = -1; TH1* hCalibT0C = nullptr; + static const int nBCsPerOrbit = o2::constants::lhc::LHCMaxBunches; + std::bitset bcPatternB; void init(InitContext&) { @@ -33,18 +37,35 @@ struct LumiQaTask { ccdb->setCaching(true); ccdb->setLocalObjectValidityChecking(); const AxisSpec axisMultT0C{1000, 0., 70000., "T0C multiplicity"}; - const AxisSpec axisCentT0C{1000, 0., 100., "T0C centrality"}; + const AxisSpec axisCentT0C{100, 0., 100., "T0C centrality"}; histos.add("hMultT0C", "", kTH1F, {axisMultT0C}); histos.add("hCentT0C", "", kTH1F, {axisCentT0C}); + histos.add("hMultT0CselTCE", "", kTH1F, {axisMultT0C}); + histos.add("hCentT0CselTCE", "", kTH1F, {axisCentT0C}); + histos.add("hMultT0CselTVXTCE", "", kTH1F, {axisMultT0C}); + histos.add("hCentT0CselTVXTCE", "", kTH1F, {axisCentT0C}); + histos.add("hMultT0CselTVXTCEB", "", kTH1F, {axisMultT0C}); + histos.add("hCentT0CselTVXTCEB", "", kTH1F, {axisCentT0C}); + + histos.add("hCounterTCE", "", kTH1D, {{1, 0., 1.}}); + histos.add("hCounterZNC", "", kTH1D, {{1, 0., 1.}}); + histos.add("hCounterZEM", "", kTH1D, {{1, 0., 1.}}); } void process(BCsRun3 const& bcs, aod::Zdcs const& zdcs, aod::FT0s const& ft0s) { int runNumber = bcs.iteratorAt(0).runNumber(); LOGP(info, "runNumber={}", runNumber); + const char* srun = Form("%d", runNumber); + if (runNumber != lastRunNumber) { - TList* callst = ccdb->getForTimeStamp("Centrality/Estimators", bcs.iteratorAt(0).timestamp()); lastRunNumber = runNumber; + int64_t ts = bcs.iteratorAt(0).timestamp(); + + auto grplhcif = ccdb->getForTimeStamp("GLO/Config/GRPLHCIF", ts); + bcPatternB = grplhcif->getBunchFilling().getBCPattern(); + + TList* callst = ccdb->getForTimeStamp("Centrality/Estimators", ts); hCalibT0C = reinterpret_cast(callst->FindObject("hCalibZeqFT0C")); } if (!hCalibT0C) { @@ -52,6 +73,17 @@ struct LumiQaTask { } for (const auto& bc : bcs) { + if (bc.has_zdc()) { + float timeZNA = bc.zdc().timeZNA(); + float timeZNC = bc.zdc().timeZNC(); + if (fabs(timeZNC) < 2) { + histos.get(HIST("hCounterZNC"))->Fill(srun, 1); + } + if (fabs(timeZNA) < 2 || fabs(timeZNC) < 2) { + histos.get(HIST("hCounterZEM"))->Fill(srun, 1); + } + } + if (!bc.has_ft0()) { continue; } @@ -59,6 +91,26 @@ struct LumiQaTask { float centT0C = hCalibT0C->GetBinContent(hCalibT0C->FindFixBin(multT0C)); histos.fill(HIST("hMultT0C"), multT0C); histos.fill(HIST("hCentT0C"), centT0C); + + if (!TESTBIT(bc.ft0().triggerMask(), o2::ft0::Triggers::bitCen)) { // TCE + continue; + } + histos.fill(HIST("hMultT0CselTCE"), multT0C); + histos.fill(HIST("hCentT0CselTCE"), centT0C); + + if (!TESTBIT(bc.ft0().triggerMask(), o2::ft0::Triggers::bitVertex)) { // TVX + continue; + } + histos.fill(HIST("hMultT0CselTVXTCE"), multT0C); + histos.fill(HIST("hCentT0CselTVXTCE"), centT0C); + + if (!bcPatternB[bc.globalBC() % nBCsPerOrbit]) { // B-mask + continue; + } + histos.fill(HIST("hMultT0CselTVXTCEB"), multT0C); + histos.fill(HIST("hCentT0CselTVXTCEB"), centT0C); + + histos.get(HIST("hCounterTCE"))->Fill(srun, 1); } } }; diff --git a/EventFiltering/PWGHF/HFFilter.cxx b/EventFiltering/PWGHF/HFFilter.cxx index 3793932ea1d..f4e86da6469 100644 --- a/EventFiltering/PWGHF/HFFilter.cxx +++ b/EventFiltering/PWGHF/HFFilter.cxx @@ -201,7 +201,7 @@ struct HfFilter { // Main struct for HF triggers helper.setPtDeltaMassRangeSigmaC(cutsPtDeltaMassCharmReso->get(0u, 6u), cutsPtDeltaMassCharmReso->get(1u, 6u), cutsPtDeltaMassCharmReso->get(0u, 7u), cutsPtDeltaMassCharmReso->get(1u, 7u), cutsPtDeltaMassCharmReso->get(2u, 6u), cutsPtDeltaMassCharmReso->get(2u, 7u)); helper.setPtRangeSoftKaonXicResoToSigmaC(ptCuts->get(0u, 5u), ptCuts->get(1u, 5u)); - hProcessedEvents = registry.add("fProcessedEvents", "HF - event filtered;;counts", HistType::kTH1F, {{kNtriggersHF + 2, -0.5, kNtriggersHF + 1.5}}); + hProcessedEvents = registry.add("fProcessedEvents", "HF - event filtered;;counts", HistType::kTH1F, {{kNtriggersHF + 2, -0.5, +kNtriggersHF + 1.5}}); for (auto iBin = 0; iBin < kNtriggersHF + 2; ++iBin) { hProcessedEvents->GetXaxis()->SetBinLabel(iBin + 1, eventTitles[iBin].data()); } @@ -252,7 +252,7 @@ struct HfFilter { // Main struct for HF triggers if (activateQA > 1) { hProtonTPCPID = registry.add("fProtonTPCPID", "#it{N}_{#sigma}^{TPC} vs. #it{p} for selected protons;#it{p} (GeV/#it{c});#it{N}_{#sigma}^{TPC}", HistType::kTH2F, {pAxis, nSigmaAxis}); hProtonTOFPID = registry.add("fProtonTOFPID", "#it{N}_{#sigma}^{TOF} vs. #it{p} for selected protons;#it{p} (GeV/#it{c});#it{N}_{#sigma}^{TOF}", HistType::kTH2F, {pAxis, nSigmaAxis}); - hV0Selected = registry.add("fV0Selected", "Selections for V0s;;counts", HistType::kTH2F, {{10, -0.5, 9.5}, {kNV0, -0.5, kNV0 - 0.5}}); + hV0Selected = registry.add("fV0Selected", "Selections for V0s;;counts", HistType::kTH2F, {{10, -0.5, 9.5}, {kNV0, -0.5, +kNV0 - 0.5}}); for (int iV0{kPhoton}; iV0 < kNV0; ++iV0) { hV0Selected->GetYaxis()->SetBinLabel(iV0 + 1, v0Labels[iV0].data()); diff --git a/EventFiltering/PWGJE/fullJetFilter.cxx b/EventFiltering/PWGJE/fullJetFilter.cxx index fa4a4fcac69..25096b7bb7a 100644 --- a/EventFiltering/PWGJE/fullJetFilter.cxx +++ b/EventFiltering/PWGJE/fullJetFilter.cxx @@ -195,7 +195,7 @@ struct fullJetFilter { Float_t kMinEta = -1.; Float_t kMaxEta = 1.; - hProcessedEvents.setObject(new TH1D("hProcessedEvents", ";;Number of filtered events", kCategories, -0.5, kCategories - 0.5)); + hProcessedEvents.setObject(new TH1D("hProcessedEvents", ";;Number of filtered events", kCategories, -0.5, +kCategories - 0.5)); hEmcClusterPtEta.setObject(new TH2F("hEmcClusterPtEta", Form("Emc Clusters;%s;#eta", (f_ObservalbeGammaTrigger == 0) ? "E (GeV)" : "#it{p}_{T}"), nPtBins, kMinPt, kMaxPt / 2, nEtaBins, kMinEta, kMaxEta)); hEmcClusterPtPhi.setObject(new TH2F("hEmcClusterPtPhi", Form("Emc Clusters;%s;#phi", (f_ObservalbeGammaTrigger == 0) ? "E (GeV)" : "#it{p}_{T}"), nPtBins, kMinPt, kMaxPt / 2, nPhiBins, kMinPhi, kMaxPhi)); diff --git a/EventFiltering/PWGJE/jetFilter.cxx b/EventFiltering/PWGJE/jetFilter.cxx index e368b7219ee..1b3208330c2 100644 --- a/EventFiltering/PWGJE/jetFilter.cxx +++ b/EventFiltering/PWGJE/jetFilter.cxx @@ -129,7 +129,7 @@ struct jetFilter { auto scalers{std::get>(spectra.add( "fProcessedEvents", ";;Number of filtered events", HistType::kTH1F, - {{kAllObjects, -0.5, kAllObjects - 0.5}}))}; + {{kAllObjects, -0.5, +kAllObjects - 0.5}}))}; for (uint32_t iS{1}; iS <= highPtObjectsNames.size(); ++iS) { scalers->GetXaxis()->SetBinLabel(iS, highPtObjectsNames[iS - 1].data()); } diff --git a/EventFiltering/PWGLF/strangenessFilter.cxx b/EventFiltering/PWGLF/strangenessFilter.cxx index 64fd7548430..39b64f1d012 100644 --- a/EventFiltering/PWGLF/strangenessFilter.cxx +++ b/EventFiltering/PWGLF/strangenessFilter.cxx @@ -444,7 +444,7 @@ struct strangenessFilter { int omegacounter = 0; int omegalargeRcounter = 0; int triggcounterForEstimates = 0; - int triggcounter = 0; + // int triggcounter = 0; for (auto& casc : fullCasc) { // loop over cascades triggcounterForEstimates = 0; @@ -593,7 +593,7 @@ struct strangenessFilter { if (isTrackFilter && !mTrackSelector.IsSelected(track)) { continue; } - triggcounter++; + // triggcounter++; keepEvent[1] = true; } // end loop over tracks } diff --git a/EventFiltering/cefpTask.cxx b/EventFiltering/cefpTask.cxx index b2367657b56..94f79e1ce58 100644 --- a/EventFiltering/cefpTask.cxx +++ b/EventFiltering/cefpTask.cxx @@ -346,7 +346,7 @@ struct centralEventFilterTask { int64_t nEvents{collTabPtr->num_rows()}; std::vector outTrigger, outDecision; - int64_t nSelected{0}; + // int64_t nSelected{0}; for (auto& tableName : mDownscaling) { if (!pc.inputs().isValid(tableName.first)) { LOG(fatal) << tableName.first << " table is not valid."; @@ -382,7 +382,7 @@ struct centralEventFilterTask { if (mUniformGenerator(mGeneratorEngine) < downscaling) { mFiltered->Fill(binCenter); outDecision[entry] |= triggerBit; - nSelected++; + // nSelected++; } } entry++; diff --git a/PWGCF/EbyEFluctuations/Tasks/IdentifiedMeanPtFluctuations.cxx b/PWGCF/EbyEFluctuations/Tasks/IdentifiedMeanPtFluctuations.cxx index 223592b1eb6..be75c1c93b3 100644 --- a/PWGCF/EbyEFluctuations/Tasks/IdentifiedMeanPtFluctuations.cxx +++ b/PWGCF/EbyEFluctuations/Tasks/IdentifiedMeanPtFluctuations.cxx @@ -254,10 +254,10 @@ struct IdentifiedMeanPtFluctuations { double Q1pi = 0, Q2pi = 0; double Q1k = 0, Q2k = 0; double Q1p = 0, Q2p = 0; - double var1, var2, twopar_allcharge; - double var1pi, var2pi; - double var1k, var2k; - double var1p, var2p; + double var1 = 0, var2 = 0, twopar_allcharge = 0; + double var1pi = 0, var2pi = 0; + double var1k = 0, var2k = 0; + double var1p = 0, var2p = 0; // cent = 0; // sampling diff --git a/PWGCF/EbyEFluctuations/Tasks/RobustFluctuationObservables.cxx b/PWGCF/EbyEFluctuations/Tasks/RobustFluctuationObservables.cxx index 9aa55347fbf..927bfb23f97 100644 --- a/PWGCF/EbyEFluctuations/Tasks/RobustFluctuationObservables.cxx +++ b/PWGCF/EbyEFluctuations/Tasks/RobustFluctuationObservables.cxx @@ -179,7 +179,7 @@ struct RobustFluctuationObservables { "TFcut", "ITSROFcut", // "ITSROF_TF_cuts", - "1globalPVcontrib", + // "1globalPVcontrib", "1globalPVcontrib_ITS7hits", "1globalPVcontrib_TRDorTOF", "diffFoundBC_vs_BC_0", @@ -209,6 +209,8 @@ struct RobustFluctuationObservables { "isITSonlyVertex", "antiIsITSonlyVertex", + "kTVXinTRD", + "ALL_CUTS_Handmade_ITSROFcut_Orbit_1_part", "ALL_CUTS_Handmade_ITSROFcut_Orbit_2_part", "ALL_CUTS_Handmade_ITSROFcut_Orbit_3_part", @@ -451,6 +453,18 @@ struct RobustFluctuationObservables { histosEventTracksFoundBC.add("hFoundBC_kTVXinTRD_nITSTPCTRDtracks", "hFoundBC_kTVXinTRD_nITSTPCTRDtracks", kTH1D, {axisBC}); histosEventTracksFoundBC.add("hFoundBC_kTVXinTRD_nITSTPCTOFtracks", "hFoundBC_kTVXinTRD_nITSTPCTOFtracks", kTH1D, {axisBC}); histosEventTracksFoundBC.add("hFoundBC_kTVXinTRD_nITSTPCTRDTOFtracks", "hFoundBC_kTVXinTRD_nITSTPCTRDTOFtracks", kTH1D, {axisBC}); + + // to study ITS ROF dips vs multiplicity + histosEventTracksFoundBC.add("hFoundBC_kTVX_nITSTPCTRDtracks_mult_1_20", "hFoundBC_kTVX_nITSTPCTRDtracks_mult_1_20", kTH1D, {axisBC}); + histosEventTracksFoundBC.add("hFoundBC_kTVX_nITSTPCTRDtracks_mult_20_100", "hFoundBC_kTVX_nITSTPCTRDtracks_mult_20_100", kTH1D, {axisBC}); + histosEventTracksFoundBC.add("hFoundBC_kTVX_nITSTPCTRDtracks_mult_100_400", "hFoundBC_kTVX_nITSTPCTRDtracks_mult_100_400", kTH1D, {axisBC}); + histosEventTracksFoundBC.add("hFoundBC_kTVX_nITSTPCTRDtracks_mult_above_400", "hFoundBC_kTVX_nITSTPCTRDtracks_mult_above_400", kTH1D, {axisBC}); + + // bcInTF + AxisSpec axisBCinTF32orbits{32 * 3564, -0.5, 32 * 3564, "bcInTF"}; + histosEventTracksFoundBC.add("hBCinTF_kTVX_nTracksPV", "hBCinTF_kTVX_nTracksPV;bc in TF; n tracks", kTH1D, {axisBCinTF32orbits}); + histosEventTracksFoundBC.add("hBCinTF_kTVX_nITSTPCTRDtracks", "hBCinTF_kTVX_nITSTPCTRDtracks;bc in TF; n tracks", kTH1D, {axisBCinTF32orbits}); + } // end of if flagIncludeQATracksInFoundBC // #### add QA histos via loop @@ -764,128 +778,6 @@ struct RobustFluctuationObservables { } } - // ### special sub-loop over tracks for numerator of tracks / T0ampl ratios - if (collision.has_foundBC() && flagIncludeQATracksInFoundBC) { - int nAllTracks = 0; - int nTracksPV = 0; - - int nITStracks = 0; - int nTPCtracks = 0; - int nTPCtracks_HandmadeITSROFcut = 0; - int nTOFtracks = 0; - int nTOFtracks_HandmadeITSROFcut = 0; - int nTRDtracks = 0; - - int nTRDTOFtracks_HandmadeITSROFcut = 0; - - int nTRDTOFtracks = 0; - int nITSTPCTRDtracks = 0; - int nITSTPCTOFtracks = 0; - int nITSTPCTRDTOFtracks = 0; - - int nGlobalTracks = 0; - - double timeFromTOFtracks = 0; - double timeFromTRDtracks = 0; - - for (auto& track : tracks) { - - nAllTracks++; - if (!track.isPVContributor()) { - continue; - } - nTracksPV++; - - if (track.isGlobalTrack()) - nGlobalTracks++; - - nITStracks += track.hasITS() && !track.hasTPC(); - nTPCtracks += track.hasTPC(); - nTOFtracks += track.hasTOF(); - nTRDtracks += track.hasTRD() && !track.hasTOF(); - - nTRDTOFtracks += track.hasTRD() && track.hasTOF(); - nITSTPCTRDtracks += track.hasITS() && track.hasTPC() && track.hasTRD(); - nITSTPCTOFtracks += track.hasITS() && track.hasTPC() && track.hasTOF(); - nITSTPCTRDTOFtracks += track.hasITS() && track.hasTPC() && track.hasTOF() && track.hasTRD(); - - // if (flagBCisNotInHandmadeBoundariesITSROF) - if (flagFoundBCisNotInHandmadeBoundariesITSROF) { - nTPCtracks_HandmadeITSROFcut += track.hasTPC(); - nTOFtracks_HandmadeITSROFcut += track.hasTOF(); - nTRDTOFtracks_HandmadeITSROFcut += track.hasTRD() && track.hasTOF(); - } - - // calculate average time using TOF and TRD tracks - if (track.hasTOF()) { - timeFromTOFtracks += track.trackTime(); - } else if (track.hasTRD()) { - timeFromTRDtracks += track.trackTime(); - } - } - - if (TFid < 2 && collBC < 200) { - if (nTOFtracks > 0) - LOGF(info, "QA: average timeFromTOFtracks = %.f", timeFromTOFtracks / nTOFtracks); - if (nTRDtracks > 0) - LOGF(info, "QA: average timeFromTRDtracks = %.f", timeFromTRDtracks / nTRDtracks); - } - - // all collisions - histosEventTracksFoundBC.fill(HIST("hFoundBC_nAllTracks"), globalFoundBC, nAllTracks); - histosEventTracksFoundBC.fill(HIST("hFoundBC_nTracksPV"), globalFoundBC, nTracksPV); - histosEventTracksFoundBC.fill(HIST("hFoundBC_nGlobalTracks"), globalFoundBC, nGlobalTracks); - histosEventTracksFoundBC.fill(HIST("hFoundBC_nITStracks"), globalFoundBC, nITStracks); - histosEventTracksFoundBC.fill(HIST("hFoundBC_nTPCtracks"), globalFoundBC, nTPCtracks); - histosEventTracksFoundBC.fill(HIST("hFoundBC_nTOFtracks"), globalFoundBC, nTOFtracks); - histosEventTracksFoundBC.fill(HIST("hFoundBC_nTRDtracks"), globalFoundBC, nTRDtracks); - - histosEventTracksFoundBC.fill(HIST("hFoundBC_nTPCtracks_HandmadeITSROFcut"), globalFoundBC, nTPCtracks_HandmadeITSROFcut); - histosEventTracksFoundBC.fill(HIST("hFoundBC_nTOFtracks_HandmadeITSROFcut"), globalFoundBC, nTOFtracks_HandmadeITSROFcut); - histosEventTracksFoundBC.fill(HIST("hFoundBC_nTRDTOFtracks_HandmadeITSROFcut"), globalFoundBC, nTRDTOFtracks_HandmadeITSROFcut); - - histosEventTracksFoundBC.fill(HIST("hFoundBC_nTRDTOFtracks"), globalFoundBC, nTRDTOFtracks); - histosEventTracksFoundBC.fill(HIST("hFoundBC_nITSTPCTRDtracks"), globalFoundBC, nITSTPCTRDtracks); - histosEventTracksFoundBC.fill(HIST("hFoundBC_nITSTPCTOFtracks"), globalFoundBC, nITSTPCTOFtracks); - histosEventTracksFoundBC.fill(HIST("hFoundBC_nITSTPCTRDTOFtracks"), globalFoundBC, nITSTPCTRDTOFtracks); - - // TVX collisions - if (collision.selection_bit(o2::aod::evsel::kIsTriggerTVX)) { - histosEventTracksFoundBC.fill(HIST("hFoundBC_kTVX_nAllTracks"), globalFoundBC, nAllTracks); - histosEventTracksFoundBC.fill(HIST("hFoundBC_kTVX_nTracksPV"), globalFoundBC, nTracksPV); - histosEventTracksFoundBC.fill(HIST("hFoundBC_kTVX_nGlobalTracks"), globalFoundBC, nGlobalTracks); - histosEventTracksFoundBC.fill(HIST("hFoundBC_kTVX_nITStracks"), globalFoundBC, nITStracks); - histosEventTracksFoundBC.fill(HIST("hFoundBC_kTVX_nTPCtracks"), globalFoundBC, nTPCtracks); - histosEventTracksFoundBC.fill(HIST("hFoundBC_kTVX_nTOFtracks"), globalFoundBC, nTOFtracks); - histosEventTracksFoundBC.fill(HIST("hFoundBC_kTVX_nTRDtracks"), globalFoundBC, nTRDtracks); - - histosEventTracksFoundBC.fill(HIST("hFoundBC_kTVX_nTPCtracks_HandmadeITSROFcut"), globalFoundBC, nTPCtracks_HandmadeITSROFcut); - histosEventTracksFoundBC.fill(HIST("hFoundBC_kTVX_nTOFtracks_HandmadeITSROFcut"), globalFoundBC, nTOFtracks_HandmadeITSROFcut); - histosEventTracksFoundBC.fill(HIST("hFoundBC_kTVX_nTRDTOFtracks_HandmadeITSROFcut"), globalFoundBC, nTRDTOFtracks_HandmadeITSROFcut); - - histosEventTracksFoundBC.fill(HIST("hFoundBC_kTVX_nTRDTOFtracks"), globalFoundBC, nTRDTOFtracks); - histosEventTracksFoundBC.fill(HIST("hFoundBC_kTVX_nITSTPCTRDtracks"), globalFoundBC, nITSTPCTRDtracks); - histosEventTracksFoundBC.fill(HIST("hFoundBC_kTVX_nITSTPCTOFtracks"), globalFoundBC, nITSTPCTOFtracks); - histosEventTracksFoundBC.fill(HIST("hFoundBC_kTVX_nITSTPCTRDTOFtracks"), globalFoundBC, nITSTPCTRDTOFtracks); - } - - // TVXinTRD collisions - if (collision.alias_bit(kTVXinTRD)) { - histosEventTracksFoundBC.fill(HIST("hFoundBC_kTVXinTRD_nAllTracks"), globalFoundBC, nAllTracks); - histosEventTracksFoundBC.fill(HIST("hFoundBC_kTVXinTRD_nTracksPV"), globalFoundBC, nTracksPV); - histosEventTracksFoundBC.fill(HIST("hFoundBC_kTVXinTRD_nGlobalTracks"), globalFoundBC, nGlobalTracks); - histosEventTracksFoundBC.fill(HIST("hFoundBC_kTVXinTRD_nITStracks"), globalFoundBC, nITStracks); - histosEventTracksFoundBC.fill(HIST("hFoundBC_kTVXinTRD_nTPCtracks"), globalFoundBC, nTPCtracks); - histosEventTracksFoundBC.fill(HIST("hFoundBC_kTVXinTRD_nTOFtracks"), globalFoundBC, nTOFtracks); - histosEventTracksFoundBC.fill(HIST("hFoundBC_kTVXinTRD_nTRDtracks"), globalFoundBC, nTRDtracks); - - histosEventTracksFoundBC.fill(HIST("hFoundBC_kTVXinTRD_nTRDTOFtracks"), globalFoundBC, nTRDTOFtracks); - histosEventTracksFoundBC.fill(HIST("hFoundBC_kTVXinTRD_nITSTPCTRDtracks"), globalFoundBC, nITSTPCTRDtracks); - histosEventTracksFoundBC.fill(HIST("hFoundBC_kTVXinTRD_nITSTPCTOFtracks"), globalFoundBC, nITSTPCTOFtracks); - histosEventTracksFoundBC.fill(HIST("hFoundBC_kTVXinTRD_nITSTPCTRDTOFtracks"), globalFoundBC, nITSTPCTRDTOFtracks); - } - } // end of if has_foundBC - double vZ = collision.posZ(); // #### values for 2D histogram axes @@ -1133,6 +1025,142 @@ struct RobustFluctuationObservables { histosEventBcInTF.fill(HIST("hIsTriggerTVX_vs_bcInTF_BEFORE_SEL8_AND_Vz"), bcInTF, collision.selection_bit(o2::aod::evsel::kIsTriggerTVX) ? 1 : 0); } + // ### special sub-loop over tracks for numerator of tracks / T0ampl ratios + if (collision.has_foundBC() && flagIncludeQATracksInFoundBC) { + int nAllTracks = 0; + int nTracksPV = 0; + + int nITStracks = 0; + int nTPCtracks = 0; + int nTPCtracks_HandmadeITSROFcut = 0; + int nTOFtracks = 0; + int nTOFtracks_HandmadeITSROFcut = 0; + int nTRDtracks = 0; + + int nTRDTOFtracks_HandmadeITSROFcut = 0; + + int nTRDTOFtracks = 0; + int nITSTPCTRDtracks = 0; + int nITSTPCTOFtracks = 0; + int nITSTPCTRDTOFtracks = 0; + + int nGlobalTracks = 0; + + double timeFromTOFtracks = 0; + double timeFromTRDtracks = 0; + + for (auto& track : tracks) { + + nAllTracks++; + if (!track.isPVContributor()) { + continue; + } + nTracksPV++; + + if (track.isGlobalTrack()) + nGlobalTracks++; + + nITStracks += track.hasITS() && !track.hasTPC(); + nTPCtracks += track.hasTPC(); + nTOFtracks += track.hasTOF(); + nTRDtracks += track.hasTRD() && !track.hasTOF(); + + nTRDTOFtracks += track.hasTRD() && track.hasTOF(); + nITSTPCTRDtracks += track.hasITS() && track.hasTPC() && track.hasTRD(); + nITSTPCTOFtracks += track.hasITS() && track.hasTPC() && track.hasTOF(); + nITSTPCTRDTOFtracks += track.hasITS() && track.hasTPC() && track.hasTOF() && track.hasTRD(); + + // if (flagBCisNotInHandmadeBoundariesITSROF) + if (flagFoundBCisNotInHandmadeBoundariesITSROF) { + nTPCtracks_HandmadeITSROFcut += track.hasTPC(); + nTOFtracks_HandmadeITSROFcut += track.hasTOF(); + nTRDTOFtracks_HandmadeITSROFcut += track.hasTRD() && track.hasTOF(); + } + + // calculate average time using TOF and TRD tracks + if (track.hasTOF()) { + timeFromTOFtracks += track.trackTime(); + } else if (track.hasTRD()) { + timeFromTRDtracks += track.trackTime(); + } + } + + if (TFid < 2 && collBC < 200) { + if (nTOFtracks > 0) + LOGF(info, "QA: average timeFromTOFtracks = %.f", timeFromTOFtracks / nTOFtracks); + if (nTRDtracks > 0) + LOGF(info, "QA: average timeFromTRDtracks = %.f", timeFromTRDtracks / nTRDtracks); + } + + // all collisions + histosEventTracksFoundBC.fill(HIST("hFoundBC_nAllTracks"), globalFoundBC, nAllTracks); + histosEventTracksFoundBC.fill(HIST("hFoundBC_nTracksPV"), globalFoundBC, nTracksPV); + histosEventTracksFoundBC.fill(HIST("hFoundBC_nGlobalTracks"), globalFoundBC, nGlobalTracks); + histosEventTracksFoundBC.fill(HIST("hFoundBC_nITStracks"), globalFoundBC, nITStracks); + histosEventTracksFoundBC.fill(HIST("hFoundBC_nTPCtracks"), globalFoundBC, nTPCtracks); + histosEventTracksFoundBC.fill(HIST("hFoundBC_nTOFtracks"), globalFoundBC, nTOFtracks); + histosEventTracksFoundBC.fill(HIST("hFoundBC_nTRDtracks"), globalFoundBC, nTRDtracks); + + histosEventTracksFoundBC.fill(HIST("hFoundBC_nTPCtracks_HandmadeITSROFcut"), globalFoundBC, nTPCtracks_HandmadeITSROFcut); + histosEventTracksFoundBC.fill(HIST("hFoundBC_nTOFtracks_HandmadeITSROFcut"), globalFoundBC, nTOFtracks_HandmadeITSROFcut); + histosEventTracksFoundBC.fill(HIST("hFoundBC_nTRDTOFtracks_HandmadeITSROFcut"), globalFoundBC, nTRDTOFtracks_HandmadeITSROFcut); + + histosEventTracksFoundBC.fill(HIST("hFoundBC_nTRDTOFtracks"), globalFoundBC, nTRDTOFtracks); + histosEventTracksFoundBC.fill(HIST("hFoundBC_nITSTPCTRDtracks"), globalFoundBC, nITSTPCTRDtracks); + histosEventTracksFoundBC.fill(HIST("hFoundBC_nITSTPCTOFtracks"), globalFoundBC, nITSTPCTOFtracks); + histosEventTracksFoundBC.fill(HIST("hFoundBC_nITSTPCTRDTOFtracks"), globalFoundBC, nITSTPCTRDTOFtracks); + + // TVX collisions + if (collision.selection_bit(o2::aod::evsel::kIsTriggerTVX)) { + histosEventTracksFoundBC.fill(HIST("hFoundBC_kTVX_nAllTracks"), globalFoundBC, nAllTracks); + histosEventTracksFoundBC.fill(HIST("hFoundBC_kTVX_nTracksPV"), globalFoundBC, nTracksPV); + histosEventTracksFoundBC.fill(HIST("hFoundBC_kTVX_nGlobalTracks"), globalFoundBC, nGlobalTracks); + histosEventTracksFoundBC.fill(HIST("hFoundBC_kTVX_nITStracks"), globalFoundBC, nITStracks); + histosEventTracksFoundBC.fill(HIST("hFoundBC_kTVX_nTPCtracks"), globalFoundBC, nTPCtracks); + histosEventTracksFoundBC.fill(HIST("hFoundBC_kTVX_nTOFtracks"), globalFoundBC, nTOFtracks); + histosEventTracksFoundBC.fill(HIST("hFoundBC_kTVX_nTRDtracks"), globalFoundBC, nTRDtracks); + + histosEventTracksFoundBC.fill(HIST("hFoundBC_kTVX_nTPCtracks_HandmadeITSROFcut"), globalFoundBC, nTPCtracks_HandmadeITSROFcut); + histosEventTracksFoundBC.fill(HIST("hFoundBC_kTVX_nTOFtracks_HandmadeITSROFcut"), globalFoundBC, nTOFtracks_HandmadeITSROFcut); + histosEventTracksFoundBC.fill(HIST("hFoundBC_kTVX_nTRDTOFtracks_HandmadeITSROFcut"), globalFoundBC, nTRDTOFtracks_HandmadeITSROFcut); + + histosEventTracksFoundBC.fill(HIST("hFoundBC_kTVX_nTRDTOFtracks"), globalFoundBC, nTRDTOFtracks); + histosEventTracksFoundBC.fill(HIST("hFoundBC_kTVX_nITSTPCTRDtracks"), globalFoundBC, nITSTPCTRDtracks); + histosEventTracksFoundBC.fill(HIST("hFoundBC_kTVX_nITSTPCTOFtracks"), globalFoundBC, nITSTPCTOFtracks); + histosEventTracksFoundBC.fill(HIST("hFoundBC_kTVX_nITSTPCTRDTOFtracks"), globalFoundBC, nITSTPCTRDTOFtracks); + + // to study ITS ROF dips vs multiplicity + if (nTracksPV >= 1 && nTracksPV < 20) + histosEventTracksFoundBC.fill(HIST("hFoundBC_kTVX_nITSTPCTRDtracks_mult_1_20"), globalFoundBC, nITSTPCTRDtracks); + else if (nTracksPV >= 20 && nTracksPV < 100) + histosEventTracksFoundBC.fill(HIST("hFoundBC_kTVX_nITSTPCTRDtracks_mult_20_100"), globalFoundBC, nITSTPCTRDtracks); + else if (nTracksPV >= 100 && nTracksPV < 400) + histosEventTracksFoundBC.fill(HIST("hFoundBC_kTVX_nITSTPCTRDtracks_mult_100_400"), globalFoundBC, nITSTPCTRDtracks); + else if (nTracksPV >= 400) + histosEventTracksFoundBC.fill(HIST("hFoundBC_kTVX_nITSTPCTRDtracks_mult_above_400"), globalFoundBC, nITSTPCTRDtracks); + + // vs bcInTF: + histosEventTracksFoundBC.fill(HIST("hBCinTF_kTVX_nTracksPV"), bcInTF, nTracksPV); + histosEventTracksFoundBC.fill(HIST("hBCinTF_kTVX_nITSTPCTRDtracks"), bcInTF, nITSTPCTRDtracks); + } + + // TVXinTRD collisions + if (collision.alias_bit(kTVXinTRD)) { + histosEventTracksFoundBC.fill(HIST("hFoundBC_kTVXinTRD_nAllTracks"), globalFoundBC, nAllTracks); + histosEventTracksFoundBC.fill(HIST("hFoundBC_kTVXinTRD_nTracksPV"), globalFoundBC, nTracksPV); + histosEventTracksFoundBC.fill(HIST("hFoundBC_kTVXinTRD_nGlobalTracks"), globalFoundBC, nGlobalTracks); + histosEventTracksFoundBC.fill(HIST("hFoundBC_kTVXinTRD_nITStracks"), globalFoundBC, nITStracks); + histosEventTracksFoundBC.fill(HIST("hFoundBC_kTVXinTRD_nTPCtracks"), globalFoundBC, nTPCtracks); + histosEventTracksFoundBC.fill(HIST("hFoundBC_kTVXinTRD_nTOFtracks"), globalFoundBC, nTOFtracks); + histosEventTracksFoundBC.fill(HIST("hFoundBC_kTVXinTRD_nTRDtracks"), globalFoundBC, nTRDtracks); + + histosEventTracksFoundBC.fill(HIST("hFoundBC_kTVXinTRD_nTRDTOFtracks"), globalFoundBC, nTRDTOFtracks); + histosEventTracksFoundBC.fill(HIST("hFoundBC_kTVXinTRD_nITSTPCTRDtracks"), globalFoundBC, nITSTPCTRDtracks); + histosEventTracksFoundBC.fill(HIST("hFoundBC_kTVXinTRD_nITSTPCTOFtracks"), globalFoundBC, nITSTPCTOFtracks); + histosEventTracksFoundBC.fill(HIST("hFoundBC_kTVXinTRD_nITSTPCTRDTOFtracks"), globalFoundBC, nITSTPCTRDTOFtracks); + } + } // end of if has_foundBC and && flagIncludeQATracksInFoundBC + // is FT0 bool isFT0 = false; double ft0_posZ = 0; @@ -1507,8 +1535,8 @@ struct RobustFluctuationObservables { } // global PV contributors - if (nTracksGlobalPVAccepted >= 1) // 2) - fillHistForThisCut("1globalPVcontrib", multNTracksPV, multTrk, nTracksGlobalAccepted, multT0A, multT0C, multV0A, t0cCentr, collBC); + // if (nTracksGlobalPVAccepted >= 1) // 2) + // fillHistForThisCut("1globalPVcontrib", multNTracksPV, multTrk, nTracksGlobalAccepted, multT0A, multT0C, multV0A, t0cCentr, collBC); // global PV contributors with 7 ITS hits if (nTracksGlobalPVwithITS7hits >= 1) // 2) @@ -1579,6 +1607,9 @@ struct RobustFluctuationObservables { // fillHistForThisCut("ALL_CUTS_Tighter", multNTracksPV, multTrk, nTracksGlobalAccepted, multT0A, multT0C, multV0A, t0cCentr, collBC); // } + if (collision.alias_bit(kTVXinTRD)) + fillHistForThisCut("kTVXinTRD", multNTracksPV, multTrk, nTracksGlobalAccepted, multT0A, multT0C, multV0A, t0cCentr, collBC); + if (flagBCisNotInHandmadeBoundariesITSROF) if (multNTracksPV < funcCutEventsByMultPVvsT0C->Eval(multT0C)) histosEvent.fill(HIST("hBC_Aft_rejectedByCutOnMultPVvsT0C_after_Handmade_ITSROF_cut"), collBC); diff --git a/PWGCF/FemtoDream/Tasks/CMakeLists.txt b/PWGCF/FemtoDream/Tasks/CMakeLists.txt index 2faaafdc4f5..58d9744c029 100644 --- a/PWGCF/FemtoDream/Tasks/CMakeLists.txt +++ b/PWGCF/FemtoDream/Tasks/CMakeLists.txt @@ -24,6 +24,11 @@ o2physics_add_dpl_workflow(femtodream-pair-track-v0 PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore COMPONENT_NAME Analysis) +o2physics_add_dpl_workflow(femtodream-triplet-track-track-v0 + SOURCES femtoDreamTripletTaskTrackTrackV0.cxx + PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore + COMPONENT_NAME Analysis) + o2physics_add_dpl_workflow(femtodream-debug-track SOURCES femtoDreamDebugTrack.cxx PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore diff --git a/PWGCF/FemtoDream/Tasks/femtoDreamCollisionMasker.cxx b/PWGCF/FemtoDream/Tasks/femtoDreamCollisionMasker.cxx index 85e60512ae8..1eb9653bf8f 100644 --- a/PWGCF/FemtoDream/Tasks/femtoDreamCollisionMasker.cxx +++ b/PWGCF/FemtoDream/Tasks/femtoDreamCollisionMasker.cxx @@ -47,6 +47,7 @@ enum Tasks { kTrackTrack, kTrackV0, kTrackTrackTrack, + kTrackTrackV0, kNTasks, }; } // namespace CollisionMasks @@ -215,6 +216,44 @@ struct femoDreamCollisionMasker { FilterPtMax.at(CollisionMasks::kPartOne).push_back(option.defaultValue.get()); } } + } else if (device.name.find("femto-dream-triplet-task-track-track-v0") != std::string::npos) { + LOG(info) << "Matched workflow: " << device.name; + TaskFinder = CollisionMasks::kTrackTrackV0; + for (auto const& option : device.options) { + if (option.name.compare(std::string("ConfCutPart")) == 0) { + TrackCutBits.at(CollisionMasks::kPartOne).push_back(option.defaultValue.get()); + } else if (option.name.compare(std::string("ConfTPCPIDBit")) == 0) { + TrackPIDTPCBits.at(CollisionMasks::kPartOne).push_back(option.defaultValue.get()); + } else if (option.name.compare(std::string("ConfTPCTOFPIDBit")) == 0) { + TrackPIDTPCTOFBits.at(CollisionMasks::kPartOne).push_back(option.defaultValue.get()); + } else if (option.name.compare(std::string("ConfPIDthrMom")) == 0) { + TrackPIDThreshold.at(CollisionMasks::kPartOne).push_back(option.defaultValue.get()); + } else if (option.name.compare(std::string("ConfMaxpT")) == 0) { + FilterPtMax.at(CollisionMasks::kPartOne).push_back(option.defaultValue.get()); + } else if (option.name.compare(std::string("ConfCutV0")) == 0) { + V0CutBits.at(CollisionMasks::kPartThree).push_back(option.defaultValue.get()); + } else if (option.name.compare(std::string("Conf_ChildPos_CutV0")) == 0) { + PosChildCutBits.at(CollisionMasks::kPartThree).push_back(option.defaultValue.get()); + } else if (option.name.compare(std::string("Conf_ChildPos_TPCBitV0")) == 0) { + PosChildPIDTPCBits.at(CollisionMasks::kPartThree).push_back(option.defaultValue.get()); + } else if (option.name.compare(std::string("Conf_ChildNeg_CutV0")) == 0) { + NegChildCutBits.at(CollisionMasks::kPartThree).push_back(option.defaultValue.get()); + } else if (option.name.compare(std::string("Conf_ChildNeg_TPCBitV0")) == 0) { + NegChildPIDTPCBits.at(CollisionMasks::kPartThree).push_back(option.defaultValue.get()); + } else if (option.name.compare(std::string("Conf_minInvMass_V0")) == 0) { + FilterInvMassMin.at(CollisionMasks::kPartThree).push_back(option.defaultValue.get()); + } else if (option.name.compare(std::string("Conf_maxInvMass_V0")) == 0) { + FilterInvMassMax.at(CollisionMasks::kPartThree).push_back(option.defaultValue.get()); + } else if (option.name.compare(std::string("Conf_minInvMassAnti_V0")) == 0) { + FilterInvMassAntiMin.at(CollisionMasks::kPartThree).push_back(option.defaultValue.get()); + } else if (option.name.compare(std::string("Conf_maxInvMassAnti_V0")) == 0) { + FilterInvMassAntiMax.at(CollisionMasks::kPartThree).push_back(option.defaultValue.get()); + } else if (option.name.compare(std::string("Conf_minPt_V0")) == 0) { + FilterPtMin.at(CollisionMasks::kPartThree).push_back(option.defaultValue.get()); + } else if (option.name.compare(std::string("Conf_maxPt_V0")) == 0) { + FilterPtMax.at(CollisionMasks::kPartThree).push_back(option.defaultValue.get()); + } + } } } @@ -353,6 +392,72 @@ struct femoDreamCollisionMasker { } } + // Make bitmask for a V0 for three body task + // This function ALWAYS checks V0 P; if howManyVoaToSetInMask is set to more than 1, it also checks how many + // V0s there are which pass V0 P selection and accordingly sets the bits in the mask for V0s P+1 or both P+1 and P+2 + template + void MaskForV0_ThreeBody(T& BitSet, CollisionMasks::Parts P, FDCollision const& col, FDParticles const& parts, int howManyV0sToSetInMask) + { + if (howManyV0sToSetInMask == 2) { + if (P == 2) { + LOG(fatal) << "You are checking third particle out of three but asking to set two new bits, not possible!"; + } + } + if (howManyV0sToSetInMask == 3) { + if (P >= 1) { + LOG(fatal) << "You are checking second or third particle out of three but asking to set three new bits, not possible!"; + } + } + for (size_t index = 0; index < V0CutBits.at(P).size(); index++) { + int countV0sWhichPassSelection = 0; + for (auto const& V0 : parts) { + if (V0.partType() != static_cast(femtodreamparticle::kV0)) { + continue; + } + // check filter cuts for pt + if (V0.pt() < FilterPtMin.at(P).at(index) || V0.pt() > FilterPtMax.at(P).at(index)) { + continue; + } + // check filter cuts for Minv + if (V0.mLambda() < FilterInvMassMin.at(P).at(index) || V0.mLambda() > FilterInvMassMax.at(P).at(index) || + V0.mAntiLambda() < FilterInvMassAntiMin.at(P).at(index) || V0.mAntiLambda() > FilterInvMassAntiMax.at(P).at(index)) { + continue; + } + // set the bit at the index of the selection equal to one if the track passes all selections + // check track cuts + if ((V0.cut() & V0CutBits.at(P).at(index)) == V0CutBits.at(P).at(index)) { + // check daughter cuts and pid cuts + const auto& posChild = parts.iteratorAt(V0.index() - 2); + const auto& negChild = parts.iteratorAt(V0.index() - 1); + if ((posChild.cut() & PosChildCutBits.at(P).at(index)) == PosChildCutBits.at(P).at(index) && + (posChild.pidcut() & PosChildPIDTPCBits.at(P).at(index)) == PosChildPIDTPCBits.at(P).at(index) && + (negChild.cut() & NegChildCutBits.at(P).at(index)) == NegChildCutBits.at(P).at(index) && + (negChild.pidcut() & NegChildPIDTPCBits.at(P).at(index)) == NegChildPIDTPCBits.at(P).at(index)) { + countV0sWhichPassSelection = countV0sWhichPassSelection + 1; + } + } + } + if (countV0sWhichPassSelection >= 1) + BitSet.at(P).set(index); + + if (howManyV0sToSetInMask == 2) { + if (countV0sWhichPassSelection >= 2) { + if (P == CollisionMasks::kPartOne) + BitSet.at(CollisionMasks::kPartTwo).set(index); + if (P == CollisionMasks::kPartTwo) + BitSet.at(CollisionMasks::kPartThree).set(index); + } + } + + if (howManyV0sToSetInMask == 3) { + if (countV0sWhichPassSelection >= 2) + BitSet.at(CollisionMasks::kPartTwo).set(index); + if (countV0sWhichPassSelection >= 3) + BitSet.at(CollisionMasks::kPartThree).set(index); + } + } + } + void process(FDCollision const& col, FDParticles const& parts) { // create a bit mask for particle one, particle two and particle three @@ -377,10 +482,15 @@ struct femoDreamCollisionMasker { break; case CollisionMasks::kTrackTrackTrack: // triplet-track-track-track task - // create mask for all identical tracks, here TrackOne means there is at least on track of interest - // TrackTwo means at least two tracks and TrackThree means at least three tracks + // this assumes three identical tracks are used in the task MaskForTrack_ThreeBody(Mask, CollisionMasks::kPartOne, col, parts, 3); break; + case CollisionMasks::kTrackTrackV0: + // triplet-track-track-v0 task + // this assumes two identical tracks and one V0 is used in the task; V0 is last particle + MaskForTrack_ThreeBody(Mask, CollisionMasks::kPartOne, col, parts, 2); + MaskForV0_ThreeBody(Mask, CollisionMasks::kPartThree, col, parts, 1); + break; // TODO: add all supported pair/triplet tasks default: LOG(fatal) << "No femtodream pair task found!"; diff --git a/PWGCF/FemtoDream/Tasks/femtoDreamTripletTaskTrackTrackTrack.cxx b/PWGCF/FemtoDream/Tasks/femtoDreamTripletTaskTrackTrackTrack.cxx index 9e7bc747abd..2ef196642eb 100644 --- a/PWGCF/FemtoDream/Tasks/femtoDreamTripletTaskTrackTrackTrack.cxx +++ b/PWGCF/FemtoDream/Tasks/femtoDreamTripletTaskTrackTrackTrack.cxx @@ -61,7 +61,7 @@ struct femtoDreamTripletTaskTrackTrackTrack { // Which particles to analyse; currently support only for same species and cuts triplets Configurable ConfPDGCodePart{"ConfPDGCodePart", 2212, "Particle PDG code"}; - Configurable ConfCutPart{"ConfCutPart", 5542474, "Particles - Selection bit from cutCulator"}; + Configurable ConfCutPart{"ConfCutPart", 5542474, "Track - Selection bit from cutCulator"}; /// Partition for selected particles Partition SelectedParts = (aod::femtodreamparticle::partType == uint8_t(aod::femtodreamparticle::ParticleType::kTrack)) && @@ -217,6 +217,9 @@ struct femtoDreamTripletTaskTrackTrackTrack { { fillCollision(col); auto thegroupSelectedParts = SelectedParts->sliceByCached(aod::femtodreamparticle::fdCollisionId, col.globalIndex(), cache); + if (thegroupSelectedParts.size() < 3) { + return; + } doSameEvent(thegroupSelectedParts, parts, col.magField(), col.multNtr(), col.multV0M()); } PROCESS_SWITCH(femtoDreamTripletTaskTrackTrackTrack, processSameEvent, "Enable processing same event", true); @@ -226,16 +229,11 @@ struct femtoDreamTripletTaskTrackTrackTrack { /// \param parts subscribe to the femtoDreamParticleTable void processSameEventMasked(MaskedCollision& col, o2::aod::FDParticles& parts) { - if (ConfTracksInMixedEvent < 1 || ConfTracksInMixedEvent > 3) - LOG(fatal) << "ConfTracksInMixedEvent must be between 1 and 3!"; - if (ConfTracksInMixedEvent == 1 && (col.bitmaskTrackOne() & MaskBit) != MaskBit) - return; - if (ConfTracksInMixedEvent == 2 && (col.bitmaskTrackTwo() & MaskBit) != MaskBit) - return; - if (ConfTracksInMixedEvent == 3 && (col.bitmaskTrackThree() & MaskBit) != MaskBit) - return; fillCollision(col); auto thegroupSelectedParts = SelectedParts->sliceByCached(aod::femtodreamparticle::fdCollisionId, col.globalIndex(), cache); + if (thegroupSelectedParts.size() < 3) { + return; + } doSameEvent(thegroupSelectedParts, parts, col.magField(), col.multNtr(), col.multV0M()); } PROCESS_SWITCH(femtoDreamTripletTaskTrackTrackTrack, processSameEventMasked, "Enable processing same event with masks", false); @@ -250,6 +248,9 @@ struct femtoDreamTripletTaskTrackTrackTrack { { fillCollision(col); auto thegroupSelectedParts = SelectedPartsMC->sliceByCached(aod::femtodreamparticle::fdCollisionId, col.globalIndex(), cache); + if (thegroupSelectedParts.size() < 3) { + return; + } doSameEvent(thegroupSelectedParts, parts, col.magField(), col.multNtr(), col.multV0M()); } PROCESS_SWITCH(femtoDreamTripletTaskTrackTrackTrack, processSameEventMC, "Enable processing same event for Monte Carlo", false); @@ -262,16 +263,11 @@ struct femtoDreamTripletTaskTrackTrackTrack { soa::Join& parts, o2::aod::FDMCParticles&) { - if (ConfTracksInMixedEvent < 1 || ConfTracksInMixedEvent > 3) - LOG(fatal) << "ConfTracksInMixedEvent must be between 1 and 3!"; - if (ConfTracksInMixedEvent == 1 && (col.bitmaskTrackOne() & MaskBit) != MaskBit) - return; - if (ConfTracksInMixedEvent == 2 && (col.bitmaskTrackTwo() & MaskBit) != MaskBit) - return; - if (ConfTracksInMixedEvent == 3 && (col.bitmaskTrackThree() & MaskBit) != MaskBit) - return; fillCollision(col); auto thegroupSelectedParts = SelectedPartsMC->sliceByCached(aod::femtodreamparticle::fdCollisionId, col.globalIndex(), cache); + if (thegroupSelectedParts.size() < 3) { + return; + } doSameEvent(thegroupSelectedParts, parts, col.magField(), col.multNtr(), col.multV0M()); } PROCESS_SWITCH(femtoDreamTripletTaskTrackTrackTrack, processSameEventMCMasked, "Enable processing same event for Monte Carlo", false); @@ -342,9 +338,10 @@ struct femtoDreamTripletTaskTrackTrackTrack { Partition PartitionMaskedCol1 = (ConfTracksInMixedEvent == 1 && (aod::femtodreamcollision::bitmaskTrackOne & MaskBit) == MaskBit) || (ConfTracksInMixedEvent == 2 && (aod::femtodreamcollision::bitmaskTrackTwo & MaskBit) == MaskBit) || (ConfTracksInMixedEvent == 3 && (aod::femtodreamcollision::bitmaskTrackThree & MaskBit) == MaskBit); + PartitionMaskedCol1.bindTable(cols); - for (auto& [collision1, collision2, collision3] : soa::selfCombinations(colBinning, ConfNEventsMix, -1, PartitionMaskedCol1, PartitionMaskedCol1, PartitionMaskedCol1)) { + for (auto& [collision1, collision2, collision3] : soa::selfCombinations(colBinning, ConfNEventsMix, -1, *PartitionMaskedCol1.mFiltered, *PartitionMaskedCol1.mFiltered, *PartitionMaskedCol1.mFiltered)) { const int multiplicityCol = collision1.multNtr(); ThreeBodyQARegistry.fill(HIST("TripletTaskQA/hMECollisionBins"), colBinning.getBin({collision1.posZ(), multiplicityCol})); @@ -408,7 +405,7 @@ struct femtoDreamTripletTaskTrackTrackTrack { (ConfTracksInMixedEvent == 3 && (aod::femtodreamcollision::bitmaskTrackThree & MaskBit) == MaskBit); PartitionMaskedCol1.bindTable(cols); - for (auto& [collision1, collision2, collision3] : soa::selfCombinations(colBinning, ConfNEventsMix, -1, PartitionMaskedCol1, PartitionMaskedCol1, PartitionMaskedCol1)) { + for (auto& [collision1, collision2, collision3] : soa::selfCombinations(colBinning, ConfNEventsMix, -1, *PartitionMaskedCol1.mFiltered, *PartitionMaskedCol1.mFiltered, *PartitionMaskedCol1.mFiltered)) { const int multiplicityCol = collision1.multNtr(); ThreeBodyQARegistry.fill(HIST("TripletTaskQA/hMECollisionBins"), colBinning.getBin({collision1.posZ(), multiplicityCol})); diff --git a/PWGCF/FemtoDream/Tasks/femtoDreamTripletTaskTrackTrackV0.cxx b/PWGCF/FemtoDream/Tasks/femtoDreamTripletTaskTrackTrackV0.cxx new file mode 100644 index 00000000000..05ba4ee37d3 --- /dev/null +++ b/PWGCF/FemtoDream/Tasks/femtoDreamTripletTaskTrackTrackV0.cxx @@ -0,0 +1,606 @@ +// Copyright 2019-2022 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. + +/// \file femtoDreamTripletTaskTrackTrackV0.cxx +/// \brief Tasks that reads the track and V0 tables and creates triplets; only two identical tracks and a V0 can be used +/// \author Laura Serksnyte, TU München, laura.serksnyte@tum.de + +#include +#include +#include "Framework/AnalysisTask.h" +#include "Framework/runDataProcessing.h" +#include "Framework/HistogramRegistry.h" +#include "Framework/ASoAHelpers.h" +#include "Framework/RunningWorkflowInfo.h" +#include "Framework/StepTHn.h" +#include "Framework/O2DatabasePDGPlugin.h" +#include "TDatabasePDG.h" + +#include "PWGCF/DataModel/FemtoDerived.h" +#include "PWGCF/FemtoDream/Core/femtoDreamParticleHisto.h" +#include "PWGCF/FemtoDream/Core/femtoDreamEventHisto.h" +#include "PWGCF/FemtoDream/Core/femtoDreamPairCleaner.h" +#include "PWGCF/FemtoDream/Core/femtoDreamContainerThreeBody.h" +#include "PWGCF/FemtoDream/Core/femtoDreamDetaDphiStar.h" +#include "PWGCF/FemtoDream/Core/femtoDreamUtils.h" + +using namespace o2; +using namespace o2::analysis::femtoDream; +using namespace o2::framework; +using namespace o2::framework::expressions; +using namespace o2::soa; + +struct femtoDreamTripletTaskTrackTrackV0 { + SliceCache cache; + Preslice perCol = aod::femtodreamparticle::fdCollisionId; + + using MaskedCollisions = soa::Join; + using MaskedCollision = MaskedCollisions::iterator; + aod::femtodreamcollision::BitMaskType MaskBit = -1; + + Configurable ConfMixIfTripletPresent{"ConfMixIfTripletPresent", true, "Use for mixing only events which have a TTV0 triplet"}; + Configurable ConfMixIfTVOPairPresent{"ConfMixIfTVOPairPresent", false, "Use for mixing only events which have a TV0 pair (at least one track and one V0)"}; + Configurable ConfMixIfTOrVOPartsPresent{"ConfMixIfTOrVOPartsPresent", false, "Use for mixing only events which have at least one particle of interest"}; + + /// Track selection + Configurable ConfPDGCodePart{"ConfPDGCodePart", 2212, "Particle PDG code"}; + Configurable ConfCutPart{"ConfCutPart", 5542474, "Track - Selection bit from cutCulator"}; + Configurable ConfTPCPIDBit{"ConfTPCPIDBit", 16, "PID TPC bit from cutCulator "}; + Configurable ConfTPCTOFPIDBit{"ConfTPCTOFPIDBit", 8, "PID TPCTOF bit from cutCulator"}; + Configurable ConfMaxpT{"ConfMaxpT", 4.05f, "Maximum transverse momentum of the particles"}; + Configurable ConfPIDthrMom{"ConfPIDthrMom", 1.f, "Momentum threshold from which TPC and TOF are required for PID"}; + Configurable ConfIsMC{"ConfIsMC", false, "Enable additional Histogramms in the case of a MonteCarlo Run"}; + Configurable ConfUse3D{"ConfUse3D", false, "Enable three dimensional histogramms (to be used only for analysis with high statistics): k* vs mT vs multiplicity"}; + + /// Partition for selected particles + Partition SelectedParts = (aod::femtodreamparticle::partType == uint8_t(aod::femtodreamparticle::ParticleType::kTrack)) && + ifnode(aod::femtodreamparticle::pt * (nexp(aod::femtodreamparticle::eta) + nexp(-1.f * aod::femtodreamparticle::eta)) / 2.f <= ConfPIDthrMom, ncheckbit(aod::femtodreamparticle::pidcut, ConfTPCPIDBit), ncheckbit(aod::femtodreamparticle::pidcut, ConfTPCTOFPIDBit)) && + (ncheckbit(aod::femtodreamparticle::cut, ConfCutPart)) && + (aod::femtodreamparticle::pt < ConfMaxpT); + Partition> SelectedPartsMC = (aod::femtodreamparticle::partType == uint8_t(aod::femtodreamparticle::ParticleType::kTrack)) && + ifnode(aod::femtodreamparticle::pt * (nexp(aod::femtodreamparticle::eta) + nexp(-1.f * aod::femtodreamparticle::eta)) / 2.f <= ConfPIDthrMom, ncheckbit(aod::femtodreamparticle::pidcut, ConfTPCPIDBit), ncheckbit(aod::femtodreamparticle::pidcut, ConfTPCTOFPIDBit)) && + (ncheckbit(aod::femtodreamparticle::cut, ConfCutPart)) && + (aod::femtodreamparticle::pt < ConfMaxpT); + + /// Histogramming of selected tracks + FemtoDreamParticleHisto trackHistoSelectedParts; + + /// V0 selection + Configurable ConfPDGCodeV0{"ConfPDGCodeV0", 3122, "V0 PDG code"}; + Configurable ConfCutV0{"ConfCutV0", 338, "V0 - Selection bit from cutCulator"}; + Configurable Conf_ChildPos_CutV0{"Conf_ChildPos_CutV0", 149, "Selection bit for positive child of V0"}; + Configurable Conf_ChildPos_TPCBitV0{"Conf_ChildPos_TPCBitV0", 2, "PID TPC bit for positive child of V0"}; + Configurable Conf_ChildNeg_CutV0{"Conf_ChildNeg_CutV0", 149, "Selection bit for negative child of V0"}; + Configurable Conf_ChildNeg_TPCBitV0{"Conf_ChildNeg_TPCBitV0", 2, "PID TPC bit for negative child of V0"}; + + Configurable Conf_minInvMass_V0{"Conf_minInvMass_V0", 1.08, "Minimum invariant mass of V0 (particle)"}; + Configurable Conf_maxInvMass_V0{"Conf_maxInvMass_V0", 1.15, "Maximum invariant mass of V0 (particle)"}; + Configurable Conf_minInvMassAnti_V0{"Conf_minInvMassAnti_V0", 1.08, "Minimum invariant mass of V0 (antiparticle)"}; + Configurable Conf_maxInvMassAnti_V0{"Conf_maxInvMassAnti_V0", 1.15, "Maximum invariant mass of V0 (antiparticle)"}; + + Configurable Conf_minPt_V0{"Conf_minPt_V0", 0., "Minimum pT of V0"}; + Configurable Conf_maxPt_V0{"Conf_maxPt_V0", 999., "Maximum pT of V0"}; + + // Partition for selected particles + Partition SelectedV0s = (aod::femtodreamparticle::partType == uint8_t(aod::femtodreamparticle::ParticleType::kV0)) && + (ncheckbit(aod::femtodreamparticle::cut, ConfCutV0)) && + (aod::femtodreamparticle::mLambda > Conf_minInvMass_V0) && + (aod::femtodreamparticle::mLambda < Conf_maxInvMass_V0) && + (aod::femtodreamparticle::mAntiLambda > Conf_minInvMassAnti_V0) && + (aod::femtodreamparticle::mAntiLambda < Conf_maxInvMassAnti_V0) && + (aod::femtodreamparticle::pt > Conf_minPt_V0) && + (aod::femtodreamparticle::pt < Conf_maxPt_V0); + Partition> SelectedV0sMC = (aod::femtodreamparticle::partType == uint8_t(aod::femtodreamparticle::ParticleType::kV0)) && + (ncheckbit(aod::femtodreamparticle::cut, ConfCutV0)) && + (aod::femtodreamparticle::mLambda > Conf_minInvMass_V0) && + (aod::femtodreamparticle::mLambda < Conf_maxInvMass_V0) && + (aod::femtodreamparticle::mAntiLambda > Conf_minInvMassAnti_V0) && + (aod::femtodreamparticle::mAntiLambda < Conf_maxInvMassAnti_V0) && + (aod::femtodreamparticle::pt > Conf_minPt_V0) && + (aod::femtodreamparticle::pt < Conf_maxPt_V0); + + /// Histogramming of selected V0s + FemtoDreamParticleHisto particleHistoSelectedV0s; + FemtoDreamParticleHisto particleHistoPosChild; + FemtoDreamParticleHisto particleHistoNegChild; + + /// Histogramming for Event + FemtoDreamEventHisto eventHisto; + + /// Particles + ConfigurableAxis ConfTempFitVarBinsTrack{"ConfTempFitVarBinsTrack", {300, -0.15, 0.15}, "binning of the TempFitVar in the pT vs. TempFitVar plot"}; + ConfigurableAxis ConfTempFitVarpTBins{"ConfTempFitVarpTBins", {20, 0.5, 4.05}, "pT binning of the pT vs. TempFitVar plot (track)"}; + ConfigurableAxis ConfTempFitVarBinsV0{"ConfTempFitVarBinsV0", {300, 0.9, 1}, "binning of the TempFitVar in the pT vs. TempFitVar plot (V0)"}; + ConfigurableAxis ConfTempFitVarBinsV0Child{"ConfTempFitVarBinsV0Child", {300, -0.15, 0.15}, "binning of the TempFitVar in the pT vs. TempFitVar plot (V0 child)"}; + ConfigurableAxis ConfTempFitVarpTV0Bins{"ConfTempFitVarpTV0Bins", {20, 0.5, 4.05}, "pT binning of the pT vs. TempFitVar plot (V0)"}; + ConfigurableAxis ConfTempFitVarpTV0Child{"ConfTempFitVarpTV0Child", {20, 0.5, 4.05}, "pT binning of the pT vs. TempFitVar plot (V0 child)"}; + ConfigurableAxis ConfInvMassBins{"ConfInvMassBins", {200, 1, 1.2}, "InvMass binning"}; + + /// Correlations + ConfigurableAxis ConfMultBins{"ConfMultBins", {VARIABLE_WIDTH, 0.0f, 20.0f, 40.0f, 60.0f, 80.0f, 100.0f, 200.0f, 99999.f}, "Mixing bins - multiplicity"}; + ConfigurableAxis ConfVtxBins{"ConfVtxBins", {VARIABLE_WIDTH, -10.0f, -8.f, -6.f, -4.f, -2.f, 0.f, 2.f, 4.f, 6.f, 8.f, 10.f}, "Mixing bins - z-vertex"}; + + ColumnBinningPolicy colBinning{{ConfVtxBins, ConfMultBins}, true}; + + ConfigurableAxis ConfQ3Bins{"ConfQ3Bins", {2000, 0., 8.}, "binning Q3"}; + Configurable ConfNEventsMix{"ConfNEventsMix", 5, "Number of events for mixing"}; + Configurable ConfIsCPR{"ConfIsCPR", true, "Close Pair Rejection"}; + Configurable ConfCPRPlotPerRadii{"ConfCPRPlotPerRadii", false, "Plot CPR per radii"}; + Configurable ConfCPRdeltaPhiMax{"ConfCPRdeltaPhiMax", 0.01, "Max. Delta Phi for Close Pair Rejection"}; + Configurable ConfCPRdeltaEtaMax{"ConfCPRdeltaEtaMax", 0.01, "Max. Delta Eta for Close Pair Rejection"}; + ConfigurableAxis ConfDummy{"ConfDummy", {1, 0, 1}, "Dummy axis"}; + + FemtoDreamContainerThreeBody sameEventCont; + FemtoDreamContainerThreeBody mixedEventCont; + FemtoDreamPairCleaner pairCleanerTrackTrack; + FemtoDreamPairCleaner pairCleanerTrackV0; + FemtoDreamDetaDphiStar pairCloseRejectionTrackTrack; + FemtoDreamDetaDphiStar pairCloseRejectionTrackV0; + /// Histogram output + HistogramRegistry qaRegistry{"TrackQA", {}, OutputObjHandlingPolicy::AnalysisObject}; + HistogramRegistry resultRegistry{"Correlations", {}, OutputObjHandlingPolicy::AnalysisObject}; + HistogramRegistry ThreeBodyQARegistry{"ThreeBodyQARegistry", {}, OutputObjHandlingPolicy::AnalysisObject}; + + void init(InitContext& context) + { + + eventHisto.init(&qaRegistry); + trackHistoSelectedParts.init(&qaRegistry, ConfDummy, ConfDummy, ConfTempFitVarpTBins, ConfDummy, ConfDummy, ConfTempFitVarBinsTrack, ConfDummy, ConfDummy, ConfDummy, ConfDummy, ConfDummy, ConfIsMC, ConfPDGCodePart); + particleHistoSelectedV0s.init(&qaRegistry, ConfDummy, ConfDummy, ConfTempFitVarpTV0Bins, ConfDummy, ConfDummy, ConfTempFitVarBinsV0, ConfDummy, ConfDummy, ConfDummy, ConfDummy, ConfInvMassBins, ConfIsMC, ConfPDGCodeV0); + particleHistoPosChild.init(&qaRegistry, ConfDummy, ConfDummy, ConfTempFitVarpTV0Child, ConfDummy, ConfDummy, ConfTempFitVarBinsV0Child, ConfDummy, ConfDummy, ConfDummy, ConfDummy, ConfDummy, ConfIsMC, 0); + particleHistoNegChild.init(&qaRegistry, ConfDummy, ConfDummy, ConfTempFitVarpTV0Child, ConfDummy, ConfDummy, ConfTempFitVarBinsV0Child, ConfDummy, ConfDummy, ConfDummy, ConfDummy, ConfDummy, ConfIsMC, 0); + + ThreeBodyQARegistry.add("TripletTaskQA/hSECollisionBins", ";bin;Entries", kTH1F, {{120, -0.5, 119.5}}); + ThreeBodyQARegistry.add("TripletTaskQA/hMECollisionBins", ";bin;Entries", kTH1F, {{120, -0.5, 119.5}}); + std::vector tmpVecMult = ConfMultBins; + framework::AxisSpec multAxis = {tmpVecMult, "Multiplicity"}; + ThreeBodyQARegistry.add("TripletTaskQA/hSEMultVSGoodTracks", ";Mult;GoodT", kTH2F, {multAxis, {100, 0, 100}}); + + sameEventCont.init(&resultRegistry, ConfQ3Bins, ConfMultBins, ConfIsMC); + mixedEventCont.init(&resultRegistry, ConfQ3Bins, ConfMultBins, ConfIsMC); + sameEventCont.setPDGCodes(ConfPDGCodePart, ConfPDGCodePart, ConfPDGCodeV0); + mixedEventCont.setPDGCodes(ConfPDGCodePart, ConfPDGCodePart, ConfPDGCodeV0); + + pairCleanerTrackTrack.init(&qaRegistry); + pairCleanerTrackV0.init(&qaRegistry); + if (ConfIsCPR.value) { + pairCloseRejectionTrackTrack.init(&resultRegistry, &qaRegistry, ConfCPRdeltaPhiMax.value, ConfCPRdeltaEtaMax.value, ConfCPRPlotPerRadii.value); + pairCloseRejectionTrackV0.init(&resultRegistry, &qaRegistry, ConfCPRdeltaPhiMax.value, ConfCPRdeltaEtaMax.value, ConfCPRPlotPerRadii.value); + } + + // get bit for the collision mask + std::bitset<8 * sizeof(aod::femtodreamcollision::BitMaskType)> mask; + int index = 0; + auto& workflows = context.services().get(); + for (DeviceSpec const& device : workflows.devices) { + if (device.name.find("femto-dream-triplet-task-track-track-v0") != std::string::npos) { + if (containsNameValuePair(device.options, "ConfCutPart", ConfCutPart.value) && + containsNameValuePair(device.options, "ConfTPCPIDBit", ConfTPCPIDBit.value) && + containsNameValuePair(device.options, "ConfTPCTOFPIDBit", ConfTPCTOFPIDBit.value) && + containsNameValuePair(device.options, "ConfPIDthrMom", ConfPIDthrMom.value) && + containsNameValuePair(device.options, "ConfMaxpT", ConfMaxpT.value) && + containsNameValuePair(device.options, "ConfCutV0", ConfCutV0.value) && + containsNameValuePair(device.options, "Conf_ChildPos_CutV0", Conf_ChildPos_CutV0.value) && + containsNameValuePair(device.options, "Conf_ChildPos_TPCBitV0", Conf_ChildPos_TPCBitV0.value) && + containsNameValuePair(device.options, "Conf_ChildNeg_CutV0", Conf_ChildNeg_CutV0.value) && + containsNameValuePair(device.options, "Conf_ChildNeg_TPCBitV0", Conf_ChildNeg_TPCBitV0.value) && + containsNameValuePair(device.options, "Conf_minInvMass_V0", Conf_minInvMass_V0.value) && + containsNameValuePair(device.options, "Conf_maxInvMass_V0", Conf_maxInvMass_V0.value) && + containsNameValuePair(device.options, "Conf_minInvMassAnti_V0", Conf_minInvMassAnti_V0.value) && + containsNameValuePair(device.options, "Conf_maxInvMassAnti_V0", Conf_maxInvMassAnti_V0.value) && + containsNameValuePair(device.options, "Conf_minPt_V0", Conf_minPt_V0.value) && + containsNameValuePair(device.options, "Conf_maxPt_V0", Conf_maxPt_V0.value)) { + mask.set(index); + MaskBit = static_cast(mask.to_ulong()); + LOG(info) << "Device name matched: " << device.name; + LOG(info) << "Bitmask for collisions: " << mask.to_string(); + break; + } else { + index++; + } + } + } + + if ((doprocessSameEvent && doprocessSameEventMasked) || + (doprocessMixedEvent && doprocessMixedEventMasked) || + (doprocessSameEventMC && doprocessSameEventMCMasked) || + (doprocessMixedEventMC && doprocessMixedEventMCMasked)) { + LOG(fatal) << "Normal and masked processing cannot be activated simultaneously!"; + } + + if ((ConfMixIfTripletPresent && ConfMixIfTVOPairPresent) || + (ConfMixIfTripletPresent && ConfMixIfTOrVOPartsPresent) || + (ConfMixIfTVOPairPresent && ConfMixIfTOrVOPartsPresent)) { + LOG(fatal) << "Only one method of mixing can be chosen!"; + } + } + + template + void fillCollision(CollisionType col) + { + ThreeBodyQARegistry.fill(HIST("TripletTaskQA/hSECollisionBins"), colBinning.getBin({col.posZ(), col.multNtr()})); + eventHisto.fillQA(col); + } + + /// This function processes the same event and takes care of all the histogramming + /// @tparam PartitionType + /// @tparam PartType + /// @tparam isMC: enables Monte Carlo truth specific histograms + /// @param groupSelectedTracks partition for the first particle passed by the process function + /// @param parts femtoDreamParticles table (in case of Monte Carlo joined with FemtoDreamMCLabels) + /// @param magFieldTesla magnetic field of the collision + /// @param multCol multiplicity of the collision + template + void doSameEvent(PartitionType groupSelectedTracks, PartitionType groupSelectedV0s, PartType parts, float magFieldTesla, int multCol, float centCol) + { + /// Histograming tracks + for (auto& part : groupSelectedTracks) { + trackHistoSelectedParts.fillQA(part, aod::femtodreamparticle::kPt, multCol, centCol); + } + /// Histograming V0s + for (auto& V0 : groupSelectedV0s) { + const auto& posChild = parts.iteratorAt(V0.index() - 2); + const auto& negChild = parts.iteratorAt(V0.index() - 1); + + particleHistoSelectedV0s.fillQA(V0, aod::femtodreamparticle::kPt, multCol, centCol); + particleHistoPosChild.fillQA(posChild, aod::femtodreamparticle::kPt, multCol, centCol); + particleHistoNegChild.fillQA(negChild, aod::femtodreamparticle::kPt, multCol, centCol); + + if (((posChild.cut() & Conf_ChildPos_CutV0) == Conf_ChildPos_CutV0 && + (posChild.pidcut() & Conf_ChildPos_TPCBitV0) == Conf_ChildPos_TPCBitV0 && + (negChild.cut() & Conf_ChildNeg_CutV0) == Conf_ChildNeg_CutV0 && + (negChild.pidcut() & Conf_ChildNeg_TPCBitV0) == Conf_ChildNeg_TPCBitV0)) { + particleHistoSelectedV0s.fillQA(V0, aod::femtodreamparticle::kPt, multCol, centCol); + particleHistoPosChild.fillQA(posChild, aod::femtodreamparticle::kPt, multCol, centCol); + particleHistoNegChild.fillQA(negChild, aod::femtodreamparticle::kPt, multCol, centCol); + } + } + + /// Now build the combinations + for (auto& V0 : groupSelectedV0s) { + const auto& posChild = parts.iteratorAt(V0.index() - 2); + const auto& negChild = parts.iteratorAt(V0.index() - 1); + if (!((posChild.cut() & Conf_ChildPos_CutV0) == Conf_ChildPos_CutV0 && + (posChild.pidcut() & Conf_ChildPos_TPCBitV0) == Conf_ChildPos_TPCBitV0 && + (negChild.cut() & Conf_ChildNeg_CutV0) == Conf_ChildNeg_CutV0 && + (negChild.pidcut() & Conf_ChildNeg_TPCBitV0) == Conf_ChildNeg_TPCBitV0)) { + continue; + } + + for (auto& [T1, T2] : combinations(CombinationsStrictlyUpperIndexPolicy(groupSelectedTracks, groupSelectedTracks))) { + + // Close pair rejection + if (ConfIsCPR.value) { + if (pairCloseRejectionTrackTrack.isClosePair(T1, T2, parts, magFieldTesla)) { + continue; + } + if (pairCloseRejectionTrackV0.isClosePair(T1, V0, parts, magFieldTesla)) { + continue; + } + if (pairCloseRejectionTrackV0.isClosePair(T2, V0, parts, magFieldTesla)) { + continue; + } + } + + // track cleaning + if (!pairCleanerTrackTrack.isCleanPair(T1, T2, parts)) { + continue; + } + if (!pairCleanerTrackV0.isCleanPair(T2, V0, parts)) { + continue; + } + if (!pairCleanerTrackV0.isCleanPair(T1, V0, parts)) { + continue; + } + sameEventCont.setTriplet(T1, T2, V0, multCol); + } + } + } + + /// process function to call doSameEvent with Data + /// \param col subscribe to the collision table (Data) + /// \param parts subscribe to the femtoDreamParticleTable + void processSameEvent(o2::aod::FDCollision& col, + o2::aod::FDParticles& parts) + { + fillCollision(col); + auto thegroupSelectedTracks = SelectedParts->sliceByCached(aod::femtodreamparticle::fdCollisionId, col.globalIndex(), cache); + auto thegroupSelectedV0s = SelectedV0s->sliceByCached(aod::femtodreamparticle::fdCollisionId, col.globalIndex(), cache); + if (thegroupSelectedTracks.size() < 2 || thegroupSelectedV0s.size() < 1) { + return; + } + doSameEvent(thegroupSelectedTracks, thegroupSelectedV0s, parts, col.magField(), col.multNtr(), col.multV0M()); + } + PROCESS_SWITCH(femtoDreamTripletTaskTrackTrackV0, processSameEvent, "Enable processing same event", true); + + /// process function to call doSameEvent with Data which has a mask for containing particles or not + /// \param col subscribe to the collision table (Data) + /// \param parts subscribe to the femtoDreamParticleTable + void processSameEventMasked(MaskedCollision& col, o2::aod::FDParticles& parts) + { + fillCollision(col); + auto thegroupSelectedTracks = SelectedParts->sliceByCached(aod::femtodreamparticle::fdCollisionId, col.globalIndex(), cache); + auto thegroupSelectedV0s = SelectedV0s->sliceByCached(aod::femtodreamparticle::fdCollisionId, col.globalIndex(), cache); + if (thegroupSelectedTracks.size() < 2 || thegroupSelectedV0s.size() < 1) { + return; + } + doSameEvent(thegroupSelectedTracks, thegroupSelectedV0s, parts, col.magField(), col.multNtr(), col.multV0M()); + } + PROCESS_SWITCH(femtoDreamTripletTaskTrackTrackV0, processSameEventMasked, "Enable processing same event with masks", false); + + /// process function for to call doSameEvent with Monte Carlo + /// \param col subscribe to the collision table (Monte Carlo Reconstructed reconstructed) + /// \param parts subscribe to joined table FemtoDreamParticles and FemtoDreamMCLables to access Monte Carlo truth + /// \param FemtoDreamMCParticles subscribe to the Monte Carlo truth table + void processSameEventMC(o2::aod::FDCollision& col, + soa::Join& parts, + o2::aod::FDMCParticles&) + { + fillCollision(col); + auto thegroupSelectedTracks = SelectedPartsMC->sliceByCached(aod::femtodreamparticle::fdCollisionId, col.globalIndex(), cache); + auto thegroupSelectedV0s = SelectedV0sMC->sliceByCached(aod::femtodreamparticle::fdCollisionId, col.globalIndex(), cache); + if (thegroupSelectedTracks.size() < 2 || thegroupSelectedV0s.size() < 1) { + return; + } + doSameEvent(thegroupSelectedTracks, thegroupSelectedV0s, parts, col.magField(), col.multNtr(), col.multV0M()); + } + PROCESS_SWITCH(femtoDreamTripletTaskTrackTrackV0, processSameEventMC, "Enable processing same event for Monte Carlo", false); + + /// process function for to call doSameEvent with Monte Carlo which has a mask for containing particles or not + /// \param col subscribe to the collision table (Monte Carlo Reconstructed reconstructed) + /// \param parts subscribe to joined table FemtoDreamParticles and FemtoDreamMCLables to access Monte Carlo truth + /// \param FemtoDreamMCParticles subscribe to the Monte Carlo truth table + void processSameEventMCMasked(MaskedCollision& col, + soa::Join& parts, + o2::aod::FDMCParticles&) + { + fillCollision(col); + auto thegroupSelectedTracks = SelectedPartsMC->sliceByCached(aod::femtodreamparticle::fdCollisionId, col.globalIndex(), cache); + auto thegroupSelectedV0s = SelectedV0sMC->sliceByCached(aod::femtodreamparticle::fdCollisionId, col.globalIndex(), cache); + if (thegroupSelectedTracks.size() < 2 || thegroupSelectedV0s.size() < 1) { + return; + } + doSameEvent(thegroupSelectedTracks, thegroupSelectedV0s, parts, col.magField(), col.multNtr(), col.multV0M()); + } + PROCESS_SWITCH(femtoDreamTripletTaskTrackTrackV0, processSameEventMCMasked, "Enable processing same event for Monte Carlo", false); + + /// This function processes the mixed event + /// \tparam PartitionType + /// \tparam PartType + /// \tparam isMC: enables Monte Carlo truth specific histograms + /// \param groupPartsOne partition for the first particle passed by the process function + /// \param groupPartsTwo partition for the second particle passed by the process function + /// \param groupPartsThree partition for the third particle passed by the process function + /// \param parts femtoDreamParticles table (in case of Monte Carlo joined with FemtoDreamMCLabels) + /// \param magFieldTesla magnetic field of the collision + /// \param multCol multiplicity of the collision + template + void doMixedEvent(PartitionType groupPartsOne, PartitionType groupPartsTwo, PartitionType groupPartsThree, PartType parts, float magFieldTesla, int multCol) + { + for (auto& [T1, T2, V0] : combinations(CombinationsFullIndexPolicy(groupPartsOne, groupPartsTwo, groupPartsThree))) { + const auto& posChild = parts.iteratorAt(V0.globalIndex() - 2); + const auto& negChild = parts.iteratorAt(V0.globalIndex() - 1); + + if (!((posChild.cut() & Conf_ChildPos_CutV0) == Conf_ChildPos_CutV0 && + (posChild.pidcut() & Conf_ChildPos_TPCBitV0) == Conf_ChildPos_TPCBitV0 && + (negChild.cut() & Conf_ChildNeg_CutV0) == Conf_ChildNeg_CutV0 && + (negChild.pidcut() & Conf_ChildNeg_TPCBitV0) == Conf_ChildNeg_TPCBitV0)) { + continue; + } + + // Close pair rejection + if (ConfIsCPR.value) { + if (pairCloseRejectionTrackTrack.isClosePair(T1, T2, parts, magFieldTesla)) { + continue; + } + if (pairCloseRejectionTrackV0.isClosePair(T1, V0, parts, magFieldTesla)) { + continue; + } + if (pairCloseRejectionTrackV0.isClosePair(T2, V0, parts, magFieldTesla)) { + continue; + } + } + mixedEventCont.setTriplet(T1, T2, V0, multCol); + } + } + + /// process function for to call doMixedEvent with Data + /// @param cols subscribe to the collisions table (Data) + /// @param parts subscribe to the femtoDreamParticleTable + void processMixedEvent(o2::aod::FDCollisions& cols, + o2::aod::FDParticles& parts) + { + for (auto& [collision1, collision2, collision3] : soa::selfCombinations(colBinning, ConfNEventsMix, -1, cols, cols, cols)) { + + const int multiplicityCol = collision1.multNtr(); + ThreeBodyQARegistry.fill(HIST("TripletTaskQA/hMECollisionBins"), colBinning.getBin({collision1.posZ(), multiplicityCol})); + + auto groupPartsOne = SelectedParts->sliceByCached(aod::femtodreamparticle::fdCollisionId, collision1.globalIndex(), cache); + auto groupPartsTwo = SelectedParts->sliceByCached(aod::femtodreamparticle::fdCollisionId, collision2.globalIndex(), cache); + auto groupPartsThree = SelectedV0s->sliceByCached(aod::femtodreamparticle::fdCollisionId, collision3.globalIndex(), cache); + + const auto& magFieldTesla1 = collision1.magField(); + const auto& magFieldTesla2 = collision2.magField(); + const auto& magFieldTesla3 = collision3.magField(); + + if ((magFieldTesla1 != magFieldTesla2) || (magFieldTesla2 != magFieldTesla3) || (magFieldTesla1 != magFieldTesla3)) { + continue; + } + // CONSIDER testing different strategies to which events to use + + doMixedEvent(groupPartsOne, groupPartsTwo, groupPartsThree, parts, magFieldTesla1, multiplicityCol); + } + } + PROCESS_SWITCH(femtoDreamTripletTaskTrackTrackV0, processMixedEvent, "Enable processing mixed events", true); + + /// process function for to call doMixedEvent with Data which has a mask for containing particles or not + /// @param cols subscribe to the collisions table (Data) + /// @param parts subscribe to the femtoDreamParticleTable + void processMixedEventMasked(MaskedCollisions& cols, o2::aod::FDParticles& parts) + { + if (ConfMixIfTripletPresent || ConfMixIfTVOPairPresent) { + Partition PartitionMaskedCol1 = (ConfMixIfTripletPresent && (aod::femtodreamcollision::bitmaskTrackTwo & MaskBit) == MaskBit && (aod::femtodreamcollision::bitmaskTrackThree & MaskBit) == MaskBit) || + (ConfMixIfTVOPairPresent && (aod::femtodreamcollision::bitmaskTrackOne & MaskBit) == MaskBit && (aod::femtodreamcollision::bitmaskTrackThree & MaskBit) == MaskBit); + PartitionMaskedCol1.bindTable(cols); + + for (auto& [collision1, collision2, collision3] : soa::selfCombinations(colBinning, ConfNEventsMix, -1, *PartitionMaskedCol1.mFiltered, *PartitionMaskedCol1.mFiltered, *PartitionMaskedCol1.mFiltered)) { + + const int multiplicityCol = collision1.multNtr(); + ThreeBodyQARegistry.fill(HIST("TripletTaskQA/hMECollisionBins"), colBinning.getBin({collision1.posZ(), multiplicityCol})); + + auto groupPartsOne = SelectedParts->sliceByCached(aod::femtodreamparticle::fdCollisionId, collision1.globalIndex(), cache); + auto groupPartsTwo = SelectedParts->sliceByCached(aod::femtodreamparticle::fdCollisionId, collision2.globalIndex(), cache); + auto groupPartsThree = SelectedV0s->sliceByCached(aod::femtodreamparticle::fdCollisionId, collision3.globalIndex(), cache); + + const auto& magFieldTesla1 = collision1.magField(); + const auto& magFieldTesla2 = collision2.magField(); + const auto& magFieldTesla3 = collision3.magField(); + + if ((magFieldTesla1 != magFieldTesla2) || (magFieldTesla2 != magFieldTesla3) || (magFieldTesla1 != magFieldTesla3)) { + continue; + } + doMixedEvent(groupPartsOne, groupPartsTwo, groupPartsThree, parts, magFieldTesla1, multiplicityCol); + } + } else if (ConfMixIfTOrVOPartsPresent) { + Partition PartitionMaskedColT = ((aod::femtodreamcollision::bitmaskTrackOne & MaskBit) == MaskBit); + Partition PartitionMaskedColV0 = ((aod::femtodreamcollision::bitmaskTrackThree & MaskBit) == MaskBit); + PartitionMaskedColT.bindTable(cols); + PartitionMaskedColV0.bindTable(cols); + + for (auto& [ColWithTrack1, ColWithTrack2, ColWithV0] : soa::combinations(soa::CombinationsBlockFullIndexPolicy(colBinning, ConfNEventsMix, -1, *PartitionMaskedColT.mFiltered, *PartitionMaskedColT.mFiltered, *PartitionMaskedColV0.mFiltered))) { + if (ColWithTrack1.globalIndex() == ColWithTrack2.globalIndex() || ColWithTrack1.globalIndex() == ColWithV0.globalIndex() || ColWithTrack2.globalIndex() == ColWithV0.globalIndex()) { + continue; + } + if (ColWithTrack1.globalIndex() > ColWithTrack2.globalIndex()) { + continue; + } + const int multiplicityCol = ColWithTrack1.multNtr(); + ThreeBodyQARegistry.fill(HIST("TripletTaskQA/hMECollisionBins"), colBinning.getBin({ColWithTrack1.posZ(), multiplicityCol})); + + auto groupPartsOne = SelectedParts->sliceByCached(aod::femtodreamparticle::fdCollisionId, ColWithTrack1.globalIndex(), cache); + auto groupPartsTwo = SelectedParts->sliceByCached(aod::femtodreamparticle::fdCollisionId, ColWithTrack2.globalIndex(), cache); + auto groupPartsThree = SelectedV0s->sliceByCached(aod::femtodreamparticle::fdCollisionId, ColWithV0.globalIndex(), cache); + + const auto& magFieldTesla1 = ColWithTrack1.magField(); + const auto& magFieldTesla2 = ColWithTrack2.magField(); + const auto& magFieldTesla3 = ColWithV0.magField(); + + if ((magFieldTesla1 != magFieldTesla2) || (magFieldTesla2 != magFieldTesla3) || (magFieldTesla1 != magFieldTesla3)) { + continue; + } + doMixedEvent(groupPartsOne, groupPartsTwo, groupPartsThree, parts, magFieldTesla1, multiplicityCol); + } + } + } + PROCESS_SWITCH(femtoDreamTripletTaskTrackTrackV0, processMixedEventMasked, "Enable processing mixed events", false); + + /// brief process function for to call doMixedEvent with Monte Carlo + /// @param cols subscribe to the collisions table (Monte Carlo Reconstructed reconstructed) + /// @param parts subscribe to joined table FemtoDreamParticles and FemtoDreamMCLables to access Monte Carlo truth + /// @param FemtoDreamMCParticles subscribe to the Monte Carlo truth table + void processMixedEventMC(o2::aod::FDCollisions& cols, + soa::Join& parts, + o2::aod::FDMCParticles&) + { + for (auto& [collision1, collision2, collision3] : soa::selfCombinations(colBinning, ConfNEventsMix, -1, cols, cols, cols)) { + + const int multiplicityCol = collision1.multNtr(); + ThreeBodyQARegistry.fill(HIST("TripletTaskQA/hMECollisionBins"), colBinning.getBin({collision1.posZ(), multiplicityCol})); + + auto groupPartsOne = SelectedPartsMC->sliceByCached(aod::femtodreamparticle::fdCollisionId, collision1.globalIndex(), cache); + auto groupPartsTwo = SelectedPartsMC->sliceByCached(aod::femtodreamparticle::fdCollisionId, collision2.globalIndex(), cache); + auto groupPartsThree = SelectedV0sMC->sliceByCached(aod::femtodreamparticle::fdCollisionId, collision3.globalIndex(), cache); + + const auto& magFieldTesla1 = collision1.magField(); + const auto& magFieldTesla2 = collision2.magField(); + const auto& magFieldTesla3 = collision3.magField(); + + if ((magFieldTesla1 != magFieldTesla2) || (magFieldTesla2 != magFieldTesla3) || (magFieldTesla1 != magFieldTesla3)) { + continue; + } + // CONSIDER testing different strategies to which events to use + + doMixedEvent(groupPartsOne, groupPartsTwo, groupPartsThree, parts, magFieldTesla1, multiplicityCol); + } + } + PROCESS_SWITCH(femtoDreamTripletTaskTrackTrackV0, processMixedEventMC, "Enable processing mixed events MC", false); + + /// brief process function for to call doMixedEvent with Monte Carlo which has a mask for containing particles or not + /// @param cols subscribe to the collisions table (Monte Carlo Reconstructed reconstructed) + /// @param parts subscribe to joined table FemtoDreamParticles and FemtoDreamMCLables to access Monte Carlo truth + /// @param FemtoDreamMCParticles subscribe to the Monte Carlo truth table + void processMixedEventMCMasked(MaskedCollisions& cols, + soa::Join& parts, + o2::aod::FDMCParticles&) + { + if (ConfMixIfTripletPresent || ConfMixIfTVOPairPresent) { + Partition PartitionMaskedCol1 = (ConfMixIfTripletPresent && (aod::femtodreamcollision::bitmaskTrackTwo & MaskBit) == MaskBit && (aod::femtodreamcollision::bitmaskTrackThree & MaskBit) == MaskBit) || + (ConfMixIfTVOPairPresent && (aod::femtodreamcollision::bitmaskTrackOne & MaskBit) == MaskBit && (aod::femtodreamcollision::bitmaskTrackThree & MaskBit) == MaskBit); + PartitionMaskedCol1.bindTable(cols); + + for (auto& [collision1, collision2, collision3] : soa::selfCombinations(colBinning, ConfNEventsMix, -1, *PartitionMaskedCol1.mFiltered, *PartitionMaskedCol1.mFiltered, *PartitionMaskedCol1.mFiltered)) { + const int multiplicityCol = collision1.multNtr(); + ThreeBodyQARegistry.fill(HIST("TripletTaskQA/hMECollisionBins"), colBinning.getBin({collision1.posZ(), multiplicityCol})); + + auto groupPartsOne = SelectedPartsMC->sliceByCached(aod::femtodreamparticle::fdCollisionId, collision1.globalIndex(), cache); + auto groupPartsTwo = SelectedPartsMC->sliceByCached(aod::femtodreamparticle::fdCollisionId, collision2.globalIndex(), cache); + auto groupPartsThree = SelectedV0sMC->sliceByCached(aod::femtodreamparticle::fdCollisionId, collision3.globalIndex(), cache); + + const auto& magFieldTesla1 = collision1.magField(); + const auto& magFieldTesla2 = collision2.magField(); + const auto& magFieldTesla3 = collision3.magField(); + + if ((magFieldTesla1 != magFieldTesla2) || (magFieldTesla2 != magFieldTesla3) || (magFieldTesla1 != magFieldTesla3)) { + continue; + } + doMixedEvent(groupPartsOne, groupPartsTwo, groupPartsThree, parts, magFieldTesla1, multiplicityCol); + } + } else if (ConfMixIfTOrVOPartsPresent) { + Partition PartitionMaskedColT = ((aod::femtodreamcollision::bitmaskTrackOne & MaskBit) == MaskBit); + Partition PartitionMaskedColV0 = ((aod::femtodreamcollision::bitmaskTrackThree & MaskBit) == MaskBit); + PartitionMaskedColT.bindTable(cols); + PartitionMaskedColV0.bindTable(cols); + + for (auto& [ColWithTrack1, ColWithTrack2, ColWithV0] : soa::combinations(soa::CombinationsBlockFullIndexPolicy(colBinning, ConfNEventsMix, -1, *PartitionMaskedColT.mFiltered, *PartitionMaskedColT.mFiltered, *PartitionMaskedColV0.mFiltered))) { + if (ColWithTrack1.globalIndex() == ColWithTrack2.globalIndex() || ColWithTrack1.globalIndex() == ColWithV0.globalIndex() || ColWithTrack2.globalIndex() == ColWithV0.globalIndex()) { + continue; + } + if (ColWithTrack1.globalIndex() > ColWithTrack2.globalIndex()) { + continue; + } + const int multiplicityCol = ColWithTrack1.multNtr(); + ThreeBodyQARegistry.fill(HIST("TripletTaskQA/hMECollisionBins"), colBinning.getBin({ColWithTrack1.posZ(), multiplicityCol})); + + auto groupPartsOne = SelectedPartsMC->sliceByCached(aod::femtodreamparticle::fdCollisionId, ColWithTrack1.globalIndex(), cache); + auto groupPartsTwo = SelectedPartsMC->sliceByCached(aod::femtodreamparticle::fdCollisionId, ColWithTrack2.globalIndex(), cache); + auto groupPartsThree = SelectedV0sMC->sliceByCached(aod::femtodreamparticle::fdCollisionId, ColWithV0.globalIndex(), cache); + + const auto& magFieldTesla1 = ColWithTrack1.magField(); + const auto& magFieldTesla2 = ColWithTrack2.magField(); + const auto& magFieldTesla3 = ColWithV0.magField(); + + if ((magFieldTesla1 != magFieldTesla2) || (magFieldTesla2 != magFieldTesla3) || (magFieldTesla1 != magFieldTesla3)) { + continue; + } + doMixedEvent(groupPartsOne, groupPartsTwo, groupPartsThree, parts, magFieldTesla1, multiplicityCol); + } + } + } + PROCESS_SWITCH(femtoDreamTripletTaskTrackTrackV0, processMixedEventMCMasked, "Enable processing mixed events MC", false); +}; + +WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) +{ + WorkflowSpec workflow{ + adaptAnalysisTask(cfgc), + }; + return workflow; +} diff --git a/PWGCF/Flow/Tasks/CMakeLists.txt b/PWGCF/Flow/Tasks/CMakeLists.txt index b6e1291b1f2..49953226773 100644 --- a/PWGCF/Flow/Tasks/CMakeLists.txt +++ b/PWGCF/Flow/Tasks/CMakeLists.txt @@ -19,3 +19,7 @@ o2physics_add_dpl_workflow(flow-pbpb-task PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore O2Physics::GFWCore COMPONENT_NAME Analysis) +o2physics_add_dpl_workflow(flow-gfw-pbpb + SOURCES FlowGFWPbPb.cxx + PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore O2Physics::GFWCore + COMPONENT_NAME Analysis) diff --git a/PWGCF/Flow/Tasks/FlowGFWPbPb.cxx b/PWGCF/Flow/Tasks/FlowGFWPbPb.cxx new file mode 100644 index 00000000000..df07e0d9d63 --- /dev/null +++ b/PWGCF/Flow/Tasks/FlowGFWPbPb.cxx @@ -0,0 +1,158 @@ +// 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. + +#include +#include +#include "Framework/runDataProcessing.h" +#include "Framework/AnalysisTask.h" +#include "Framework/ASoAHelpers.h" +#include "Framework/RunningWorkflowInfo.h" +#include "Framework/HistogramRegistry.h" + +#include "Common/DataModel/EventSelection.h" +#include "Common/Core/TrackSelection.h" +#include "Common/DataModel/TrackSelectionTables.h" +#include "Common/DataModel/Centrality.h" + +#include "GFWPowerArray.h" +#include "GFW.h" +#include "GFWCumulant.h" +#include "TList.h" +#include +#include + +using namespace o2; +using namespace o2::framework; +using namespace o2::framework::expressions; + +#define O2_DEFINE_CONFIGURABLE(NAME, TYPE, DEFAULT, HELP) Configurable NAME{#NAME, DEFAULT, HELP}; + +struct FlowGFWPbPb { + + O2_DEFINE_CONFIGURABLE(cfgCutVertex, float, 10.0f, "Accepted z-vertex range") + O2_DEFINE_CONFIGURABLE(cfgCutPtPOIMin, float, 0.2f, "Minimal pT for poi tracks") + O2_DEFINE_CONFIGURABLE(cfgCutPtPOIMax, float, 10.0f, "Maximal pT for poi tracks") + O2_DEFINE_CONFIGURABLE(cfgCutPtMin, float, 0.2f, "Minimal pT for ref tracks") + O2_DEFINE_CONFIGURABLE(cfgCutPtMax, float, 3.0f, "Maximal pT for ref tracks") + O2_DEFINE_CONFIGURABLE(cfgCutEta, float, 0.8f, "Eta range for tracks") + O2_DEFINE_CONFIGURABLE(cfgCutChi2prTPCcls, float, 2.5, "Chi2 per TPC clusters") + O2_DEFINE_CONFIGURABLE(cfgUseNch, bool, false, "Use Nch for flow observables") + O2_DEFINE_CONFIGURABLE(cfgNbootstrap, int, 10, "Number of subsamples") + + ConfigurableAxis axisVertex{"axisVertex", {20, -10, 10}, "vertex axis for histograms"}; + ConfigurableAxis axisPhi{"axisPhi", {60, 0.0, constants::math::TwoPI}, "phi axis for histograms"}; + ConfigurableAxis axisEta{"axisEta", {40, -1., 1.}, "eta axis for histograms"}; + ConfigurableAxis axisPt{"axisPt", {VARIABLE_WIDTH, 0.2, 0.25, 0.30, 0.40, 0.45, 0.50, 0.55, 0.60, 0.65, 0.70, 0.75, 0.80, 0.85, 0.90, 0.95, 1.00, 1.10, 1.20, 1.30, 1.40, 1.50, 1.60, 1.70, 1.80, 1.90, 2.00, 2.20, 2.40, 2.60, 2.80, 3.00}, "pt axis for histograms"}; + // ConfigurableAxis axisMultiplicity{"axisMultiplicity", {VARIABLE_WIDTH, 0, 5, 10, 20, 30, 40, 50, 60, 70, 80, 90}, "centrality axis for histograms"}; + AxisSpec axisMultiplicity{{0, 5, 10, 20, 30, 40, 50, 60, 70, 80, 90}, "Centrality (%)"}; + // AxisSpec axisC22{{0,0.02}, "C_2{2}"}; + + // std::vector centBinning = {0, 5., 10., 20., 30., 40., 50., 60., 70.}; + // AxisSpec axisCentBins{centBinning, "centrality percentile"}; + + Filter collisionFilter = nabs(aod::collision::posZ) < cfgCutVertex; + Filter trackFilter = (nabs(aod::track::eta) < cfgCutEta) && (aod::track::pt > cfgCutPtMin) && (aod::track::pt < cfgCutPtMax) && ((requireGlobalTrackInFilter()) || (aod::track::isGlobalTrackSDD == (uint8_t) true)) && (aod::track::tpcChi2NCl < cfgCutChi2prTPCcls); + + // Connect to ccdb + Service ccdb; + Configurable nolaterthan{"ccdb-no-later-than", std::chrono::duration_cast(std::chrono::system_clock::now().time_since_epoch()).count(), "latest acceptable timestamp of creation for the object"}; + Configurable url{"ccdb-url", "http://ccdb-test.cern.ch:8080", "url of the ccdb repository"}; + + // Define output + HistogramRegistry registry{"registry"}; + + // define global variables + GFW* fGFW = new GFW(); // GFW class used from main src + std::vector corrconfigs; + + using aodCollisions = soa::Filtered>; // collisions filter + using aodTracks = soa::Filtered>; // tracks filter + + void init(InitContext const&) // Initialization + { + ccdb->setURL(url.value); + ccdb->setCaching(true); + ccdb->setCreatedNotAfter(nolaterthan.value); + + // Add some output objects to the histogram registry + registry.add("hPhi", "", {HistType::kTH1D, {axisPhi}}); + registry.add("hEta", "", {HistType::kTH1D, {axisEta}}); + registry.add("hVtxZ", "", {HistType::kTH1D, {axisVertex}}); + registry.add("hMult", "", {HistType::kTH1D, {{3000, 0.5, 3000.5}}}); + registry.add("hCent", "", {HistType::kTH1D, {{90, 0, 90}}}); + registry.add("c22", ";Centrality (%) ; C_{2}{2} ", {HistType::kTProfile, {axisMultiplicity}}); + registry.add("c24", ";Centrality (%) ; C_{2}{4}", {HistType::kTProfile, {axisMultiplicity}}); + registry.add("c26", ";Centrality (%) ; C_{2}{6}", {HistType::kTProfile, {axisMultiplicity}}); + registry.add("c28", ";Centrality (%) ; C_{2}{8}", {HistType::kTProfile, {axisMultiplicity}}); + + fGFW->AddRegion("full", -0.8, 0.8, 1, 1); // eta region -0.8 to 0.8 + corrconfigs.push_back(fGFW->GetCorrelatorConfig("full {2 -2}", "ChFull22", kFALSE)); + corrconfigs.push_back(fGFW->GetCorrelatorConfig("full {2 2 -2 -2}", "ChFull24", kFALSE)); + corrconfigs.push_back(fGFW->GetCorrelatorConfig("full {2 2 2 -2 -2 -2}", "ChFull26", kFALSE)); + corrconfigs.push_back(fGFW->GetCorrelatorConfig("full {2 2 2 2 -2 -2 -2 -2}", "ChFull28", kFALSE)); + + fGFW->CreateRegions(); // finalize the initialization + } + + template + void FillProfile(const GFW::CorrConfig& corrconf, const ConstStr& tarName, const double& cent) + { + double dnx, val; + dnx = fGFW->Calculate(corrconf, 0, kTRUE).real(); + if (dnx == 0) + return; + + if (!corrconf.pTDif) { + val = fGFW->Calculate(corrconf, 0, kFALSE).real() / dnx; + if (TMath::Abs(val) < 1) + registry.fill(tarName, cent, val, dnx); + return; + } + return; + } + + void process(aodCollisions::iterator const& collision, aod::BCsWithTimestamps const&, aodTracks const& tracks) + { + int Ntot = tracks.size(); + + if (Ntot < 1) + return; + + // if (!collision.sel7()) return; + + float vtxz = collision.posZ(); + registry.fill(HIST("hVtxZ"), vtxz); + registry.fill(HIST("hMult"), Ntot); + registry.fill(HIST("hCent"), collision.centFT0C()); + fGFW->Clear(); + + const auto cent = collision.centFT0C(); + float weff = 1, wacc = 1; + for (auto& track : tracks) { + registry.fill(HIST("hPhi"), track.phi()); + registry.fill(HIST("hEta"), track.eta()); + + fGFW->Fill(track.eta(), 1, track.phi(), wacc * weff, 1); + } + + // Filling c22 with ROOT TProfile + FillProfile(corrconfigs.at(0), HIST("c22"), cent); + FillProfile(corrconfigs.at(1), HIST("c24"), cent); + FillProfile(corrconfigs.at(2), HIST("c26"), cent); + FillProfile(corrconfigs.at(3), HIST("c28"), cent); + } +}; + +WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) +{ + return WorkflowSpec{ + adaptAnalysisTask(cfgc)}; +} diff --git a/PWGCF/Flow/Tasks/FlowPbPbTask.cxx b/PWGCF/Flow/Tasks/FlowPbPbTask.cxx index e31113117f4..dafb8d5e810 100644 --- a/PWGCF/Flow/Tasks/FlowPbPbTask.cxx +++ b/PWGCF/Flow/Tasks/FlowPbPbTask.cxx @@ -514,8 +514,9 @@ struct FlowPbPbTask { // track weights float weff = 1, wacc = 1; - double weffEvent = 0, waccEvent = 0; - int TrackNum = 0; + double weffEvent = 0; + // double waccEvent = 0; + // int TrackNum = 0; double ptSum = 0., ptSum_Gap08 = 0.; double weffEvent_WithinGap08 = 0., weffEventSquare_WithinGap08 = 0.; double sum_ptSquare_wSquare_WithinGap08 = 0., sum_pt_wSquare_WithinGap08 = 0.; @@ -549,9 +550,9 @@ struct FlowPbPbTask { registry.fill(HIST("hDCAz"), track.dcaZ()); registry.fill(HIST("hDCAxy"), track.dcaXY(), track.pt()); weffEvent += weff; - waccEvent += wacc; + // waccEvent += wacc; ptSum += weff * track.pt(); - TrackNum++; + // TrackNum++; if (WithinEtaGap08) { ptSum_Gap08 += weff * track.pt(); sum_pt_wSquare_WithinGap08 += weff * weff * track.pt(); diff --git a/PWGCF/GenericFramework/Core/BootstrapProfile.cxx b/PWGCF/GenericFramework/Core/BootstrapProfile.cxx index ae97bb67400..db349a85fe7 100644 --- a/PWGCF/GenericFramework/Core/BootstrapProfile.cxx +++ b/PWGCF/GenericFramework/Core/BootstrapProfile.cxx @@ -79,7 +79,7 @@ TH1* BootstrapProfile::getHist(Int_t ind) if (fPresetWeights && fMultiRebin > 0) return getWeightBasedRebin(ind); if (ind < 0) { - if (reinterpret_cast(this)) { + if (reinterpret_cast(this)) { // FIXME: -Wnonnull-compare return getHistRebinned(reinterpret_cast(this)); //((TProfile*)this)->ProjectionX(Form("%s_hist",this->GetName())); } else { printf("Empty BootstrapProfile addressed, cannot get a histogram\n"); @@ -102,7 +102,7 @@ TH1* BootstrapProfile::getHist(Int_t ind) TProfile* BootstrapProfile::getProfile(Int_t ind) { if (ind < 0) { - if (reinterpret_cast(this)) { + if (reinterpret_cast(this)) { // FIXME: -Wnonnull-compare return reinterpret_cast(this); } else { printf("Empty BootstrapProfile addressed, cannot get a histogram\n"); @@ -124,7 +124,7 @@ TProfile* BootstrapProfile::getProfile(Int_t ind) Long64_t BootstrapProfile::Merge(TCollection* collist) { Long64_t nmergedpf = TProfile::Merge(collist); - Long64_t nmerged = 0; + // Long64_t nmerged = 0; BootstrapProfile* l_PBS = 0; TIter all_PBS(collist); while ((l_PBS = reinterpret_cast(all_PBS()))) { @@ -139,7 +139,7 @@ Long64_t BootstrapProfile::Merge(TCollection* collist) } for (Int_t i = 0; i < fListOfEntries->GetEntries(); i++) reinterpret_cast(fListOfEntries->At(i))->Add(reinterpret_cast(tarL->At(i))); - nmerged++; + // nmerged++; } return nmergedpf; }; diff --git a/PWGCF/GenericFramework/Core/FlowPtContainer.cxx b/PWGCF/GenericFramework/Core/FlowPtContainer.cxx index 8c586add9f9..d7b6b8dd114 100644 --- a/PWGCF/GenericFramework/Core/FlowPtContainer.cxx +++ b/PWGCF/GenericFramework/Core/FlowPtContainer.cxx @@ -366,6 +366,7 @@ TH1* FlowPtContainer::getCumulantHist(int ind, int m) return 0; if (ind + 1 < fCumulantList->GetEntries()) return reinterpret_cast(fCumulantList->At((ind + 1) * mpar + m - 1)); + return 0; } void FlowPtContainer::CreateCumulantList() { diff --git a/PWGCF/MultiparticleCorrelations/Core/MuPa-MemberFunctions.h b/PWGCF/MultiparticleCorrelations/Core/MuPa-MemberFunctions.h index 4479b682001..13b79930b6e 100644 --- a/PWGCF/MultiparticleCorrelations/Core/MuPa-MemberFunctions.h +++ b/PWGCF/MultiparticleCorrelations/Core/MuPa-MemberFunctions.h @@ -45,34 +45,34 @@ void BookBaseList() Form("fRunNumber = %s", tc.fRunNumber.Data())); fBasePro->GetXaxis()->SetBinLabel(eDryRun, "fDryRun"); - fBasePro->Fill(eDryRun - 0.5, (Int_t)tc.fDryRun); + fBasePro->Fill(+eDryRun - 0.5, (Int_t)tc.fDryRun); fBasePro->GetXaxis()->SetBinLabel(eVerbose, "fVerbose"); - fBasePro->Fill(eVerbose - 0.5, (Int_t)tc.fVerbose); + fBasePro->Fill(+eVerbose - 0.5, (Int_t)tc.fVerbose); fBasePro->GetXaxis()->SetBinLabel(eVerboseForEachParticle, "fVerboseForEachParticle"); - fBasePro->Fill(eVerboseForEachParticle - 0.5, (Int_t)tc.fVerboseForEachParticle); + fBasePro->Fill(+eVerboseForEachParticle - 0.5, (Int_t)tc.fVerboseForEachParticle); fBasePro->GetXaxis()->SetBinLabel(eDoAdditionalInsanityChecks, "fDoAdditionalInsanityChecks"); - fBasePro->Fill(eDoAdditionalInsanityChecks - 0.5, (Int_t)tc.fDoAdditionalInsanityChecks); + fBasePro->Fill(+eDoAdditionalInsanityChecks - 0.5, (Int_t)tc.fDoAdditionalInsanityChecks); fBasePro->GetXaxis()->SetBinLabel(eUseCCDB, "fUseCCDB"); - fBasePro->Fill(eUseCCDB - 0.5, (Int_t)tc.fUseCCDB); + fBasePro->Fill(+eUseCCDB - 0.5, (Int_t)tc.fUseCCDB); fBasePro->GetXaxis()->SetBinLabel(eWhichProcess, Form("WhichProcess = %s", tc.fWhichProcess.Data())); fBasePro->GetXaxis()->SetBinLabel(eRandomSeed, "fRandomSeed"); - fBasePro->Fill(eRandomSeed - 0.5, (Int_t)tc.fRandomSeed); + fBasePro->Fill(+eRandomSeed - 0.5, (Int_t)tc.fRandomSeed); fBasePro->GetXaxis()->SetBinLabel(eUseFisherYates, "fUseFisherYates"); - fBasePro->Fill(eUseFisherYates - 0.5, (Int_t)tc.fUseFisherYates); + fBasePro->Fill(+eUseFisherYates - 0.5, (Int_t)tc.fUseFisherYates); fBasePro->GetXaxis()->SetBinLabel(eFixedNumberOfRandomlySelectedTracks, "fFixedNumberOfRandomlySelectedTracks"); - fBasePro->Fill(eFixedNumberOfRandomlySelectedTracks - 0.5, (Int_t)tc.fFixedNumberOfRandomlySelectedTracks); + fBasePro->Fill(+eFixedNumberOfRandomlySelectedTracks - 0.5, (Int_t)tc.fFixedNumberOfRandomlySelectedTracks); fBasePro->GetXaxis()->SetBinLabel(eUseStopwatch, "fUseStopwatch"); - fBasePro->Fill(eUseStopwatch - 0.5, (Int_t)tc.fUseStopwatch); + fBasePro->Fill(+eUseStopwatch - 0.5, (Int_t)tc.fUseStopwatch); fBaseList->Add(fBasePro); @@ -870,11 +870,11 @@ void BookEventCutsHistograms() ec.fEventCutsPro->GetXaxis()->SetBinLabel(eTrigger, Form("fTrigger = %s", ec.fTrigger.Data())); ec.fEventCutsPro->GetXaxis()->SetBinLabel(eUseTrigger, "fUseTrigger"); - ec.fEventCutsPro->Fill(eUseTrigger - 0.5, (Int_t)ec.fUseTrigger); + ec.fEventCutsPro->Fill(+eUseTrigger - 0.5, (Int_t)ec.fUseTrigger); ec.fEventCutsPro->GetXaxis()->SetBinLabel(eUseSel7, "fUseSel7"); - ec.fEventCutsPro->Fill(eUseSel7 - 0.5, (Int_t)ec.fUseSel7); + ec.fEventCutsPro->Fill(+eUseSel7 - 0.5, (Int_t)ec.fUseSel7); ec.fEventCutsPro->GetXaxis()->SetBinLabel(eUseSel8, "fUseSel8"); - ec.fEventCutsPro->Fill(eUseSel8 - 0.5, (Int_t)ec.fUseSel8); + ec.fEventCutsPro->Fill(+eUseSel8 - 0.5, (Int_t)ec.fUseSel8); ec.fEventCutsPro->GetXaxis()->SetBinLabel(eCentralityEstimator, Form("fCentralityEstimator = %s", ec.fCentralityEstimator.Data())); ec.fEventCutsList->Add(ec.fEventCutsPro); diff --git a/PWGDQ/Core/CutsLibrary.cxx b/PWGDQ/Core/CutsLibrary.cxx index b22ed19645d..4aec1b1b4d9 100644 --- a/PWGDQ/Core/CutsLibrary.cxx +++ b/PWGDQ/Core/CutsLibrary.cxx @@ -140,6 +140,49 @@ AnalysisCompositeCut* o2::aod::dqcuts::GetCompositeCut(const char* cutName) cut->AddCut(GetAnalysisCut("electronPIDnsigmaMedium")); return cut; } + if (!nameStr.compare("electronSelection1pos_ionut")) { + cut->AddCut(GetAnalysisCut("posTrack")); + cut->AddCut(GetAnalysisCut("jpsiStandardKine")); + cut->AddCut(GetAnalysisCut("electronStandardQualityForO2MCdebug")); + cut->AddCut(GetAnalysisCut("dcaCut1_ionut")); + cut->AddCut(GetAnalysisCut("electronPIDnsigmaMedium")); + return cut; + } + if (!nameStr.compare("electronSelection1neg_ionut")) { + cut->AddCut(GetAnalysisCut("negTrack")); + cut->AddCut(GetAnalysisCut("jpsiStandardKine")); + cut->AddCut(GetAnalysisCut("electronStandardQualityForO2MCdebug")); + cut->AddCut(GetAnalysisCut("dcaCut1_ionut")); + cut->AddCut(GetAnalysisCut("electronPIDnsigmaMedium")); + return cut; + } + + if (!nameStr.compare("electronSelection2_ionut")) { + cut->AddCut(GetAnalysisCut("jpsiStandardKine")); + cut->AddCut(GetAnalysisCut("electronStandardQualityForO2MCdebug")); + cut->AddCut(GetAnalysisCut("dcaCut1_ionut")); + cut->AddCut(GetAnalysisCut("electronPIDnsigmaMedium")); + cut->AddCut(GetAnalysisCut("insideTPCsector")); + return cut; + } + if (!nameStr.compare("electronSelection2pos_ionut")) { + cut->AddCut(GetAnalysisCut("posTrack")); + cut->AddCut(GetAnalysisCut("jpsiStandardKine")); + cut->AddCut(GetAnalysisCut("electronStandardQualityForO2MCdebug")); + cut->AddCut(GetAnalysisCut("dcaCut1_ionut")); + cut->AddCut(GetAnalysisCut("electronPIDnsigmaMedium")); + cut->AddCut(GetAnalysisCut("insideTPCsector")); + return cut; + } + if (!nameStr.compare("electronSelection2neg_ionut")) { + cut->AddCut(GetAnalysisCut("negTrack")); + cut->AddCut(GetAnalysisCut("jpsiStandardKine")); + cut->AddCut(GetAnalysisCut("electronStandardQualityForO2MCdebug")); + cut->AddCut(GetAnalysisCut("dcaCut1_ionut")); + cut->AddCut(GetAnalysisCut("electronPIDnsigmaMedium")); + cut->AddCut(GetAnalysisCut("insideTPCsector")); + return cut; + } if (!nameStr.compare("jpsiO2MCdebugCuts4_Corr")) { cut->AddCut(GetAnalysisCut("jpsiStandardKine")); @@ -2758,6 +2801,11 @@ AnalysisCut* o2::aod::dqcuts::GetAnalysisCut(const char* cutName) return cut; } + if (!nameStr.compare("insideTPCsector")) { + cut->AddCut(VarManager::kTrackIsInsideTPCModule, 0.5, 1.5); + return cut; + } + if (!nameStr.compare("rho0Kine")) { cut->AddCut(VarManager::kPt, 0.1, 1000.0); cut->AddCut(VarManager::kEta, -1.1, 1.1); @@ -2843,6 +2891,7 @@ AnalysisCut* o2::aod::dqcuts::GetAnalysisCut(const char* cutName) if (!nameStr.compare("PIDStandardKine")) { cut->AddCut(VarManager::kPt, 0.1, 1000.0); cut->AddCut(VarManager::kEta, -0.9, 0.9); + cut->AddCut(VarManager::kPt, 1.0, 1000.0); return cut; } diff --git a/PWGDQ/Core/HistogramsLibrary.cxx b/PWGDQ/Core/HistogramsLibrary.cxx index 0679b2c5cd3..9b73926bc5b 100644 --- a/PWGDQ/Core/HistogramsLibrary.cxx +++ b/PWGDQ/Core/HistogramsLibrary.cxx @@ -211,6 +211,7 @@ void o2::aod::dqhistograms::DefineHistograms(HistogramManager* hm, const char* h hm->AddHistogram(histClass, "Pt", "p_{T} distribution", false, 2000, 0.0, 20.0, VarManager::kPt); hm->AddHistogram(histClass, "Eta", "#eta distribution", false, 500, -5.0, 5.0, VarManager::kEta); hm->AddHistogram(histClass, "Phi", "#varphi distribution", false, 500, -2. * TMath::Pi(), 2. * TMath::Pi(), VarManager::kPhi); + hm->AddHistogram(histClass, "Phi_Pt", "#varphi distribution", false, 50, 0.0, 10.0, VarManager::kPt, 720, 0.0, TMath::TwoPi(), VarManager::kPhi); hm->AddHistogram(histClass, "IsPVcontrib_pt", "is PV contributor vs pt", false, 50, 0.0, 50.0, VarManager::kPt, 2, -0.5, 1.5, VarManager::kPVContributor); hm->AddHistogram(histClass, "IsPVcontrib_pt_prof", "is PV contributor vs pt", true, 50, 0.0, 50.0, VarManager::kPt, 2, -0.5, 1.5, VarManager::kPVContributor); if (subGroupStr.Contains("cent")) { @@ -273,6 +274,8 @@ void o2::aod::dqhistograms::DefineHistograms(HistogramManager* hm, const char* h } if (subGroupStr.Contains("tpc")) { hm->AddHistogram(histClass, "TPCncls", "Number of cluster in TPC", false, 160, -0.5, 159.5, VarManager::kTPCncls); + hm->AddHistogram(histClass, "TPCncls_Phi", "Number of cluster in TPC vs #varphi", true, 720, 0.0, TMath::TwoPi(), VarManager::kPhi, 10, 0.0, 200.0, VarManager::kTPCncls); + hm->AddHistogram(histClass, "TPCncls_PhiPt", "Number of cluster in TPC vs p_{T} and #varphi", true, 20, 0.0, 10.0, VarManager::kPt, 720, 0.0, TMath::TwoPi(), VarManager::kPhi, 10, 0.0, 200.0, VarManager::kTPCncls); hm->AddHistogram(histClass, "TPCncls_Run", "Number of cluster in TPC", true, (VarManager::GetNRuns() > 0 ? VarManager::GetNRuns() : 1), 0.5, 0.5 + VarManager::GetNRuns(), VarManager::kRunId, 10, -0.5, 159.5, VarManager::kTPCncls, 10, 0., 1., VarManager::kNothing, VarManager::GetRunStr().Data()); hm->AddHistogram(histClass, "TPCnclsCR", "Number of crossed rows in TPC", false, 160, -0.5, 159.5, VarManager::kTPCnclsCR); @@ -340,15 +343,6 @@ void o2::aod::dqhistograms::DefineHistograms(HistogramManager* hm, const char* h hm->AddHistogram(histClass, "TPCnSigPi_Corr_Eta", "TPC n-#sigma(#pi) Corr. vs Eta", false, 20, -1.0, 1.0, VarManager::kEta, 100, -5.0, 5.0, VarManager::kTPCnSigmaPi_Corr); hm->AddHistogram(histClass, "TPCnSigKa_Corr_Eta", "TPC n-#sigma(K) Corr. vs Eta", false, 20, -1.0, 1.0, VarManager::kEta, 100, -5.0, 5.0, VarManager::kTPCnSigmaKa_Corr); hm->AddHistogram(histClass, "TPCnSigPr_Corr_Eta", "TPC n-#sigma(p) Corr. vs Eta", false, 20, -1.0, 1.0, VarManager::kEta, 100, -5.0, 5.0, VarManager::kTPCnSigmaPr_Corr); - hm->AddHistogram(histClass, "TPCdedxRandomized_pIN", "TPC dE/dx (randomized) vs pIN", false, 200, 0.0, 10.0, VarManager::kPin, 200, 0.0, 200., VarManager::kTPCsignalRandomized); - hm->AddHistogram(histClass, "TPCdedxRandomizedDelta_pIN", "TPC dE/dx (randomized - delta) vs pIN", false, 200, 0.0, 10.0, VarManager::kPin, 100, 0.0, 10., VarManager::kTPCsignalRandomizedDelta); - hm->AddHistogram(histClass, "TPCnSigEleRandomized_pIN", "TPC n-#sigma(e) - randomized - vs pIN", false, 200, 0.0, 10.0, VarManager::kPin, 100, -5.0, 5.0, VarManager::kTPCnSigmaElRandomized); - hm->AddHistogram(histClass, "TPCnSigEleRandomizedDelta_pIN", "TPC n-#sigma(e) - randomized delta - vs pIN", false, 20, 0.0, 10.0, VarManager::kPin, 200, -0.5, 0.5, VarManager::kTPCnSigmaElRandomizedDelta); - hm->AddHistogram(histClass, "TPCnSigEleRandomized_TPCnSigEle", "TPC n-#sigma(e) - randomized - vs TPC n-#sigma(e)", false, 100, -5.0, 5.0, VarManager::kTPCnSigmaEl, 100, -5.0, 5.0, VarManager::kTPCnSigmaElRandomized); - hm->AddHistogram(histClass, "TPCnSigPiRandomized_TPCnSigPi", "TPC n-#sigma(#pi) - randomized - vs TPC n-#sigma(#pi)", false, 100, -5.0, 5.0, VarManager::kTPCnSigmaPi, 100, -5.0, 5.0, VarManager::kTPCnSigmaPiRandomized); - hm->AddHistogram(histClass, "TPCnSigPrRandomized_TPCnSigPr", "TPC n-#sigma(p) - randomized - vs TPC n-#sigma(p)", false, 100, -5.0, 5.0, VarManager::kTPCnSigmaPr, 100, -5.0, 5.0, VarManager::kTPCnSigmaPrRandomized); - hm->AddHistogram(histClass, "TPCnSigPiRandomized_pIN", "TPC n-#sigma(#pi) - randomized - vs pIN", false, 200, 0.0, 10.0, VarManager::kPin, 100, -5.0, 5.0, VarManager::kTPCnSigmaPiRandomized); - hm->AddHistogram(histClass, "TPCnSigPrRandomized_pIN", "TPC n-#sigma(p) - randomized - vs pIN", false, 200, 0.0, 10.0, VarManager::kPin, 100, -5.0, 5.0, VarManager::kTPCnSigmaPrRandomized); } if (subGroupStr.Contains("postcalib")) { const int kNvarsPID = 4; @@ -1004,7 +998,7 @@ void o2::aod::dqhistograms::DefineHistograms(HistogramManager* hm, const char* h DelEtaBinLims[i] = -2 + i * 0.2; const int kDelPhiBins = 50; - double DelPhiBinLims[kDelEtaBins + 1]; + double DelPhiBinLims[kDelPhiBins + 1]; for (int i = 0; i <= kDelPhiBins; i++) DelPhiBinLims[i] = -8 + i * 0.32; diff --git a/PWGDQ/Core/VarManager.cxx b/PWGDQ/Core/VarManager.cxx index b4fcc5fed92..ee11ec499d2 100644 --- a/PWGDQ/Core/VarManager.cxx +++ b/PWGDQ/Core/VarManager.cxx @@ -29,6 +29,7 @@ TString VarManager::fgRunStr = ""; std::vector VarManager::fgRunList = {0}; float VarManager::fgCenterOfMassEnergy = 13600; // GeV float VarManager::fgMassofCollidingParticle = 9.382720; // GeV +float VarManager::fgTPCInterSectorBoundary = 1.0; // cm o2::vertexing::DCAFitterN<2> VarManager::fgFitterTwoProngBarrel; o2::vertexing::DCAFitterN<3> VarManager::fgFitterThreeProngBarrel; o2::vertexing::FwdDCAFitterN<2> VarManager::fgFitterTwoProngFwd; @@ -56,29 +57,32 @@ void VarManager::SetVariableDependencies() // Set as used variables on which other variables calculation depends // if (fgUsedVars[kP]) { - fgUsedVars[kPt] = kTRUE; - fgUsedVars[kEta] = kTRUE; + fgUsedVars[kPt] = true; + fgUsedVars[kEta] = true; } if (fgUsedVars[kVertexingLxyOverErr]) { - fgUsedVars[kVertexingLxy] = kTRUE; - fgUsedVars[kVertexingLxyErr] = kTRUE; + fgUsedVars[kVertexingLxy] = true; + fgUsedVars[kVertexingLxyErr] = true; } if (fgUsedVars[kVertexingLzOverErr]) { - fgUsedVars[kVertexingLz] = kTRUE; - fgUsedVars[kVertexingLzErr] = kTRUE; + fgUsedVars[kVertexingLz] = true; + fgUsedVars[kVertexingLzErr] = true; } if (fgUsedVars[kVertexingLxyzOverErr]) { - fgUsedVars[kVertexingLxyz] = kTRUE; - fgUsedVars[kVertexingLxyzErr] = kTRUE; + fgUsedVars[kVertexingLxyz] = true; + fgUsedVars[kVertexingLxyzErr] = true; } if (fgUsedVars[kKFTracksDCAxyzMax]) { - fgUsedVars[kKFTrack0DCAxyz] = kTRUE; - fgUsedVars[kKFTrack1DCAxyz] = kTRUE; + fgUsedVars[kKFTrack0DCAxyz] = true; + fgUsedVars[kKFTrack1DCAxyz] = true; } if (fgUsedVars[kKFTracksDCAxyMax]) { - fgUsedVars[kKFTrack0DCAxy] = kTRUE; - fgUsedVars[kKFTrack1DCAxy] = kTRUE; + fgUsedVars[kKFTrack0DCAxy] = true; + fgUsedVars[kKFTrack1DCAxy] = true; + } + if (fgUsedVars[kTrackIsInsideTPCModule]) { + fgUsedVars[kPhiTPCOuter] = true; } } @@ -122,45 +126,6 @@ void VarManager::SetRunNumbers(std::vector runs) fgRunList = runs; } -//__________________________________________________________________ -void VarManager::SetRunlist(TString period) -{ - // - // runlist for the different periods - // TODO: add more periods - std::vector LHC22f = {520259, 520294, 520471, 520472, 520473}; - std::vector LHC22m = {523141, 523142, 523148, 523182, 523186, 523298, 523306, 523308, 523309, 523397, 523399, 523401, 523441, 523541, 523559, 523669, 523671, 523677, 523728, 523731, 523779, 523783, 523786, 523788, 523789, 523792, 523797, 523821, 523897}; - std::vector LHC22o = {526463, 526465, 526466, 526467, 526468, 526486, 526505, 526508, 526510, 526512, 526525, 526526, 526528, 526534, 526559, 526596, 526606, 526612, 526638, 526639, 526641, 526643, 526647, 526649, 526689, 526712, 526713, 526714, 526715, 526776, 526865, 526886, 526926, 526927, 526928, 526929, 526934, 526935, 526937, 526966, 526968, 527015, 527109, 527228, 527237, 527240, 527259, 527260, 527261, 527262, 527345, 527347, 527349, 527446, 527518, 527522, 527523, 527799, 527821, 527825, 527826, 527828, 527848, 527850, 527852, 527863, 527864, 527865, 527869, 527871, 527895, 527898, 527899, 527902, 527963, 527976, 527978, 527979, 528021, 528026, 528036, 528093, 528094, 528097, 528105, 528107, 528109, 528110, 528231, 528232, 528233, 528263, 528266, 528292, 528294, 528316, 528319, 528328, 528329, 528330, 528332, 528336, 528347, 528359, 528379, 528381, 528386, 528448, 528451, 528461, 528463, 528529, 528530, 528531, 528534, 528537, 528543}; - std::vector LHC22p = {528602, 528604, 528617, 528781, 528782, 528783, 528784, 528798, 528801}; - std::vector LHC22q = {528991, 528997, 529003, 529005, 529006, 529009, 529015, 529035, 529037, 529038, 529039, 529043}; - std::vector LHC22r = {529066, 529067, 529077, 529078, 529084, 529088, 529115, 529116, 529117, 529128, 529129, 529208, 529209, 529210, 529211, 529235, 529237, 529242, 529248, 529252, 529270, 529306, 529310, 529317, 529320, 529324, 529337, 529338, 529341}; - std::vector LHC22s = {529397, 529399, 529403, 529414, 529418}; - std::vector LHC22t = {529450, 529452, 529454, 529458, 529460, 529461, 529462, 529542, 529552, 529554, 529610, 529662, 529663, 529664, 529674, 529675, 529690, 529691}; - if (period.Contains("LHC22f")) { - SetRunNumbers(LHC22f); - } - if (period.Contains("LHC22q")) { - SetRunNumbers(LHC22q); - } - if (period.Contains("LHC22m")) { - SetRunNumbers(LHC22m); - } - if (period.Contains("LHC22o")) { - SetRunNumbers(LHC22o); - } - if (period.Contains("LHC22p")) { - SetRunNumbers(LHC22p); - } - if (period.Contains("LHC22r")) { - SetRunNumbers(LHC22r); - } - if (period.Contains("LHC22s")) { - SetRunNumbers(LHC22s); - } - if (period.Contains("LHC22t")) { - SetRunNumbers(LHC22t); - } -} //__________________________________________________________________ void VarManager::SetDummyRunlist(int InitRunnumber) { @@ -410,6 +375,10 @@ void VarManager::SetDefaultVarNames() fgVariableUnits[kTPCchi2] = ""; fgVariableNames[kTPCsignal] = "TPC dE/dx"; fgVariableUnits[kTPCsignal] = ""; + fgVariableNames[kPhiTPCOuter] = "#varphi_{TPCout}"; + fgVariableUnits[kPhiTPCOuter] = "rad."; + fgVariableNames[kTrackIsInsideTPCModule] = "Track is in TPC module"; + fgVariableUnits[kTrackIsInsideTPCModule] = ""; fgVariableNames[kTRDsignal] = "TRD dE/dx"; fgVariableUnits[kTRDsignal] = ""; fgVariableNames[kTOFbeta] = "TOF #beta"; diff --git a/PWGDQ/Core/VarManager.h b/PWGDQ/Core/VarManager.h index bc2dd18d438..4fe7e34ce9a 100644 --- a/PWGDQ/Core/VarManager.h +++ b/PWGDQ/Core/VarManager.h @@ -353,6 +353,8 @@ class VarManager : public TObject kTPCsignal, kTPCsignalRandomized, kTPCsignalRandomizedDelta, + kPhiTPCOuter, + kTrackIsInsideTPCModule, kTRDsignal, kTRDPattern, kTOFbeta, @@ -639,7 +641,6 @@ class VarManager : public TObject static void SetRunNumbers(int n, int* runs); static void SetRunNumbers(std::vector runs); static float GetRunIndex(double); - static void SetRunlist(TString period); static void SetDummyRunlist(int InitRunnumber); static int GetDummyFirst(); static int GetDummyLast(); @@ -827,6 +828,10 @@ class VarManager : public TObject return obj->second; } } + static void SetTPCInterSectorBoundary(float boundarySize) + { + fgTPCInterSectorBoundary = boundarySize; + } public: VarManager(); @@ -846,6 +851,7 @@ class VarManager : public TObject static std::vector fgRunList; // vector of runs, to be used for histogram axis static float fgCenterOfMassEnergy; // collision energy static float fgMassofCollidingParticle; // mass of the colliding particle + static float fgTPCInterSectorBoundary; // TPC inter-sector border size at the TPC outer radius, in cm static void FillEventDerived(float* values = nullptr); static void FillTrackDerived(float* values = nullptr); @@ -1481,6 +1487,26 @@ void VarManager::FillTrack(T const& track, float* values) values[kEta] = track.eta(); values[kPhi] = track.phi(); values[kCharge] = track.sign(); + if (fgUsedVars[kPhiTPCOuter]) { + values[kPhiTPCOuter] = track.phi() - (track.sign() > 0 ? 1.0 : -1.0) * (TMath::PiOver2() - TMath::ACos(0.22 * fgMagField / track.pt())); + if (values[kPhiTPCOuter] > TMath::TwoPi()) { + values[kPhiTPCOuter] -= TMath::TwoPi(); + } + if (values[kPhiTPCOuter] < 0.0) { + values[kPhiTPCOuter] += TMath::TwoPi(); + } + } + if (fgUsedVars[kTrackIsInsideTPCModule]) { + float localSectorPhi = values[kPhiTPCOuter] - TMath::Floor(18.0 * values[kPhiTPCOuter] / TMath::TwoPi()) * (TMath::TwoPi() / 18.0); + float edge = fgTPCInterSectorBoundary / 2.0 / 246.6; // minimal inter-sector boundary as angle + float curvature = 3.0 * 3.33 * track.pt() / fgMagField * (1.0 - TMath::Sin(TMath::ACos(0.22 * fgMagField / track.pt()))); + if (curvature / 2.466 > edge) { + edge = curvature / 2.466; + } + double min = edge; + double max = TMath::TwoPi() / 18.0 - edge; + values[kTrackIsInsideTPCModule] = (localSectorPhi > min && localSectorPhi < max ? 1.0 : 0.0); + } if constexpr ((fillMap & ReducedTrack) > 0 && !((fillMap & Pair) > 0)) { // values[kIsGlobalTrack] = track.filteringFlags_bit(0); @@ -1650,6 +1676,16 @@ void VarManager::FillTrack(T const& track, float* values) } } + // Quantities based on the V0 selections + if constexpr ((fillMap & TrackV0Bits) > 0) { + values[kIsLegFromGamma] = static_cast(track.pidbit() & (uint8_t(1) << VarManager::kIsConversionLeg)); + values[kIsLegFromK0S] = static_cast(track.pidbit() & (uint8_t(1) << VarManager::kIsK0sLeg)); + values[kIsLegFromLambda] = static_cast(track.pidbit() & (uint8_t(1) << VarManager::kIsLambdaLeg)); + values[kIsLegFromAntiLambda] = static_cast(track.pidbit() & (uint8_t(1) << VarManager::kIsALambdaLeg)); + values[kIsLegFromOmega] = static_cast(track.pidbit() & (uint8_t(1) << VarManager::kIsOmegaLeg)); + values[kIsProtonFromLambdaAndAntiLambda] = static_cast((values[kIsLegFromLambda] * track.sign() > 0) || (values[kIsLegFromAntiLambda] * (-track.sign()) > 0)); + } + // Quantities based on the barrel PID tables if constexpr ((fillMap & TrackPID) > 0 || (fillMap & ReducedTrackBarrelPID) > 0) { values[kTPCnSigmaEl] = track.tpcNSigmaEl(); diff --git a/PWGDQ/TableProducer/tableMaker.cxx b/PWGDQ/TableProducer/tableMaker.cxx index d2216c679fd..908043b33e3 100644 --- a/PWGDQ/TableProducer/tableMaker.cxx +++ b/PWGDQ/TableProducer/tableMaker.cxx @@ -87,6 +87,11 @@ using MyBarrelTracksWithDalitzBits = soa::Join; +using MyBarrelTracksWithV0AndDalitzBits = soa::Join; using MyEvents = soa::Join; using MyEventsWithMults = soa::Join; using MyEventsWithFilter = soa::Join; @@ -118,6 +123,7 @@ constexpr static uint32_t gkTrackFillMapWithCov = VarManager::ObjTypes::Track | constexpr static uint32_t gkTrackFillMapWithV0Bits = gkTrackFillMap | VarManager::ObjTypes::TrackV0Bits; constexpr static uint32_t gkTrackFillMapWithV0BitsForMaps = VarManager::ObjTypes::Track | VarManager::ObjTypes::TrackExtra | VarManager::ObjTypes::TrackDCA | VarManager::ObjTypes::TrackV0Bits | VarManager::ObjTypes::TrackSelection | VarManager::ObjTypes::TrackTPCPID; constexpr static uint32_t gkTrackFillMapWithDalitzBits = gkTrackFillMap | VarManager::ObjTypes::DalitzBits; +constexpr static uint32_t gkTrackFillMapWithV0AndDalitzBits = gkTrackFillMap | VarManager::ObjTypes::TrackV0Bits | VarManager::ObjTypes::DalitzBits; constexpr static uint32_t gkMuonFillMap = VarManager::ObjTypes::Muon; constexpr static uint32_t gkMuonFillMapWithCov = VarManager::ObjTypes::Muon | VarManager::ObjTypes::MuonCov; constexpr static uint32_t gkMuonFillMapWithAmbi = VarManager::ObjTypes::Muon | VarManager::ObjTypes::AmbiMuon; @@ -162,13 +168,11 @@ struct TableMaker { Configurable fIsRun2{"cfgIsRun2", false, "Whether we analyze Run-2 or Run-3 data"}; Configurable fIsAmbiguous{"cfgIsAmbiguous", false, "Whether we enable QA plots for ambiguous tracks"}; Configurable fConfigCcdbUrl{"ccdb-url", "http://alice-ccdb.cern.ch", "url of the ccdb repository"}; - Configurable fConfigCcdbPathTPC{"ccdb-path-tpc", "Users/z/zhxiong/Postcalib/pass4/apass3BB", "base path to the ccdb object"}; + Configurable fConfigCcdbPathTPC{"ccdb-path-tpc", "Users/z/zhxiong/TPCPID/PostCalib", "base path to the ccdb object"}; Configurable fConfigNoLaterThan{"ccdb-no-later-than", std::chrono::duration_cast(std::chrono::system_clock::now().time_since_epoch()).count(), "latest acceptable timestamp of creation for the object"}; Configurable fConfigComputeTPCpostCalib{"cfgTPCpostCalib", false, "If true, compute TPC post-calibrated n-sigmas(electrons, pions, protons)"}; Configurable fConfigComputeTPCpostCalibKaon{"cfgTPCpostCalibKaon", false, "If true, compute TPC post-calibrated n-sigmas for kaons"}; - Configurable fConfigRunPeriods{"cfgRunPeriods", "LHC22f", "run periods for used data"}; Configurable fConfigIsOnlyforMaps{"cfgIsforMaps", false, "If true, run for postcalibration maps only"}; - Configurable fConfigSaveElectronSample{"cfgSaveElectronSample", false, "If true, only save electron sample"}; Configurable fConfigDummyRunlist{"cfgDummyRunlist", false, "If true, use dummy runlist"}; Configurable fConfigInitRunNumber{"cfgInitRunNumber", 543215, "Initial run number used in run by run checks"}; Configurable fPropMuon{"cfgPropMuon", false, "Propgate muon tracks through absorber"}; @@ -234,8 +238,9 @@ struct TableMaker { context.mOptions.get("processBarrelOnlyWithMults") || context.mOptions.get("processBarrelOnlyWithCentAndMults") || context.mOptions.get("processBarrelOnlyWithCovWithCentAndMults") || context.mOptions.get("processBarrelOnlyWithCov") || context.mOptions.get("processBarrelOnlyWithEventFilter") || context.mOptions.get("processBarrelOnlyWithMultsAndEventFilter") || context.mOptions.get("processBarrelOnlyWithCovAndEventFilter") || - context.mOptions.get("processBarrelOnlyWithDalitzBits") || context.mOptions.get("processBarrelOnlyWithV0Bits") || - context.mOptions.get("processBarrelOnlyWithV0BitsAndMaps") || context.mOptions.get("processAmbiguousBarrelOnly")); + context.mOptions.get("processBarrelOnlyWithDalitzBits") || context.mOptions.get("processBarrelOnlyWithV0Bits") || context.mOptions.get("processBarrelWithDalitzEvent") || + context.mOptions.get("processBarrelOnlyWithV0BitsAndMaps") || context.mOptions.get("processAmbiguousBarrelOnly")) || + context.mOptions.get("processBarrelWithV0AndDalitzEvent"); bool enableMuonHistos = (context.mOptions.get("processFull") || context.mOptions.get("processFullWithCov") || context.mOptions.get("processFullWithCent") || context.mOptions.get("processFullWithCovAndEventFilter") || context.mOptions.get("processFullWithCovMultsAndEventFilter") || @@ -287,11 +292,9 @@ struct TableMaker { } } } - VarManager::SetRunlist((TString)fConfigRunPeriods); + if (fConfigDummyRunlist) { VarManager::SetDummyRunlist(fConfigInitRunNumber); - } else { - VarManager::SetRunlist((TString)fConfigRunPeriods); } DefineHistograms(histClasses); // define all histograms @@ -528,12 +531,6 @@ struct TableMaker { } trackFilteringTag |= (uint64_t(trackTempFilterMap) << VarManager::kBarrelUserCutsBits); // BIT13-20...: user track filters - if (fConfigSaveElectronSample) { // only save electron sample - if (!(trackFilteringTag & (uint64_t(1) << VarManager::kIsConversionLeg))) { - continue; - } - } - if constexpr (static_cast(TTrackFillMap & VarManager::ObjTypes::TrackPID)) { if (fConfigComputeTPCpostCalib) { trackFilteringTag |= (uint64_t(1) << VarManager::kIsTPCPostcalibrated); // store the info on whether TPC pid is skimmed as postcalibrated @@ -579,11 +576,11 @@ struct TableMaker { trackMFT.reserve(mftTracks.size()); trackMFTExtra.reserve(mftTracks.size()); // TODO add cuts on the MFT tracks - int nDel = 0; + // int nDel = 0; for (auto& mft : mftTracks) { if (false) // for now no cuts { - nDel++; + // nDel++; } else { // it passes the cuts and will be saved in the tables newMFTTableSize[mft.index()] = trackMFT.lastIndex(); } @@ -1185,7 +1182,7 @@ struct TableMaker { fStatsList.setObject(new TList()); fStatsList->SetOwner(kTRUE); std::vector eventLabels{"BCs", "Collisions before filtering", "Before cuts", "After cuts"}; - TH2I* histEvents = new TH2I("EventStats", "Event statistics", eventLabels.size(), -0.5, eventLabels.size() - 0.5, kNaliases + 1, -0.5, kNaliases + 0.5); + TH2I* histEvents = new TH2I("EventStats", "Event statistics", eventLabels.size(), -0.5, eventLabels.size() - 0.5, kNaliases + 1, -0.5, +kNaliases + 0.5); int ib = 1; for (auto label = eventLabels.begin(); label != eventLabels.end(); label++, ib++) { histEvents->GetXaxis()->SetBinLabel(ib, (*label).Data()); @@ -1300,6 +1297,36 @@ struct TableMaker { fullSkimming(collision, bcs, tracksBarrel, nullptr, nullptr, nullptr); } + // Produce barrel tables, with DalitzBits, and skip events without dalitz track ------------------------------------------------------------------------------ + void processBarrelWithDalitzEvent(MyEventsWithMults::iterator const& collision, aod::BCsWithTimestamps const& bcs, + soa::Filtered const& tracksBarrel) + { + for (auto const& track : tracksBarrel) { + if (track.dalitzBits() != uint8_t(0)) { + fullSkimming(collision, bcs, tracksBarrel, nullptr, nullptr, nullptr); + break; + } + } + } + + // Produce barrel only tables, with V0Bits and DalitzBits, and skip event without dalitz/V0 electron ----------------------------------------------------------------- + void processBarrelWithV0AndDalitzEvent(MyEventsWithMults::iterator const& collision, aod::BCsWithTimestamps const& bcs, + soa::Filtered const& tracksBarrel) + { + for (auto const& track : tracksBarrel) { + // check if this event has a Dalitz candidate + if (track.dalitzBits() != uint8_t(0)) { + fullSkimming(collision, bcs, tracksBarrel, nullptr, nullptr, nullptr); + break; + } + // check if this event has a electron candidate from V0 + if (track.pidbit() == uint8_t(1)) { + fullSkimming(collision, bcs, tracksBarrel, nullptr, nullptr, nullptr); + break; + } + } + } + // Produce barrel only tables, with event filtering ---------------------------------------------------------------------------------------- void processBarrelOnlyWithEventFilter(MyEventsWithFilter::iterator const& collision, aod::BCsWithTimestamps const& bcs, soa::Filtered const& tracksBarrel) @@ -1618,6 +1645,8 @@ struct TableMaker { PROCESS_SWITCH(TableMaker, processBarrelOnlyWithV0Bits, "Build full DQ skimmed data model, w/o centrality, w/ V0Bits", false); PROCESS_SWITCH(TableMaker, processBarrelOnlyWithV0BitsAndMaps, "Build full DQ skimmed data model, w/o multiplicity, w/ V0Bits", false); PROCESS_SWITCH(TableMaker, processBarrelOnlyWithDalitzBits, "Build barrel-only DQ skimmed data model, w/o centrality, w/ DalitzBits", false); + PROCESS_SWITCH(TableMaker, processBarrelWithDalitzEvent, "Build barrel-only DQ skimmed data model, w/o centrality, w/ DalitzBits", false); + PROCESS_SWITCH(TableMaker, processBarrelWithV0AndDalitzEvent, "Build barrel-only DQ skimmed data model, w/o centrality, w/ V0Bits and DalitzBits", false); PROCESS_SWITCH(TableMaker, processBarrelOnlyWithEventFilter, "Build full DQ skimmed data model, w/o centrality, w/ event filter", false); PROCESS_SWITCH(TableMaker, processBarrelOnlyWithMults, "Build barrel-only DQ skimmed data model, w/ multiplicity", false); PROCESS_SWITCH(TableMaker, processBarrelOnlyWithMultsAndEventFilter, "Build barrel-only DQ skimmed data model, w/ multiplicity, w/ event filter", false); diff --git a/PWGDQ/TableProducer/tableMaker_withAssoc.cxx b/PWGDQ/TableProducer/tableMaker_withAssoc.cxx index fdbe9ce6731..4dd54b24be3 100644 --- a/PWGDQ/TableProducer/tableMaker_withAssoc.cxx +++ b/PWGDQ/TableProducer/tableMaker_withAssoc.cxx @@ -177,7 +177,7 @@ struct TableMaker { // CCDB connection configurables Configurable fConfigCcdbUrl{"ccdb-url", "http://alice-ccdb.cern.ch", "url of the ccdb repository"}; - Configurable fConfigCcdbPathTPC{"ccdb-path-tpc", "Users/z/zhxiong/Postcalib/pass4/apass3BB", "base path to the ccdb object"}; + Configurable fConfigCcdbPathTPC{"ccdb-path-tpc", "Users/z/zhxiong/TPCPID/PostCalib", "base path to the ccdb object"}; Configurable fConfigNoLaterThan{"ccdb-no-later-than", std::chrono::duration_cast(std::chrono::system_clock::now().time_since_epoch()).count(), "latest acceptable timestamp of creation for the object"}; Configurable geoPath{"geoPath", "GLO/Config/GeometryAligned", "Path of the geometry file"}; Configurable grpmagPath{"grpmagPath", "GLO/Config/GRPMagField", "CCDB path of the GRPMagField object"}; @@ -186,7 +186,6 @@ struct TableMaker { // TPC postcalibration related options Configurable fConfigComputeTPCpostCalib{"cfgTPCpostCalib", false, "If true, compute TPC post-calibrated n-sigmas(electrons, pions, protons)"}; Configurable fConfigComputeTPCpostCalibKaon{"cfgTPCpostCalibKaon", false, "If true, compute TPC post-calibrated n-sigmas for kaons"}; - Configurable fConfigRunPeriods{"cfgRunPeriods", "LHC22f", "run periods for used data"}; Configurable fConfigIsOnlyforMaps{"cfgIsforMaps", false, "If true, run for postcalibration maps only"}; Configurable fConfigSaveElectronSample{"cfgSaveElectronSample", false, "If true, only save electron sample"}; Configurable fConfigDummyRunlist{"cfgDummyRunlist", false, "If true, use dummy runlist"}; @@ -289,11 +288,8 @@ struct TableMaker { } } - VarManager::SetRunlist((TString)fConfigRunPeriods); if (fConfigDummyRunlist) { VarManager::SetDummyRunlist(fConfigInitRunNumber); - } else { - VarManager::SetRunlist((TString)fConfigRunPeriods); } DefineHistograms(histClasses); // define all histograms diff --git a/PWGDQ/Tasks/dqCorrelation.cxx b/PWGDQ/Tasks/dqCorrelation.cxx index d7e06bf306e..cfaa5252e72 100644 --- a/PWGDQ/Tasks/dqCorrelation.cxx +++ b/PWGDQ/Tasks/dqCorrelation.cxx @@ -318,8 +318,6 @@ struct DqCumulantFlow { } } - VarManager::fgValues[VarManager::kCentFT0C]; - for (auto dilepton : dileptons) { registry.fill(HIST("dimuon_mass"), dilepton.mass()); diff --git a/PWGDQ/Tasks/filterPPwithAssociation.cxx b/PWGDQ/Tasks/filterPPwithAssociation.cxx index 03ff2acc1b0..ce804d5264b 100644 --- a/PWGDQ/Tasks/filterPPwithAssociation.cxx +++ b/PWGDQ/Tasks/filterPPwithAssociation.cxx @@ -842,12 +842,12 @@ struct DQFilterPPTask { } // Loop over collisions - int event = 0; + // int event = 0; int eventsFired = 0; for (const auto& collision : collisions) { // skip those that do not pass our selection if (!collision.isDQEventSelected()) { - event++; + // event++; continue; } // group the tracks and muons for this collision @@ -860,7 +860,7 @@ struct DQFilterPPTask { filter = runFilterPP(collision, bcs, tracks, muons, groupedTrackIndices, groupedMuonIndices); } if (filter == 0) { - event++; + // event++; continue; } eventsFired++; @@ -947,7 +947,7 @@ struct DQFilterPPTask { } } } - event++; + // event++; } // At this point, we have all the non-null decisions for all collisions. diff --git a/PWGDQ/Tasks/tableReader.cxx b/PWGDQ/Tasks/tableReader.cxx index e6201ed5def..8d396771b0a 100644 --- a/PWGDQ/Tasks/tableReader.cxx +++ b/PWGDQ/Tasks/tableReader.cxx @@ -226,7 +226,7 @@ struct AnalysisTrackSelection { Configurable fConfigAddTrackHistogram{"cfgAddTrackHistogram", "", "Comma separated list of histograms"}; Configurable fConfigPrefilterCutId{"cfgPrefilterCutId", 32, "Id of the Prefilter track cut (starting at 0)"}; // In order to create another column prefilter (should be temporary before improving cut selection in configurables, then displaced to AnalysisPrefilterSelection) Configurable fConfigCcdbUrl{"ccdb-url", "http://alice-ccdb.cern.ch", "url of the ccdb repository"}; - Configurable fConfigCcdbPathTPC{"ccdb-path-tpc", "Users/i/iarsene/Calib/TPCpostCalib", "base path to the ccdb object"}; + Configurable fConfigCcdbPathTPC{"ccdb-path-tpc", "Users/z/zhxiong/TPCPID/PostCalib", "base path to the ccdb object"}; Configurable fConfigNoLaterThan{"ccdb-no-later-than", std::chrono::duration_cast(std::chrono::system_clock::now().time_since_epoch()).count(), "latest acceptable timestamp of creation for the object"}; Configurable fConfigComputeTPCpostCalib{"cfgTPCpostCalib", false, "If true, compute TPC post-calibrated n-sigmas"}; Configurable fConfigRunPeriods{"cfgRunPeriods", "LHC22f", "run periods for used data"}; @@ -266,15 +266,12 @@ struct AnalysisTrackSelection { histDirNames += Form("TrackBarrel_%s;", cut.GetName()); } - VarManager::SetRunlist((TString)fConfigRunPeriods); DefineHistograms(fHistMan, histDirNames.Data(), fConfigAddTrackHistogram); // define all histograms VarManager::SetUseVars(fHistMan->GetUsedVars()); // provide the list of required variables so that VarManager knows what to fill fOutputList.setObject(fHistMan->GetMainHistogramList()); } if (fConfigDummyRunlist) { VarManager::SetDummyRunlist(fConfigInitRunNumber); - } else { - VarManager::SetRunlist((TString)fConfigRunPeriods); } if (fConfigComputeTPCpostCalib) { // CCDB configuration @@ -1797,15 +1794,6 @@ void DefineHistograms(HistogramManager* histMan, TString histClasses, Configurab if (classStr.Contains("Track") && !classStr.Contains("Pairs")) { if (classStr.Contains("Barrel")) { dqhistograms::DefineHistograms(histMan, objArray->At(iclass)->GetName(), "track", histName); - if (classStr.Contains("PIDCalibElectron")) { - dqhistograms::DefineHistograms(histMan, objArray->At(iclass)->GetName(), "track", "postcalib_electron"); - } - if (classStr.Contains("PIDCalibPion")) { - dqhistograms::DefineHistograms(histMan, objArray->At(iclass)->GetName(), "track", "postcalib_pion"); - } - if (classStr.Contains("PIDCalibProton")) { - dqhistograms::DefineHistograms(histMan, objArray->At(iclass)->GetName(), "track", "postcalib_proton"); - } } if (classStr.Contains("Muon")) { dqhistograms::DefineHistograms(histMan, objArray->At(iclass)->GetName(), "track", histName); diff --git a/PWGDQ/Tasks/tableReader_withAssoc.cxx b/PWGDQ/Tasks/tableReader_withAssoc.cxx index b5dbe02aa7b..c3a6abb8abd 100644 --- a/PWGDQ/Tasks/tableReader_withAssoc.cxx +++ b/PWGDQ/Tasks/tableReader_withAssoc.cxx @@ -143,12 +143,20 @@ struct AnalysisEventSelection { Configurable fConfigQA{"cfgQA", false, "If true, fill QA histograms"}; Configurable fConfigAddEventHistogram{"cfgAddEventHistogram", "", "Comma separated list of histograms"}; + Configurable fConfigCcdbUrl{"ccdb-url", "http://alice-ccdb.cern.ch", "url of the ccdb repository"}; + Configurable fConfigNoLaterThan{"ccdb-no-later-than", std::chrono::duration_cast(std::chrono::system_clock::now().time_since_epoch()).count(), "latest acceptable timestamp of creation for the object"}; + HistogramManager* fHistMan = nullptr; MixingHandler* fMixHandler = nullptr; AnalysisCompositeCut* fEventCut; + Service fCCDB; + o2::ccdb::CcdbApi fCCDBApi; + std::map fSelMap; // key: reduced event global index, value: event selection decision std::map> fBCCollMap; // key: global BC, value: vector of reduced event global indices + std::map fMetadataRCT, fHeader; + int fCurrentRun; void init(o2::framework::InitContext&) { @@ -176,11 +184,25 @@ struct AnalysisEventSelection { dqmixing::SetUpMixing(fMixHandler, objArray->At(iVar)->GetName()); } } + + fCurrentRun = -1; + fCCDB->setURL(fConfigCcdbUrl.value); + fCCDB->setCaching(true); + fCCDB->setLocalObjectValidityChecking(); + fCCDB->setCreatedNotAfter(fConfigNoLaterThan.value); + fCCDBApi.init(fConfigCcdbUrl.value); } template void runEventSelection(TEvents const& events) { + if (events.size() > 0 && events.begin().runNumber() != fCurrentRun) { + fHeader = fCCDBApi.retrieveHeaders(Form("RCT/Info/RunInformation/%i", events.begin().runNumber()), fMetadataRCT, -1); + uint64_t sor = std::atol(fHeader["SOR"].c_str()); + uint64_t eor = std::atol(fHeader["EOR"].c_str()); + cout << "=========================== SOR / EOR is " << sor << " / " << eor << endl; + } + fSelMap.clear(); fBCCollMap.clear(); @@ -292,11 +314,10 @@ struct AnalysisTrackSelection { Configurable fConfigQA{"cfgQA", false, "If true, fill QA histograms"}; Configurable fConfigAddTrackHistogram{"cfgAddTrackHistogram", "", "Comma separated list of histograms"}; Configurable fConfigCcdbUrl{"ccdb-url", "http://alice-ccdb.cern.ch", "url of the ccdb repository"}; - Configurable fConfigCcdbPathTPC{"ccdb-path-tpc", "Users/i/iarsene/Calib/TPCpostCalib", "base path to the ccdb object"}; + Configurable fConfigCcdbPathTPC{"ccdb-path-tpc", "Users/z/zhxiong/TPCPID/PostCalib", "base path to the ccdb object"}; Configurable fConfigNoLaterThan{"ccdb-no-later-than", std::chrono::duration_cast(std::chrono::system_clock::now().time_since_epoch()).count(), "latest acceptable timestamp of creation for the object"}; Configurable fConfigComputeTPCpostCalib{"cfgTPCpostCalib", false, "If true, compute TPC post-calibrated n-sigmas"}; Configurable grpmagPath{"grpmagPath", "GLO/Config/GRPMagField", "CCDB path of the GRPMagField object"}; - Configurable fConfigRunPeriods{"cfgRunPeriods", "LHC22f", "run periods for used data"}; Configurable fConfigDummyRunlist{"cfgDummyRunlist", false, "If true, use dummy runlist"}; Configurable fConfigInitRunNumber{"cfgInitRunNumber", 543215, "Initial run number used in run by run checks"}; @@ -337,15 +358,12 @@ struct AnalysisTrackSelection { } histDirNames += "TrackBarrel_AmbiguityInBunch;TrackBarrel_AmbiguityOutOfBunch;"; - VarManager::SetRunlist((TString)fConfigRunPeriods); DefineHistograms(fHistMan, histDirNames.Data(), fConfigAddTrackHistogram.value.data()); // define all histograms VarManager::SetUseVars(fHistMan->GetUsedVars()); // provide the list of required variables so that VarManager knows what to fill fOutputList.setObject(fHistMan->GetMainHistogramList()); } if (fConfigDummyRunlist) { VarManager::SetDummyRunlist(fConfigInitRunNumber); - } else { - VarManager::SetRunlist((TString)fConfigRunPeriods); } if (fConfigComputeTPCpostCalib) { fCCDB->setURL(fConfigCcdbUrl.value); @@ -1164,7 +1182,7 @@ struct AnalysisSameEventPairing { dileptonInfoList(t1.collisionId(), event.posX(), event.posY(), event.posZ()); } if constexpr (trackHasCov && TTwoProngFitter) { - dielectronsExtraList(t1.globalIndex(), t2.globalIndex(), VarManager::fgValues[VarManager::kVertexingTauz], VarManager::fgValues[VarManager::kVertexingLz], VarManager::fgValues[VarManager::kVertexingLxy]); + dielectronsExtraList(t1.globalIndex(), t2.globalIndex(), VarManager::fgValues[VarManager::kVertexingTauzProjected], VarManager::fgValues[VarManager::kVertexingLzProjected], VarManager::fgValues[VarManager::kVertexingLxyProjected]); } } @@ -1420,6 +1438,7 @@ struct AnalysisDileptonTrack { Configurable fConfigDileptonLowMass{"cfgDileptonLowMass", 2.8, "Low mass cut for the dileptons used in analysis"}; Configurable fConfigDileptonHighMass{"cfgDileptonHighMass", 3.2, "High mass cut for the dileptons used in analysis"}; Configurable fConfigDileptonpTCut{"cfgDileptonpTCut", 0.0, "pT cut for dileptons used in the triplet vertexing"}; + Configurable fConfigDileptonLxyCut{"cfgDileptonLxyCut", 0.0, "Lxy cut for dileptons used in the triplet vertexing"}; Configurable fConfigUseKFVertexing{"cfgUseKFVertexing", false, "Use KF Particle for secondary vertex reconstruction (DCAFitter is used by default)"}; Configurable fConfigHistogramSubgroups{"cfgDileptonTrackHistogramsSubgroups", "invmass,vertexing", "Comma separated list of dilepton-track histogram subgroups"}; @@ -1440,7 +1459,7 @@ struct AnalysisDileptonTrack { // TODO: The filter expressions seem to always use the default value of configurables, not the values from the actual configuration file Filter eventFilter = aod::dqanalysisflags::isEventSelected == uint32_t(1); - Filter dileptonFilter = aod::reducedpair::pt > fConfigDileptonpTCut&& aod::reducedpair::mass > fConfigDileptonLowMass&& aod::reducedpair::mass < fConfigDileptonHighMass&& aod::reducedpair::sign == 0; + Filter dileptonFilter = aod::reducedpair::pt > fConfigDileptonpTCut&& aod::reducedpair::mass > fConfigDileptonLowMass&& aod::reducedpair::mass fConfigDileptonLxyCut; Filter filterBarrel = aod::dqanalysisflags::isBarrelSelected > uint32_t(0); Filter filterMuon = aod::dqanalysisflags::isMuonSelected > uint32_t(0); @@ -1515,7 +1534,7 @@ struct AnalysisDileptonTrack { fHistNamesDileptonTrack[icut] = Form("DileptonTrack_%s_%s", tempStr.Data(), fConfigTrackCut.value.data()); fHistNamesDileptons[icut] = Form("DileptonsSelected_%s", tempStr.Data()); DefineHistograms(fHistMan, fHistNamesDileptonTrack[icut], fConfigHistogramSubgroups.value.data()); // define dilepton-track histograms - DefineHistograms(fHistMan, fHistNamesDileptons[icut], "empty"); // define dilepton histograms + DefineHistograms(fHistMan, fHistNamesDileptons[icut], "barrel,vertexing"); // define dilepton histograms if (isBarrelME || isMuonME) { fHistNamesME[icut] = Form("DileptonTrackME_%s", tempStr.Data()); DefineHistograms(fHistMan, fHistNamesME[icut], "mixedevent"); // define ME histograms @@ -1818,7 +1837,7 @@ void DefineHistograms(HistogramManager* histMan, TString histClasses, const char } if (classStr.Contains("DileptonsSelected")) { - dqhistograms::DefineHistograms(histMan, objArray->At(iclass)->GetName(), "pair", "barrel"); + dqhistograms::DefineHistograms(histMan, objArray->At(iclass)->GetName(), "pair", "barrel,vertexing"); } if (classStr.Contains("DileptonTrack") && !classStr.Contains("ME")) { diff --git a/PWGEM/Dilepton/Tasks/MCtemplates.cxx b/PWGEM/Dilepton/Tasks/MCtemplates.cxx index adabf6a389b..ec8c168da90 100644 --- a/PWGEM/Dilepton/Tasks/MCtemplates.cxx +++ b/PWGEM/Dilepton/Tasks/MCtemplates.cxx @@ -453,8 +453,8 @@ struct AnalysisSameEventPairing { // Loop over two track combinations uint8_t twoTrackFilter = 0; - uint32_t dileptonFilterMap = 0; - uint32_t dileptonMcDecision = 0; + // uint32_t dileptonFilterMap = 0; + // uint32_t dileptonMcDecision = 0; for (auto& [t1, t2] : combinations(tracks1, tracks2)) { if constexpr (TPairType == VarManager::kDecayToEE) { @@ -481,8 +481,8 @@ struct AnalysisSameEventPairing { } } // end loop over MC signals - dileptonFilterMap = twoTrackFilter; - dileptonMcDecision = mcDecision; + // dileptonFilterMap = twoTrackFilter; + // dileptonMcDecision = mcDecision; // Loop over all fulfilled cuts and fill pair histograms for (unsigned int icut = 0; icut < ncuts; icut++) { diff --git a/PWGEM/Dilepton/Tasks/emEfficiencyEE.cxx b/PWGEM/Dilepton/Tasks/emEfficiencyEE.cxx index dac157ab454..5d7ecbb6ecc 100644 --- a/PWGEM/Dilepton/Tasks/emEfficiencyEE.cxx +++ b/PWGEM/Dilepton/Tasks/emEfficiencyEE.cxx @@ -220,7 +220,7 @@ struct AnalysisEventQa { std::map fMCEventLabels; int fMCCounters = 0; - int fEvCounters = 0; + // int fEvCounters = 0; // First loop @@ -230,7 +230,7 @@ struct AnalysisEventQa { eventFilter = uint32_t(event.isEventSelected()); if (!eventFilter) continue; - fEvCounters++; + // fEvCounters++; registry.fill(HIST("RecEvent"), 0.5); Int_t midrap = 0; diff --git a/PWGEM/Tasks/phosNbar.cxx b/PWGEM/Tasks/phosNbar.cxx index 9d6d43aa29c..26bcc3530c9 100644 --- a/PWGEM/Tasks/phosNbar.cxx +++ b/PWGEM/Tasks/phosNbar.cxx @@ -438,7 +438,7 @@ struct phosNbar { } // Find optimal region double maxCPA = -1; - int iMax; + int iMax = -1; for (int i = 0; i < npoints; i++) { if (st[i].first > maxCPA) { maxCPA = st[i].first; diff --git a/PWGHF/ALICE3/TableProducer/treeCreatorChicToJpsiGamma.cxx b/PWGHF/ALICE3/TableProducer/treeCreatorChicToJpsiGamma.cxx index 67883eff199..c7df4a673e8 100644 --- a/PWGHF/ALICE3/TableProducer/treeCreatorChicToJpsiGamma.cxx +++ b/PWGHF/ALICE3/TableProducer/treeCreatorChicToJpsiGamma.cxx @@ -150,7 +150,7 @@ struct HfTreeCreatorChicToJpsiGamma { } // Filling candidate properties - int indexCand = 0; + // int indexCand = 0; rowCandidateFull.reserve(candidates.size()); for (const auto& candidate : candidates) { std::array pvecChic = {candidate.px(), candidate.py(), candidate.pz()}; @@ -163,7 +163,7 @@ struct HfTreeCreatorChicToJpsiGamma { auto alpha = (pl1 - pl2) / (pl1 + pl2); auto qt = std::sqrt(pjpsi * pjpsi - pl1 * pl1); - indexCand++; + // indexCand++; auto fillTable = [&](int CandFlag, int FunctionSelection, float FunctionInvMass, diff --git a/PWGHF/ALICE3/TableProducer/treeCreatorXToJpsiPiPi.cxx b/PWGHF/ALICE3/TableProducer/treeCreatorXToJpsiPiPi.cxx index 527605893e6..e15aa64e07e 100644 --- a/PWGHF/ALICE3/TableProducer/treeCreatorXToJpsiPiPi.cxx +++ b/PWGHF/ALICE3/TableProducer/treeCreatorXToJpsiPiPi.cxx @@ -173,13 +173,13 @@ struct HfTreeCreatorXToJpsiPiPi { } // Filling candidate properties - int indexCand = 0; + // int indexCand = 0; rowCandidateFull.reserve(candidates.size()); for (const auto& candidate : candidates) { if (!candidate.isSelXToJpsiToMuMuPiPi()) { continue; } - indexCand++; + // indexCand++; auto fillTable = [&](int CandFlag, int FunctionSelection, float FunctionInvMass, diff --git a/PWGHF/DataModel/DerivedTables.h b/PWGHF/DataModel/DerivedTables.h index 45cad081aa4..ebb8866030f 100644 --- a/PWGHF/DataModel/DerivedTables.h +++ b/PWGHF/DataModel/DerivedTables.h @@ -15,6 +15,8 @@ #ifndef PWGHF_DATAMODEL_DERIVEDTABLES_H_ #define PWGHF_DATAMODEL_DERIVEDTABLES_H_ +#include + #include "CommonConstants/PhysicsConstants.h" #include "Framework/AnalysisDataModel.h" #include "Framework/ASoA.h" @@ -22,6 +24,7 @@ #include "Common/Core/RecoDecay.h" #include "PWGHF/DataModel/CandidateReconstructionTables.h" +#include "PWGHF/DataModel/CandidateSelectionTables.h" namespace o2::aod { @@ -283,6 +286,7 @@ DECLARE_SOA_COLUMN(FlagMcDecayChanGen, flagMcDecayChanGen, int8_t); //! resonant DECLARE_SOA_COLUMN(MlScoreBkg, mlScoreBkg, float); //! ML score for background class DECLARE_SOA_COLUMN(MlScorePrompt, mlScorePrompt, float); //! ML score for prompt class DECLARE_SOA_COLUMN(MlScoreNonPrompt, mlScoreNonPrompt, float); //! ML score for non-prompt class +DECLARE_SOA_COLUMN(MlScores, mlScores, std::vector); //! vector of ML scores } // namespace hf_cand_mc // D0 @@ -433,6 +437,13 @@ DECLARE_SOA_TABLE(StoredHfD0Sels, "AOD1", "HFD0SEL", //! Table with candidate se hf_cand_sel::CandidateSelFlag, soa::Marker<1>); +DECLARE_SOA_TABLE(HfD0Mls, "AOD", "HFD0ML", //! Table with candidate selection ML scores + hf_cand_mc::MlScores); + +DECLARE_SOA_TABLE(StoredHfD0Mls, "AOD1", "HFD0ML", //! Table with candidate selection ML scores (stored version) + hf_cand_mc::MlScores, + soa::Marker<1>); + DECLARE_SOA_TABLE(HfD0Ids, "AOD", "HFD0ID", //! Table with global indices for candidates hf_cand::CollisionId, hf_track_index::Prong0Id, @@ -654,6 +665,14 @@ DECLARE_SOA_TABLE(StoredHf3PSels, "AOD1", "HF3PSEL", //! Table with candidate se hf_cand_sel::CandidateSelFlag, soa::Marker<3>); +DECLARE_SOA_TABLE(Hf3PMls, "AOD", "HF3PML", //! Table with candidate selection ML scores + hf_cand_mc::MlScores, + soa::Marker<2>); + +DECLARE_SOA_TABLE(StoredHf3PMls, "AOD1", "HF3PML", //! Table with candidate selection ML scores (stored version) + hf_cand_mc::MlScores, + soa::Marker<3>); + DECLARE_SOA_TABLE(Hf3PIds, "AOD", "HF3PID", //! Table with global indices for candidates hf_cand::CollisionId, hf_track_index::Prong0Id, diff --git a/PWGHF/HFC/TableProducer/correlatorDsHadrons.cxx b/PWGHF/HFC/TableProducer/correlatorDsHadrons.cxx index 7f351750bc6..1fc31333d65 100644 --- a/PWGHF/HFC/TableProducer/correlatorDsHadrons.cxx +++ b/PWGHF/HFC/TableProducer/correlatorDsHadrons.cxx @@ -170,8 +170,10 @@ struct HfCorrelatorDsHadrons { enum CandidateStep { kCandidateStepMcGenAll = 0, kCandidateStepMcGenDsToKKPi, - kCandidateStepMcGenInAcceptance, + kCandidateStepMcCandInAcceptance, + kCandidateStepMcDaughtersInAcceptance, kCandidateStepMcReco, + kCandidateStepMcRecoInAcceptance, kCandidateNSteps }; enum AssocTrackStep { kAssocTrackStepMcGen = 0, @@ -251,7 +253,7 @@ struct HfCorrelatorDsHadrons { registry.add("hEtaMcGen", "Ds,Hadron particles - MC Gen", {HistType::kTH1F, {axisEta}}); registry.add("hPhiMcGen", "Ds,Hadron particles - MC Gen", {HistType::kTH1F, {axisPhi}}); // Histograms for efficiencies - auto hCandidates = registry.add("hCandidates", "Candidate count at different steps", {HistType::kStepTHnF, {axisPtD, axisMultFT0M, {RecoDecay::OriginType::NonPrompt + 1, RecoDecay::OriginType::None - 0.5, RecoDecay::OriginType::NonPrompt + 0.5}}, kCandidateNSteps}); + auto hCandidates = registry.add("hCandidates", "Candidate count at different steps", {HistType::kStepTHnF, {axisPtD, axisMultFT0M, {RecoDecay::OriginType::NonPrompt + 1, +RecoDecay::OriginType::None - 0.5, +RecoDecay::OriginType::NonPrompt + 0.5}}, kCandidateNSteps}); hCandidates->GetAxis(0)->SetTitle("#it{p}_{T} (GeV/#it{c})"); hCandidates->GetAxis(1)->SetTitle("multiplicity"); hCandidates->GetAxis(2)->SetTitle("Charm hadron origin"); @@ -518,6 +520,10 @@ struct HfCorrelatorDsHadrons { hCandidates->Fill(kCandidateStepMcGenAll, mcParticle.pt(), multiplicity, mcParticle.originMcGen()); if (std::abs(mcParticle.flagMcMatchGen()) == 1 << aod::hf_cand_3prong::DecayType::DsToKKPi) { hCandidates->Fill(kCandidateStepMcGenDsToKKPi, mcParticle.pt(), multiplicity, mcParticle.originMcGen()); + auto yDs = RecoDecay::y(std::array{mcParticle.px(), mcParticle.py(), mcParticle.pz()}, o2::constants::physics::MassDS); + if (std::abs(yDs) <= yCandMax) { + hCandidates->Fill(kCandidateStepMcCandInAcceptance, mcParticle.pt(), multiplicity, mcParticle.originMcGen()); + } bool inAcceptance = true; auto daughters = mcParticle.template daughters_as(); for (const auto& daughter : daughters) { @@ -526,7 +532,7 @@ struct HfCorrelatorDsHadrons { } } if (inAcceptance) { - hCandidates->Fill(kCandidateStepMcGenInAcceptance, mcParticle.pt(), multiplicity, mcParticle.originMcGen()); + hCandidates->Fill(kCandidateStepMcDaughtersInAcceptance, mcParticle.pt(), multiplicity, mcParticle.originMcGen()); fillHistoMcGen(mcParticle); } } @@ -544,6 +550,9 @@ struct HfCorrelatorDsHadrons { if (((std::abs(prong0McPart.pdgCode()) == kKPlus) && (candidate.isSelDsToKKPi() >= selectionFlagDs)) || ((std::abs(prong0McPart.pdgCode()) == kPiPlus) && (candidate.isSelDsToPiKK() >= selectionFlagDs))) { registry.fill(HIST("hPtCand"), candidate.pt()); hCandidates->Fill(kCandidateStepMcReco, candidate.pt(), multiplicity, candidate.originMcRec()); + if (std::abs(hfHelper.yDs(candidate)) <= yCandMax) { + hCandidates->Fill(kCandidateStepMcRecoInAcceptance, candidate.pt(), multiplicity, candidate.originMcRec()); + } } } } diff --git a/PWGHF/TableProducer/derivedDataCreatorD0ToKPi.cxx b/PWGHF/TableProducer/derivedDataCreatorD0ToKPi.cxx index 88d780eb814..e905115aaa9 100644 --- a/PWGHF/TableProducer/derivedDataCreatorD0ToKPi.cxx +++ b/PWGHF/TableProducer/derivedDataCreatorD0ToKPi.cxx @@ -20,6 +20,8 @@ #include "Framework/runDataProcessing.h" #include "Common/Core/RecoDecay.h" +#include "Common/DataModel/Centrality.h" +#include "Common/DataModel/Multiplicity.h" #include "PWGHF/Core/HfHelper.h" #include "PWGHF/DataModel/CandidateReconstructionTables.h" @@ -36,6 +38,7 @@ struct HfDerivedDataCreatorD0ToKPi { Produces rowCandidatePar; Produces rowCandidateParE; Produces rowCandidateSel; + Produces rowCandidateMl; Produces rowCandidateId; Produces rowCandidateMc; Produces rowCollBase; @@ -48,6 +51,7 @@ struct HfDerivedDataCreatorD0ToKPi { Configurable fillCandidatePar{"fillCandidatePar", true, "Fill candidate parameters"}; Configurable fillCandidateParE{"fillCandidateParE", true, "Fill candidate extended parameters"}; Configurable fillCandidateSel{"fillCandidateSel", true, "Fill candidate selection flags"}; + Configurable fillCandidateMl{"fillCandidateMl", true, "Fill candidate selection ML scores"}; Configurable fillCandidateId{"fillCandidateId", true, "Fill candidate indices"}; Configurable fillCandidateMc{"fillCandidateMc", true, "Fill candidate MC info"}; Configurable fillCollBase{"fillCollBase", true, "Fill collision base properties"}; @@ -61,12 +65,16 @@ struct HfDerivedDataCreatorD0ToKPi { HfHelper hfHelper; SliceCache cache; - using CollisionsWCentMult = soa::Join; + using CollisionsWCentMult = soa::Join; using TracksWPid = soa::Join; using SelectedCandidates = soa::Filtered>; using SelectedCandidatesKf = soa::Filtered>; using SelectedCandidatesMc = soa::Filtered>; using SelectedCandidatesMcKf = soa::Filtered>; + using SelectedCandidatesMl = soa::Filtered>; + using SelectedCandidatesKfMl = soa::Filtered>; + using SelectedCandidatesMcMl = soa::Filtered>; + using SelectedCandidatesMcKfMl = soa::Filtered>; using MatchedGenCandidatesMc = soa::Filtered>; Filter filterSelectCandidates = aod::hf_sel_candidate_d0::isSelD0 >= 1 || aod::hf_sel_candidate_d0::isSelD0bar >= 1; @@ -76,21 +84,34 @@ struct HfDerivedDataCreatorD0ToKPi { Preslice candidatesKfPerCollision = aod::hf_cand::collisionId; Preslice candidatesMcPerCollision = aod::hf_cand::collisionId; Preslice candidatesMcKfPerCollision = aod::hf_cand::collisionId; + Preslice candidatesMlPerCollision = aod::hf_cand::collisionId; + Preslice candidatesKfMlPerCollision = aod::hf_cand::collisionId; + Preslice candidatesMcMlPerCollision = aod::hf_cand::collisionId; + Preslice candidatesMcKfMlPerCollision = aod::hf_cand::collisionId; // trivial partitions for all candidates to allow "->sliceByCached" inside processCandidates Partition candidatesAll = aod::hf_sel_candidate_d0::isSelD0 >= 0; Partition candidatesKfAll = aod::hf_sel_candidate_d0::isSelD0 >= 0; Partition candidatesMcAll = aod::hf_sel_candidate_d0::isSelD0 >= 0; Partition candidatesMcKfAll = aod::hf_sel_candidate_d0::isSelD0 >= 0; + Partition candidatesMlAll = aod::hf_sel_candidate_d0::isSelD0 >= 0; + Partition candidatesKfMlAll = aod::hf_sel_candidate_d0::isSelD0 >= 0; + Partition candidatesMcMlAll = aod::hf_sel_candidate_d0::isSelD0 >= 0; + Partition candidatesMcKfMlAll = aod::hf_sel_candidate_d0::isSelD0 >= 0; // partitions for signal and background Partition candidatesMcSig = nabs(aod::hf_cand_2prong::flagMcMatchRec) == static_cast(BIT(aod::hf_cand_2prong::DecayType::D0ToPiK)); Partition candidatesMcBkg = nabs(aod::hf_cand_2prong::flagMcMatchRec) != static_cast(BIT(aod::hf_cand_2prong::DecayType::D0ToPiK)); Partition candidatesMcKfSig = nabs(aod::hf_cand_2prong::flagMcMatchRec) == static_cast(BIT(aod::hf_cand_2prong::DecayType::D0ToPiK)); Partition candidatesMcKfBkg = nabs(aod::hf_cand_2prong::flagMcMatchRec) != static_cast(BIT(aod::hf_cand_2prong::DecayType::D0ToPiK)); + Partition candidatesMcMlSig = nabs(aod::hf_cand_2prong::flagMcMatchRec) == static_cast(BIT(aod::hf_cand_2prong::DecayType::D0ToPiK)); + Partition candidatesMcMlBkg = nabs(aod::hf_cand_2prong::flagMcMatchRec) != static_cast(BIT(aod::hf_cand_2prong::DecayType::D0ToPiK)); + Partition candidatesMcKfMlSig = nabs(aod::hf_cand_2prong::flagMcMatchRec) == static_cast(BIT(aod::hf_cand_2prong::DecayType::D0ToPiK)); + Partition candidatesMcKfMlBkg = nabs(aod::hf_cand_2prong::flagMcMatchRec) != static_cast(BIT(aod::hf_cand_2prong::DecayType::D0ToPiK)); void init(InitContext const&) { - std::array doprocess{doprocessDataWithDCAFitterN, doprocessDataWithKFParticle, doprocessMcWithDCAFitterSig, doprocessMcWithDCAFitterBkg, doprocessMcWithDCAFitterAll, doprocessMcWithKFParticleSig, doprocessMcWithKFParticleBkg, doprocessMcWithKFParticleAll}; + std::array doprocess{doprocessDataWithDCAFitterN, doprocessDataWithKFParticle, doprocessMcWithDCAFitterSig, doprocessMcWithDCAFitterBkg, doprocessMcWithDCAFitterAll, doprocessMcWithKFParticleSig, doprocessMcWithKFParticleBkg, doprocessMcWithKFParticleAll, + doprocessDataWithDCAFitterNMl, doprocessDataWithKFParticleMl, doprocessMcWithDCAFitterMlSig, doprocessMcWithDCAFitterMlBkg, doprocessMcWithDCAFitterMlAll, doprocessMcWithKFParticleMlSig, doprocessMcWithKFParticleMlBkg, doprocessMcWithKFParticleMlAll}; if (std::accumulate(doprocess.begin(), doprocess.end(), 0) != 1) { LOGP(fatal, "Only one process function can be enabled at a time."); } @@ -129,7 +150,7 @@ struct HfDerivedDataCreatorD0ToKPi { template auto fillTablesCandidate(const T& candidate, const U& prong0, const U& prong1, int candFlag, double invMass, double cosThetaStar, double topoChi2, - double ct, int8_t flagMc, int8_t origin) + double ct, int8_t flagMc, int8_t origin, const std::vector& mlScores) { if (fillCandidateBase) { rowCandidateBase( @@ -198,6 +219,10 @@ struct HfDerivedDataCreatorD0ToKPi { rowCandidateSel( BIT(candFlag)); } + if (fillCandidateMl) { + rowCandidateMl( + mlScores); + } if (fillCandidateId) { rowCandidateId( candidate.collisionId(), @@ -229,7 +254,7 @@ struct HfDerivedDataCreatorD0ToKPi { } } - template + template void processCandidates(CollType const& collisions, Partition& candidates, TracksWPid const&, @@ -296,11 +321,16 @@ struct HfDerivedDataCreatorD0ToKPi { massD0 = hfHelper.invMassD0ToPiK(candidate); massD0bar = hfHelper.invMassD0barToKPi(candidate); } + std::vector mlScoresD0, mlScoresD0bar; + if constexpr (isMl) { + std::copy(candidate.mlProbD0().begin(), candidate.mlProbD0().end(), mlScoresD0.begin()); + std::copy(candidate.mlProbD0bar().begin(), candidate.mlProbD0bar().end(), mlScoresD0bar.begin()); + } if (candidate.isSelD0()) { - fillTablesCandidate(candidate, prong0, prong1, 0, massD0, hfHelper.cosThetaStarD0(candidate), topolChi2PerNdf, ctD, flagMcRec, origin); + fillTablesCandidate(candidate, prong0, prong1, 0, massD0, hfHelper.cosThetaStarD0(candidate), topolChi2PerNdf, ctD, flagMcRec, origin, mlScoresD0); } if (candidate.isSelD0bar()) { - fillTablesCandidate(candidate, prong0, prong1, 1, massD0bar, hfHelper.cosThetaStarD0bar(candidate), topolChi2PerNdf, ctD, flagMcRec, origin); + fillTablesCandidate(candidate, prong0, prong1, 1, massD0bar, hfHelper.cosThetaStarD0bar(candidate), topolChi2PerNdf, ctD, flagMcRec, origin, mlScoresD0bar); } } } @@ -326,7 +356,7 @@ struct HfDerivedDataCreatorD0ToKPi { TracksWPid const& tracks, aod::BCs const& bcs) { - processCandidates(collisions, candidatesAll, tracks, bcs); + processCandidates(collisions, candidatesAll, tracks, bcs); } PROCESS_SWITCH(HfDerivedDataCreatorD0ToKPi, processDataWithDCAFitterN, "Process data with DCAFitterN", true); @@ -335,7 +365,7 @@ struct HfDerivedDataCreatorD0ToKPi { TracksWPid const& tracks, aod::BCs const& bcs) { - processCandidates(collisions, candidatesKfAll, tracks, bcs); + processCandidates(collisions, candidatesKfAll, tracks, bcs); } PROCESS_SWITCH(HfDerivedDataCreatorD0ToKPi, processDataWithKFParticle, "Process data with KFParticle", false); @@ -345,7 +375,7 @@ struct HfDerivedDataCreatorD0ToKPi { TracksWPid const& tracks, aod::BCs const& bcs) { - processCandidates(collisions, candidatesMcSig, tracks, bcs); + processCandidates(collisions, candidatesMcSig, tracks, bcs); processMcParticles(mcParticles); } PROCESS_SWITCH(HfDerivedDataCreatorD0ToKPi, processMcWithDCAFitterSig, "Process MC with DCAFitterN only for signals", false); @@ -356,7 +386,7 @@ struct HfDerivedDataCreatorD0ToKPi { TracksWPid const& tracks, aod::BCs const& bcs) { - processCandidates(collisions, candidatesMcBkg, tracks, bcs); + processCandidates(collisions, candidatesMcBkg, tracks, bcs); processMcParticles(mcParticles); } PROCESS_SWITCH(HfDerivedDataCreatorD0ToKPi, processMcWithDCAFitterBkg, "Process MC with DCAFitterN only for background", false); @@ -367,7 +397,7 @@ struct HfDerivedDataCreatorD0ToKPi { TracksWPid const& tracks, aod::BCs const& bcs) { - processCandidates(collisions, candidatesMcAll, tracks, bcs); + processCandidates(collisions, candidatesMcAll, tracks, bcs); processMcParticles(mcParticles); } PROCESS_SWITCH(HfDerivedDataCreatorD0ToKPi, processMcWithDCAFitterAll, "Process MC with DCAFitterN", false); @@ -378,7 +408,7 @@ struct HfDerivedDataCreatorD0ToKPi { TracksWPid const& tracks, aod::BCs const& bcs) { - processCandidates(collisions, candidatesMcKfSig, tracks, bcs); + processCandidates(collisions, candidatesMcKfSig, tracks, bcs); processMcParticles(mcParticles); } PROCESS_SWITCH(HfDerivedDataCreatorD0ToKPi, processMcWithKFParticleSig, "Process MC with KFParticle only for signals", false); @@ -389,7 +419,7 @@ struct HfDerivedDataCreatorD0ToKPi { TracksWPid const& tracks, aod::BCs const& bcs) { - processCandidates(collisions, candidatesMcKfBkg, tracks, bcs); + processCandidates(collisions, candidatesMcKfBkg, tracks, bcs); processMcParticles(mcParticles); } PROCESS_SWITCH(HfDerivedDataCreatorD0ToKPi, processMcWithKFParticleBkg, "Process MC with KFParticle only for background", false); @@ -400,10 +430,96 @@ struct HfDerivedDataCreatorD0ToKPi { TracksWPid const& tracks, aod::BCs const& bcs) { - processCandidates(collisions, candidatesMcKfAll, tracks, bcs); + processCandidates(collisions, candidatesMcKfAll, tracks, bcs); processMcParticles(mcParticles); } PROCESS_SWITCH(HfDerivedDataCreatorD0ToKPi, processMcWithKFParticleAll, "Process MC with KFParticle", false); + + // ML versions + + void processDataWithDCAFitterNMl(CollisionsWCentMult const& collisions, + SelectedCandidatesMl const&, + TracksWPid const& tracks, + aod::BCs const& bcs) + { + processCandidates(collisions, candidatesMlAll, tracks, bcs); + } + PROCESS_SWITCH(HfDerivedDataCreatorD0ToKPi, processDataWithDCAFitterNMl, "Process data with DCAFitterN and ML", false); + + void processDataWithKFParticleMl(CollisionsWCentMult const& collisions, + SelectedCandidatesKfMl const&, + TracksWPid const& tracks, + aod::BCs const& bcs) + { + processCandidates(collisions, candidatesKfMlAll, tracks, bcs); + } + PROCESS_SWITCH(HfDerivedDataCreatorD0ToKPi, processDataWithKFParticleMl, "Process data with KFParticle and ML", false); + + void processMcWithDCAFitterMlSig(CollisionsWCentMult const& collisions, + SelectedCandidatesMcMl const&, + MatchedGenCandidatesMc const& mcParticles, + TracksWPid const& tracks, + aod::BCs const& bcs) + { + processCandidates(collisions, candidatesMcMlSig, tracks, bcs); + processMcParticles(mcParticles); + } + PROCESS_SWITCH(HfDerivedDataCreatorD0ToKPi, processMcWithDCAFitterMlSig, "Process MC with DCAFitterN and ML only for signals", false); + + void processMcWithDCAFitterMlBkg(CollisionsWCentMult const& collisions, + SelectedCandidatesMcMl const&, + MatchedGenCandidatesMc const& mcParticles, + TracksWPid const& tracks, + aod::BCs const& bcs) + { + processCandidates(collisions, candidatesMcMlBkg, tracks, bcs); + processMcParticles(mcParticles); + } + PROCESS_SWITCH(HfDerivedDataCreatorD0ToKPi, processMcWithDCAFitterMlBkg, "Process MC with DCAFitterN and ML only for background", false); + + void processMcWithDCAFitterMlAll(CollisionsWCentMult const& collisions, + SelectedCandidatesMcMl const&, + MatchedGenCandidatesMc const& mcParticles, + TracksWPid const& tracks, + aod::BCs const& bcs) + { + processCandidates(collisions, candidatesMcMlAll, tracks, bcs); + processMcParticles(mcParticles); + } + PROCESS_SWITCH(HfDerivedDataCreatorD0ToKPi, processMcWithDCAFitterMlAll, "Process MC with DCAFitterN and ML", false); + + void processMcWithKFParticleMlSig(CollisionsWCentMult const& collisions, + SelectedCandidatesMcKfMl const&, + MatchedGenCandidatesMc const& mcParticles, + TracksWPid const& tracks, + aod::BCs const& bcs) + { + processCandidates(collisions, candidatesMcKfMlSig, tracks, bcs); + processMcParticles(mcParticles); + } + PROCESS_SWITCH(HfDerivedDataCreatorD0ToKPi, processMcWithKFParticleMlSig, "Process MC with KFParticle and ML only for signals", false); + + void processMcWithKFParticleMlBkg(CollisionsWCentMult const& collisions, + SelectedCandidatesMcKfMl const&, + MatchedGenCandidatesMc const& mcParticles, + TracksWPid const& tracks, + aod::BCs const& bcs) + { + processCandidates(collisions, candidatesMcKfMlBkg, tracks, bcs); + processMcParticles(mcParticles); + } + PROCESS_SWITCH(HfDerivedDataCreatorD0ToKPi, processMcWithKFParticleMlBkg, "Process MC with KFParticle and ML only for background", false); + + void processMcWithKFParticleMlAll(CollisionsWCentMult const& collisions, + SelectedCandidatesMcKfMl const&, + MatchedGenCandidatesMc const& mcParticles, + TracksWPid const& tracks, + aod::BCs const& bcs) + { + processCandidates(collisions, candidatesMcKfMlAll, tracks, bcs); + processMcParticles(mcParticles); + } + PROCESS_SWITCH(HfDerivedDataCreatorD0ToKPi, processMcWithKFParticleMlAll, "Process MC with KFParticle and ML", false); }; WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) diff --git a/PWGHF/TableProducer/derivedDataCreatorLcToPKPi.cxx b/PWGHF/TableProducer/derivedDataCreatorLcToPKPi.cxx index 5415791973e..c3437cbc006 100644 --- a/PWGHF/TableProducer/derivedDataCreatorLcToPKPi.cxx +++ b/PWGHF/TableProducer/derivedDataCreatorLcToPKPi.cxx @@ -20,6 +20,8 @@ #include "Framework/runDataProcessing.h" #include "Common/Core/RecoDecay.h" +#include "Common/DataModel/Centrality.h" +#include "Common/DataModel/Multiplicity.h" #include "PWGHF/Core/HfHelper.h" #include "PWGHF/DataModel/CandidateReconstructionTables.h" @@ -36,6 +38,7 @@ struct HfDerivedDataCreatorLcToPKPi { Produces rowCandidatePar; Produces rowCandidateParE; Produces rowCandidateSel; + Produces rowCandidateMl; Produces rowCandidateId; Produces rowCandidateMc; Produces rowCollBase; @@ -48,6 +51,7 @@ struct HfDerivedDataCreatorLcToPKPi { Configurable fillCandidatePar{"fillCandidatePar", true, "Fill candidate parameters"}; Configurable fillCandidateParE{"fillCandidateParE", true, "Fill candidate extended parameters"}; Configurable fillCandidateSel{"fillCandidateSel", true, "Fill candidate selection flags"}; + Configurable fillCandidateMl{"fillCandidateMl", true, "Fill candidate selection ML scores"}; Configurable fillCandidateId{"fillCandidateId", true, "Fill candidate indices"}; Configurable fillCandidateMc{"fillCandidateMc", true, "Fill candidate MC info"}; Configurable fillCollBase{"fillCollBase", true, "Fill collision base properties"}; @@ -61,10 +65,12 @@ struct HfDerivedDataCreatorLcToPKPi { HfHelper hfHelper; SliceCache cache; - using CollisionsWCentMult = soa::Join; + using CollisionsWCentMult = soa::Join; using TracksWPid = soa::Join; using SelectedCandidates = soa::Filtered>; using SelectedCandidatesMc = soa::Filtered>; + using SelectedCandidatesMl = soa::Filtered>; + using SelectedCandidatesMcMl = soa::Filtered>; using MatchedGenCandidatesMc = soa::Filtered>; Filter filterSelectCandidates = aod::hf_sel_candidate_lc::isSelLcToPKPi >= 1 || aod::hf_sel_candidate_lc::isSelLcToPiKP >= 1; @@ -72,17 +78,23 @@ struct HfDerivedDataCreatorLcToPKPi { Preslice candidatesPerCollision = aod::hf_cand::collisionId; Preslice candidatesMcPerCollision = aod::hf_cand::collisionId; + Preslice candidatesMlPerCollision = aod::hf_cand::collisionId; + Preslice candidatesMcMlPerCollision = aod::hf_cand::collisionId; // trivial partitions for all candidates to allow "->sliceByCached" inside processCandidates Partition candidatesAll = aod::hf_sel_candidate_lc::isSelLcToPKPi >= 0; Partition candidatesMcAll = aod::hf_sel_candidate_lc::isSelLcToPKPi >= 0; + Partition candidatesMlAll = aod::hf_sel_candidate_lc::isSelLcToPKPi >= 0; + Partition candidatesMcMlAll = aod::hf_sel_candidate_lc::isSelLcToPKPi >= 0; // partitions for signal and background Partition candidatesMcSig = nabs(aod::hf_cand_3prong::flagMcMatchRec) == static_cast(BIT(aod::hf_cand_3prong::DecayType::LcToPKPi)); Partition candidatesMcBkg = nabs(aod::hf_cand_3prong::flagMcMatchRec) != static_cast(BIT(aod::hf_cand_3prong::DecayType::LcToPKPi)); + Partition candidatesMcMlSig = nabs(aod::hf_cand_3prong::flagMcMatchRec) == static_cast(BIT(aod::hf_cand_3prong::DecayType::LcToPKPi)); + Partition candidatesMcMlBkg = nabs(aod::hf_cand_3prong::flagMcMatchRec) != static_cast(BIT(aod::hf_cand_3prong::DecayType::LcToPKPi)); void init(InitContext const&) { - std::array doprocess{doprocessData, doprocessMcSig, doprocessMcBkg, doprocessMcAll}; + std::array doprocess{doprocessData, doprocessMcSig, doprocessMcBkg, doprocessMcAll, doprocessDataMl, doprocessMcMlSig, doprocessMcMlBkg, doprocessMcMlAll}; if (std::accumulate(doprocess.begin(), doprocess.end(), 0) != 1) { LOGP(fatal, "Only one process function can be enabled at a time."); } @@ -122,7 +134,7 @@ struct HfDerivedDataCreatorLcToPKPi { template auto fillTablesCandidate(const T& candidate, const U& prong0, const U& prong1, const U& prong2, int candFlag, double invMass, - double ct, int8_t flagMc, int8_t origin, int8_t swapping) + double ct, int8_t flagMc, int8_t origin, int8_t swapping, const std::vector& mlScores) { if (fillCandidateBase) { rowCandidateBase( @@ -199,6 +211,10 @@ struct HfDerivedDataCreatorLcToPKPi { rowCandidateSel( BIT(candFlag)); } + if (fillCandidateMl) { + rowCandidateMl( + mlScores); + } if (fillCandidateId) { rowCandidateId( candidate.collisionId(), @@ -232,7 +248,7 @@ struct HfDerivedDataCreatorLcToPKPi { } } - template + template void processCandidates(CollType const& collisions, Partition& candidates, TracksWPid const&, @@ -291,11 +307,16 @@ struct HfDerivedDataCreatorLcToPKPi { double ct = hfHelper.ctLc(candidate); float massLcToPKPi = hfHelper.invMassLcToPKPi(candidate); float massLcToPiKP = hfHelper.invMassLcToPiKP(candidate); + std::vector mlScoresLcToPKPi, mlScoresLcToPiKP; + if constexpr (isMl) { + std::copy(candidate.mlProbLcToPKPi().begin(), candidate.mlProbLcToPKPi().end(), mlScoresLcToPKPi.begin()); + std::copy(candidate.mlProbLcToPiKP().begin(), candidate.mlProbLcToPiKP().end(), mlScoresLcToPiKP.begin()); + } if (candidate.isSelLcToPKPi()) { - fillTablesCandidate(candidate, prong0, prong1, prong2, 0, massLcToPKPi, ct, flagMcRec, origin, swapping); + fillTablesCandidate(candidate, prong0, prong1, prong2, 0, massLcToPKPi, ct, flagMcRec, origin, swapping, mlScoresLcToPKPi); } if (candidate.isSelLcToPiKP()) { - fillTablesCandidate(candidate, prong0, prong1, prong2, 1, massLcToPiKP, ct, flagMcRec, origin, swapping); + fillTablesCandidate(candidate, prong0, prong1, prong2, 1, massLcToPiKP, ct, flagMcRec, origin, swapping, mlScoresLcToPiKP); } } } @@ -321,7 +342,7 @@ struct HfDerivedDataCreatorLcToPKPi { TracksWPid const& tracks, aod::BCs const& bcs) { - processCandidates(collisions, candidatesAll, tracks, bcs); + processCandidates(collisions, candidatesAll, tracks, bcs); } PROCESS_SWITCH(HfDerivedDataCreatorLcToPKPi, processData, "Process data", true); @@ -331,7 +352,7 @@ struct HfDerivedDataCreatorLcToPKPi { TracksWPid const& tracks, aod::BCs const& bcs) { - processCandidates(collisions, candidatesMcSig, tracks, bcs); + processCandidates(collisions, candidatesMcSig, tracks, bcs); processMcParticles(mcParticles); } PROCESS_SWITCH(HfDerivedDataCreatorLcToPKPi, processMcSig, "Process MC only for signals", false); @@ -342,7 +363,7 @@ struct HfDerivedDataCreatorLcToPKPi { TracksWPid const& tracks, aod::BCs const& bcs) { - processCandidates(collisions, candidatesMcBkg, tracks, bcs); + processCandidates(collisions, candidatesMcBkg, tracks, bcs); processMcParticles(mcParticles); } PROCESS_SWITCH(HfDerivedDataCreatorLcToPKPi, processMcBkg, "Process MC only for background", false); @@ -353,10 +374,54 @@ struct HfDerivedDataCreatorLcToPKPi { TracksWPid const& tracks, aod::BCs const& bcs) { - processCandidates(collisions, candidatesMcAll, tracks, bcs); + processCandidates(collisions, candidatesMcAll, tracks, bcs); processMcParticles(mcParticles); } PROCESS_SWITCH(HfDerivedDataCreatorLcToPKPi, processMcAll, "Process MC", false); + + // ML versions + + void processDataMl(CollisionsWCentMult const& collisions, + SelectedCandidatesMl const&, + TracksWPid const& tracks, + aod::BCs const& bcs) + { + processCandidates(collisions, candidatesMlAll, tracks, bcs); + } + PROCESS_SWITCH(HfDerivedDataCreatorLcToPKPi, processDataMl, "Process data with ML", false); + + void processMcMlSig(CollisionsWCentMult const& collisions, + SelectedCandidatesMcMl const&, + MatchedGenCandidatesMc const& mcParticles, + TracksWPid const& tracks, + aod::BCs const& bcs) + { + processCandidates(collisions, candidatesMcMlSig, tracks, bcs); + processMcParticles(mcParticles); + } + PROCESS_SWITCH(HfDerivedDataCreatorLcToPKPi, processMcMlSig, "Process MC with ML only for signals", false); + + void processMcMlBkg(CollisionsWCentMult const& collisions, + SelectedCandidatesMcMl const&, + MatchedGenCandidatesMc const& mcParticles, + TracksWPid const& tracks, + aod::BCs const& bcs) + { + processCandidates(collisions, candidatesMcMlBkg, tracks, bcs); + processMcParticles(mcParticles); + } + PROCESS_SWITCH(HfDerivedDataCreatorLcToPKPi, processMcMlBkg, "Process MC with ML only for background", false); + + void processMcMlAll(CollisionsWCentMult const& collisions, + SelectedCandidatesMcMl const&, + MatchedGenCandidatesMc const& mcParticles, + TracksWPid const& tracks, + aod::BCs const& bcs) + { + processCandidates(collisions, candidatesMcMlAll, tracks, bcs); + processMcParticles(mcParticles); + } + PROCESS_SWITCH(HfDerivedDataCreatorLcToPKPi, processMcMlAll, "Process MC with ML", false); }; WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) diff --git a/PWGHF/TableProducer/treeCreatorLcToPKPi.cxx b/PWGHF/TableProducer/treeCreatorLcToPKPi.cxx index 9f5548e1377..0c77102a73e 100644 --- a/PWGHF/TableProducer/treeCreatorLcToPKPi.cxx +++ b/PWGHF/TableProducer/treeCreatorLcToPKPi.cxx @@ -21,11 +21,12 @@ #include "Framework/AnalysisTask.h" #include "Framework/runDataProcessing.h" +#include "Common/DataModel/Centrality.h" +#include "Common/DataModel/Multiplicity.h" + #include "PWGHF/Core/HfHelper.h" #include "PWGHF/DataModel/CandidateReconstructionTables.h" #include "PWGHF/DataModel/CandidateSelectionTables.h" -#include "Common/DataModel/Multiplicity.h" -#include "Common/DataModel/Centrality.h" using namespace o2; using namespace o2::framework; @@ -272,7 +273,7 @@ struct HfTreeCreatorLcToPKPi { { } - void processMc(soa::Join const& collisions, + void processMc(soa::Join const& collisions, aod::McCollisions const& mcCollisions, soa::Join const& candidates, soa::Join const& particles, @@ -479,7 +480,7 @@ struct HfTreeCreatorLcToPKPi { } PROCESS_SWITCH(HfTreeCreatorLcToPKPi, processMc, "Process MC tree writer", true); - void processData(soa::Join const& collisions, + void processData(soa::Join const& collisions, soa::Join const& candidates, TracksWPid const& tracks, aod::BCs const&) { diff --git a/PWGHF/Tasks/taskMcEfficiency.cxx b/PWGHF/Tasks/taskMcEfficiency.cxx index d5894e59ed3..c7d9a808632 100644 --- a/PWGHF/Tasks/taskMcEfficiency.cxx +++ b/PWGHF/Tasks/taskMcEfficiency.cxx @@ -80,7 +80,7 @@ struct HfTaskMcEfficiency { LOGP(fatal, "Data and MC process functions cannot run simultaneously!"); } - auto hCandidates = registry.add("hCandidates", "Candidate count at different steps", {HistType::kStepTHnF, {axisPt, axisMass, axisPdg, axisCPA, {2, -0.5, 1.5, "collision matched"}, {RecoDecay::OriginType::NonPrompt + 1, RecoDecay::OriginType::None - 0.5, RecoDecay::OriginType::NonPrompt + 0.5}}, kHFNSteps}); + auto hCandidates = registry.add("hCandidates", "Candidate count at different steps", {HistType::kStepTHnF, {axisPt, axisMass, axisPdg, axisCPA, {2, -0.5, 1.5, "collision matched"}, {RecoDecay::OriginType::NonPrompt + 1, +RecoDecay::OriginType::None - 0.5, +RecoDecay::OriginType::NonPrompt + 0.5}}, kHFNSteps}); hCandidates->GetAxis(0)->SetTitle("#it{p}_{T} (GeV/#it{c})"); hCandidates->GetAxis(1)->SetTitle("#it{m}_{inv} (GeV/#it{c}^{2})"); hCandidates->GetAxis(2)->SetTitle("PDG code"); diff --git a/PWGHF/Tasks/taskMcEfficiencyToXiPi.cxx b/PWGHF/Tasks/taskMcEfficiencyToXiPi.cxx index 730d95069ad..cf7db76036a 100644 --- a/PWGHF/Tasks/taskMcEfficiencyToXiPi.cxx +++ b/PWGHF/Tasks/taskMcEfficiencyToXiPi.cxx @@ -73,7 +73,7 @@ struct HfTaskMcEfficiencyToXiPi { void init(InitContext&) { - auto hCandidates = registry.add("hCandidates", "Candidate count at different steps", {HistType::kStepTHnF, {axisPt, axisMass, {2, -0.5, 1.5, "collision matched"}, {RecoDecay::OriginType::NonPrompt + 1, RecoDecay::OriginType::None - 0.5, RecoDecay::OriginType::NonPrompt + 0.5}}, kHFNSteps}); + auto hCandidates = registry.add("hCandidates", "Candidate count at different steps", {HistType::kStepTHnF, {axisPt, axisMass, {2, -0.5, 1.5, "collision matched"}, {RecoDecay::OriginType::NonPrompt + 1, +RecoDecay::OriginType::None - 0.5, +RecoDecay::OriginType::NonPrompt + 0.5}}, kHFNSteps}); hCandidates->GetAxis(0)->SetTitle("#it{p}_{T} (GeV/#it{c})"); hCandidates->GetAxis(1)->SetTitle("#it{m}_{inv} (GeV/#it{c}^{2})"); hCandidates->GetAxis(2)->SetTitle("Collision matched"); diff --git a/PWGJE/Core/JetHFUtilities.h b/PWGJE/Core/JetHFUtilities.h index 867fca8eee8..564d366777e 100644 --- a/PWGJE/Core/JetHFUtilities.h +++ b/PWGJE/Core/JetHFUtilities.h @@ -21,6 +21,7 @@ #include #include #include +#include #include "Framework/AnalysisTask.h" #include "Framework/AnalysisDataModel.h" @@ -447,8 +448,8 @@ void fillHFCollisionTable(T const& collision, U const& candidates, V& HFCollisio } } -template -void fillD0CandidateTable(T const& candidate, int32_t collisionIndex, U& D0BaseTable, V& D0ParTable, M& D0ParETable, N& D0SelectionFlagTable, O& D0MCDTable, int32_t& D0CandidateTableIndex) +template +void fillD0CandidateTable(T const& candidate, int32_t collisionIndex, U& D0BaseTable, V& D0ParTable, M& D0ParETable, N& D0SelectionFlagTable, O& D0MlTable, P& D0MCDTable, int32_t& D0CandidateTableIndex) { D0BaseTable(collisionIndex, candidate.pt(), candidate.eta(), candidate.phi(), candidate.m()); @@ -511,11 +512,16 @@ void fillD0CandidateTable(T const& candidate, int32_t collisionIndex, U& D0BaseT D0MCDTable(candidate.flagMcMatchRec(), candidate.originMcRec()); } + std::vector mlScoresVector; + auto mlScoresSpan = candidate.mlScores(); + std::copy(mlScoresSpan.begin(), mlScoresSpan.end(), std::back_inserter(mlScoresVector)); + D0MlTable(mlScoresVector); + D0CandidateTableIndex = D0BaseTable.lastIndex(); } -template -void fillLcCandidateTable(T const& candidate, int32_t collisionIndex, U& LcBaseTable, V& LcParTable, M& LcParETable, N& LcSelectionFlagTable, O& LcMCDTable, int32_t& LcCandidateTableIndex) +template +void fillLcCandidateTable(T const& candidate, int32_t collisionIndex, U& LcBaseTable, V& LcParTable, M& LcParETable, N& LcSelectionFlagTable, O& LcMlTable, P& LcMCDTable, int32_t& LcCandidateTableIndex) { LcBaseTable(collisionIndex, candidate.pt(), candidate.eta(), candidate.phi(), candidate.m()); @@ -586,17 +592,22 @@ void fillLcCandidateTable(T const& candidate, int32_t collisionIndex, U& LcBaseT LcMCDTable(candidate.flagMcMatchRec(), candidate.originMcRec(), candidate.isCandidateSwapped()); } + std::vector mlScoresVector; + auto mlScoresSpan = candidate.mlScores(); + std::copy(mlScoresSpan.begin(), mlScoresSpan.end(), std::back_inserter(mlScoresVector)); + LcMlTable(mlScoresVector); + LcCandidateTableIndex = LcBaseTable.lastIndex(); } -template -void fillCandidateTable(T const& candidate, int32_t collisionIndex, U& HFBaseTable, V& HFParTable, M& HFParETable, N& HFSelectionFlagTable, O& HFMCDTable, int32_t& HFCandidateTableIndex) +template +void fillCandidateTable(T const& candidate, int32_t collisionIndex, U& HFBaseTable, V& HFParTable, M& HFParETable, N& HFSelectionFlagTable, O& HFMlTable, P& HFMCDTable, int32_t& HFCandidateTableIndex) { if constexpr (isD0Candidate()) { - fillD0CandidateTable(candidate, collisionIndex, HFBaseTable, HFParTable, HFParETable, HFSelectionFlagTable, HFMCDTable, HFCandidateTableIndex); + fillD0CandidateTable(candidate, collisionIndex, HFBaseTable, HFParTable, HFParETable, HFSelectionFlagTable, HFMlTable, HFMCDTable, HFCandidateTableIndex); } if constexpr (isLcCandidate()) { - fillLcCandidateTable(candidate, collisionIndex, HFBaseTable, HFParTable, HFParETable, HFSelectionFlagTable, HFMCDTable, HFCandidateTableIndex); + fillLcCandidateTable(candidate, collisionIndex, HFBaseTable, HFParTable, HFParETable, HFSelectionFlagTable, HFMlTable, HFMCDTable, HFCandidateTableIndex); } } diff --git a/PWGJE/DataModel/Jet.h b/PWGJE/DataModel/Jet.h index 292be36d4c6..113ac5a002f 100644 --- a/PWGJE/DataModel/Jet.h +++ b/PWGJE/DataModel/Jet.h @@ -182,16 +182,16 @@ using CandidatesD0MCP = o2::soa::Join; using CandidatesLcMCP = o2::soa::Join; using CandidatesBplusMCP = o2::soa::Join; -using CandidatesD0Data = o2::soa::Join; -using CandidatesD0MCD = o2::soa::Join; +using CandidatesD0Data = o2::soa::Join; +using CandidatesD0MCD = o2::soa::Join; using JetTracksSubD0 = o2::aod::JTrackD0Subs; using CandidatesBplusData = o2::soa::Join; using CandidatesBplusMCD = o2::soa::Join; using JetTracksSubBplus = o2::aod::JTrackBplusSubs; -using CandidatesLcData = o2::soa::Join; -using CandidatesLcMCD = o2::soa::Join; +using CandidatesLcData = o2::soa::Join; +using CandidatesLcMCD = o2::soa::Join; using JetTracksSubLc = o2::aod::JTrackLcSubs; #endif // PWGJE_DATAMODEL_JET_H_ diff --git a/PWGJE/TableProducer/jetderiveddataproducerdummy.cxx b/PWGJE/TableProducer/jetderiveddataproducerdummy.cxx index 7ae3ab96442..bcfe64d000b 100644 --- a/PWGJE/TableProducer/jetderiveddataproducerdummy.cxx +++ b/PWGJE/TableProducer/jetderiveddataproducerdummy.cxx @@ -31,6 +31,7 @@ struct JetDerivedDataProducerDummyTask { Produces d0ParsTable; Produces d0ParExtrasTable; Produces d0SelsTable; + Produces d0MlsTable; Produces d0McsTable; Produces d0ParticlesTable; @@ -39,6 +40,7 @@ struct JetDerivedDataProducerDummyTask { Produces LcParsTable; Produces LcParExtrasTable; Produces LcSelsTable; + Produces LcMlsTable; Produces LcMcsTable; Produces LcParticlesTable; diff --git a/PWGJE/TableProducer/jetderiveddataproducerdummyd0.cxx b/PWGJE/TableProducer/jetderiveddataproducerdummyd0.cxx index e1fa1116555..0f334a3bc2d 100644 --- a/PWGJE/TableProducer/jetderiveddataproducerdummyd0.cxx +++ b/PWGJE/TableProducer/jetderiveddataproducerdummyd0.cxx @@ -31,6 +31,7 @@ struct JetDerivedDataProducerDummyD0Task { Produces LcParsTable; Produces LcParExtrasTable; Produces LcSelsTable; + Produces LcMlsTable; Produces LcMcsTable; Produces LcParticlesTable; diff --git a/PWGJE/TableProducer/jetderiveddataproducerdummylc.cxx b/PWGJE/TableProducer/jetderiveddataproducerdummylc.cxx index 6fc440c1b5f..88753516753 100644 --- a/PWGJE/TableProducer/jetderiveddataproducerdummylc.cxx +++ b/PWGJE/TableProducer/jetderiveddataproducerdummylc.cxx @@ -31,6 +31,7 @@ struct JetDerivedDataProducerDummyLcTask { Produces d0ParsTable; Produces d0ParExtrasTable; Produces d0SelsTable; + Produces d0MlsTable; Produces d0McsTable; Produces d0ParticlesTable; diff --git a/PWGJE/TableProducer/jetderiveddatawriter.cxx b/PWGJE/TableProducer/jetderiveddatawriter.cxx index 352efc25fb6..e6dbb7d9e11 100644 --- a/PWGJE/TableProducer/jetderiveddatawriter.cxx +++ b/PWGJE/TableProducer/jetderiveddatawriter.cxx @@ -76,6 +76,7 @@ struct JetDerivedDataWriter { Produces storedD0ParsTable; Produces storedD0ParExtrasTable; Produces storedD0SelsTable; + Produces storedD0MlsTable; Produces storedD0McsTable; Produces storedD0IdsTable; Produces storedD0ParticlesTable; @@ -86,18 +87,18 @@ struct JetDerivedDataWriter { Produces storedLcParsTable; Produces storedLcParExtrasTable; Produces storedLcSelsTable; + Produces storedLcMlsTable; Produces storedLcMcsTable; Produces storedLcIdsTable; Produces storedLcParticlesTable; Produces storedLcParticleIdsTable; - PresliceUnsorted> - CollisionsPerMcCollision = aod::jmccollisionlb::mcCollisionId; + PresliceUnsorted> CollisionsPerMcCollision = aod::jmccollisionlb::mcCollisionId; PresliceUnsorted> ParticlesPerMcCollision = aod::jmcparticle::mcCollisionId; Preslice> TracksPerCollision = aod::jtrack::collisionId; Preslice> ClustersPerCollision = aod::jcluster::collisionId; - Preslice> D0sPerCollision = aod::jd0indices::collisionId; - Preslice> LcsPerCollision = aod::jlcindices::collisionId; + Preslice D0sPerCollision = aod::jd0indices::collisionId; + Preslice LcsPerCollision = aod::jlcindices::collisionId; std::vector collisionFlag; std::vector McCollisionFlag; @@ -249,7 +250,7 @@ struct JetDerivedDataWriter { nD0InCollision++; int32_t D0Index = -1; - jethfutilities::fillD0CandidateTable(D0, collisionD0Index, storedD0sTable, storedD0ParsTable, storedD0ParExtrasTable, storedD0SelsTable, storedD0McsTable, D0Index); + jethfutilities::fillD0CandidateTable(D0, collisionD0Index, storedD0sTable, storedD0ParsTable, storedD0ParExtrasTable, storedD0SelsTable, storedD0MlsTable, storedD0McsTable, D0Index); int32_t prong0Id = -1; int32_t prong1Id = -1; @@ -275,7 +276,7 @@ struct JetDerivedDataWriter { nLcInCollision++; int32_t LcIndex = -1; - jethfutilities::fillLcCandidateTable(Lc, collisionLcIndex, storedLcsTable, storedLcParsTable, storedLcParExtrasTable, storedLcSelsTable, storedLcMcsTable, LcIndex); + jethfutilities::fillLcCandidateTable(Lc, collisionLcIndex, storedLcsTable, storedLcParsTable, storedLcParExtrasTable, storedLcSelsTable, storedLcMlsTable, storedLcMcsTable, LcIndex); int32_t prong0Id = -1; int32_t prong1Id = -1; @@ -479,7 +480,7 @@ struct JetDerivedDataWriter { nD0InCollision++; int32_t D0Index = -1; - jethfutilities::fillD0CandidateTable(D0, collisionD0Index, storedD0sTable, storedD0ParsTable, storedD0ParExtrasTable, storedD0SelsTable, storedD0McsTable, D0Index); + jethfutilities::fillD0CandidateTable(D0, collisionD0Index, storedD0sTable, storedD0ParsTable, storedD0ParExtrasTable, storedD0SelsTable, storedD0MlsTable, storedD0McsTable, D0Index); int32_t prong0Id = -1; int32_t prong1Id = -1; @@ -506,7 +507,7 @@ struct JetDerivedDataWriter { nLcInCollision++; int32_t LcIndex = -1; - jethfutilities::fillLcCandidateTable(Lc, collisionLcIndex, storedLcsTable, storedLcParsTable, storedLcParExtrasTable, storedLcSelsTable, storedLcMcsTable, LcIndex); + jethfutilities::fillLcCandidateTable(Lc, collisionLcIndex, storedLcsTable, storedLcParsTable, storedLcParExtrasTable, storedLcSelsTable, storedLcMlsTable, storedLcMcsTable, LcIndex); int32_t prong0Id = -1; int32_t prong1Id = -1; diff --git a/PWGJE/Tasks/emcvertexselectionqa.cxx b/PWGJE/Tasks/emcvertexselectionqa.cxx index 0d7369f7d9e..9d3a33a2443 100644 --- a/PWGJE/Tasks/emcvertexselectionqa.cxx +++ b/PWGJE/Tasks/emcvertexselectionqa.cxx @@ -130,8 +130,8 @@ struct EmcVertexSelectionQA { std::vector nVtxContributors; for (auto& col : colsinbc) { // Loop over all collisions/vertices int ivtxquality = 0; // 0: TPC/ITS contributor, 1: TRD contributor , 2: TOF contributor - int nITStracks = 0; - int nTPCtracks = 0; + // int nITStracks = 0; + // int nTPCtracks = 0; int nTOFtracks = 0; int nTRDtracks = 0; int nPVContributorTracks = 0; @@ -142,8 +142,8 @@ struct EmcVertexSelectionQA { if (!track.isPVContributor()) { continue; } - nITStracks += track.hasITS(); - nTPCtracks += track.hasTPC(); + // nITStracks += track.hasITS(); + // nTPCtracks += track.hasTPC(); nTOFtracks += track.hasTOF(); nTRDtracks += track.hasTRD() && !track.hasTOF(); TrackDCA.push_back(track.dcaXY()); diff --git a/PWGJE/Tasks/jetsubstructurehfoutput.cxx b/PWGJE/Tasks/jetsubstructurehfoutput.cxx index 6572e7ff990..2534a11376f 100644 --- a/PWGJE/Tasks/jetsubstructurehfoutput.cxx +++ b/PWGJE/Tasks/jetsubstructurehfoutput.cxx @@ -40,7 +40,7 @@ using namespace o2::framework::expressions; // NB: runDataProcessing.h must be included after customize! #include "Framework/runDataProcessing.h" -template +template struct JetSubstructureHFOutputTask { Produces collisionOutputTableData; Produces jetOutputTableData; @@ -63,6 +63,7 @@ struct JetSubstructureHFOutputTask { Produces candidateParsTable; Produces candidateParExtrasTable; Produces candidateSelsTable; + Produces candidateMlsTable; Produces candidateMcsTable; Produces hfParticlesTable; @@ -187,7 +188,7 @@ struct JetSubstructureHFOutputTask { if constexpr (isMCP) { jethfutilities::fillCandidateMcTable(candidate, hfParticlesTable, candidateIndex); } else { - jethfutilities::fillCandidateTable(candidate, candidateCollisionIndex, candidateTable, candidateParsTable, candidateParExtrasTable, candidateSelsTable, candidateMcsTable, candidateIndex); + jethfutilities::fillCandidateTable(candidate, candidateCollisionIndex, candidateTable, candidateParsTable, candidateParExtrasTable, candidateSelsTable, candidateMlsTable, candidateMcsTable, candidateIndex); } candidateMap.insert(std::make_pair(candidate.globalIndex(), candidateIndex)); } @@ -342,9 +343,9 @@ struct JetSubstructureHFOutputTask { } PROCESS_SWITCH(JetSubstructureHFOutputTask, processOutputMatchingMC, "jet matching output MC", false); }; -using JetSubstructureOutputD0 = JetSubstructureHFOutputTask, soa::Join, aod::D0CJetCOs, aod::D0CJetOs, aod::D0CJetSSOs, aod::D0CJetMOs, soa::Join, aod::D0CMCDJetCOs, aod::D0CMCDJetOs, aod::D0CMCDJetSSOs, aod::D0CMCDJetMOs, soa::Join, aod::D0CMCPJetCOs, aod::D0CMCPJetOs, aod::D0CMCPJetSSOs, aod::D0CMCPJetMOs, soa::Join, aod::D0CEWSJetCOs, aod::D0CEWSJetOs, aod::D0CEWSJetSSOs, aod::D0CEWSJetMOs, aod::StoredHfD0CollBase, aod::StoredHfD0Bases, aod::StoredHfD0Pars, aod::StoredHfD0ParEs, aod::StoredHfD0Sels, aod::StoredHfD0Mcs, aod::StoredHfD0PBases>; -using JetSubstructureOutputLc = JetSubstructureHFOutputTask, soa::Join, aod::LcCJetCOs, aod::LcCJetOs, aod::LcCJetSSOs, aod::LcCJetMOs, soa::Join, aod::LcCMCDJetCOs, aod::LcCMCDJetOs, aod::LcCMCDJetSSOs, aod::LcCMCDJetMOs, soa::Join, aod::LcCMCPJetCOs, aod::LcCMCPJetOs, aod::LcCMCPJetSSOs, aod::LcCMCPJetMOs, soa::Join, aod::LcCEWSJetCOs, aod::LcCEWSJetOs, aod::LcCEWSJetSSOs, aod::LcCEWSJetMOs, aod::StoredHf3PCollBase, aod::StoredHf3PBases, aod::StoredHf3PPars, aod::StoredHf3PParEs, aod::StoredHf3PSels, aod::StoredHf3PMcs, aod::StoredHf3PPBases>; -// using JetSubstructureOutputBplus = JetSubstructureHFOutputTask, soa::Join, aod::BplusCJetCOs, aod::BplusCJetOs, aod::BplusCJetSSOs, aod::BplusCJetMOs, soa::Join, aod::BplusCMCDJetCOs, aod::BplusCMCDJetOs, aod::BplusCMCDJetSSOs, aod::BplusCMCDJetMOs, soa::Join, aod::BplusCMCPJetCOs, aod::BplusCMCPJetOs, aod::BplusCMCPJetSSOs, aod::BplusCMCPJetMOs, soa::Join, aod::BplusCEWSJetCOs, aod::BplusCEWSJetOs, aod::BplusCEWSJetSSOs, aod::BplusCEWSJetMOs, aod::StoredHfBplusCollBase, aod::StoredHfBplusBases, aod::StoredHfBplusPars, aod::StoredHfBplusParEs, aod::StoredHfBplusSels, aod::StoredHfBplusMcs, aod::StoredHfBplusPBases>; +using JetSubstructureOutputD0 = JetSubstructureHFOutputTask, soa::Join, aod::D0CJetCOs, aod::D0CJetOs, aod::D0CJetSSOs, aod::D0CJetMOs, soa::Join, aod::D0CMCDJetCOs, aod::D0CMCDJetOs, aod::D0CMCDJetSSOs, aod::D0CMCDJetMOs, soa::Join, aod::D0CMCPJetCOs, aod::D0CMCPJetOs, aod::D0CMCPJetSSOs, aod::D0CMCPJetMOs, soa::Join, aod::D0CEWSJetCOs, aod::D0CEWSJetOs, aod::D0CEWSJetSSOs, aod::D0CEWSJetMOs, aod::StoredHfD0CollBase, aod::StoredHfD0Bases, aod::StoredHfD0Pars, aod::StoredHfD0ParEs, aod::StoredHfD0Sels, aod::StoredHfD0Mls, aod::StoredHfD0Mcs, aod::StoredHfD0PBases>; +using JetSubstructureOutputLc = JetSubstructureHFOutputTask, soa::Join, aod::LcCJetCOs, aod::LcCJetOs, aod::LcCJetSSOs, aod::LcCJetMOs, soa::Join, aod::LcCMCDJetCOs, aod::LcCMCDJetOs, aod::LcCMCDJetSSOs, aod::LcCMCDJetMOs, soa::Join, aod::LcCMCPJetCOs, aod::LcCMCPJetOs, aod::LcCMCPJetSSOs, aod::LcCMCPJetMOs, soa::Join, aod::LcCEWSJetCOs, aod::LcCEWSJetOs, aod::LcCEWSJetSSOs, aod::LcCEWSJetMOs, aod::StoredHf3PCollBase, aod::StoredHf3PBases, aod::StoredHf3PPars, aod::StoredHf3PParEs, aod::StoredHf3PSels, aod::StoredHf3PMls, aod::StoredHf3PMcs, aod::StoredHf3PPBases>; +// using JetSubstructureOutputBplus = JetSubstructureHFOutputTask, soa::Join, aod::BplusCJetCOs, aod::BplusCJetOs, aod::BplusCJetSSOs, aod::BplusCJetMOs, soa::Join, aod::BplusCMCDJetCOs, aod::BplusCMCDJetOs, aod::BplusCMCDJetSSOs, aod::BplusCMCDJetMOs, soa::Join, aod::BplusCMCPJetCOs, aod::BplusCMCPJetOs, aod::BplusCMCPJetSSOs, aod::BplusCMCPJetMOs, soa::Join, aod::BplusCEWSJetCOs, aod::BplusCEWSJetOs, aod::BplusCEWSJetSSOs, aod::BplusCEWSJetMOs, aod::StoredHfBplusCollBase, aod::StoredHfBplusBases, aod::StoredHfBplusPars, aod::StoredHfBplusParEs, aod::StoredHfBplusSels, aod::StoredHfBplusMls, aod::StoredHfBplusMcs, aod::StoredHfBplusPBases>; WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) { diff --git a/PWGJE/Tasks/triggerCorrelations.cxx b/PWGJE/Tasks/triggerCorrelations.cxx index f8490c9480f..98392cebc09 100644 --- a/PWGJE/Tasks/triggerCorrelations.cxx +++ b/PWGJE/Tasks/triggerCorrelations.cxx @@ -42,111 +42,90 @@ using namespace o2::framework::expressions; struct TriggerCorrelationsTask { - HistogramRegistry registry{"registry", - {{"h3_jetcharged_pt_jetfull_pt_photon_pt_triggered", ";#it{p}_{T,jet}^{charged} (GeV/#it{c}); #it{p}_{T,jet}^{full} (GeV/#it{c}); #it{p}_{T,photon} (GeV/#it{c})", {HistType::kTH3F, {{201, -1.0, 200}, {201, -1.0, 200}, {201, -1.0, 200}}}, true}, - {"h_collision_trigger_events", "event status;event status;entries", {HistType::kTH1F, {{4, 0.0, 4.0}}}, true}}}; - - Configurable vertexZCut{"vertexZCut", 10.0f, "Accepted z-vertex range"}; - Configurable doChargedJetTrigger{"doChargedJetTrigger", true, "add the charged jeet trigger to the QA"}; - Configurable doFullJetTrigger{"doFullJetTrigger", true, "add the full et trigger to the QA"}; - Configurable doGammaTrigger{"doGammaTrigger", true, "add the gamma trigger to the QA"}; - Configurable jetsChargedR{"jetsChargedR", 0.6, "resolution parameter for triggered charged jets"}; - Configurable jetsFullR{"jetsFullR", 0.2, "resolution parameter for triggered full jets"}; - Configurable rejectExoticClusters{"rejectExoticClusters", true, "reject exotic clusters"}; - Configurable clusterTimeMin{"clusterTimeMin", -999, "minimum cluster time for gamma trigger"}; - Configurable clusterTimeMax{"clusterTimeMax", 999, "maximum cluster time for gamma trigger"}; - Configurable emcalTriggered{"emcalTriggered", -1, "-1 = min bias, 0 = L0"}; - Configurable clusterDefinition{"clusterDefinition", "kV3Default", "cluster definition to be selected, e.g. V3Default"}; + HistogramRegistry registry; - void init(o2::framework::InitContext&) - { - } + int nChTrigs; + int nFullTrigs; + int nChHFTrigs; + int nAllTrigs; - aod::EMCALClusterDefinition clusterDef = aod::emcalcluster::getClusterDefinitionFromString(clusterDefinition.value); - Filter clusterDefinitionSelection = o2::aod::jcluster::definition == static_cast(clusterDef); + int chTrigOffset; + int fullTrigOffset; + int chHFTrigOffset; - void processTriggeredCorrelations(JetCollision const& collision, - soa::Join const& jetsCharged, - soa::Join const& jetsFull, - soa::Filtered const& clusters, - JetTracks const& tracks) + void init(o2::framework::InitContext&) { - - registry.fill(HIST("h_collision_trigger_events"), 0.5); // all events - if (collision.posZ() < vertexZCut) { - registry.fill(HIST("h_collision_trigger_events"), 1.5); // all events with z vertex cut + std::vector trigSelChLabels = {"chargedLow", "chargedHigh"}; + std::vector trigSelFullLabels = {"fullHigh", "fullLow", "neutralHigh", "neutralLow", "gammaVeryHighEMCAL", "gammaHighEMCAL", "gammaLowEMCAL", "gammaVeryLowEMCAL", "gammaVeryHighDCAL", "gammaHighDCAL", "gammaLowDCAL", "gammaVeryLowDCAL"}; + std::vector trigSelChHFLabels = {"chargedD0Low", "chargedD0High", "chargedLcLow", "chargedLcHigh"}; + nChTrigs = trigSelChLabels.size(); + nFullTrigs = trigSelFullLabels.size(); + nChHFTrigs = trigSelChHFLabels.size(); + nAllTrigs = nChTrigs + nFullTrigs + nChHFTrigs; + chTrigOffset = 0; + fullTrigOffset = chTrigOffset + nChTrigs; + chHFTrigOffset = fullTrigOffset + nFullTrigs; + registry.add("triggerCorrelations", "Correlation between jet triggers", HistType::kTH2D, {{nAllTrigs, -0.5, static_cast(nAllTrigs) - 0.5, "primary trigger"}, {nAllTrigs, -0.5, static_cast(nAllTrigs) - 0.5, "secondary trigger"}}); + auto triggerCorrelation = registry.get(HIST("triggerCorrelations")); + for (auto iChTrigs = 0; iChTrigs < nChTrigs; iChTrigs++) { + triggerCorrelation->GetXaxis()->SetBinLabel(iChTrigs + chTrigOffset + 1, trigSelChLabels[iChTrigs].data()); + triggerCorrelation->GetYaxis()->SetBinLabel(iChTrigs + chTrigOffset + 1, trigSelChLabels[iChTrigs].data()); } - if (jetderiveddatautilities::selectCollision(collision, jetderiveddatautilities::JCollisionSel::sel8)) { - registry.fill(HIST("h_collision_trigger_events"), 2.5); // events with sel8() + for (auto iFullTrigs = 0; iFullTrigs < nFullTrigs; iFullTrigs++) { + triggerCorrelation->GetXaxis()->SetBinLabel(iFullTrigs + fullTrigOffset + 1, trigSelFullLabels[iFullTrigs].data()); + triggerCorrelation->GetYaxis()->SetBinLabel(iFullTrigs + fullTrigOffset + 1, trigSelFullLabels[iFullTrigs].data()); } - if (collision.alias_bit(triggerAliases::kTVXinEMC)) { - registry.fill(HIST("h_collision_trigger_events"), 3.5); // events with emcal bit + for (auto iChHFTrigs = 0; iChHFTrigs < nChHFTrigs; iChHFTrigs++) { + triggerCorrelation->GetXaxis()->SetBinLabel(iChHFTrigs + chHFTrigOffset + 1, trigSelChHFLabels[iChHFTrigs].data()); + triggerCorrelation->GetYaxis()->SetBinLabel(iChHFTrigs + chHFTrigOffset + 1, trigSelChHFLabels[iChHFTrigs].data()); } + } - float jetsChargedLeadingPt = -1.0; - float jetsFullLeadingPt = -1.0; - float gammaLeadingPt = -1.0; - if (jetderiveddatautilities::selectCollision(collision, jetderiveddatautilities::JCollisionSel::sel8)) { - if (doChargedJetTrigger) { - for (auto& jetCharged : jetsCharged) { - if (jetCharged.r() == round(jetsChargedR * 100.0f)) { - jetsChargedLeadingPt = jetCharged.pt(); - break; - } + template + void fillCorrelationsHistogram(T const& collision, bool fill = false, int iTrig = -1) + { + + for (auto iChTrigs = 0; iChTrigs < nChTrigs; iChTrigs++) { + if (fill) { + if (jetderiveddatautilities::selectChargedTrigger(collision, iChTrigs + 1)) { + registry.fill(HIST("triggerCorrelations"), iTrig, iChTrigs + chTrigOffset); + } + } else { + if (jetderiveddatautilities::selectChargedTrigger(collision, iChTrigs + 1)) { + fillCorrelationsHistogram(collision, true, iChTrigs + chTrigOffset); } } } - if ((emcalTriggered == -1 && collision.alias_bit(triggerAliases::kTVXinEMC)) || (emcalTriggered == 0 && (collision.alias_bit(triggerAliases::kEMC7) || collision.alias_bit(triggerAliases::kDMC7)))) { - if (doFullJetTrigger) { - for (auto& jetFull : jetsFull) { - if (jetFull.r() == round(jetsFullR * 100.0f)) { - jetsFullLeadingPt = jetFull.pt(); - break; - } + for (auto iFullTrigs = 0; iFullTrigs < nFullTrigs; iFullTrigs++) { + if (fill) { + if (jetderiveddatautilities::selectFullTrigger(collision, iFullTrigs + 1)) { + registry.fill(HIST("triggerCorrelations"), iTrig, iFullTrigs + fullTrigOffset); } - } - - if (doGammaTrigger) { - for (const auto& cluster : clusters) { - if (rejectExoticClusters && cluster.isExotic()) { - continue; - } - if (cluster.time() < clusterTimeMin || cluster.time() > clusterTimeMax) { - continue; - } - double gammaPt = cluster.energy() / std::cosh(cluster.eta()); - if (TVector2::Phi_0_2pi(cluster.phi()) < 4 && gammaPt > gammaLeadingPt) { - gammaLeadingPt = gammaPt; - } + } else { + if (jetderiveddatautilities::selectFullTrigger(collision, iFullTrigs + 1)) { + fillCorrelationsHistogram(collision, true, iFullTrigs + fullTrigOffset); } } } - float jetsChargedPtStart = 0.0; - float jetsFullPtStart = 0.0; - float gammaPtStart = 0.0; - if (jetsChargedLeadingPt < 0.0) { - jetsChargedPtStart = -1.0; - } - if (jetsFullLeadingPt < 0.0) { - jetsFullPtStart = -1.0; - } - if (gammaLeadingPt < 0.0) { - gammaPtStart = -1.0; - } - - for (float jetChargedPt = jetsChargedPtStart; jetChargedPt <= jetsChargedLeadingPt; jetChargedPt += 1.0) { - - for (float jetFullPt = jetsFullPtStart; jetFullPt <= jetsFullLeadingPt; jetFullPt += 1.0) { - - for (float gammaPt = gammaPtStart; gammaPt <= gammaLeadingPt; gammaPt += 1.0) { - - registry.fill(HIST("h3_jetcharged_pt_jetfull_pt_photon_pt_triggered"), jetChargedPt, jetFullPt, gammaPt); + for (auto iChHFTrigs = 0; iChHFTrigs < nFullTrigs; iChHFTrigs++) { + if (fill) { + if (jetderiveddatautilities::selectChargedHFTrigger(collision, iChHFTrigs + 1)) { + registry.fill(HIST("triggerCorrelations"), iTrig, iChHFTrigs + chHFTrigOffset); + } + } else { + if (jetderiveddatautilities::selectChargedHFTrigger(collision, iChHFTrigs + 1)) { + fillCorrelationsHistogram(collision, true, iChHFTrigs + chHFTrigOffset); } } } } + + void processTriggeredCorrelations(soa::Join::iterator const& collision) + { + fillCorrelationsHistogram(collision); + } PROCESS_SWITCH(TriggerCorrelationsTask, processTriggeredCorrelations, "QA for trigger correlations", true); }; diff --git a/PWGLF/TableProducer/LFResonanceInitializer.cxx b/PWGLF/TableProducer/LFResonanceInitializer.cxx index 49b0da6f7e9..2d236b357d5 100644 --- a/PWGLF/TableProducer/LFResonanceInitializer.cxx +++ b/PWGLF/TableProducer/LFResonanceInitializer.cxx @@ -879,7 +879,7 @@ struct reso2initializer { } // MC histograms if (doprocessMCGenCount) { - AxisSpec EvtClassAxis = {kECend - 1, kECbegin + 0.5, kECend - 0.5, "", "event class"}; + AxisSpec EvtClassAxis = {kECend - 1, +kECbegin + 0.5, +kECend - 0.5, "", "event class"}; AxisSpec ZAxis = {CfgVtxBins, "zaxis"}; AxisSpec CentAxis = {binsCent, "centrality"}; qaRegistry.add("Event/totalEventGenMC", "totalEventGenMC", {HistType::kTHnSparseF, {EvtClassAxis}}); diff --git a/PWGLF/TableProducer/LFStrangeTreeCreator.cxx b/PWGLF/TableProducer/LFStrangeTreeCreator.cxx index 11815e69a42..f3581deabde 100644 --- a/PWGLF/TableProducer/LFStrangeTreeCreator.cxx +++ b/PWGLF/TableProducer/LFStrangeTreeCreator.cxx @@ -379,7 +379,7 @@ struct LFStrangeTreeCreator { if (std::abs(mcPart.pdgCode()) != 3122) continue; - std::array secVtx; + std::array secVtx{0.f}; std::array primVtx = {mcPart.vx(), mcPart.vy(), mcPart.vz()}; std::array momMother = {mcPart.px(), mcPart.py(), mcPart.pz()}; for (auto& mcDaught : mcPart.daughters_as()) { diff --git a/PWGLF/TableProducer/cascadepid.cxx b/PWGLF/TableProducer/cascadepid.cxx index 842685e49aa..9aa2be45384 100644 --- a/PWGLF/TableProducer/cascadepid.cxx +++ b/PWGLF/TableProducer/cascadepid.cxx @@ -383,19 +383,23 @@ struct cascadepid { float negDeltaTimeAsOmPi = -1e+6, negDeltaTimeAsOmPr = -1e+6; float bachDeltaTimeAsOmKa = -1e+6; - if (cascade.posTOFSignal() > 0 && cascade.posTOFEventTime() > 0) { + auto pTra = cascade.posTrackExtra_as(); + auto nTra = cascade.negTrackExtra_as(); + auto bTra = cascade.negTrackExtra_as(); + + if (pTra.hasTOF()) { posDeltaTimeAsXiPi = (cascade.posTOFSignal() - cascade.posTOFEventTime()) - (xiFlight + lambdaFlight + posFlightPi); posDeltaTimeAsXiPr = (cascade.posTOFSignal() - cascade.posTOFEventTime()) - (xiFlight + lambdaFlight + posFlightPr); posDeltaTimeAsOmPi = (cascade.posTOFSignal() - cascade.posTOFEventTime()) - (omFlight + lambdaFlight + posFlightPi); posDeltaTimeAsOmPr = (cascade.posTOFSignal() - cascade.posTOFEventTime()) - (omFlight + lambdaFlight + posFlightPr); } - if (cascade.negTOFSignal() > 0 && cascade.negTOFEventTime() > 0) { + if (nTra.hasTOF()) { negDeltaTimeAsXiPi = (cascade.negTOFSignal() - cascade.negTOFEventTime()) - (xiFlight + lambdaFlight + negFlightPi); negDeltaTimeAsXiPr = (cascade.negTOFSignal() - cascade.negTOFEventTime()) - (xiFlight + lambdaFlight + negFlightPr); negDeltaTimeAsOmPi = (cascade.negTOFSignal() - cascade.negTOFEventTime()) - (omFlight + lambdaFlight + negFlightPi); negDeltaTimeAsOmPr = (cascade.negTOFSignal() - cascade.negTOFEventTime()) - (omFlight + lambdaFlight + negFlightPr); } - if (cascade.bachTOFSignal() > 0 && cascade.bachTOFEventTime() > 0) { + if (bTra.hasTOF()) { bachDeltaTimeAsXiPi = (cascade.bachTOFSignal() - cascade.bachTOFEventTime()) - (xiFlight + bachFlightPi); bachDeltaTimeAsOmKa = (cascade.bachTOFSignal() - cascade.bachTOFEventTime()) - (omFlight + bachFlightKa); } @@ -407,10 +411,6 @@ struct cascadepid { ); if (doQA) { - auto pTra = cascade.posTrackExtra_as(); - auto nTra = cascade.negTrackExtra_as(); - auto bTra = cascade.negTrackExtra_as(); - // fill QA histograms for cross-checking histos.fill(HIST("hArcDebug"), cascade.pt(), lengthCascade - d3d); // for debugging purposes diff --git a/PWGLF/TableProducer/epvector.cxx b/PWGLF/TableProducer/epvector.cxx index 6088a9177dc..571b725d76b 100644 --- a/PWGLF/TableProducer/epvector.cxx +++ b/PWGLF/TableProducer/epvector.cxx @@ -66,7 +66,7 @@ struct epvector { // Configurables. struct : ConfigurableGroup { Configurable cfgURL{"cfgURL", "http://alice-ccdb.cern.ch", "Address of the CCDB to browse"}; - Configurable nolaterthan{"ccdb-no-later-than", std::chrono::duration_cast(std::chrono::system_clock::now().time_since_epoch()).count(), "Latest acceptable timestamp of creation for the object"}; + Configurable nolaterthan{"ccdb-no-later-than", std::chrono::duration_cast(std::chrono::system_clock::now().time_since_epoch()).count(), "Latest acceptable timestamp of creation for the object"}; } cfgCcdbParam; // Enable access to the CCDB for the offset and correction constants and save them in dedicated variables. diff --git a/PWGLF/TableProducer/hyhe4builder.cxx b/PWGLF/TableProducer/hyhe4builder.cxx index f4330b039e4..5ae8f5a34b8 100644 --- a/PWGLF/TableProducer/hyhe4builder.cxx +++ b/PWGLF/TableProducer/hyhe4builder.cxx @@ -111,11 +111,11 @@ struct hyhefourbuilder { void init(InitContext& context) { - const AxisSpec axisMassHyHe4{(int)1000, 3.5f, 4.5f, "Hyperhelium4 Mass Distribution (GeV/c^{2})"}; - const AxisSpec axisNCandidates{(int)100, 0.0f, 100.0f, "Number of 3-body candidates"}; + const AxisSpec axisMassHyHe4{1000, 3.5f, 4.5f, "Hyperhelium4 Mass Distribution (GeV/c^{2})"}; + const AxisSpec axisNCandidates{100, 0.0f, 100.0f, "Number of 3-body candidates"}; - const AxisSpec axisEventCounter{(int)1, 0.0f, 1.0f, "Number of events"}; - const AxisSpec axisPt{(int)1000, 0.0f, 10.0f, "#it{p}_{T} (GeV/#it{c})"}; + const AxisSpec axisEventCounter{1, 0.0f, 1.0f, "Number of events"}; + const AxisSpec axisPt{1000, 0.0f, 10.0f, "#it{p}_{T} (GeV/#it{c})"}; // Base counters histos.add("hNEvents", "hNEvents", kTH1F, {axisEventCounter}); @@ -361,7 +361,7 @@ struct hyhefourbuilder { void process(aod::Collisions const& collisions, soa::Filtered const& d3bodys, FullTracksExtIU const&, aod::BCsWithTimestamps const&) { - long eventCounter = 0; + int64_t eventCounter = 0; for (const auto& collision : collisions) { eventCounter++; // Fire up CCDB @@ -402,7 +402,7 @@ struct hyHe4Preselector { void init(InitContext& context) { - const AxisSpec hEventCounter{(int)1, 0.0f, 1.0f, "Number of events"}; + const AxisSpec hEventCounter{1, 0.0f, 1.0f, "Number of events"}; histos.add("hNEvents", "hNEvents", kTH1F, {hEventCounter}); } @@ -433,9 +433,9 @@ struct hyHe4Preselector { auto const& trackProng1 = d3body.template track1_as(); auto const& trackProng2 = d3body.template track2_as(); - int lPDG0 = -1; - int lPDG1 = -1; - int lPDG2 = -1; + // int lPDG0 = -1; + // int lPDG1 = -1; + // int lPDG2 = -1; // Association check // Lets do something to identify the PID of particles @@ -443,9 +443,9 @@ struct hyHe4Preselector { auto lMCtrackProng0 = trackProng0.template mcParticle_as(); auto lMCtrackProng1 = trackProng1.template mcParticle_as(); auto lMCtrackProng2 = trackProng2.template mcParticle_as(); - lPDG0 = lMCtrackProng0.pdgCode(); - lPDG1 = lMCtrackProng1.pdgCode(); - lPDG2 = lMCtrackProng2.pdgCode(); + // lPDG0 = lMCtrackProng0.pdgCode(); + // lPDG1 = lMCtrackProng1.pdgCode(); + // lPDG2 = lMCtrackProng2.pdgCode(); if (lMCtrackProng0.has_mothers() && lMCtrackProng1.has_mothers() && lMCtrackProng2.has_mothers()) { for (auto& lProng0Mother : lMCtrackProng0.template mothers_as()) { for (auto& lProng1Mother : lMCtrackProng1.template mothers_as()) { @@ -472,9 +472,9 @@ struct hyHe4Preselector { /// This process function ensures that all 3 body candidates are built. It will simply tag everything as true. void processBuildAll(aod::Collisions const& collisions, aod::Decay3Bodys const& d3bodys, aod::TracksExtra const&) { - long eventCounter = 0; + // int64_t eventCounter = 0; for (const auto& d3body : d3bodys) { - eventCounter++; + // eventCounter++; bool lIsQualityInteresting = false; checkTrackQuality(d3body, lIsQualityInteresting); hyhetags(lIsQualityInteresting, true, true, true, true); diff --git a/PWGLF/TableProducer/lambdakzeropid.cxx b/PWGLF/TableProducer/lambdakzeropid.cxx index 0f07d7c5687..c534e5bc0d5 100644 --- a/PWGLF/TableProducer/lambdakzeropid.cxx +++ b/PWGLF/TableProducer/lambdakzeropid.cxx @@ -116,6 +116,11 @@ struct lambdakzeropid { float maxSnp; // max sine phi for propagation float maxStep; // max step size (cm) for propagation + // enum to keep track of the TOF-related properties for V0s + enum tofEnum { kLength = 0, + kHasTOF, + kNEnums }; + /// function to calculate track length of this track up to a certain segment of a detector /// to be used internally in another funcrtion that calculates length until it finds the proper one /// warning: this could be optimised further for speed @@ -289,6 +294,9 @@ struct lambdakzeropid { histos.add("h2dDeltaTimePositiveK0ShortPi", "h2dDeltaTimePositiveK0ShortPi", {HistType::kTH3F, {axisPt, axisEta, axisDeltaTime}}); histos.add("h2dDeltaTimeNegativeK0ShortPi", "h2dDeltaTimeNegativeK0ShortPi", {HistType::kTH3F, {axisPt, axisEta, axisDeltaTime}}); + histos.add("h2dPositiveTOFProperties", "h2dPositiveTOFProperties", {HistType::kTH2F, {axisPt, {4, -0.5, 3.5f}}}); + histos.add("h2dNegativeTOFProperties", "h2dNegativeTOFProperties", {HistType::kTH2F, {axisPt, {4, -0.5, 3.5f}}}); + if (doQANSigma) { // standard NSigma values histos.add("h2dNSigmaPositiveLambdaPi", "h2dNSigmaPositiveLambdaPi", {HistType::kTH2F, {axisPt, axisNSigma}}); @@ -411,6 +419,9 @@ struct lambdakzeropid { o2::track::TrackPar posTrack = o2::track::TrackPar({v0.x(), v0.y(), v0.z()}, {v0.pxpos(), v0.pypos(), v0.pzpos()}, +1); o2::track::TrackPar negTrack = o2::track::TrackPar({v0.x(), v0.y(), v0.z()}, {v0.pxneg(), v0.pyneg(), v0.pzneg()}, -1); + auto pTra = v0.posTrackExtra_as(); + auto nTra = v0.negTrackExtra_as(); + float deltaTimePositiveLambdaPi = -1e+6; float deltaTimeNegativeLambdaPi = -1e+6; float deltaTimePositiveLambdaPr = -1e+6; @@ -437,20 +448,38 @@ struct lambdakzeropid { float timeNegativePr = lengthNegative / velocityNegativePr; float timeNegativePi = lengthNegative / velocityNegativePi; - if (v0.posTOFSignal() > 0 && v0.posTOFEventTime() > 0 && lengthPositive > 0) { + if (pTra.hasTOF() && lengthPositive > 0) { deltaTimePositiveLambdaPr = (v0.posTOFSignal() - v0.posTOFEventTime()) - (timeLambda + timePositivePr); deltaTimePositiveLambdaPi = (v0.posTOFSignal() - v0.posTOFEventTime()) - (timeLambda + timePositivePi); deltaTimePositiveK0ShortPi = (v0.posTOFSignal() - v0.posTOFEventTime()) - (timeK0Short + timePositivePi); } - if (v0.negTOFSignal() > 0 && v0.negTOFEventTime() > 0 && lengthNegative > 0) { + if (nTra.hasTOF() && lengthNegative > 0) { deltaTimeNegativeLambdaPr = (v0.negTOFSignal() - v0.negTOFEventTime()) - (timeLambda + timeNegativePr); deltaTimeNegativeLambdaPi = (v0.negTOFSignal() - v0.negTOFEventTime()) - (timeLambda + timeNegativePi); deltaTimeNegativeK0ShortPi = (v0.negTOFSignal() - v0.negTOFEventTime()) - (timeK0Short + timeNegativePi); } + + if (doQA) { + // calculate and pack properties for QA purposes + int posProperties = 0; + if (lengthPositive > 0) + posProperties = posProperties | (int(1) << kLength); + if (pTra.hasTOF()) + posProperties = posProperties | (int(1) << kHasTOF); + int negProperties = 0; + if (lengthNegative > 0) + negProperties = negProperties | (int(1) << kLength); + if (nTra.hasTOF()) + negProperties = negProperties | (int(1) << kHasTOF); + + histos.fill(HIST("h2dPositiveTOFProperties"), v0.pt(), posProperties); + histos.fill(HIST("h2dNegativeTOFProperties"), v0.pt(), negProperties); + } + float deltaDecayTimeLambda = -10e+4; float deltaDecayTimeAntiLambda = -10e+4; float deltaDecayTimeK0Short = -10e+4; - if (v0.posTOFSignal() > 0 && v0.negTOFSignal() > 0 && lengthPositive > 0 && lengthNegative > 0) { // does not depend on event time + if (nTra.hasTOF() && pTra.hasTOF() > 0 && lengthPositive > 0 && lengthNegative > 0) { // does not depend on event time deltaDecayTimeLambda = (v0.posTOFSignal() - timePositivePr) - (v0.negTOFSignal() - timeNegativePi); deltaDecayTimeAntiLambda = (v0.posTOFSignal() - timePositivePi) - (v0.negTOFSignal() - timeNegativePr); deltaDecayTimeK0Short = (v0.posTOFSignal() - timePositivePi) - (v0.negTOFSignal() - timeNegativePi); @@ -467,7 +496,7 @@ struct lambdakzeropid { float betaAntiLambda = -1e+6; float betaK0Short = -1e+6; - if (v0.posTOFSignal() > 0 && v0.negTOFSignal() > 0 && v0.posTOFEventTime() > 0 && v0.negTOFEventTime() > 0) { + if (nTra.hasTOF() && pTra.hasTOF()) { betaLambda = (lengthV0 / decayTimeLambda) / 0.0299792458; betaAntiLambda = (lengthV0 / decayTimeAntiLambda) / 0.0299792458; betaK0Short = (lengthV0 / decayTimeK0Short) / 0.0299792458; @@ -505,10 +534,7 @@ struct lambdakzeropid { } if (doQA) { - auto pTra = v0.posTrackExtra_as(); - auto nTra = v0.negTrackExtra_as(); - - if (v0.posTOFSignal() > 0 && v0.posTOFEventTime() > 0) { + if (pTra.hasTOF()) { histos.fill(HIST("h2dProtonMeasuredVsExpected"), (timeLambda + timePositivePr), (v0.posTOFSignal() - v0.posTOFEventTime())); @@ -531,7 +557,7 @@ struct lambdakzeropid { } } - if (v0.negTOFSignal() > 0 && v0.negTOFEventTime() > 0) { + if (nTra.hasTOF()) { histos.fill(HIST("h2dPionMeasuredVsExpected"), (timeLambda + timeNegativePi), (v0.negTOFSignal() - v0.negTOFEventTime())); @@ -539,12 +565,12 @@ struct lambdakzeropid { if (std::abs(v0.mLambda() - 1.115683) < qaMassWindow && fabs(pTra.tpcNSigmaPr()) < qaTPCNSigma && fabs(nTra.tpcNSigmaPi()) < qaTPCNSigma) { histos.fill(HIST("h2dDeltaTimeNegativeLambdaPi"), v0.pt(), v0.eta(), deltaTimeNegativeLambdaPi); if (doQANSigma) - histos.fill(HIST("h2dNSigmaNegativeLambdaPr"), v0.pt(), nSigmaNegativeLambdaPr); + histos.fill(HIST("h2dNSigmaNegativeLambdaPi"), v0.pt(), nSigmaNegativeLambdaPi); } if (std::abs(v0.mAntiLambda() - 1.115683) < qaMassWindow && fabs(pTra.tpcNSigmaPi()) < qaTPCNSigma && fabs(nTra.tpcNSigmaPr()) < qaTPCNSigma) { histos.fill(HIST("h2dDeltaTimeNegativeLambdaPr"), v0.pt(), v0.eta(), deltaTimeNegativeLambdaPr); if (doQANSigma) - histos.fill(HIST("h2dNSigmaNegativeLambdaPi"), v0.pt(), nSigmaNegativeLambdaPi); + histos.fill(HIST("h2dNSigmaNegativeLambdaPr"), v0.pt(), nSigmaNegativeLambdaPr); } if (std::abs(v0.mK0Short() - 0.497) < qaMassWindow && fabs(pTra.tpcNSigmaPi()) < qaTPCNSigma && fabs(nTra.tpcNSigmaPi()) < qaTPCNSigma) { histos.fill(HIST("h2dDeltaTimeNegativeK0ShortPi"), v0.pt(), v0.eta(), deltaTimeNegativeK0ShortPi); diff --git a/PWGLF/TableProducer/lithium4analysis.cxx b/PWGLF/TableProducer/lithium4analysis.cxx index 127de74ba8c..19ae25e93c4 100644 --- a/PWGLF/TableProducer/lithium4analysis.cxx +++ b/PWGLF/TableProducer/lithium4analysis.cxx @@ -154,7 +154,7 @@ struct lithium4analysis { histos.add("h2NsigmaHe3TPC", "NsigmaHe3 TPC distribution; Signed #it{p}/#it{z} (GeV/#it{c}); n#sigma_{TPC}({}^{3}He)", kTH2F, {{20, -5.0f, 5.0f}, {200, -5.0f, 5.0f}}); histos.add("h2NsigmaProtonTPC", "NsigmaProton TPC distribution; Signed #it{p}/#it{z} (GeV/#it{c}); n#sigma_{TPC}(p)", kTH2F, {{20, -5.0f, 5.0f}, {200, -5.0f, 5.0f}}); histos.add("h2NsigmaProtonTOF", "NsigmaProton TOF distribution; #it{p}_{T} (GeV/#it{c}); n#sigma_{TOF}(p)", kTH2F, {{20, -5.0f, 5.0f}, {200, -5.0f, 5.0f}}); - histos.add("hTrackSel", "Accepted tracks", kTH1F, {{Selections::kAll, -0.5, Selections::kAll - 0.5}}); + histos.add("hTrackSel", "Accepted tracks", kTH1F, {{Selections::kAll, -0.5, +Selections::kAll - 0.5}}); for (int i = 0; i < 5; i++) { mBBparamsHe[i] = cfgBetheBlochParams->get("He3", Form("p%i", i)); diff --git a/PWGLF/TableProducer/threebodyRecoTask.cxx b/PWGLF/TableProducer/threebodyRecoTask.cxx index 29c6c0db307..449c5f5544c 100644 --- a/PWGLF/TableProducer/threebodyRecoTask.cxx +++ b/PWGLF/TableProducer/threebodyRecoTask.cxx @@ -635,7 +635,7 @@ struct threebodyRecoTask { continue; } bool isSurEvSelection = isGoodCollision[mcparticle.mcCollisionId()]; - std::array posSV; + std::array posSV{0.f}; for (auto& mcDaughter : mcparticle.daughters_as()) { if (std::abs(mcDaughter.pdgCode()) == bachelorPdgCode) { posSV = {mcDaughter.vx(), mcDaughter.vy(), mcDaughter.vz()}; diff --git a/PWGLF/Tasks/Nuspex/hypertriton3bodyMCQA.cxx b/PWGLF/Tasks/Nuspex/hypertriton3bodyMCQA.cxx index fcdc624cc71..0fe77aa86b9 100644 --- a/PWGLF/Tasks/Nuspex/hypertriton3bodyMCQA.cxx +++ b/PWGLF/Tasks/Nuspex/hypertriton3bodyMCQA.cxx @@ -254,9 +254,11 @@ struct hypertriton3bodyTrackMcinfo { std::vector protons, pions, deuterons; // index for daughter tracks std::unordered_set set_proton, set_pion, set_deuteron; // check duplicated daughters - int itrack = 0; + int itrack = -1; for (auto& track : tracks) { + + ++itrack; registry.fill(HIST("hParticleCount"), 0.5); registry.fill(HIST("hTrackITSNcls"), track.itsNCls()); registry.fill(HIST("hTPCNCls"), track.tpcNClsFound()); @@ -271,10 +273,14 @@ struct hypertriton3bodyTrackMcinfo { registry.fill(HIST("hTestCounter"), i + 3.5); } } + if (!track.has_mcParticle()) { continue; } registry.fill(HIST("hTestCounter"), 1.5); + auto mcparticle = track.mcParticle_as(); + registry.fill(HIST("hTPCBB"), track.p() * track.sign(), track.tpcSignal()); + if (track.hasTOF() && track.hasTPC()) { registry.fill(HIST("hTestCounter"), 2.5); if (!(track.mcMask() & 1 << 15)) { @@ -288,8 +294,6 @@ struct hypertriton3bodyTrackMcinfo { } } registry.fill(HIST("hParticleCount"), 1.5); - auto mcparticle = track.mcParticle_as(); - registry.fill(HIST("hTPCBB"), track.p() * track.sign(), track.tpcSignal()); // if (TMath::Abs(mcparticle.y()) > 0.9) {continue;} registry.fill(HIST("hParticleCount"), 2.5); @@ -495,7 +499,6 @@ struct hypertriton3bodyTrackMcinfo { } } } - ++itrack; } std::vector set_pair; @@ -665,12 +668,12 @@ struct hypertriton3bodyMcParticleCount { registry.fill(HIST("hMcRecoInvMass"), RecoDecay::m(array{array{dauProtonMom[0], dauProtonMom[1], dauProtonMom[2]}, array{dauPionMom[0], dauPionMom[1], dauPionMom[2]}, array{dauDeuteronMom[0], dauDeuteronMom[1], dauDeuteronMom[2]}}, array{o2::constants::physics::MassProton, o2::constants::physics::MassPionCharged, o2::constants::physics::MassDeuteron})); registry.fill(HIST("h3dMCDecayedHypertriton"), mcparticle.y(), mcparticle.pt(), MClifetime); - int daughterPionCount = 0; - for (auto& mcparticleDaughter : mcparticle.daughters_as()) { - if (std::abs(mcparticleDaughter.pdgCode()) == 211) { - daughterPionCount++; - } - } + // int daughterPionCount = 0; + // for (auto& mcparticleDaughter : mcparticle.daughters_as()) { + // if (std::abs(mcparticleDaughter.pdgCode()) == 211) { + // daughterPionCount++; + // } + // } // Count for hypertriton N_gen if (TMath::Abs(mcparticle.y()) < 1) { diff --git a/PWGLF/Tasks/Nuspex/nuclei_in_jets.cxx b/PWGLF/Tasks/Nuspex/nuclei_in_jets.cxx index 33b688f621a..d0d2ee195cf 100644 --- a/PWGLF/Tasks/Nuspex/nuclei_in_jets.cxx +++ b/PWGLF/Tasks/Nuspex/nuclei_in_jets.cxx @@ -101,12 +101,13 @@ struct nuclei_in_jets { Configurable min_nsigmaTOF{"min_nsigmaTOF", -3.0f, "Minimum nsigma TOF"}; Configurable max_nsigmaTOF{"max_nsigmaTOF", +3.5f, "Maximum nsigma TOF"}; Configurable require_primVtx_contributor{"require_primVtx_contributor", true, "require that the track is a PV contributor"}; - Configurable> param_proton_ref{"param_proton_ref", {0.00007, 984.79694, 0.45856, 0.00036}, "Parameters of Levi-Tsallis fit of Protons from pythia"}; - Configurable> param_proton_jet{"param_proton_jet", {0.00109, 4.27109, 0.51173, 2.26176}, "Parameters for reweighting protons in jets"}; - Configurable> param_deuteron_jet{"param_deuteron_jet", {0.00026, 2.09662, 1.00000, 1.87561}, "Parameters for reweighting deuterons in jets"}; + Configurable applyReweighting{"applyReweighting", true, "apply Reweighting"}; + Configurable> param_proton_ref{"param_proton_ref", {0.000000000151, 984.796940000000, 0.458560000000, 0.000360000000}, "Parameters of Levi-Tsallis fit of Protons from pythia"}; + Configurable> param_proton_jet{"param_proton_jet", {0.025285984480, 4.271090000000, 0.511730000000, 2.261760000000}, "Parameters for reweighting protons in jets"}; + Configurable> param_deuteron_jet{"param_deuteron_jet", {20.121453090900, 2.096620000000, 1.000000000000, 1.875610000000}, "Parameters for reweighting deuterons in jets"}; Configurable> param_helium3_jet{"param_helium3_jet", {0.00026, 2.09662, 1.00000, 1.87561}, "Parameters for reweighting helium3 in jets"}; - Configurable> param_proton_ue{"param_proton_ue", {0.00000, 88.48017, 0.53952, 0.06212}, "Parameters for reweighting protons in ue"}; - Configurable> param_deuteron_ue{"param_deuteron_ue", {0.00000, 25.00000, 0.51497, 1.00000}, "Parameters for reweighting deuterons in ue"}; + Configurable> param_proton_ue{"param_proton_ue", {0.000000977546, 88.480170000000, 0.539520000000, 0.062120000000}, "Parameters for reweighting protons in ue"}; + Configurable> param_deuteron_ue{"param_deuteron_ue", {0.000294563800, 25.000000000000, 0.514970000000, 1.000000000000}, "Parameters for reweighting deuterons in ue"}; Configurable> param_helium3_ue{"param_helium3_ue", {0.00000, 25.00000, 0.51497, 1.00000}, "Parameters for reweighting helium3 in ue"}; // List of Particles @@ -347,6 +348,9 @@ struct nuclei_in_jets { float Weight(float pt, int event_region, int nucleus_of_interest) { + if (!applyReweighting) + return 1; + auto par_proton_ref = static_cast>(param_proton_ref); auto par_proton_jet = static_cast>(param_proton_jet); auto par_deuteron_jet = static_cast>(param_deuteron_jet); @@ -405,6 +409,9 @@ struct nuclei_in_jets { if (!collision.sel8()) return; + if (abs(collision.posZ()) > 10) + return; + // Event Counter: after event selection registryQC.fill(HIST("number_of_events_data"), 1.5); @@ -751,57 +758,78 @@ struct nuclei_in_jets { } // end processData PROCESS_SWITCH(nuclei_in_jets, processData, "Process data", true); - // MC - void processMC(soa::Join::iterator const& collision, MCTracks const& mcTracks, aod::McParticles& mcParticles, aod::McCollisions const& mcCollisions) + Preslice perMCCollision = o2::aod::mcparticle::mcCollisionId; + Preslice perCollision = o2::aod::track::collisionId; + + void processGen(o2::aod::McCollisions const& mcCollisions, aod::McParticles const& mcParticles) { + for (const auto& mccollision : mcCollisions) { + + // Event Counter (before event sel) + registryQC.fill(HIST("number_of_events_mc"), 0.5); + + auto mcParticles_per_coll = mcParticles.sliceBy(perMCCollision, mccollision.globalIndex()); + + // Generated Particles + for (auto& particle : mcParticles_per_coll) { + + if (!particle.isPhysicalPrimary()) + continue; + if ((particle.pdgCode() != -2212) && (particle.pdgCode() != -1000010020) && (particle.pdgCode() != -1000020030)) + continue; + if (particle.y() < min_y || particle.y() > max_y) + continue; + + // Reweighting + float wpr_jet = Weight(particle.pt(), region::jet, nucleus::proton); + float wpr_ue = Weight(particle.pt(), region::underlying_event, nucleus::proton); + float wde_jet = Weight(particle.pt(), region::jet, nucleus::deuteron); + float wde_ue = Weight(particle.pt(), region::underlying_event, nucleus::deuteron); + float whe_jet = Weight(particle.pt(), region::jet, nucleus::helium); + float whe_ue = Weight(particle.pt(), region::underlying_event, nucleus::helium); + + // Fill Histograms + if (particle.pdgCode() == -2212) { + registryMC.fill(HIST("antiproton_input"), particle.pt()); + registryMC.fill(HIST("antiproton_weighted_jet"), particle.pt(), wpr_jet); + registryMC.fill(HIST("antiproton_weighted_ue"), particle.pt(), wpr_ue); + registryMC.fill(HIST("antiproton_jet_gen"), particle.pt(), wpr_jet); + registryMC.fill(HIST("antiproton_ue_gen"), particle.pt(), wpr_ue); + } + if (particle.pdgCode() == -1000010020) { + registryMC.fill(HIST("antideuteron_jet_gen"), particle.pt(), wde_jet); + registryMC.fill(HIST("antideuteron_ue_gen"), particle.pt(), wde_ue); + } + if (particle.pdgCode() == -1000020030) { + registryMC.fill(HIST("antihelium3_jet_gen"), particle.pt(), whe_jet); + registryMC.fill(HIST("antihelium3_ue_gen"), particle.pt(), whe_ue); + } + } + } + } + + // void processMC(soa::Join::iterator const& collision, MCTracks const& mcTracks, aod::McParticles& mcParticles, aod::McCollisions const& mcCollisions) + + void processRec(soa::Join::iterator const& collision, MCTracks const& mcTracks, const o2::aod::McCollisions& mcCollisions, const aod::McParticles& mcParticles) + { + // Event Counter (before event sel) - registryQC.fill(HIST("number_of_events_mc"), 0.5); + registryQC.fill(HIST("number_of_events_mc"), 1.5); // Event Selection if (!collision.sel8()) return; - // Event Counter (after event sel) - registryQC.fill(HIST("number_of_events_mc"), 1.5); - - // Generated Particles - for (auto& particle : mcParticles) { - - if (!particle.isPhysicalPrimary()) - continue; - if ((particle.pdgCode() != -2212) && (particle.pdgCode() != -1000010020) && (particle.pdgCode() != -1000020030)) - continue; - if (particle.y() < min_y || particle.y() > max_y) - continue; + if (abs(collision.posZ()) > 10) + return; - // Reweighting - float wpr_jet = Weight(particle.pt(), region::jet, nucleus::proton); - float wpr_ue = Weight(particle.pt(), region::underlying_event, nucleus::proton); - float wde_jet = Weight(particle.pt(), region::jet, nucleus::deuteron); - float wde_ue = Weight(particle.pt(), region::underlying_event, nucleus::deuteron); - float whe_jet = Weight(particle.pt(), region::jet, nucleus::helium); - float whe_ue = Weight(particle.pt(), region::underlying_event, nucleus::helium); + // Event Counter (after event sel) + registryQC.fill(HIST("number_of_events_mc"), 2.5); - // Fill Histograms - if (particle.pdgCode() == -2212) { - registryMC.fill(HIST("antiproton_input"), particle.pt()); - registryMC.fill(HIST("antiproton_weighted_jet"), particle.pt(), wpr_jet); - registryMC.fill(HIST("antiproton_weighted_ue"), particle.pt(), wpr_ue); - registryMC.fill(HIST("antiproton_jet_gen"), particle.pt(), wpr_jet); - registryMC.fill(HIST("antiproton_ue_gen"), particle.pt(), wpr_ue); - } - if (particle.pdgCode() == -1000010020) { - registryMC.fill(HIST("antideuteron_jet_gen"), particle.pt(), wde_jet); - registryMC.fill(HIST("antideuteron_ue_gen"), particle.pt(), wde_ue); - } - if (particle.pdgCode() == -1000020030) { - registryMC.fill(HIST("antihelium3_jet_gen"), particle.pt(), whe_jet); - registryMC.fill(HIST("antihelium3_ue_gen"), particle.pt(), whe_ue); - } - } + auto tracks_per_coll = mcTracks.sliceBy(perCollision, collision.globalIndex()); // Reconstructed Tracks - for (auto track : mcTracks) { + for (auto track : tracks_per_coll) { // Get MC Particle if (!track.has_mcParticle()) @@ -887,7 +915,9 @@ struct nuclei_in_jets { } } } - PROCESS_SWITCH(nuclei_in_jets, processMC, "process MC", false); + + PROCESS_SWITCH(nuclei_in_jets, processGen, "process Gen MC", false); + PROCESS_SWITCH(nuclei_in_jets, processRec, "process Rec MC", false); }; WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) diff --git a/PWGLF/Tasks/Resonances/chargedkstaranalysis.cxx b/PWGLF/Tasks/Resonances/chargedkstaranalysis.cxx index 4e0ae317909..d5863924ec8 100644 --- a/PWGLF/Tasks/Resonances/chargedkstaranalysis.cxx +++ b/PWGLF/Tasks/Resonances/chargedkstaranalysis.cxx @@ -728,7 +728,7 @@ struct chargedkstaranalysis { rGenParticles.fill(HIST("hMC"), 6.5); auto daughts = false; auto daughtp = false; - int count = 0; + // int count = 0; for (auto kCurrentDaughter : kDaughters) { // LOG(info) << "Daughters PDG:\t" << count<<" "< LHpt) { LHpt = trk.pt(); diff --git a/PWGLF/Tasks/Resonances/k892analysis.cxx b/PWGLF/Tasks/Resonances/k892analysis.cxx index 510a13acca0..9441f0b2317 100644 --- a/PWGLF/Tasks/Resonances/k892analysis.cxx +++ b/PWGLF/Tasks/Resonances/k892analysis.cxx @@ -87,6 +87,7 @@ struct k892analysis { Configurable cfgITScluster{"cfgITScluster", 0, "Number of ITS cluster"}; Configurable cfgTPCcluster{"cfgTPCcluster", 70, "Number of TPC cluster"}; Configurable cfgRCRFC{"cfgRCRFC", 0.8f, "Crossed Rows to Findable Clusters"}; + Configurable allmanualcuts{"allmanualcuts", false, "All manual cuts without using track selection table"}; // Event selection cuts - Alex (Temporary, need to fix!) TF1* fMultPVCutLow = nullptr; @@ -235,14 +236,33 @@ struct k892analysis { return false; if (cfgPVContributor && !track.isPVContributor()) return false; - if (!manualtrkselcuts) { - if (cfgPrimaryTrack && !track.isPrimaryTrack()) - return false; - } else if (manualtrkselcuts) { - if (!(track.isGlobalTrackWoDCA() && - track.itsNCls() > cfgITScluster && track.tpcNClsFound() > cfgTPCcluster && track.tpcCrossedRowsOverFindableCls() > cfgRCRFC)) { - return false; // condition is like \bar{A.B} = \bar{A} + \bar{B} (+ is or, . is and) + if (!allmanualcuts) { + if (!manualtrkselcuts) { + // if (cfgPrimaryTrack && !track.isPrimaryTrack()) + // return false; + if (!track.isGlobalTrack()) + return false; + } else if (manualtrkselcuts) { + if (!(track.isGlobalTrackWoDCA() && + track.itsNCls() > cfgITScluster && track.tpcNClsFound() > cfgTPCcluster && track.tpcCrossedRowsOverFindableCls() > cfgRCRFC)) { + return false; // condition is like \bar{A.B} = \bar{A} + \bar{B} (+ is or, . is and) + } } + } else { + if (track.itsNCls() < cfgITScluster) + return false; + if (track.tpcNClsFound() < cfgTPCcluster) + return false; + if (track.tpcCrossedRowsOverFindableCls() < cfgRCRFC) + return false; + if (track.itsChi2NCl() >= 36) + return false; + if (track.tpcChi2NCl() >= 4) + return false; + if (!track.passedITSRefit()) + return false; + if (!track.passedTPCRefit()) + return false; } return true; diff --git a/PWGLF/Tasks/Resonances/lambda1520analysis.cxx b/PWGLF/Tasks/Resonances/lambda1520analysis.cxx index fa261382d8b..d237e569106 100644 --- a/PWGLF/Tasks/Resonances/lambda1520analysis.cxx +++ b/PWGLF/Tasks/Resonances/lambda1520analysis.cxx @@ -404,7 +404,7 @@ struct lambda1520analysis { } } } - return false; + return isTrk1Selected; } template @@ -450,7 +450,7 @@ struct lambda1520analysis { } } } - return false; + return isTrk2Selected; } template diff --git a/PWGLF/Tasks/Resonances/phipbpb.cxx b/PWGLF/Tasks/Resonances/phipbpb.cxx index ed243a31e80..c120f7f3c4d 100644 --- a/PWGLF/Tasks/Resonances/phipbpb.cxx +++ b/PWGLF/Tasks/Resonances/phipbpb.cxx @@ -76,6 +76,7 @@ struct phipbpb { Configurable cfgCutVertex{"cfgCutVertex", 10.0f, "Accepted z-vertex range"}; Configurable cfgCutCentrality{"cfgCutCentrality", 80.0f, "Accepted maximum Centrality"}; // track + Configurable fillRapidity{"fillRapidity", true, "fill rapidity bin"}; Configurable useGlobalTrack{"useGlobalTrack", true, "use Global track"}; Configurable cfgCutCharge{"cfgCutCharge", 0.0, "cut on Charge"}; Configurable cfgCutPT{"cfgCutPT", 0.2, "PT cut on daughter track"}; @@ -98,6 +99,7 @@ struct phipbpb { ConfigurableAxis configThnAxisCentrality{"configThnAxisCentrality", {8, 0., 80}, "Centrality"}; ConfigurableAxis configThnAxisPhiminusPsi{"configThnAxisPhiminusPsi", {6, 0.0, TMath::Pi()}, "#phi - #psi"}; ConfigurableAxis configThnAxisV2{"configThnAxisV2", {200, -1, 1}, "V2"}; + ConfigurableAxis configThnAxisRapidity{"configThnAxisRapidity", {8, 0, 0.8}, "Rapidity"}; ConfigurableAxis configThnAxisSA{"configThnAxisSA", {200, -1, 1}, "SA"}; ConfigurableAxis configThnAxiscosthetaSA{"configThnAxiscosthetaSA", {200, 0, 1}, "costhetaSA"}; Configurable additionalEvsel{"additionalEvsel", false, "Additional event selcection"}; @@ -144,6 +146,7 @@ struct phipbpb { const AxisSpec thnAxisPhiminusPsi{configThnAxisPhiminusPsi, "#phi - #psi"}; const AxisSpec thnAxisCentrality{configThnAxisCentrality, "Centrality (%)"}; const AxisSpec thnAxisV2{configThnAxisV2, "V2"}; + const AxisSpec thnAxisRapidity{configThnAxisRapidity, "Rapidity"}; const AxisSpec thnAxisSA{configThnAxisSA, "SA"}; const AxisSpec thnAxiscosthetaSA{configThnAxiscosthetaSA, "costhetaSA"}; AxisSpec phiAxis = {500, -6.28, 6.28, "phi"}; @@ -166,28 +169,34 @@ struct phipbpb { histos.add("hPsiTPC", "PsiTPC", kTH2F, {centAxis, phiAxis}); histos.add("hPsiTPCR", "PsiTPCR", kTH2F, {centAxis, phiAxis}); histos.add("hPsiTPCL", "PsiTPCL", kTH2F, {centAxis, phiAxis}); - - histos.add("hSparseV2SASameEvent_costhetastarOP", "hSparseV2SASameEvent_costhetastarOP", HistType::kTHnSparseF, {thnAxisInvMass, thnAxisPt, thnAxisCosThetaStarOP, thnAxisPhiminusPsi, thnAxisCentrality}); - histos.add("hSparseV2SASameEvent_costhetastarIP", "hSparseV2SASameEvent_costhetastarIP", HistType::kTHnSparseF, {thnAxisInvMass, thnAxisPt, thnAxisCosThetaStarOP, thnAxisPhiminusPsi, thnAxisCentrality}); - histos.add("hSparseV2SASameEvent_SA", "hSparseV2SASameEvent_SA", HistType::kTHnSparseF, {thnAxisInvMass, thnAxisPt, thnAxisSA, thnAxisPhiminusPsi, thnAxisCentrality}); - histos.add("hSparseV2SASameEvent_costheta_SA", "hSparseV2SASameEvent_costheta_SA", HistType::kTHnSparseF, {thnAxisInvMass, thnAxisPt, thnAxiscosthetaSA, thnAxisPhiminusPsi, thnAxisCentrality}); - histos.add("hSparseV2SASameEvent_SA_A0", "hSparseV2SASameEvent_SA_A0", HistType::kTHnSparseF, {thnAxisInvMass, thnAxisPt, thnAxisSA, thnAxisPhiminusPsi, thnAxisCentrality}); - histos.add("hSparseV2SASameEvent_V2", "hSparseV2SASameEvent_V2", HistType::kTHnSparseF, {thnAxisInvMass, thnAxisPt, thnAxisV2, thnAxisCentrality}); - - if (islike) { - histos.add("hSparseV2SASameEventlikepp_costhetastarOP", "hSparseV2SASameEventlikepp_costhetastarOP", HistType::kTHnSparseF, {thnAxisInvMass, thnAxisPt, thnAxisCosThetaStarOP, thnAxisPhiminusPsi, thnAxisCentrality}); - histos.add("hSparseV2SASameEventlikepp_costhetastarIP", "hSparseV2SASameEventlikepp_costhetastarIP", HistType::kTHnSparseF, {thnAxisInvMass, thnAxisPt, thnAxisCosThetaStarOP, thnAxisPhiminusPsi, thnAxisCentrality}); - histos.add("hSparseV2SASameEventlikemm_costhetastarOP", "hSparseV2SASameEventlikemm_costhetastarOP", HistType::kTHnSparseF, {thnAxisInvMass, thnAxisPt, thnAxisCosThetaStarOP, thnAxisPhiminusPsi, thnAxisCentrality}); - histos.add("hSparseV2SASameEventlikemm_costhetastarIP", "hSparseV2SASameEventlikemm_costhetastarIP", HistType::kTHnSparseF, {thnAxisInvMass, thnAxisPt, thnAxisCosThetaStarOP, thnAxisPhiminusPsi, thnAxisCentrality}); + if (!fillRapidity) { + histos.add("hSparseV2SASameEvent_costhetastarOP", "hSparseV2SASameEvent_costhetastarOP", HistType::kTHnSparseF, {thnAxisInvMass, thnAxisPt, thnAxisCosThetaStarOP, thnAxisPhiminusPsi, thnAxisCentrality}); + histos.add("hSparseV2SASameEvent_costhetastarIP", "hSparseV2SASameEvent_costhetastarIP", HistType::kTHnSparseF, {thnAxisInvMass, thnAxisPt, thnAxisCosThetaStarOP, thnAxisPhiminusPsi, thnAxisCentrality}); + histos.add("hSparseV2SASameEvent_SA", "hSparseV2SASameEvent_SA", HistType::kTHnSparseF, {thnAxisInvMass, thnAxisPt, thnAxisSA, thnAxisPhiminusPsi, thnAxisCentrality}); + histos.add("hSparseV2SASameEvent_costheta_SA", "hSparseV2SASameEvent_costheta_SA", HistType::kTHnSparseF, {thnAxisInvMass, thnAxisPt, thnAxiscosthetaSA, thnAxisPhiminusPsi, thnAxisCentrality}); + histos.add("hSparseV2SASameEvent_SA_A0", "hSparseV2SASameEvent_SA_A0", HistType::kTHnSparseF, {thnAxisInvMass, thnAxisPt, thnAxisSA, thnAxisPhiminusPsi, thnAxisCentrality}); + histos.add("hSparseV2SASameEvent_V2", "hSparseV2SASameEvent_V2", HistType::kTHnSparseF, {thnAxisInvMass, thnAxisPt, thnAxisV2, thnAxisCentrality}); + histos.add("hSparseV2SAMixedEvent_costhetastarOP", "hSparseV2SAMixedEvent_costhetastarOP", HistType::kTHnSparseF, {thnAxisInvMass, thnAxisPt, thnAxisCosThetaStarOP, thnAxisPhiminusPsi, thnAxisCentrality}); + histos.add("hSparseV2SAMixedEvent_costhetastarIP", "hSparseV2SAMixedEvent_costhetastarIP", HistType::kTHnSparseF, {thnAxisInvMass, thnAxisPt, thnAxisCosThetaStarOP, thnAxisPhiminusPsi, thnAxisCentrality}); + histos.add("hSparseV2SAMixedEvent_SA", "hSparseV2SAMixedEvent_SA", HistType::kTHnSparseF, {thnAxisInvMass, thnAxisPt, thnAxisSA, thnAxisPhiminusPsi, thnAxisCentrality}); + histos.add("hSparseV2SAMixedEvent_costheta_SA", "hSparseV2SAMixedEvent_costheta_SA", HistType::kTHnSparseF, {thnAxisInvMass, thnAxisPt, thnAxiscosthetaSA, thnAxisPhiminusPsi, thnAxisCentrality}); + histos.add("hSparseV2SAMixedEvent_SA_A0", "hSparseV2SAMixedEvent_SA_A0", HistType::kTHnSparseF, {thnAxisInvMass, thnAxisPt, thnAxisSA, thnAxisPhiminusPsi, thnAxisCentrality}); + histos.add("hSparseV2SAMixedEvent_V2", "hSparseV2SAMixedEvent_V2", HistType::kTHnSparseF, {thnAxisInvMass, thnAxisPt, thnAxisV2, thnAxisCentrality}); + } + if (fillRapidity) { + histos.add("hSparseV2SASameEvent_costhetastarOP", "hSparseV2SASameEvent_costhetastarOP", HistType::kTHnSparseF, {thnAxisInvMass, thnAxisPt, thnAxisCosThetaStarOP, thnAxisRapidity, thnAxisCentrality}); + histos.add("hSparseV2SASameEvent_costhetastarIP", "hSparseV2SASameEvent_costhetastarIP", HistType::kTHnSparseF, {thnAxisInvMass, thnAxisPt, thnAxisCosThetaStarOP, thnAxisRapidity, thnAxisCentrality}); + histos.add("hSparseV2SASameEvent_SA", "hSparseV2SASameEvent_SA", HistType::kTHnSparseF, {thnAxisInvMass, thnAxisPt, thnAxisSA, thnAxisRapidity, thnAxisCentrality}); + histos.add("hSparseV2SASameEvent_costheta_SA", "hSparseV2SASameEvent_costheta_SA", HistType::kTHnSparseF, {thnAxisInvMass, thnAxisPt, thnAxiscosthetaSA, thnAxisRapidity, thnAxisCentrality}); + histos.add("hSparseV2SASameEvent_SA_A0", "hSparseV2SASameEvent_SA_A0", HistType::kTHnSparseF, {thnAxisInvMass, thnAxisPt, thnAxisSA, thnAxisRapidity, thnAxisCentrality}); + histos.add("hSparseV2SASameEvent_V2", "hSparseV2SASameEvent_V2", HistType::kTHnSparseF, {thnAxisInvMass, thnAxisPt, thnAxisV2, thnAxisCentrality}); + histos.add("hSparseV2SAMixedEvent_costhetastarOP", "hSparseV2SAMixedEvent_costhetastarOP", HistType::kTHnSparseF, {thnAxisInvMass, thnAxisPt, thnAxisCosThetaStarOP, thnAxisRapidity, thnAxisCentrality}); + histos.add("hSparseV2SAMixedEvent_costhetastarIP", "hSparseV2SAMixedEvent_costhetastarIP", HistType::kTHnSparseF, {thnAxisInvMass, thnAxisPt, thnAxisCosThetaStarOP, thnAxisRapidity, thnAxisCentrality}); + histos.add("hSparseV2SAMixedEvent_SA", "hSparseV2SAMixedEvent_SA", HistType::kTHnSparseF, {thnAxisInvMass, thnAxisPt, thnAxisSA, thnAxisRapidity, thnAxisCentrality}); + histos.add("hSparseV2SAMixedEvent_costheta_SA", "hSparseV2SAMixedEvent_costheta_SA", HistType::kTHnSparseF, {thnAxisInvMass, thnAxisPt, thnAxiscosthetaSA, thnAxisRapidity, thnAxisCentrality}); + histos.add("hSparseV2SAMixedEvent_SA_A0", "hSparseV2SAMixedEvent_SA_A0", HistType::kTHnSparseF, {thnAxisInvMass, thnAxisPt, thnAxisSA, thnAxisRapidity, thnAxisCentrality}); + histos.add("hSparseV2SAMixedEvent_V2", "hSparseV2SAMixedEvent_V2", HistType::kTHnSparseF, {thnAxisInvMass, thnAxisPt, thnAxisV2, thnAxisCentrality}); } - - histos.add("hSparseV2SAMixedEvent_costhetastarOP", "hSparseV2SAMixedEvent_costhetastarOP", HistType::kTHnSparseF, {thnAxisInvMass, thnAxisPt, thnAxisCosThetaStarOP, thnAxisPhiminusPsi, thnAxisCentrality}); - histos.add("hSparseV2SAMixedEvent_costhetastarIP", "hSparseV2SAMixedEvent_costhetastarIP", HistType::kTHnSparseF, {thnAxisInvMass, thnAxisPt, thnAxisCosThetaStarOP, thnAxisPhiminusPsi, thnAxisCentrality}); - histos.add("hSparseV2SAMixedEvent_SA", "hSparseV2SAMixedEvent_SA", HistType::kTHnSparseF, {thnAxisInvMass, thnAxisPt, thnAxisSA, thnAxisPhiminusPsi, thnAxisCentrality}); - histos.add("hSparseV2SAMixedEvent_costheta_SA", "hSparseV2SAMixedEvent_costheta_SA", HistType::kTHnSparseF, {thnAxisInvMass, thnAxisPt, thnAxiscosthetaSA, thnAxisPhiminusPsi, thnAxisCentrality}); - histos.add("hSparseV2SAMixedEvent_SA_A0", "hSparseV2SAMixedEvent_SA_A0", HistType::kTHnSparseF, {thnAxisInvMass, thnAxisPt, thnAxisSA, thnAxisPhiminusPsi, thnAxisCentrality}); - histos.add("hSparseV2SAMixedEvent_V2", "hSparseV2SAMixedEvent_V2", HistType::kTHnSparseF, {thnAxisInvMass, thnAxisPt, thnAxisV2, thnAxisCentrality}); - // histogram for resolution histos.add("ResFT0CTPC", "ResFT0CTPC", kTH2F, {centAxis, resAxis}); histos.add("ResFT0CTPCR", "ResFT0CTPCR", kTH2F, {centAxis, resAxis}); @@ -201,19 +210,36 @@ struct phipbpb { histos.add("hMC", "MC Event statistics", kTH1F, {{10, 0.0f, 10.0f}}); histos.add("h1PhiRecsplit", "Phi meson Rec split", kTH1F, {{100, 0.0f, 10.0f}}); histos.add("CentPercentileMCRecHist", "MC Centrality", kTH1F, {{100, 0.0f, 100.0f}}); - histos.add("hSparseV2SASameEvent_costhetastarOP_MCGen", "hSparseV2SASameEvent_costhetastarOP_MCGen", HistType::kTHnSparseF, {thnAxisInvMass, thnAxisPt, thnAxisCosThetaStarOP, thnAxisPhiminusPsi, thnAxisCentrality}); - histos.add("hSparseV2SASameEvent_costhetastarIP_MCGen", "hSparseV2SASameEvent_costhetastarIP_MCGen", HistType::kTHnSparseF, {thnAxisInvMass, thnAxisPt, thnAxisCosThetaStarOP, thnAxisPhiminusPsi, thnAxisCentrality}); - histos.add("hSparseV2SASameEvent_SA_MCGen", "hSparseV2SASameEvent_SA_MCGen", HistType::kTHnSparseF, {thnAxisInvMass, thnAxisPt, thnAxisSA, thnAxisPhiminusPsi, thnAxisCentrality}); - histos.add("hSparseV2SASameEvent_costheta_SA_MCGen", "hSparseV2SASameEvent_costheta_SA_MCGen", HistType::kTHnSparseF, {thnAxisInvMass, thnAxisPt, thnAxiscosthetaSA, thnAxisPhiminusPsi, thnAxisCentrality}); - histos.add("hSparseV2SASameEvent_SA_A0_MCGen", "hSparseV2SASameEvent_SA_A0_MCGen", HistType::kTHnSparseF, {thnAxisInvMass, thnAxisPt, thnAxisSA, thnAxisPhiminusPsi, thnAxisCentrality}); - histos.add("hSparseV2SASameEvent_V2_MCGen", "hSparseV2SASameEvent_V2_MCGen", HistType::kTHnSparseF, {thnAxisInvMass, thnAxisPt, thnAxisV2, thnAxisCentrality}); - - histos.add("hSparseV2SASameEvent_costhetastarOP_MCRec", "hSparseV2SASameEvent_costhetastarOP_MCRec", HistType::kTHnSparseF, {thnAxisInvMass, thnAxisPt, thnAxisCosThetaStarOP, thnAxisPhiminusPsi, thnAxisCentrality}); - histos.add("hSparseV2SASameEvent_costhetastarIP_MCRec", "hSparseV2SASameEvent_costhetastarIP_MCRec", HistType::kTHnSparseF, {thnAxisInvMass, thnAxisPt, thnAxisCosThetaStarOP, thnAxisPhiminusPsi, thnAxisCentrality}); - histos.add("hSparseV2SASameEvent_SA_MCRec", "hSparseV2SASameEvent_SA_MCRec", HistType::kTHnSparseF, {thnAxisInvMass, thnAxisPt, thnAxisSA, thnAxisPhiminusPsi, thnAxisCentrality}); - histos.add("hSparseV2SASameEvent_costheta_SA_MCRec", "hSparseV2SASameEvent_costheta_SA_MCRec", HistType::kTHnSparseF, {thnAxisInvMass, thnAxisPt, thnAxiscosthetaSA, thnAxisPhiminusPsi, thnAxisCentrality}); - histos.add("hSparseV2SASameEvent_SA_A0_MCRec", "hSparseV2SASameEvent_SA_A0_MCRec", HistType::kTHnSparseF, {thnAxisInvMass, thnAxisPt, thnAxisSA, thnAxisPhiminusPsi, thnAxisCentrality}); - histos.add("hSparseV2SASameEvent_V2_MCRec", "hSparseV2SASameEvent_V2_MCRec", HistType::kTHnSparseF, {thnAxisInvMass, thnAxisPt, thnAxisV2, thnAxisCentrality}); + if (!fillRapidity) { + histos.add("hSparseV2SASameEvent_costhetastarOP_MCGen", "hSparseV2SASameEvent_costhetastarOP_MCGen", HistType::kTHnSparseF, {thnAxisInvMass, thnAxisPt, thnAxisCosThetaStarOP, thnAxisPhiminusPsi, thnAxisCentrality}); + histos.add("hSparseV2SASameEvent_costhetastarIP_MCGen", "hSparseV2SASameEvent_costhetastarIP_MCGen", HistType::kTHnSparseF, {thnAxisInvMass, thnAxisPt, thnAxisCosThetaStarOP, thnAxisPhiminusPsi, thnAxisCentrality}); + histos.add("hSparseV2SASameEvent_SA_MCGen", "hSparseV2SASameEvent_SA_MCGen", HistType::kTHnSparseF, {thnAxisInvMass, thnAxisPt, thnAxisSA, thnAxisPhiminusPsi, thnAxisCentrality}); + histos.add("hSparseV2SASameEvent_costheta_SA_MCGen", "hSparseV2SASameEvent_costheta_SA_MCGen", HistType::kTHnSparseF, {thnAxisInvMass, thnAxisPt, thnAxiscosthetaSA, thnAxisPhiminusPsi, thnAxisCentrality}); + histos.add("hSparseV2SASameEvent_SA_A0_MCGen", "hSparseV2SASameEvent_SA_A0_MCGen", HistType::kTHnSparseF, {thnAxisInvMass, thnAxisPt, thnAxisSA, thnAxisPhiminusPsi, thnAxisCentrality}); + histos.add("hSparseV2SASameEvent_V2_MCGen", "hSparseV2SASameEvent_V2_MCGen", HistType::kTHnSparseF, {thnAxisInvMass, thnAxisPt, thnAxisV2, thnAxisCentrality}); + + histos.add("hSparseV2SASameEvent_costhetastarOP_MCRec", "hSparseV2SASameEvent_costhetastarOP_MCRec", HistType::kTHnSparseF, {thnAxisInvMass, thnAxisPt, thnAxisCosThetaStarOP, thnAxisPhiminusPsi, thnAxisCentrality}); + histos.add("hSparseV2SASameEvent_costhetastarIP_MCRec", "hSparseV2SASameEvent_costhetastarIP_MCRec", HistType::kTHnSparseF, {thnAxisInvMass, thnAxisPt, thnAxisCosThetaStarOP, thnAxisPhiminusPsi, thnAxisCentrality}); + histos.add("hSparseV2SASameEvent_SA_MCRec", "hSparseV2SASameEvent_SA_MCRec", HistType::kTHnSparseF, {thnAxisInvMass, thnAxisPt, thnAxisSA, thnAxisPhiminusPsi, thnAxisCentrality}); + histos.add("hSparseV2SASameEvent_costheta_SA_MCRec", "hSparseV2SASameEvent_costheta_SA_MCRec", HistType::kTHnSparseF, {thnAxisInvMass, thnAxisPt, thnAxiscosthetaSA, thnAxisPhiminusPsi, thnAxisCentrality}); + histos.add("hSparseV2SASameEvent_SA_A0_MCRec", "hSparseV2SASameEvent_SA_A0_MCRec", HistType::kTHnSparseF, {thnAxisInvMass, thnAxisPt, thnAxisSA, thnAxisPhiminusPsi, thnAxisCentrality}); + histos.add("hSparseV2SASameEvent_V2_MCRec", "hSparseV2SASameEvent_V2_MCRec", HistType::kTHnSparseF, {thnAxisInvMass, thnAxisPt, thnAxisV2, thnAxisCentrality}); + } + if (fillRapidity) { + histos.add("hSparseV2SASameEvent_costhetastarOP_MCGen", "hSparseV2SASameEvent_costhetastarOP_MCGen", HistType::kTHnSparseF, {thnAxisInvMass, thnAxisPt, thnAxisCosThetaStarOP, thnAxisRapidity, thnAxisCentrality}); + histos.add("hSparseV2SASameEvent_costhetastarIP_MCGen", "hSparseV2SASameEvent_costhetastarIP_MCGen", HistType::kTHnSparseF, {thnAxisInvMass, thnAxisPt, thnAxisCosThetaStarOP, thnAxisRapidity, thnAxisCentrality}); + histos.add("hSparseV2SASameEvent_SA_MCGen", "hSparseV2SASameEvent_SA_MCGen", HistType::kTHnSparseF, {thnAxisInvMass, thnAxisPt, thnAxisSA, thnAxisRapidity, thnAxisCentrality}); + histos.add("hSparseV2SASameEvent_costheta_SA_MCGen", "hSparseV2SASameEvent_costheta_SA_MCGen", HistType::kTHnSparseF, {thnAxisInvMass, thnAxisPt, thnAxiscosthetaSA, thnAxisRapidity, thnAxisCentrality}); + histos.add("hSparseV2SASameEvent_SA_A0_MCGen", "hSparseV2SASameEvent_SA_A0_MCGen", HistType::kTHnSparseF, {thnAxisInvMass, thnAxisPt, thnAxisSA, thnAxisRapidity, thnAxisCentrality}); + histos.add("hSparseV2SASameEvent_V2_MCGen", "hSparseV2SASameEvent_V2_MCGen", HistType::kTHnSparseF, {thnAxisInvMass, thnAxisPt, thnAxisV2, thnAxisCentrality}); + + histos.add("hSparseV2SASameEvent_costhetastarOP_MCRec", "hSparseV2SASameEvent_costhetastarOP_MCRec", HistType::kTHnSparseF, {thnAxisInvMass, thnAxisPt, thnAxisCosThetaStarOP, thnAxisRapidity, thnAxisCentrality}); + histos.add("hSparseV2SASameEvent_costhetastarIP_MCRec", "hSparseV2SASameEvent_costhetastarIP_MCRec", HistType::kTHnSparseF, {thnAxisInvMass, thnAxisPt, thnAxisCosThetaStarOP, thnAxisRapidity, thnAxisCentrality}); + histos.add("hSparseV2SASameEvent_SA_MCRec", "hSparseV2SASameEvent_SA_MCRec", HistType::kTHnSparseF, {thnAxisInvMass, thnAxisPt, thnAxisSA, thnAxisRapidity, thnAxisCentrality}); + histos.add("hSparseV2SASameEvent_costheta_SA_MCRec", "hSparseV2SASameEvent_costheta_SA_MCRec", HistType::kTHnSparseF, {thnAxisInvMass, thnAxisPt, thnAxiscosthetaSA, thnAxisRapidity, thnAxisCentrality}); + histos.add("hSparseV2SASameEvent_SA_A0_MCRec", "hSparseV2SASameEvent_SA_A0_MCRec", HistType::kTHnSparseF, {thnAxisInvMass, thnAxisPt, thnAxisSA, thnAxisRapidity, thnAxisCentrality}); + histos.add("hSparseV2SASameEvent_V2_MCRec", "hSparseV2SASameEvent_V2_MCRec", HistType::kTHnSparseF, {thnAxisInvMass, thnAxisPt, thnAxisV2, thnAxisCentrality}); + } } // Event selection cut additional - Alex if (additionalEvsel) { @@ -443,12 +469,23 @@ struct phipbpb { auto cosThetaStarIP = eventplaneVec.Dot(threeVecDauCM) / std::sqrt(threeVecDauCM.Mag2()) / std::sqrt(eventplaneVec.Mag2()); auto phiminuspsi = GetPhiInRange(PhiMesonMother.Phi() - psiFT0C); auto v2 = TMath::Cos(2.0 * phiminuspsi); - histos.fill(HIST("hSparseV2SASameEvent_costhetastarOP"), PhiMesonMother.M(), PhiMesonMother.Pt(), cosThetaStarOP, phiminuspsi, centrality); - histos.fill(HIST("hSparseV2SASameEvent_costheta_SA"), PhiMesonMother.M(), PhiMesonMother.Pt(), cosThetaStarOP * cosThetaStarOP, phiminuspsi, centrality); - histos.fill(HIST("hSparseV2SASameEvent_costhetastarIP"), PhiMesonMother.M(), PhiMesonMother.Pt(), cosThetaStarIP, phiminuspsi, centrality); - histos.fill(HIST("hSparseV2SASameEvent_SA"), PhiMesonMother.M(), PhiMesonMother.Pt(), SA, phiminuspsi, centrality); - histos.fill(HIST("hSparseV2SASameEvent_SA_A0"), PhiMesonMother.M(), PhiMesonMother.Pt(), SA_A0, phiminuspsi, centrality); - histos.fill(HIST("hSparseV2SASameEvent_V2"), PhiMesonMother.M(), PhiMesonMother.Pt(), v2, centrality); + if (!fillRapidity) { + histos.fill(HIST("hSparseV2SASameEvent_costhetastarOP"), PhiMesonMother.M(), PhiMesonMother.Pt(), cosThetaStarOP, phiminuspsi, centrality); + histos.fill(HIST("hSparseV2SASameEvent_costheta_SA"), PhiMesonMother.M(), PhiMesonMother.Pt(), cosThetaStarOP * cosThetaStarOP, phiminuspsi, centrality); + histos.fill(HIST("hSparseV2SASameEvent_costhetastarIP"), PhiMesonMother.M(), PhiMesonMother.Pt(), cosThetaStarIP, phiminuspsi, centrality); + histos.fill(HIST("hSparseV2SASameEvent_SA"), PhiMesonMother.M(), PhiMesonMother.Pt(), SA, phiminuspsi, centrality); + histos.fill(HIST("hSparseV2SASameEvent_SA_A0"), PhiMesonMother.M(), PhiMesonMother.Pt(), SA_A0, phiminuspsi, centrality); + histos.fill(HIST("hSparseV2SASameEvent_V2"), PhiMesonMother.M(), PhiMesonMother.Pt(), v2, centrality); + } + + if (fillRapidity) { + histos.fill(HIST("hSparseV2SASameEvent_costhetastarOP"), PhiMesonMother.M(), PhiMesonMother.Pt(), cosThetaStarOP, TMath::Abs(PhiMesonMother.Rapidity()), centrality); + histos.fill(HIST("hSparseV2SASameEvent_costheta_SA"), PhiMesonMother.M(), PhiMesonMother.Pt(), cosThetaStarOP * cosThetaStarOP, TMath::Abs(PhiMesonMother.Rapidity()), centrality); + histos.fill(HIST("hSparseV2SASameEvent_costhetastarIP"), PhiMesonMother.M(), PhiMesonMother.Pt(), cosThetaStarIP, TMath::Abs(PhiMesonMother.Rapidity()), centrality); + histos.fill(HIST("hSparseV2SASameEvent_SA"), PhiMesonMother.M(), PhiMesonMother.Pt(), SA, TMath::Abs(PhiMesonMother.Rapidity()), centrality); + histos.fill(HIST("hSparseV2SASameEvent_SA_A0"), PhiMesonMother.M(), PhiMesonMother.Pt(), SA_A0, TMath::Abs(PhiMesonMother.Rapidity()), centrality); + histos.fill(HIST("hSparseV2SASameEvent_V2"), PhiMesonMother.M(), PhiMesonMother.Pt(), v2, centrality); + } } } } @@ -525,12 +562,22 @@ struct phipbpb { auto cosThetaStarIP = eventplaneVec.Dot(threeVecDauCM) / std::sqrt(threeVecDauCM.Mag2()) / std::sqrt(eventplaneVec.Mag2()); auto phiminuspsi = GetPhiInRange(PhiMesonMother.Phi() - psiFT0C); auto v2 = TMath::Cos(2.0 * phiminuspsi); - histos.fill(HIST("hSparseV2SAMixedEvent_costhetastarOP"), PhiMesonMother.M(), PhiMesonMother.Pt(), cosThetaStarOP, phiminuspsi, centrality); - histos.fill(HIST("hSparseV2SAMixedEvent_costheta_SA"), PhiMesonMother.M(), PhiMesonMother.Pt(), cosThetaStarOP * cosThetaStarOP, phiminuspsi, centrality); - histos.fill(HIST("hSparseV2SAMixedEvent_costhetastarIP"), PhiMesonMother.M(), PhiMesonMother.Pt(), cosThetaStarIP, phiminuspsi, centrality); - histos.fill(HIST("hSparseV2SAMixedEvent_SA"), PhiMesonMother.M(), PhiMesonMother.Pt(), SA, phiminuspsi, centrality); - histos.fill(HIST("hSparseV2SAMixedEvent_SA_A0"), PhiMesonMother.M(), PhiMesonMother.Pt(), SA_A0, phiminuspsi, centrality); - histos.fill(HIST("hSparseV2SAMixedEvent_V2"), PhiMesonMother.M(), PhiMesonMother.Pt(), v2, centrality); + if (!fillRapidity) { + histos.fill(HIST("hSparseV2SAMixedEvent_costhetastarOP"), PhiMesonMother.M(), PhiMesonMother.Pt(), cosThetaStarOP, phiminuspsi, centrality); + histos.fill(HIST("hSparseV2SAMixedEvent_costheta_SA"), PhiMesonMother.M(), PhiMesonMother.Pt(), cosThetaStarOP * cosThetaStarOP, phiminuspsi, centrality); + histos.fill(HIST("hSparseV2SAMixedEvent_costhetastarIP"), PhiMesonMother.M(), PhiMesonMother.Pt(), cosThetaStarIP, phiminuspsi, centrality); + histos.fill(HIST("hSparseV2SAMixedEvent_SA"), PhiMesonMother.M(), PhiMesonMother.Pt(), SA, phiminuspsi, centrality); + histos.fill(HIST("hSparseV2SAMixedEvent_SA_A0"), PhiMesonMother.M(), PhiMesonMother.Pt(), SA_A0, phiminuspsi, centrality); + histos.fill(HIST("hSparseV2SAMixedEvent_V2"), PhiMesonMother.M(), PhiMesonMother.Pt(), v2, centrality); + } + if (fillRapidity) { + histos.fill(HIST("hSparseV2SAMixedEvent_costhetastarOP"), PhiMesonMother.M(), PhiMesonMother.Pt(), cosThetaStarOP, TMath::Abs(PhiMesonMother.Rapidity()), centrality); + histos.fill(HIST("hSparseV2SAMixedEvent_costheta_SA"), PhiMesonMother.M(), PhiMesonMother.Pt(), cosThetaStarOP * cosThetaStarOP, TMath::Abs(PhiMesonMother.Rapidity()), centrality); + histos.fill(HIST("hSparseV2SAMixedEvent_costhetastarIP"), PhiMesonMother.M(), PhiMesonMother.Pt(), cosThetaStarIP, TMath::Abs(PhiMesonMother.Rapidity()), centrality); + histos.fill(HIST("hSparseV2SAMixedEvent_SA"), PhiMesonMother.M(), PhiMesonMother.Pt(), SA, TMath::Abs(PhiMesonMother.Rapidity()), centrality); + histos.fill(HIST("hSparseV2SAMixedEvent_SA_A0"), PhiMesonMother.M(), PhiMesonMother.Pt(), SA_A0, TMath::Abs(PhiMesonMother.Rapidity()), centrality); + histos.fill(HIST("hSparseV2SAMixedEvent_V2"), PhiMesonMother.M(), PhiMesonMother.Pt(), v2, centrality); + } } } } @@ -605,12 +652,22 @@ struct phipbpb { auto cosThetaStarIP = eventplaneVec.Dot(threeVecDauCM) / std::sqrt(threeVecDauCM.Mag2()) / std::sqrt(eventplaneVec.Mag2()); auto phiminuspsi = GetPhiInRange(PhiMesonMother.Phi() - psiFT0C); auto v2 = TMath::Cos(2.0 * phiminuspsi); - histos.fill(HIST("hSparseV2SAMixedEvent_costhetastarOP"), PhiMesonMother.M(), PhiMesonMother.Pt(), cosThetaStarOP, phiminuspsi, centrality); - histos.fill(HIST("hSparseV2SAMixedEvent_costheta_SA"), PhiMesonMother.M(), PhiMesonMother.Pt(), cosThetaStarOP * cosThetaStarOP, phiminuspsi, centrality); - histos.fill(HIST("hSparseV2SAMixedEvent_costhetastarIP"), PhiMesonMother.M(), PhiMesonMother.Pt(), cosThetaStarIP, phiminuspsi, centrality); - histos.fill(HIST("hSparseV2SAMixedEvent_SA"), PhiMesonMother.M(), PhiMesonMother.Pt(), SA, phiminuspsi, centrality); - histos.fill(HIST("hSparseV2SAMixedEvent_SA_A0"), PhiMesonMother.M(), PhiMesonMother.Pt(), SA_A0, phiminuspsi, centrality); - histos.fill(HIST("hSparseV2SAMixedEvent_V2"), PhiMesonMother.M(), PhiMesonMother.Pt(), v2, centrality); + if (!fillRapidity) { + histos.fill(HIST("hSparseV2SAMixedEvent_costhetastarOP"), PhiMesonMother.M(), PhiMesonMother.Pt(), cosThetaStarOP, phiminuspsi, centrality); + histos.fill(HIST("hSparseV2SAMixedEvent_costheta_SA"), PhiMesonMother.M(), PhiMesonMother.Pt(), cosThetaStarOP * cosThetaStarOP, phiminuspsi, centrality); + histos.fill(HIST("hSparseV2SAMixedEvent_costhetastarIP"), PhiMesonMother.M(), PhiMesonMother.Pt(), cosThetaStarIP, phiminuspsi, centrality); + histos.fill(HIST("hSparseV2SAMixedEvent_SA"), PhiMesonMother.M(), PhiMesonMother.Pt(), SA, phiminuspsi, centrality); + histos.fill(HIST("hSparseV2SAMixedEvent_SA_A0"), PhiMesonMother.M(), PhiMesonMother.Pt(), SA_A0, phiminuspsi, centrality); + histos.fill(HIST("hSparseV2SAMixedEvent_V2"), PhiMesonMother.M(), PhiMesonMother.Pt(), v2, centrality); + } + if (fillRapidity) { + histos.fill(HIST("hSparseV2SAMixedEvent_costhetastarOP"), PhiMesonMother.M(), PhiMesonMother.Pt(), cosThetaStarOP, TMath::Abs(PhiMesonMother.Rapidity()), centrality); + histos.fill(HIST("hSparseV2SAMixedEvent_costheta_SA"), PhiMesonMother.M(), PhiMesonMother.Pt(), cosThetaStarOP * cosThetaStarOP, TMath::Abs(PhiMesonMother.Rapidity()), centrality); + histos.fill(HIST("hSparseV2SAMixedEvent_costhetastarIP"), PhiMesonMother.M(), PhiMesonMother.Pt(), cosThetaStarIP, TMath::Abs(PhiMesonMother.Rapidity()), centrality); + histos.fill(HIST("hSparseV2SAMixedEvent_SA"), PhiMesonMother.M(), PhiMesonMother.Pt(), SA, TMath::Abs(PhiMesonMother.Rapidity()), centrality); + histos.fill(HIST("hSparseV2SAMixedEvent_SA_A0"), PhiMesonMother.M(), PhiMesonMother.Pt(), SA_A0, TMath::Abs(PhiMesonMother.Rapidity()), centrality); + histos.fill(HIST("hSparseV2SAMixedEvent_V2"), PhiMesonMother.M(), PhiMesonMother.Pt(), v2, centrality); + } } } } @@ -747,12 +804,22 @@ struct phipbpb { auto cosThetaStarIP = eventplaneVec.Dot(threeVecDauCM) / std::sqrt(threeVecDauCM.Mag2()) / std::sqrt(eventplaneVec.Mag2()); auto phiminuspsi = GetPhiInRange(PhiMesonMother.Phi() - psiFT0C); auto v2 = TMath::Cos(2.0 * phiminuspsi); - histos.fill(HIST("hSparseV2SASameEvent_costhetastarOP_MCRec"), PhiMesonMother.M(), PhiMesonMother.Pt(), cosThetaStarOP, phiminuspsi, centrality); - histos.fill(HIST("hSparseV2SASameEvent_costheta_SA_MCRec"), PhiMesonMother.M(), PhiMesonMother.Pt(), cosThetaStarOP * cosThetaStarOP, phiminuspsi, centrality); - histos.fill(HIST("hSparseV2SASameEvent_costhetastarIP_MCRec"), PhiMesonMother.M(), PhiMesonMother.Pt(), cosThetaStarIP, phiminuspsi, centrality); - histos.fill(HIST("hSparseV2SASameEvent_SA_MCRec"), PhiMesonMother.M(), PhiMesonMother.Pt(), SA, phiminuspsi, centrality); - histos.fill(HIST("hSparseV2SASameEvent_SA_A0_MCRec"), PhiMesonMother.M(), PhiMesonMother.Pt(), SA_A0, phiminuspsi, centrality); - histos.fill(HIST("hSparseV2SASameEvent_V2_MCRec"), PhiMesonMother.M(), PhiMesonMother.Pt(), v2, centrality); + if (!fillRapidity) { + histos.fill(HIST("hSparseV2SASameEvent_costhetastarOP_MCRec"), PhiMesonMother.M(), PhiMesonMother.Pt(), cosThetaStarOP, phiminuspsi, centrality); + histos.fill(HIST("hSparseV2SASameEvent_costheta_SA_MCRec"), PhiMesonMother.M(), PhiMesonMother.Pt(), cosThetaStarOP * cosThetaStarOP, phiminuspsi, centrality); + histos.fill(HIST("hSparseV2SASameEvent_costhetastarIP_MCRec"), PhiMesonMother.M(), PhiMesonMother.Pt(), cosThetaStarIP, phiminuspsi, centrality); + histos.fill(HIST("hSparseV2SASameEvent_SA_MCRec"), PhiMesonMother.M(), PhiMesonMother.Pt(), SA, phiminuspsi, centrality); + histos.fill(HIST("hSparseV2SASameEvent_SA_A0_MCRec"), PhiMesonMother.M(), PhiMesonMother.Pt(), SA_A0, phiminuspsi, centrality); + histos.fill(HIST("hSparseV2SASameEvent_V2_MCRec"), PhiMesonMother.M(), PhiMesonMother.Pt(), v2, centrality); + } + if (fillRapidity) { + histos.fill(HIST("hSparseV2SASameEvent_costhetastarOP_MCRec"), PhiMesonMother.M(), PhiMesonMother.Pt(), cosThetaStarOP, TMath::Abs(PhiMesonMother.Rapidity()), centrality); + histos.fill(HIST("hSparseV2SASameEvent_costheta_SA_MCRec"), PhiMesonMother.M(), PhiMesonMother.Pt(), cosThetaStarOP * cosThetaStarOP, TMath::Abs(PhiMesonMother.Rapidity()), centrality); + histos.fill(HIST("hSparseV2SASameEvent_costhetastarIP_MCRec"), PhiMesonMother.M(), PhiMesonMother.Pt(), cosThetaStarIP, TMath::Abs(PhiMesonMother.Rapidity()), centrality); + histos.fill(HIST("hSparseV2SASameEvent_SA_MCRec"), PhiMesonMother.M(), PhiMesonMother.Pt(), SA, TMath::Abs(PhiMesonMother.Rapidity()), centrality); + histos.fill(HIST("hSparseV2SASameEvent_SA_A0_MCRec"), PhiMesonMother.M(), PhiMesonMother.Pt(), SA_A0, TMath::Abs(PhiMesonMother.Rapidity()), centrality); + histos.fill(HIST("hSparseV2SASameEvent_V2_MCRec"), PhiMesonMother.M(), PhiMesonMother.Pt(), v2, centrality); + } } } } @@ -798,12 +865,22 @@ struct phipbpb { auto cosThetaStarIP = TMath::Abs(eventplaneVec.Dot(threeVecDauCM) / std::sqrt(threeVecDauCM.Mag2()) / std::sqrt(eventplaneVec.Mag2())); auto phiminuspsi = GetPhiInRange(PhiMesonMother.Phi() - psiFT0C); auto v2 = TMath::Cos(2.0 * phiminuspsi); - histos.fill(HIST("hSparseV2SASameEvent_costhetastarOP_MCGen"), PhiMesonMother.M(), PhiMesonMother.Pt(), cosThetaStarOP, phiminuspsi, centrality); - histos.fill(HIST("hSparseV2SASameEvent_costheta_SA_MCGen"), PhiMesonMother.M(), PhiMesonMother.Pt(), cosThetaStarOP * cosThetaStarOP, phiminuspsi, centrality); - histos.fill(HIST("hSparseV2SASameEvent_costhetastarIP_MCGen"), PhiMesonMother.M(), PhiMesonMother.Pt(), cosThetaStarIP, phiminuspsi, centrality); - histos.fill(HIST("hSparseV2SASameEvent_SA_MCGen"), PhiMesonMother.M(), PhiMesonMother.Pt(), SA, phiminuspsi, centrality); - histos.fill(HIST("hSparseV2SASameEvent_SA_A0_MCGen"), PhiMesonMother.M(), PhiMesonMother.Pt(), SA_A0, phiminuspsi, centrality); - histos.fill(HIST("hSparseV2SASameEvent_V2_MCGen"), PhiMesonMother.M(), PhiMesonMother.Pt(), v2, centrality); + if (!fillRapidity) { + histos.fill(HIST("hSparseV2SASameEvent_costhetastarOP_MCGen"), PhiMesonMother.M(), PhiMesonMother.Pt(), cosThetaStarOP, phiminuspsi, centrality); + histos.fill(HIST("hSparseV2SASameEvent_costheta_SA_MCGen"), PhiMesonMother.M(), PhiMesonMother.Pt(), cosThetaStarOP * cosThetaStarOP, phiminuspsi, centrality); + histos.fill(HIST("hSparseV2SASameEvent_costhetastarIP_MCGen"), PhiMesonMother.M(), PhiMesonMother.Pt(), cosThetaStarIP, phiminuspsi, centrality); + histos.fill(HIST("hSparseV2SASameEvent_SA_MCGen"), PhiMesonMother.M(), PhiMesonMother.Pt(), SA, phiminuspsi, centrality); + histos.fill(HIST("hSparseV2SASameEvent_SA_A0_MCGen"), PhiMesonMother.M(), PhiMesonMother.Pt(), SA_A0, phiminuspsi, centrality); + histos.fill(HIST("hSparseV2SASameEvent_V2_MCGen"), PhiMesonMother.M(), PhiMesonMother.Pt(), v2, centrality); + } + if (fillRapidity) { + histos.fill(HIST("hSparseV2SASameEvent_costhetastarOP_MCGen"), PhiMesonMother.M(), PhiMesonMother.Pt(), cosThetaStarOP, TMath::Abs(PhiMesonMother.Rapidity()), centrality); + histos.fill(HIST("hSparseV2SASameEvent_costheta_SA_MCGen"), PhiMesonMother.M(), PhiMesonMother.Pt(), cosThetaStarOP * cosThetaStarOP, TMath::Abs(PhiMesonMother.Rapidity()), centrality); + histos.fill(HIST("hSparseV2SASameEvent_costhetastarIP_MCGen"), PhiMesonMother.M(), PhiMesonMother.Pt(), cosThetaStarIP, TMath::Abs(PhiMesonMother.Rapidity()), centrality); + histos.fill(HIST("hSparseV2SASameEvent_SA_MCGen"), PhiMesonMother.M(), PhiMesonMother.Pt(), SA, TMath::Abs(PhiMesonMother.Rapidity()), centrality); + histos.fill(HIST("hSparseV2SASameEvent_SA_A0_MCGen"), PhiMesonMother.M(), PhiMesonMother.Pt(), SA_A0, TMath::Abs(PhiMesonMother.Rapidity()), centrality); + histos.fill(HIST("hSparseV2SASameEvent_V2_MCGen"), PhiMesonMother.M(), PhiMesonMother.Pt(), v2, centrality); + } } } } // rec collision loop diff --git a/PWGMM/Lumi/Tasks/LumiFDDFT0.cxx b/PWGMM/Lumi/Tasks/LumiFDDFT0.cxx index 98e58bbba46..454a996b462 100644 --- a/PWGMM/Lumi/Tasks/LumiFDDFT0.cxx +++ b/PWGMM/Lumi/Tasks/LumiFDDFT0.cxx @@ -176,15 +176,15 @@ struct LumiFDDFT0 { std::vector vec_TrkContributos = {}; int nContrib = 0; - int nNonContrib = 0; + // int nNonContrib = 0; for (const auto& unfiltered_track : unfiltered_tracks) { if (!unfiltered_track.hasITS()) { - nNonContrib++; + // nNonContrib++; continue; } if (unfiltered_track.pt() < 0.8 || unfiltered_track.itsNCls() < 5) { - nNonContrib++; + // nNonContrib++; continue; } vec_globID_contr.push_back(unfiltered_track.globalIndex()); @@ -223,9 +223,9 @@ struct LumiFDDFT0 { double refitX = -999.; double refitY = -999.; double refitZ = -999.; - double refitXX = -999.; - double refitYY = -999.; - double refitXY = -999.; + // double refitXX = -999.; + // double refitYY = -999.; + // double refitXY = -999.; double timeaFDD = -999.; double timecFDD = -999.; @@ -245,9 +245,9 @@ struct LumiFDDFT0 { refitX = Pvtx_refitted.getX(); refitY = Pvtx_refitted.getY(); refitZ = Pvtx_refitted.getZ(); - refitXX = Pvtx_refitted.getSigmaX2(); - refitYY = Pvtx_refitted.getSigmaY2(); - refitXY = Pvtx_refitted.getSigmaXY(); + // refitXX = Pvtx_refitted.getSigmaX2(); + // refitYY = Pvtx_refitted.getSigmaY2(); + // refitXY = Pvtx_refitted.getSigmaXY(); // now get information for FDD if (collision.has_foundFDD()) { diff --git a/PWGMM/Lumi/Tasks/lumi.cxx b/PWGMM/Lumi/Tasks/lumi.cxx index 567ee49ce64..325f506c6b7 100644 --- a/PWGMM/Lumi/Tasks/lumi.cxx +++ b/PWGMM/Lumi/Tasks/lumi.cxx @@ -155,14 +155,14 @@ struct lumiTask { std::vector vec_TrkContributos = {}; int nContrib = 0; - int nNonContrib = 0; + // int nNonContrib = 0; for (const auto& unfiltered_track : unfiltered_tracks) { if (!unfiltered_track.hasITS()) { - nNonContrib++; + // nNonContrib++; continue; } if (unfiltered_track.pt() < 0.8 || unfiltered_track.itsNCls() < 5) { - nNonContrib++; + // nNonContrib++; continue; } vec_globID_contr.push_back(unfiltered_track.globalIndex()); diff --git a/PWGMM/Mult/TableProducer/particles2tracks.cxx b/PWGMM/Mult/TableProducer/particles2tracks.cxx index 4d7a40b38fd..6b7e7db6a17 100644 --- a/PWGMM/Mult/TableProducer/particles2tracks.cxx +++ b/PWGMM/Mult/TableProducer/particles2tracks.cxx @@ -40,7 +40,7 @@ struct ParticlesToTracks { void process(aod::McParticles const& particles) { - if (doprocessIndexingCentral) { + if (doprocessIndexingCentral || doprocessIndexingCentralFast) { p2t.reserve(particles.size()); } if (doprocessIndexingFwd) { @@ -48,6 +48,20 @@ struct ParticlesToTracks { } } + void processIndexingCentralFast(aod::McParticles const& mcParticles, LabeledTracks const& tracks) + { + // faster version, but will use more memory due to pre-allocation + std::vector> part2track(mcParticles.size()); + for (auto& track : tracks) { + if (track.has_mcParticle()) + part2track[track.mcParticleId()].push_back(track.globalIndex()); + } + for (auto& mcParticle : mcParticles) { + p2t(part2track[mcParticle.globalIndex()]); + } + } + PROCESS_SWITCH(ParticlesToTracks, processIndexingCentralFast, "Create reverse index from particles to tracks: more memory use but potentially faster", false); + void processIndexingCentral(aod::McParticle const&, soa::SmallGroups const& tracks) { trackIds.clear(); diff --git a/PWGMM/Mult/TableProducer/trackPropagation.cxx b/PWGMM/Mult/TableProducer/trackPropagation.cxx index 6e2be374f7b..7f5561ff1de 100644 --- a/PWGMM/Mult/TableProducer/trackPropagation.cxx +++ b/PWGMM/Mult/TableProducer/trackPropagation.cxx @@ -197,8 +197,8 @@ struct AmbiguousTrackPropagation { initCCDB(bcs.begin()); // Minimum only on DCAxy - float dcaInfo; - float bestDCA, bestDCAx, bestDCAy; + float dcaInfo = 0.f; + float bestDCA = 0.f, bestDCAx = 0.f, bestDCAy = 0.f; o2::track::TrackParCovFwd bestTrackPar; for (auto& atrack : atracks) { @@ -283,8 +283,8 @@ struct AmbiguousTrackPropagation { } initCCDB(bcs.begin()); - float dcaInfo; - float bestDCA, bestDCAx, bestDCAy; + float dcaInfo = 0.f; + float bestDCA = 0.f, bestDCAx = 0.f, bestDCAy = 0.f; o2::track::TrackParCovFwd bestTrackPar; for (auto& track : tracks) { diff --git a/PWGMM/Mult/Tasks/dndeta-hi.cxx b/PWGMM/Mult/Tasks/dndeta-hi.cxx index 75b7fe9a587..e7a9d15ce5f 100644 --- a/PWGMM/Mult/Tasks/dndeta-hi.cxx +++ b/PWGMM/Mult/Tasks/dndeta-hi.cxx @@ -150,18 +150,18 @@ AxisSpec DCAAxis = {601, -3.01, 3.01, "", "DCA axis"}; AxisSpec EtaAxis = {80, -4.0, 4.0, "#eta", "eta axis"}; AxisSpec V0EtaAxis = {20, -1.0, 1.0, "#etav0", "eta axis"}; AxisSpec PhiAxis = {629, 0, 2 * M_PI, "Rad", "phi axis"}; -AxisSpec PtVarAxis = {kPtVarend - 1, kPtVarbegin + 0.5, kPtVarend - 0.5, "", "ptvar axis"}; -AxisSpec EvtClassAxis = {kECend - 1, kECbegin + 0.5, kECend - 0.5, "", "event class"}; -AxisSpec TrigClassAxis = {kTrigend - 1, kTrigbegin + 0.5, kTrigend - 0.5, "", "trigger class"}; -AxisSpec ParticleTypeAxis = {kParTypeend - 1, kParTypebegin + 0.5, kParTypeend - 0.5, "", "Particle type"}; +AxisSpec PtVarAxis = {kPtVarend - 1, +kPtVarbegin + 0.5, +kPtVarend - 0.5, "", "ptvar axis"}; +AxisSpec EvtClassAxis = {kECend - 1, +kECbegin + 0.5, +kECend - 0.5, "", "event class"}; +AxisSpec TrigClassAxis = {kTrigend - 1, +kTrigbegin + 0.5, +kTrigend - 0.5, "", "trigger class"}; +AxisSpec ParticleTypeAxis = {kParTypeend - 1, +kParTypebegin + 0.5, +kParTypeend - 0.5, "", "Particle type"}; std::vector centBinningPbPb = {0, 1, 2, 3, 4, 5, 10, 20, 30, 40, 50, 60, 70, 80, 100}; std::vector centBinning = {0., 0.01, 0.1, 1.0, 5.0, 10., 15, 20., 25, 30., 35., 40., 45., 50., 70., 100.0}; AxisSpec CentAxis = {centBinning, "", "centrality"}; AxisSpec CentAxisPbPb = {centBinningPbPb, "", "centrality"}; -AxisSpec SpeciesAxis = {kSpeciesend - 1, kSpeciesbegin + 0.5, kSpeciesend - 0.5, "", "species class"}; +AxisSpec SpeciesAxis = {kSpeciesend - 1, +kSpeciesbegin + 0.5, +kSpeciesend - 0.5, "", "species class"}; AxisSpec MassAxis = {600, 0.3f, 1.3f, "Mass (GeV/c^{2})", "Inv. Mass (GeV/c^{2})"}; -AxisSpec SignAxis = {kSignend - 1, kSignbegin + 0.5, kSignend - 0.5, "", "sign"}; -AxisSpec StepAxis = {kStepend - 1, kStepbegin + 0.5, kStepend - 0.5, "", "step"}; +AxisSpec SignAxis = {kSignend - 1, +kSignbegin + 0.5, +kSignend - 0.5, "", "sign"}; +AxisSpec StepAxis = {kStepend - 1, +kStepbegin + 0.5, +kStepend - 0.5, "", "step"}; AxisSpec testAxis = {101, -0.5, 100.5, "", "test"}; AxisSpec multAxis = {1001, -0.5, 1000.5, "", "Ntrks"}; AxisSpec StatusCodeAxis = {3, -1.5, 2.5, "", "StatusCode"}; @@ -285,7 +285,7 @@ struct MultiplicityCounter { { std::vector::iterator> cols; for (auto& bc : bcs) { - if (!useEvSel || (bc.selection_bit(o2::aod::evsel::kIsBBT0A) & + if (!useEvSel || (bc.selection_bit(o2::aod::evsel::kIsBBT0A) && bc.selection_bit(o2::aod::evsel::kIsBBT0C)) != 0) { registry.fill(HIST("Selection"), 5.); cols.clear(); @@ -462,13 +462,13 @@ struct MultiplicityCounter { if constexpr (MyCollisionsCent::template contains()) cent = collision.centFT0M(); - auto Ntrk_rec = 0; - auto trackspart = tracks.sliceByCached(aod::track::collisionId, collision.globalIndex(), cache); - for (auto& track : trackspart) { - if (std::abs(track.eta()) < 1) { - Ntrk_rec++; - } - } + // auto Ntrk_rec = 0; + // auto trackspart = tracks.sliceByCached(aod::track::collisionId, collision.globalIndex(), cache); + // for (auto& track : trackspart) { + // if (std::abs(track.eta()) < 1) { + // Ntrk_rec++; + // } + // } } } } @@ -529,13 +529,13 @@ struct MultiplicityCounter { } else { if constexpr (MyCollisionsCent::template contains()) cent = collision.centFT0M(); - auto Ntrk_rec = 0; - auto trackspart = tracks.sliceByCached(aod::track::collisionId, collision.globalIndex(), cache); - for (auto& track : trackspart) { - if (std::abs(track.eta()) < 1) { - Ntrk_rec++; - } - } + // auto Ntrk_rec = 0; + // auto trackspart = tracks.sliceByCached(aod::track::collisionId, collision.globalIndex(), cache); + // for (auto& track : trackspart) { + // if (std::abs(track.eta()) < 1) { + // Ntrk_rec++; + // } + // } } Bool_1d btrigc(kTrigend, false); diff --git a/PWGMM/Mult/Tasks/dndeta-mft.cxx b/PWGMM/Mult/Tasks/dndeta-mft.cxx index 65dd38b7ea6..b69458d3d34 100644 --- a/PWGMM/Mult/Tasks/dndeta-mft.cxx +++ b/PWGMM/Mult/Tasks/dndeta-mft.cxx @@ -315,7 +315,7 @@ struct PseudorapidityDensityMFT { std::vector::iterator> cols; for (auto& bc : bcs) { if (!useEvSel || - (useEvSel && ((bc.selection_bit(aod::evsel::kIsBBT0A) & + (useEvSel && ((bc.selection_bit(aod::evsel::kIsBBT0A) && bc.selection_bit(aod::evsel::kIsBBT0C)) != 0))) { registry.fill(HIST("EventSelection"), 5.); cols.clear(); diff --git a/PWGMM/Mult/Tasks/dndeta.cxx b/PWGMM/Mult/Tasks/dndeta.cxx index d57b29851e4..0ed4939f9db 100644 --- a/PWGMM/Mult/Tasks/dndeta.cxx +++ b/PWGMM/Mult/Tasks/dndeta.cxx @@ -221,8 +221,6 @@ struct MultiplicityCounter { binnedRegistry.add({PtEtaGen.data(), " ; p_{T} (GeV/c) ; #eta; centrality", {HistType::kTHnSparseF, {PtAxis, EtaAxis, CentAxis}}}); binnedRegistry.add({PhiEtaGen.data(), "; #varphi; #eta; tracks", {HistType::kTHnSparseF, {PhiAxis, EtaAxis, CentAxis}}}); - binnedRegistry.add({PhiEtaGenDuplicates.data(), "; #varphi; #eta; centrality", {HistType::kTHnSparseF, {PhiAxis, EtaAxis, CentAxis}}}); - binnedRegistry.add({PhiEtaDuplicates.data(), "; #varphi; #eta; centrality", {HistType::kTHnSparseF, {PhiAxis, EtaAxis, CentAxis}}}); binnedRegistry.add({Efficiency.data(), "; status; centrality; events", {HistType::kTH2F, {{static_cast(EvEffBins::kSelectedPVgt0), 0.5, static_cast(EvEffBins::kSelectedPVgt0) + 0.5}, CentAxis}}}); binnedRegistry.add({NotFoundZvtx.data(), " ; Z_{vtx} (cm); centrality; events", {HistType::kTH2F, {ZAxis, CentAxis}}}); @@ -781,7 +779,7 @@ struct MultiplicityCounter { if constexpr (hasRecoCent()) { binnedRegistry.fill(HIST(PtGenIdxNoEtaCut), particle.pt(), c_gen); if (std::abs(particle.eta()) < estimatorEta) { - binnedRegistry.fill(HIST(PtGenIdx), particle.pt()); + binnedRegistry.fill(HIST(PtGenIdx), particle.pt(), c_gen); if (particle.pdgCode() == speciesIds[0]) { binnedRegistry.fill(HIST(prefix) + HIST(species[0]) + HIST(PtGenIdxSuff), particle.pt(), c_gen); } else if (particle.pdgCode() == speciesIds[1]) { diff --git a/PWGMM/Mult/Tasks/vertexing-fwd.cxx b/PWGMM/Mult/Tasks/vertexing-fwd.cxx index 51ed8cb7a5b..aecb9e7cd9c 100644 --- a/PWGMM/Mult/Tasks/vertexing-fwd.cxx +++ b/PWGMM/Mult/Tasks/vertexing-fwd.cxx @@ -133,8 +133,8 @@ struct vertexingfwd { // initCCDB(bcs.begin()); if Bz is needed ambTrackIds.clear(); - float dcaXY; - float bestDCA, bestDCAX, bestDCAY; + float dcaXY = 0.f; + float bestDCA = 0.f, bestDCAX = 0.f, bestDCAY = 0.f; o2::track::TrackParCovFwd bestTrackPar; for (auto& atrack : atracks) { @@ -238,8 +238,7 @@ struct vertexingfwd { if (collOrig.mcCollisionId() == mcCollID) { // initially correctly assigned registry.fill(HIST("AmbiguousTrackStatus"), 5); } - } else // the track has a collision and track.collisionId() == bestCol - { + } else { // the track has a collision and track.collisionId() == bestCol if (track.collisionId() != bestCol) { printf("------------------- PROBLEM HERE track.collisionId() %d, bestCollid %d\n", track.collisionId(), bestCol); } diff --git a/PWGUD/AQC/udQCmidRap.cxx b/PWGUD/AQC/udQCmidRap.cxx index fd53a5f42d3..744e59a12e7 100644 --- a/PWGUD/AQC/udQCmidRap.cxx +++ b/PWGUD/AQC/udQCmidRap.cxx @@ -152,7 +152,7 @@ struct UDQCmid { // bool goodetas = true; // bool goodpts = true; bool ispipiCand = false; - auto netCharge = 0; + // auto netCharge = 0; auto lvtmp = TLorentzVector(); auto ivm = TLorentzVector(); if (isDGcandidate) { @@ -183,7 +183,7 @@ struct UDQCmid { if (track.eta() <= diffCuts.minEta() || track.eta() >= diffCuts.maxEta()) { goodetas = false; }*/ - netCharge += track.sign(); + // netCharge += track.sign(); ivm += lvtmp; } diff --git a/PWGUD/TableProducer/DGBCCandProducer.cxx b/PWGUD/TableProducer/DGBCCandProducer.cxx index 1df6ba9b91b..b98d13bd150 100644 --- a/PWGUD/TableProducer/DGBCCandProducer.cxx +++ b/PWGUD/TableProducer/DGBCCandProducer.cxx @@ -536,7 +536,7 @@ struct DGBCCandProducer { } // run over all BC in bcs and tibcs - int64_t lastCollision = 0; + // int64_t lastCollision = 0; float vpos[3]; upchelpers::FITInfo fitInfo{}; auto col = collisions.iteratorAt(0); @@ -596,7 +596,7 @@ struct DGBCCandProducer { if (withCollision) { // -> vertex position: col.[posX(), posY(), posZ()] SETBIT(bcFlag, 2); - lastCollision = col.globalIndex(); + // lastCollision = col.globalIndex(); ntr1 = col.numContrib(); auto bcRange = udhelpers::compatibleBCs(bc, bcnum, diffCuts.minNBCs(), bcs); diff --git a/dependencies/O2PhysicsCompileFlags.cmake b/dependencies/O2PhysicsCompileFlags.cmake index 9226f5e63d8..c29d8c4a996 100644 --- a/dependencies/O2PhysicsCompileFlags.cmake +++ b/dependencies/O2PhysicsCompileFlags.cmake @@ -11,7 +11,13 @@ include_guard() -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wno-error -Werror=unused-variable") +set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wno-error \ +-Werror=deprecated-enum-float-conversion \ +-Werror=narrowing \ +-Werror=parentheses \ +-Werror=return-type \ +-Werror=uninitialized \ +-Werror=unused") IF (ENABLE_TIMETRACE) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -ftime-trace")