diff --git a/PWGCF/TwoParticleCorrelations/Tasks/longRangeDihadronCor.cxx b/PWGCF/TwoParticleCorrelations/Tasks/longRangeDihadronCor.cxx index ae3a3056bad..c8524d0507f 100644 --- a/PWGCF/TwoParticleCorrelations/Tasks/longRangeDihadronCor.cxx +++ b/PWGCF/TwoParticleCorrelations/Tasks/longRangeDihadronCor.cxx @@ -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" @@ -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 cfgGainEqPath{"cfgGainEqPath", "Analysis/EventPlane/GainEq", "CCDB path for gain equalization constants"}; + Configurable 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(true))) && (aod::track::tpcChi2NCl < cfgCutChi2prTPCcls) && (nabs(aod::track::dcaZ) < cfgCutDCAz); using FilteredCollisions = soa::Filtered>; using FilteredTracks = soa::Filtered>; // FT0 geometry o2::ft0::Geometry ft0Det; std::vector* offsetFT0; + std::vector cstFT0RelGain{}; // Corrections TH3D* mEfficiency = nullptr; @@ -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 @@ -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>(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) { @@ -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 @@ -613,6 +653,7 @@ struct LongRangeDihadronCor { if (!collision.has_foundFT0()) return; loadAlignParam(bc.timestamp()); + loadGain(bc); loadCorrection(bc.timestamp()); if (!cfgCentTableUnavailable) { getCentralityWeight(weightCent, cent);