Skip to content

Commit 27e9d4b

Browse files
committed
Add gain eq to FIT for the long range correlations
1 parent 4bc7f94 commit 27e9d4b

File tree

1 file changed

+41
-2
lines changed

1 file changed

+41
-2
lines changed

PWGCF/TwoParticleCorrelations/Tasks/longRangeDihadronCor.cxx

Lines changed: 41 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"
@@ -149,7 +149,12 @@ struct LongRangeDihadronCor {
149149
ConfigurableAxis axisPtEfficiency{"axisPtEfficiency", {VARIABLE_WIDTH, 0.2, 0.5, 1, 1.5, 2, 3, 4, 6, 10}, "pt axis for efficiency histograms"};
150150
ConfigurableAxis axisAmplitudeFt0a{"axisAmplitudeFt0a", {5000, 0, 1000}, "FT0A amplitude"};
151151
ConfigurableAxis axisChannelFt0aAxis{"axisChannelFt0aAxis", {96, 0.0, 96.0}, "FT0A channel"};
152-
152+
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);
155160
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);
@@ -159,6 +164,7 @@ struct LongRangeDihadronCor {
159164
// FT0 geometry
160165
o2::ft0::Geometry ft0Det;
161166
std::vector<o2::detectors::AlignParam>* offsetFT0;
167+
std::vector<float> FT0RelGainConst{};
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,30 @@ struct LongRangeDihadronCor {
354362
}
355363
}
356364

365+
void loadGain(aod::BCsWithTimestamps::iterator const& bc) {
366+
FT0RelGainConst.clear();
367+
FT0RelGainConst = {};
368+
std::string fullPath;
369+
370+
auto timestamp = bc.timestamp();
371+
if (cfgCorrLevel==0) {
372+
for (auto i{0u}; i < 208; i++) {
373+
FT0RelGainConst.push_back(1.);
374+
}
375+
} else {
376+
fullPath = cfgGainEqPath;
377+
fullPath += "/FT0";
378+
const auto objft0Gain = ccdb->getForTimeStamp<std::vector<float>>(fullPath, timestamp);
379+
if (!objft0Gain) {
380+
for (auto i{0u}; i < 208; i++) {
381+
FT0RelGainConst.push_back(1.);
382+
}
383+
} else {
384+
FT0RelGainConst = *(objft0Gain);
385+
}
386+
}
387+
}
388+
357389
void loadCorrection(uint64_t timestamp)
358390
{
359391
if (correctionsLoaded) {
@@ -434,15 +466,21 @@ struct LongRangeDihadronCor {
434466
void getChannel(TFT0s const& ft0, std::size_t const& iCh, int& id, float& ampl)
435467
{
436468
int switchCor = cfgSwitchCor;
469+
int rID{0};
437470
if (switchCor == kFT0C) {
438471
id = ft0.channelC()[iCh];
472+
rID = id + 96;
439473
ampl = ft0.amplitudeC()[iCh];
440474
} else if (switchCor == kFT0A) {
441475
id = ft0.channelA()[iCh];
476+
rID = id;
442477
ampl = ft0.amplitudeA()[iCh];
443478
} else {
444479
LOGF(fatal, "Cor Index %d out of range", switchCor);
445480
}
481+
registry.fill(HIST("FT0Amp"), rID, ampl);
482+
ampl = ampl / FT0RelGainConst[iCh];
483+
registry.fill(HIST("FT0AmpCorr"), rID, ampl);
446484
}
447485

448486
template <CorrelationContainer::CFStep step, typename TTracks, typename TFT0s>
@@ -613,6 +651,7 @@ struct LongRangeDihadronCor {
613651
if (!collision.has_foundFT0())
614652
return;
615653
loadAlignParam(bc.timestamp());
654+
loadGain(bc);
616655
loadCorrection(bc.timestamp());
617656
if (!cfgCentTableUnavailable) {
618657
getCentralityWeight(weightCent, cent);

0 commit comments

Comments
 (0)