Skip to content

Commit f887e36

Browse files
authored
[PWGCF] Add gain eq to FIT for the long range correlations (#13009)
1 parent 57b4bff commit f887e36

File tree

1 file changed

+43
-2
lines changed

1 file changed

+43
-2
lines changed

PWGCF/TwoParticleCorrelations/Tasks/longRangeDihadronCor.cxx

Lines changed: 43 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

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

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

153+
Configurable<std::string> cfgGainEqPath{"cfgGainEqPath", "Analysis/EventPlane/GainEq", "CCDB path for gain equalization constants"};
154+
Configurable<int> cfgCorrLevel{"cfgCorrLevel", 1, "calibration step: 0 = no corr, 1 = gain corr"};
155+
ConfigurableAxis cfgaxisFITamp{"cfgaxisFITamp", {1000, 0, 5000}, ""};
156+
AxisSpec axisFit{cfgaxisFITamp, "fit amplitude"};
157+
AxisSpec axisChID = {220, 0, 220};
153158
// make the filters and cuts.
154159
Filter collisionFilter = (nabs(aod::collision::posZ) < cfgCutVtxZ);
155-
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);
160+
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);
156161
using FilteredCollisions = soa::Filtered<soa::Join<aod::Collisions, aod::EvSel, aod::CentFT0Cs, aod::CentFT0CVariant1s, aod::CentFT0Ms, aod::CentFV0As, aod::Mults>>;
157162
using FilteredTracks = soa::Filtered<soa::Join<aod::Tracks, aod::TrackSelection, aod::TracksExtra, aod::TracksDCA>>;
158163

159164
// FT0 geometry
160165
o2::ft0::Geometry ft0Det;
161166
std::vector<o2::detectors::AlignParam>* offsetFT0;
167+
std::vector<float> cstFT0RelGain{};
162168

163169
// Corrections
164170
TH3D* mEfficiency = nullptr;
@@ -272,6 +278,8 @@ struct LongRangeDihadronCor {
272278
registry.add("Trig_hist", "", {HistType::kTHnSparseF, {{axisSample, axisVertex, axisPtTrigger}}});
273279
registry.add("Assoc_amp_same", "", {HistType::kTH2D, {axisChannelFt0aAxis, axisAmplitudeFt0a}});
274280
registry.add("Assoc_amp_mixed", "", {HistType::kTH2D, {axisChannelFt0aAxis, axisAmplitudeFt0a}});
281+
registry.add("FT0Amp", "", {HistType::kTH2F, {axisChID, axisFit}});
282+
registry.add("FT0AmpCorr", "", {HistType::kTH2F, {axisChID, axisFit}});
275283
}
276284

277285
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 {
354362
}
355363
}
356364

365+
void loadGain(aod::BCsWithTimestamps::iterator const& bc)
366+
{
367+
cstFT0RelGain.clear();
368+
cstFT0RelGain = {};
369+
std::string fullPath;
370+
371+
auto timestamp = bc.timestamp();
372+
constexpr int ChannelsFT0 = 208;
373+
if (cfgCorrLevel == 0) {
374+
for (auto i{0u}; i < ChannelsFT0; i++) {
375+
cstFT0RelGain.push_back(1.);
376+
}
377+
} else {
378+
fullPath = cfgGainEqPath;
379+
fullPath += "/FT0";
380+
const auto objft0Gain = ccdb->getForTimeStamp<std::vector<float>>(fullPath, timestamp);
381+
if (!objft0Gain) {
382+
for (auto i{0u}; i < ChannelsFT0; i++) {
383+
cstFT0RelGain.push_back(1.);
384+
}
385+
} else {
386+
cstFT0RelGain = *(objft0Gain);
387+
}
388+
}
389+
}
390+
357391
void loadCorrection(uint64_t timestamp)
358392
{
359393
if (correctionsLoaded) {
@@ -434,15 +468,21 @@ struct LongRangeDihadronCor {
434468
void getChannel(TFT0s const& ft0, std::size_t const& iCh, int& id, float& ampl)
435469
{
436470
int switchCor = cfgSwitchCor;
471+
int rID{0};
437472
if (switchCor == kFT0C) {
438473
id = ft0.channelC()[iCh];
474+
rID = id + 96;
439475
ampl = ft0.amplitudeC()[iCh];
440476
} else if (switchCor == kFT0A) {
441477
id = ft0.channelA()[iCh];
478+
rID = id;
442479
ampl = ft0.amplitudeA()[iCh];
443480
} else {
444481
LOGF(fatal, "Cor Index %d out of range", switchCor);
445482
}
483+
registry.fill(HIST("FT0Amp"), rID, ampl);
484+
ampl = ampl / cstFT0RelGain[iCh];
485+
registry.fill(HIST("FT0AmpCorr"), rID, ampl);
446486
}
447487

448488
template <CorrelationContainer::CFStep step, typename TTracks, typename TFT0s>
@@ -613,6 +653,7 @@ struct LongRangeDihadronCor {
613653
if (!collision.has_foundFT0())
614654
return;
615655
loadAlignParam(bc.timestamp());
656+
loadGain(bc);
616657
loadCorrection(bc.timestamp());
617658
if (!cfgCentTableUnavailable) {
618659
getCentralityWeight(weightCent, cent);

0 commit comments

Comments
 (0)