diff --git a/PWGCF/TableProducer/dptDptFilter.h b/PWGCF/TableProducer/dptDptFilter.h index af632d74ae6..879b8092209 100644 --- a/PWGCF/TableProducer/dptDptFilter.h +++ b/PWGCF/TableProducer/dptDptFilter.h @@ -554,6 +554,10 @@ int tracktype = 1; std::vector trackFilters = {}; // the vector of track selectors struct DptDptTrackSelection { + /* disable copying and assignment explicitly */ + DptDptTrackSelection(const DptDptTrackSelection&) = delete; + DptDptTrackSelection& operator=(const DptDptTrackSelection&) = delete; + DptDptTrackSelection(TrackSelection* stdTs, TList* outputList, const char* name) : stdTrackSelection(stdTs) { passedHistogram = new TH1F(name, name, ptbins, ptlow, ptup); @@ -836,7 +840,7 @@ float particleMaxDCAxy = 999.9f; float particleMaxDCAZ = 999.9f; bool traceCollId0 = false; -inline TList* getCCDBInput(auto& ccdb, const char* ccdbpath, const char* ccdbdate, bool periodInPath = false, const std::string& suffix = "") +inline TList* getCCDBInput(const auto& ccdb, const char* ccdbpath, const char* ccdbdate, bool periodInPath = false, const std::string& suffix = "") { std::tm cfgtm = {}; std::stringstream ss(ccdbdate); @@ -1107,7 +1111,7 @@ template inline bool triggerSelection(CollisionObject const&) { LOGF(fatal, "Trigger selection not implemented for this kind of collisions"); - return false; + return true; } /// \brief Trigger selection for reconstructed collision tables without centrality/multiplicity @@ -1280,7 +1284,7 @@ template inline bool centralitySelection(CollisionObject const&, float&) { LOGF(fatal, "Centrality selection not implemented for this kind of collisions"); - return false; + return true; } /// \brief Centrality selection for reconstructed and detector level collision tables with centrality/multiplicity information @@ -1396,7 +1400,7 @@ template inline bool occupancySelection(CollisionObject const&) { LOGF(fatal, "Occupancy selection not implemented for this kind of collisions"); - return false; + return true; } /// \brief Occupancy selection for reconstructed and detector level collision tables with centrality/multiplicity information @@ -1561,7 +1565,7 @@ struct TpcExcludeTrack { switch (method) { case kNOEXCLUSION: { return false; - } break; + } case kSTATIC: { int phiBinIx = getPhiBinIx(track); /* bins multiple of four have got sector border */ @@ -1570,7 +1574,7 @@ struct TpcExcludeTrack { } else { return true; } - } break; + } case kDYNAMIC: { float phiInTpcSector = std::fmod(track.phi(), TpcPhiSectorWidth); if (track.sign() > 0) { @@ -1578,7 +1582,7 @@ struct TpcExcludeTrack { } else { return (phiInTpcSector < negativeUpCut->Eval(track.pt())) && (negativeLowCut->Eval(track.pt()) < phiInTpcSector); } - } break; + } default: return false; } @@ -1836,14 +1840,14 @@ struct PIDSpeciesSelection { /* out debug if needed */ outnsigmasdebug(); - auto closeTo = [](auto& values, auto& mindet, auto& maxdet, uint8_t sp) { + auto closeTo = [](const auto& values, const auto& mindet, const auto& maxdet, uint8_t sp) { if (mindet[sp] <= values[sp] && values[sp] < maxdet[sp]) { return true; } else { return false; } }; - auto awayFrom = [&](auto& values, auto& mindet, auto& maxdet, uint8_t sp) { + auto awayFrom = [&](const auto& values, const auto& mindet, const auto& maxdet, uint8_t sp) { for (size_t ix = 0; ix < pdgcodes.size(); ix++) { if (ix != sp) { if (mindet[ix] <= values[ix] && values[ix] < maxdet[ix]) { @@ -1889,7 +1893,7 @@ struct PIDSpeciesSelection { } return true; }; - auto aboveThreshold = [&](auto& config) { + auto aboveThreshold = [&](const auto& config) { return ((config->mPThreshold > 0.0) && (config->mPThreshold < track.p())); }; auto isA = [&](auto& config, uint8_t sp) { diff --git a/PWGCF/Tasks/dptDptCorrelations.cxx b/PWGCF/Tasks/dptDptCorrelations.cxx index 7da4997b702..99602575f1d 100644 --- a/PWGCF/Tasks/dptDptCorrelations.cxx +++ b/PWGCF/Tasks/dptDptCorrelations.cxx @@ -112,7 +112,7 @@ struct DptDptCorrelations { // The DptDptCorrelationsAnalysisTask output objects //============================================================================================ /* histograms */ - TH1F* fhVertexZA; //! fhN1VsPt{nch, nullptr}; //! fhN1VsPtEta{nch, nullptr}; //! fhN1VsEtaPhi{nch, nullptr}; //! ptavgs) + void storePtAverages(const std::vector& ptavgs) { LOGF(info, "Stored pT average for %d track ids", ptavgs.size()); for (uint i = 0; i < ptavgs.size(); ++i) { @@ -905,9 +905,9 @@ struct DptDptCorrelations { float* fCentMultMax = nullptr; /* the data collecting engine instances */ - DataCollectingEngine** dataCE; - DataCollectingEngine** dataCEsmall; - DataCollectingEngine** dataCEME; + DataCollectingEngine** dataCE = nullptr; + DataCollectingEngine** dataCEsmall = nullptr; + DataCollectingEngine** dataCEME = nullptr; /* the input file structure from CCDB */ TList* ccdblst = nullptr; @@ -1248,14 +1248,14 @@ struct DptDptCorrelations { return dataCE[ixDCE]->isCCDBstored(); } }; - auto storePtAverages = [&](auto& ptavgs) { + auto storePtAverages = [&](const auto& ptavgs) { if (cfgSmallDCE.value) { dataCEsmall[ixDCE]->storePtAverages(ptavgs); } else { dataCE[ixDCE]->storePtAverages(ptavgs); } }; - auto storeTrackCorrections = [&](auto& corrs) { + auto storeTrackCorrections = [&](const auto& corrs) { if (cfgSmallDCE.value) { dataCEsmall[ixDCE]->storeTrackCorrections(corrs); } else { @@ -1583,6 +1583,7 @@ struct DptDptCorrelations { LOGF(DPTDPTLOGCOLLISIONS, "Received generated collision pair: %ld (%f, %f): %s, %ld (%f, %f): %s", collision1.globalIndex(), collision1.posZ(), collision1.centmult(), collision1.collisionaccepted() ? "accepted" : "not accepted", collision2.globalIndex(), collision2.posZ(), collision2.centmult(), collision2.collisionaccepted() ? "accepted" : "not accepted"); + logcomb++; } if (!collision1.collisionaccepted() || !collision2.collisionaccepted()) { LOGF(error, "Received collision pair: %ld (%f, %f): %s, %ld (%f, %f): %s", @@ -1621,6 +1622,7 @@ struct DptDptCorrelations { collision2.posZ(), collision2.centmult(), collision2.collisionaccepted() ? "accepted" : "not accepted"); + logcomb++; } if (!collision1.collisionaccepted() || !collision2.collisionaccepted()) { LOGF(error, diff --git a/PWGCF/TwoParticleCorrelations/Tasks/dptDptEfficiencyAndQc.cxx b/PWGCF/TwoParticleCorrelations/Tasks/dptDptEfficiencyAndQc.cxx index e084e4dfd33..a531df7a4c7 100644 --- a/PWGCF/TwoParticleCorrelations/Tasks/dptDptEfficiencyAndQc.cxx +++ b/PWGCF/TwoParticleCorrelations/Tasks/dptDptEfficiencyAndQc.cxx @@ -514,7 +514,7 @@ struct QADataCollectingEngine { fhTruePvsP->Fill(track.p(), mcparticle.p()); fhTruePvsInnerP->Fill(track.tpcInnerParam(), mcparticle.p()); - auto fillhisto = [](auto& h, float pt, float eta, bool cond1, bool cond2) { + auto fillmchisto = [](auto& h, float pt, float eta, bool cond1, bool cond2) { if (cond1 && cond2) { h->Fill(eta, pt); } @@ -522,15 +522,15 @@ struct QADataCollectingEngine { std::vector tPt = {track.pt(), mcparticle.pt()}; std::vector tEta = {track.eta(), mcparticle.eta()}; for (uint ix = 0; ix < tPt.size(); ++ix) { - fillhisto(fhPtVsEtaPrimItsA[ix][track.trackacceptedid()], tPt[ix], tEta[ix], hasits, isprimary); - fillhisto(fhPtVsEtaPrimItsTpcA[ix][track.trackacceptedid()], tPt[ix], tEta[ix], hasits && hastpc, isprimary); - fillhisto(fhPtVsEtaPrimItsTpcTofA[ix][track.trackacceptedid()], tPt[ix], tEta[ix], hasits && hastof, isprimary); - fillhisto(fhPtVsEtaSecItsA[ix][track.trackacceptedid()], tPt[ix], tEta[ix], hasits, issecdecay); - fillhisto(fhPtVsEtaSecItsTpcA[ix][track.trackacceptedid()], tPt[ix], tEta[ix], hasits && hastpc, issecdecay); - fillhisto(fhPtVsEtaSecItsTpcTofA[ix][track.trackacceptedid()], tPt[ix], tEta[ix], hasits && hastof, issecdecay); - fillhisto(fhPtVsEtaMatItsA[ix][track.trackacceptedid()], tPt[ix], tEta[ix], hasits, isfrommaterial); - fillhisto(fhPtVsEtaMatItsTpcA[ix][track.trackacceptedid()], tPt[ix], tEta[ix], hasits && hastpc, isfrommaterial); - fillhisto(fhPtVsEtaMatItsTpcTofA[ix][track.trackacceptedid()], tPt[ix], tEta[ix], hasits && hastof, isfrommaterial); + fillmchisto(fhPtVsEtaPrimItsA[ix][track.trackacceptedid()], tPt[ix], tEta[ix], hasits, isprimary); + fillmchisto(fhPtVsEtaPrimItsTpcA[ix][track.trackacceptedid()], tPt[ix], tEta[ix], hasits && hastpc, isprimary); + fillmchisto(fhPtVsEtaPrimItsTpcTofA[ix][track.trackacceptedid()], tPt[ix], tEta[ix], hasits && hastof, isprimary); + fillmchisto(fhPtVsEtaSecItsA[ix][track.trackacceptedid()], tPt[ix], tEta[ix], hasits, issecdecay); + fillmchisto(fhPtVsEtaSecItsTpcA[ix][track.trackacceptedid()], tPt[ix], tEta[ix], hasits && hastpc, issecdecay); + fillmchisto(fhPtVsEtaSecItsTpcTofA[ix][track.trackacceptedid()], tPt[ix], tEta[ix], hasits && hastof, issecdecay); + fillmchisto(fhPtVsEtaMatItsA[ix][track.trackacceptedid()], tPt[ix], tEta[ix], hasits, isfrommaterial); + fillmchisto(fhPtVsEtaMatItsTpcA[ix][track.trackacceptedid()], tPt[ix], tEta[ix], hasits && hastpc, isfrommaterial); + fillmchisto(fhPtVsEtaMatItsTpcTofA[ix][track.trackacceptedid()], tPt[ix], tEta[ix], hasits && hastof, isfrommaterial); } } } @@ -879,13 +879,10 @@ struct PidExtraDataCollectingEngine { /* only after track selection */ std::vector> fhIdTPCdEdxSignalVsP{nsp, nullptr}; std::vector> fpIdTPCdEdxSignalVsPSigmas{nsp, nullptr}; - std::vector>> fhIdTPCdEdxSignalDiffVsP{nsp, {nmainsp, nullptr}}; std::vector>> fhIdTPCnSigmasVsP{nsp, {nallmainsp, nullptr}}; std::vector> fhIdTOFSignalVsP{nsp, nullptr}; std::vector> fpIdTOFSignalVsPSigmas{nsp, nullptr}; - std::vector>> fhIdTOFSignalDiffVsP{nsp, {nmainsp, nullptr}}; std::vector>> fhIdTOFnSigmasVsP{nsp, {nallmainsp, nullptr}}; - std::vector> fhIdPvsTOFSqMass{nsp, nullptr}; template void init(HistogramRegistry& registry, const char* dirname) @@ -1005,10 +1002,10 @@ struct DptDptEfficiencyAndQc { float* fCentMultMax = nullptr; /* the data collecting engine instances */ - QADataCollectingEngine** qaDataCE; - QAExtraDataCollectingEngine** qaExtraDataCE; - PidDataCollectingEngine** pidDataCE; - PidExtraDataCollectingEngine** pidExtraDataCE; + QADataCollectingEngine** qaDataCE = nullptr; + QAExtraDataCollectingEngine** qaExtraDataCE = nullptr; + PidDataCollectingEngine** pidDataCE = nullptr; + PidExtraDataCollectingEngine** pidExtraDataCE = nullptr; /* the histogram registries */ HistogramRegistry registryOne{"registryOne", {}, OutputObjHandlingPolicy::AnalysisObject}; @@ -1179,7 +1176,6 @@ struct DptDptEfficiencyAndQc { if (doPidExtraAnalysis) { pidExtraDataCE = new PidExtraDataCollectingEngine*[ncmranges]; } - std::string recogen; if (ncmranges > registryBank.size()) { LOGF(fatal, "There are more centrality ranges configured than registries in the bank. Please fix it!"); } @@ -1434,7 +1430,7 @@ using BCsWithTimestamps = soa::Join; struct CheckTimestamp { o2::ccdb::CcdbApi ccdbApi; - int mRunNumber; + int mRunNumber = 0; uint64_t runsor = 0; uint64_t runeor = 0; std::shared_ptr hTimeStampDiffNegative = nullptr;