Skip to content
Merged
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
45 changes: 43 additions & 2 deletions PWGCF/TwoParticleCorrelations/Tasks/longRangeDihadronCor.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

/// \file longRangeDihadronCor.cxx
/// \brief long range di-hadron correlation for O-O, Pb-Pb collisions
/// \author Zhiyong Lu (zhiyong.lu@cern.ch)
/// \author Zhiyong Lu (zhiyong.lu@cern.ch), Joachim Hansen (joachim.hansen@cern.ch)
/// \since Sep/10/2025

#include "PWGCF/Core/CorrelationContainer.h"
Expand Down Expand Up @@ -150,15 +150,21 @@ struct LongRangeDihadronCor {
ConfigurableAxis axisAmplitudeFt0a{"axisAmplitudeFt0a", {5000, 0, 1000}, "FT0A amplitude"};
ConfigurableAxis axisChannelFt0aAxis{"axisChannelFt0aAxis", {96, 0.0, 96.0}, "FT0A channel"};

Configurable<std::string> cfgGainEqPath{"cfgGainEqPath", "Analysis/EventPlane/GainEq", "CCDB path for gain equalization constants"};
Configurable<int> cfgCorrLevel{"cfgCorrLevel", 1, "calibration step: 0 = no corr, 1 = gain corr"};
ConfigurableAxis cfgaxisFITamp{"cfgaxisFITamp", {1000, 0, 5000}, ""};
AxisSpec axisFit{cfgaxisFITamp, "fit amplitude"};
AxisSpec axisChID = {220, 0, 220};
// make the filters and cuts.
Filter collisionFilter = (nabs(aod::collision::posZ) < cfgCutVtxZ);
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) && (nabs(aod::track::dcaZ) < cfgCutDCAz);
Filter trackFilter = (nabs(aod::track::eta) < cfgCutEta) && (aod::track::pt > cfgCutPtMin) && (aod::track::pt < cfgCutPtMax) && ((requireGlobalTrackInFilter()) || (aod::track::isGlobalTrackSDD == static_cast<uint8_t>(true))) && (aod::track::tpcChi2NCl < cfgCutChi2prTPCcls) && (nabs(aod::track::dcaZ) < cfgCutDCAz);
using FilteredCollisions = soa::Filtered<soa::Join<aod::Collisions, aod::EvSel, aod::CentFT0Cs, aod::CentFT0CVariant1s, aod::CentFT0Ms, aod::CentFV0As, aod::Mults>>;
using FilteredTracks = soa::Filtered<soa::Join<aod::Tracks, aod::TrackSelection, aod::TracksExtra, aod::TracksDCA>>;

// FT0 geometry
o2::ft0::Geometry ft0Det;
std::vector<o2::detectors::AlignParam>* offsetFT0;
std::vector<float> cstFT0RelGain{};

// Corrections
TH3D* mEfficiency = nullptr;
Expand Down Expand Up @@ -272,6 +278,8 @@ struct LongRangeDihadronCor {
registry.add("Trig_hist", "", {HistType::kTHnSparseF, {{axisSample, axisVertex, axisPtTrigger}}});
registry.add("Assoc_amp_same", "", {HistType::kTH2D, {axisChannelFt0aAxis, axisAmplitudeFt0a}});
registry.add("Assoc_amp_mixed", "", {HistType::kTH2D, {axisChannelFt0aAxis, axisAmplitudeFt0a}});
registry.add("FT0Amp", "", {HistType::kTH2F, {axisChID, axisFit}});
registry.add("FT0AmpCorr", "", {HistType::kTH2F, {axisChID, axisFit}});
}

registry.add("eventcount", "bin", {HistType::kTH1F, {{4, 0, 4, "bin"}}}); // histogram to see how many events are in the same and mixed event
Expand Down Expand Up @@ -354,6 +362,32 @@ struct LongRangeDihadronCor {
}
}

void loadGain(aod::BCsWithTimestamps::iterator const& bc)
{
cstFT0RelGain.clear();
cstFT0RelGain = {};
std::string fullPath;

auto timestamp = bc.timestamp();
constexpr int ChannelsFT0 = 208;
if (cfgCorrLevel == 0) {
for (auto i{0u}; i < ChannelsFT0; i++) {
cstFT0RelGain.push_back(1.);
}
} else {
fullPath = cfgGainEqPath;
fullPath += "/FT0";
const auto objft0Gain = ccdb->getForTimeStamp<std::vector<float>>(fullPath, timestamp);
if (!objft0Gain) {
for (auto i{0u}; i < ChannelsFT0; i++) {
cstFT0RelGain.push_back(1.);
}
} else {
cstFT0RelGain = *(objft0Gain);
}
}
}

void loadCorrection(uint64_t timestamp)
{
if (correctionsLoaded) {
Expand Down Expand Up @@ -434,15 +468,21 @@ struct LongRangeDihadronCor {
void getChannel(TFT0s const& ft0, std::size_t const& iCh, int& id, float& ampl)
{
int switchCor = cfgSwitchCor;
int rID{0};
if (switchCor == kFT0C) {
id = ft0.channelC()[iCh];
rID = id + 96;
ampl = ft0.amplitudeC()[iCh];
} else if (switchCor == kFT0A) {
id = ft0.channelA()[iCh];
rID = id;
ampl = ft0.amplitudeA()[iCh];
} else {
LOGF(fatal, "Cor Index %d out of range", switchCor);
}
registry.fill(HIST("FT0Amp"), rID, ampl);
ampl = ampl / cstFT0RelGain[iCh];
registry.fill(HIST("FT0AmpCorr"), rID, ampl);
}

template <CorrelationContainer::CFStep step, typename TTracks, typename TFT0s>
Expand Down Expand Up @@ -613,6 +653,7 @@ struct LongRangeDihadronCor {
if (!collision.has_foundFT0())
return;
loadAlignParam(bc.timestamp());
loadGain(bc);
loadCorrection(bc.timestamp());
if (!cfgCentTableUnavailable) {
getCentralityWeight(weightCent, cent);
Expand Down
Loading