Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 14 additions & 10 deletions PWGCF/TableProducer/dptDptFilter.h
Original file line number Diff line number Diff line change
Expand Up @@ -554,6 +554,10 @@ int tracktype = 1;
std::vector<DptDptTrackSelection*> 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);
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -1107,7 +1111,7 @@ template <typename CollisionObject>
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
Expand Down Expand Up @@ -1280,7 +1284,7 @@ template <typename CollisionObject>
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
Expand Down Expand Up @@ -1396,7 +1400,7 @@ template <typename CollisionObject>
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
Expand Down Expand Up @@ -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 */
Expand All @@ -1570,15 +1574,15 @@ struct TpcExcludeTrack {
} else {
return true;
}
} break;
}
case kDYNAMIC: {
float phiInTpcSector = std::fmod(track.phi(), TpcPhiSectorWidth);
if (track.sign() > 0) {
return (phiInTpcSector < positiveUpCut->Eval(track.pt())) && (positiveLowCut->Eval(track.pt()) < phiInTpcSector);
} else {
return (phiInTpcSector < negativeUpCut->Eval(track.pt())) && (negativeLowCut->Eval(track.pt()) < phiInTpcSector);
}
} break;
}
default:
return false;
}
Expand Down Expand Up @@ -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]) {
Expand Down Expand Up @@ -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) {
Expand Down
16 changes: 9 additions & 7 deletions PWGCF/Tasks/dptDptCorrelations.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ struct DptDptCorrelations {
// The DptDptCorrelationsAnalysisTask output objects
//============================================================================================
/* histograms */
TH1F* fhVertexZA; //!<! the z vertex distribution for the current multiplicity/centrality class
TH1F* fhVertexZA = nullptr; //!<! the z vertex distribution for the current multiplicity/centrality class
std::vector<TH1F*> fhN1VsPt{nch, nullptr}; //!<! weighted single particle distribution vs \f$p_T\f$, for the different species
std::vector<TH2F*> fhN1VsPtEta{nch, nullptr}; //!<! weighted single particle distribution vs \f$p_T,\;\eta\f$, for the different species
std::vector<TH2F*> fhN1VsEtaPhi{nch, nullptr}; //!<! weighted single particle distribution vs \f$\eta,\;\phi\f$, for the different species
Expand Down Expand Up @@ -352,7 +352,7 @@ struct DptDptCorrelations {
ccdbstored = true;
}

void storePtAverages(std::vector<TH2*> ptavgs)
void storePtAverages(const std::vector<TH2*>& ptavgs)
{
LOGF(info, "Stored pT average for %d track ids", ptavgs.size());
for (uint i = 0; i < ptavgs.size(); ++i) {
Expand Down Expand Up @@ -905,9 +905,9 @@ struct DptDptCorrelations {
float* fCentMultMax = nullptr;

/* the data collecting engine instances */
DataCollectingEngine<false>** dataCE;
DataCollectingEngine<true>** dataCEsmall;
DataCollectingEngine<false>** dataCEME;
DataCollectingEngine<false>** dataCE = nullptr;
DataCollectingEngine<true>** dataCEsmall = nullptr;
DataCollectingEngine<false>** dataCEME = nullptr;

/* the input file structure from CCDB */
TList* ccdblst = nullptr;
Expand Down Expand Up @@ -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 {
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -1621,6 +1622,7 @@ struct DptDptCorrelations {
collision2.posZ(),
collision2.centmult(),
collision2.collisionaccepted() ? "accepted" : "not accepted");
logcomb++;
}
if (!collision1.collisionaccepted() || !collision2.collisionaccepted()) {
LOGF(error,
Expand Down
34 changes: 15 additions & 19 deletions PWGCF/TwoParticleCorrelations/Tasks/dptDptEfficiencyAndQc.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -514,23 +514,23 @@ 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);
}
};
std::vector<float> tPt = {track.pt(), mcparticle.pt()};
std::vector<float> 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);
}
}
}
Expand Down Expand Up @@ -879,13 +879,10 @@ struct PidExtraDataCollectingEngine {
/* only after track selection */
std::vector<std::shared_ptr<TH2>> fhIdTPCdEdxSignalVsP{nsp, nullptr};
std::vector<std::shared_ptr<TProfile2D>> fpIdTPCdEdxSignalVsPSigmas{nsp, nullptr};
std::vector<std::vector<std::shared_ptr<TH2>>> fhIdTPCdEdxSignalDiffVsP{nsp, {nmainsp, nullptr}};
std::vector<std::vector<std::shared_ptr<TH2>>> fhIdTPCnSigmasVsP{nsp, {nallmainsp, nullptr}};
std::vector<std::shared_ptr<TH2>> fhIdTOFSignalVsP{nsp, nullptr};
std::vector<std::shared_ptr<TProfile2D>> fpIdTOFSignalVsPSigmas{nsp, nullptr};
std::vector<std::vector<std::shared_ptr<TH2>>> fhIdTOFSignalDiffVsP{nsp, {nmainsp, nullptr}};
std::vector<std::vector<std::shared_ptr<TH2>>> fhIdTOFnSigmasVsP{nsp, {nallmainsp, nullptr}};
std::vector<std::shared_ptr<TH2>> fhIdPvsTOFSqMass{nsp, nullptr};

template <efficiencyandqatask::KindOfData kindOfData>
void init(HistogramRegistry& registry, const char* dirname)
Expand Down Expand Up @@ -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};
Expand Down Expand Up @@ -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!");
}
Expand Down Expand Up @@ -1434,7 +1430,7 @@ using BCsWithTimestamps = soa::Join<aod::BCs, aod::Timestamps>;
struct CheckTimestamp {

o2::ccdb::CcdbApi ccdbApi;
int mRunNumber;
int mRunNumber = 0;
uint64_t runsor = 0;
uint64_t runeor = 0;
std::shared_ptr<TH2> hTimeStampDiffNegative = nullptr;
Expand Down
Loading