Skip to content

Commit 51ce500

Browse files
authored
[PWGCF] JCorran updates (#9754)
1 parent f7bd203 commit 51ce500

File tree

8 files changed

+63
-32
lines changed

8 files changed

+63
-32
lines changed

PWGCF/JCorran/Core/JFFlucAnalysis.cxx

Lines changed: 31 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,13 @@ TComplex JFFlucAnalysis::Q(int n, int p)
116116
return n >= 0 ? pqvecs->QvectorQC[n][p] : C(pqvecs->QvectorQC[-n][p]);
117117
}
118118

119+
TComplex JFFlucAnalysis::Q(const JQVectorsT& qvecs, int n, int p)
120+
{
121+
// Return QvectorQC
122+
// Q{-n, p} = Q{n, p}*
123+
return n >= 0 ? qvecs.QvectorQC[n][p] : C(qvecs.QvectorQC[-n][p]);
124+
}
125+
119126
TComplex JFFlucAnalysis::Two(int n1, int n2)
120127
{
121128
// two-particle correlation <exp[i(n1*phi1 + n2*phi2)]>
@@ -124,9 +131,26 @@ TComplex JFFlucAnalysis::Two(int n1, int n2)
124131

125132
TComplex JFFlucAnalysis::Four(int n1, int n2, int n3, int n4)
126133
{
127-
128134
return Q(n1, 1) * Q(n2, 1) * Q(n3, 1) * Q(n4, 1) - Q(n1 + n2, 2) * Q(n3, 1) * Q(n4, 1) - Q(n2, 1) * Q(n1 + n3, 2) * Q(n4, 1) - Q(n1, 1) * Q(n2 + n3, 2) * Q(n4, 1) + 2. * Q(n1 + n2 + n3, 3) * Q(n4, 1) - Q(n2, 1) * Q(n3, 1) * Q(n1 + n4, 2) + Q(n2 + n3, 2) * Q(n1 + n4, 2) - Q(n1, 1) * Q(n3, 1) * Q(n2 + n4, 2) + Q(n1 + n3, 2) * Q(n2 + n4, 2) + 2. * Q(n3, 1) * Q(n1 + n2 + n4, 3) - Q(n1, 1) * Q(n2, 1) * Q(n3 + n4, 2) + Q(n1 + n2, 2) * Q(n3 + n4, 2) + 2. * Q(n2, 1) * Q(n1 + n3 + n4, 3) + 2. * Q(n1, 1) * Q(n2 + n3 + n4, 3) - 6. * Q(n1 + n2 + n3 + n4, 4);
129135
}
136+
137+
TComplex JFFlucAnalysis::TwoDiff(int n1, int n2)
138+
{
139+
#define dp(n, p) Q(*pqvecs, n, p) // POI
140+
#define dQ(n, p) Q(*pqvecsRef, n, p) // REF
141+
#define dq(n, p) dp(n, p) //(dp(n,p)+dQ(n,p)) //POI+REF in narrow bin. Since there is no mass for ref, q = POI
142+
// #define dq(n,p) (dp(n,p)+dQ(n,p)) //POI+REF in narrow bin. Since there is no mass for ref, q = POI
143+
return dp(n1, 1) * dQ(n2, 1) - dq(n1 + n2, 2);
144+
}
145+
146+
TComplex JFFlucAnalysis::FourDiff(int n1, int n2, int n3, int n4)
147+
{
148+
return dp(n1, 1) * dQ(n2, 1) * dQ(n3, 1) * dQ(n4, 1) - dq(n1 + n2, 2) * dQ(n3, 1) * dQ(n4, 1) - dq(n1 + n3, 2) * dQ(n2, 1) * dQ(n4, 1) - dp(n1, 1) * dQ(n2 + n3, 2) * dQ(n4, 1) + 2. * dq(n1 + n2 + n3, 3) * dQ(n4, 1) - dQ(n2, 1) * dQ(n3, 1) * dq(n1 + n4, 2) + dQ(n2 + n3, 2) * dq(n1 + n4, 2) - dp(n1, 1) * dQ(n3, 1) * dQ(n2 + n4, 2) + dq(n1 + n3, 2) * dQ(n2 + n4, 2) + 2. * dQ(n3, 1) * dq(n1 + n2 + n4, 3) - dp(n1, 1) * dQ(n2, 1) * dQ(n3 + n4, 2) + dq(n1 + n2, 2) * dQ(n3 + n4, 2) + 2. * dQ(n2, 1) * dq(n1 + n3 + n4, 3) + 2. * dp(n1, 1) * dQ(n2 + n3 + n4, 3) - 6. * dq(n1 + n2 + n3 + n4, 4);
149+
}
150+
151+
#undef dp
152+
#undef dQ
153+
#undef dq
130154
#undef C
131155

132156
//________________________________________________________________________
@@ -296,19 +320,21 @@ void JFFlucAnalysis::UserExec(Option_t* /*popt*/) // NOLINT(readability/casting)
296320
}
297321
}
298322

323+
auto four = [&](int a, int b, int c, int d) -> TComplex { return pqvecsRef ? FourDiff(a, b, c, d) : Four(a, b, c, d); };
324+
auto two = [&](int a, int b) -> TComplex { return pqvecsRef ? TwoDiff(a, b) : Two(a, b); };
299325
Double_t event_weight_four = 1.0;
300326
Double_t event_weight_two = 1.0;
301327
if (flags & kFlucEbEWeighting) {
302-
event_weight_four = Four(0, 0, 0, 0).Re();
303-
event_weight_two = Two(0, 0).Re();
328+
event_weight_four = four(0, 0, 0, 0).Re();
329+
event_weight_two = two(0, 0).Re();
304330
}
305331

306332
for (UInt_t ih = 2; ih < kNH; ih++) {
307333
for (UInt_t ihh = 2, mm = (ih < kcNH ? ih : static_cast<UInt_t>(kcNH)); ihh < mm; ihh++) {
308-
TComplex scfour = Four(ih, ihh, -ih, -ihh) / Four(0, 0, 0, 0).Re();
334+
TComplex scfour = four(ih, ihh, -ih, -ihh) / four(0, 0, 0, 0).Re();
309335
pht[HIST_THN_SC_with_QC_4corr]->Fill(fCent, fAvgInvariantMass, ih, ihh, scfour.Re(), event_weight_four);
310336
}
311-
TComplex sctwo = Two(ih, -ih) / Two(0, 0).Re();
337+
TComplex sctwo = two(ih, -ih) / two(0, 0).Re();
312338
pht[HIST_THN_SC_with_QC_2corr]->Fill(fCent, fAvgInvariantMass, ih, sctwo.Re(), event_weight_two);
313339
}
314340
}

PWGCF/JCorran/Core/JFFlucAnalysis.h

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,8 @@ class JFFlucAnalysis : public TNamed
3737
TComplex Q(int n, int p);
3838
TComplex Two(int n1, int n2);
3939
TComplex Four(int n1, int n2, int n3, int n4);
40+
TComplex TwoDiff(int n1, int n2);
41+
TComplex FourDiff(int n1, int n2, int n3, int n4);
4042
void UserExec(Option_t* option);
4143
void Terminate(Option_t*);
4244

@@ -124,6 +126,7 @@ class JFFlucAnalysis : public TNamed
124126
kK4,
125127
nKL }; // order
126128
using JQVectorsT = JQVectors<TComplex, kNH, nKL, true>;
129+
TComplex Q(const JQVectorsT& qvecs, int n, int p);
127130
inline void SetJQVectors(const JQVectorsT* _pqvecs)
128131
{
129132
pqvecs = _pqvecs;
@@ -140,10 +143,10 @@ class JFFlucAnalysis : public TNamed
140143
template <class T>
141144
using hasWeightEff = decltype(std::declval<T&>().weightEff());
142145
template <class T>
143-
using hasType = decltype(std::declval<T&>().particleType());
146+
using hasSign = decltype(std::declval<T&>().sign());
144147

145148
template <class JInputClass>
146-
inline void FillQA(JInputClass& inputInst, UInt_t type = 0)
149+
inline void FillQA(JInputClass& inputInst, UInt_t type = 0u)
147150
{
148151
ph1[HIST_TH1_CENTRALITY]->Fill(fCent);
149152
ph1[HIST_TH1_IMPACTPARAM]->Fill(fImpactParameter);
@@ -153,19 +156,20 @@ class JFFlucAnalysis : public TNamed
153156
using JInputClassIter = typename JInputClass::iterator;
154157
if constexpr (std::experimental::is_detected<hasWeightEff, const JInputClassIter>::value)
155158
corrInv /= track.weightEff();
156-
pht[HIST_THN_PTETA]->Fill(fCent, track.pt(), track.eta(), corrInv);
159+
if constexpr (std::experimental::is_detected<hasSign, const JInputClassIter>::value)
160+
pht[HIST_THN_PTETA]->Fill(fCent, track.pt(), track.eta(), track.sign(), corrInv);
161+
else
162+
pht[HIST_THN_PTETA]->Fill(fCent, track.pt(), track.eta(), 0.0, corrInv);
157163
if constexpr (std::experimental::is_detected<hasWeightNUA, const JInputClassIter>::value)
158164
corrInv /= track.weightNUA();
159165
pht[HIST_THN_PHIETA]->Fill(fCent, track.phi(), track.eta(), corrInv);
160-
if constexpr (std::experimental::is_detected<hasType, const JInputClassIter>::value)
161-
type = track.particleType();
162166
pht[HIST_THN_PHIETAZ]->Fill(fCent, static_cast<Double_t>(type), track.phi(), track.eta(), fVertex, corrInv);
163167
}
164168

165169
ph1[HIST_TH1_ZVERTEX]->Fill(fVertex);
166170
}
167171

168-
#define kcNH kH6 // max second dimension + 1
172+
#define kcNH kH4 // max second dimension + 1
169173
protected:
170174
Float_t fVertex; //!
171175
Float_t fAvgInvariantMass; //!
@@ -178,7 +182,7 @@ class JFFlucAnalysis : public TNamed
178182
const JQVectorsT* pqvecsRef; //!
179183

180184
TH1* ph1[HIST_TH1_COUNT]; //!
181-
THn* pht[HIST_THN_COUNT]; //!
185+
THnSparse* pht[HIST_THN_COUNT]; //!
182186
THnSparse* phs[HIST_THN_SPARSE_COUNT]; //!
183187

184188
ClassDef(JFFlucAnalysis, 1)

PWGCF/JCorran/Core/JFFlucAnalysisO2Hist.cxx

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -18,28 +18,26 @@
1818

1919
using namespace o2;
2020

21-
JFFlucAnalysisO2Hist::JFFlucAnalysisO2Hist(HistogramRegistry& registry, AxisSpec& axisMultiplicity, AxisSpec& phiAxis, AxisSpec& etaAxis, AxisSpec& zvtAxis, AxisSpec& massAxis, const TString& folder) : JFFlucAnalysis()
21+
JFFlucAnalysisO2Hist::JFFlucAnalysisO2Hist(HistogramRegistry& registry, AxisSpec& axisMultiplicity, AxisSpec& phiAxis, AxisSpec& etaAxis, AxisSpec& zvtAxis, AxisSpec& ptAxis, AxisSpec& massAxis, const TString& folder) : JFFlucAnalysis()
2222
{
2323

2424
ph1[HIST_TH1_CENTRALITY] = std::get<std::shared_ptr<TH1>>(registry.add(Form("%s/h_cent", folder.Data()), "multiplicity/centrality", {HistType::kTH1F, {axisMultiplicity}})).get();
2525
ph1[HIST_TH1_IMPACTPARAM] = std::get<std::shared_ptr<TH1>>(registry.add(Form("%s/h_IP", folder.Data()), "impact parameter", {HistType::kTH1F, {{400, -2.0, 20.0}}})).get();
2626
ph1[HIST_TH1_ZVERTEX] = std::get<std::shared_ptr<TH1>>(registry.add(Form("%s/h_vertex", folder.Data()), "z vertex", {HistType::kTH1F, {{100, -20.0, 20.0}}})).get();
27-
//
28-
// TODO: these shall be configurable
29-
std::vector<double> ptBinning = {0.5, 1.0, 1.5, 2.0, 3.0, 4.0, 6.0, 10.0};
30-
AxisSpec ptAxis = {ptBinning, "#it{p}_{T} (GeV/c)"};
27+
28+
AxisSpec chgAxis = {3, -1.5, 1.5, "charge"};
3129
AxisSpec typeAxis = {2, -0.5, 1.5, "type"};
32-
pht[HIST_THN_PHIETAZ] = std::get<std::shared_ptr<THn>>(registry.add(Form("%s/h_phietaz", folder.Data()), "multiplicity/centrality, type, phi, eta, z", {HistType::kTHnF, {axisMultiplicity, typeAxis, phiAxis, etaAxis, zvtAxis}})).get();
33-
pht[HIST_THN_PTETA] = std::get<std::shared_ptr<THn>>(registry.add(Form("%s/h_pteta", folder.Data()), "(corrected) multiplicity/centrality, pT, eta", {HistType::kTHnF, {axisMultiplicity, ptAxis, etaAxis}})).get();
34-
pht[HIST_THN_PHIETA] = std::get<std::shared_ptr<THn>>(registry.add(Form("%s/h_phieta", folder.Data()), "(corrected) multiplicity/centrality, phi, eta", {HistType::kTHnF, {axisMultiplicity, phiAxis, etaAxis}})).get();
30+
pht[HIST_THN_PHIETAZ] = std::get<std::shared_ptr<THnSparse>>(registry.add(Form("%s/h_phietaz", folder.Data()), "multiplicity/centrality, type, phi, eta, z", {HistType::kTHnSparseF, {axisMultiplicity, typeAxis, phiAxis, etaAxis, zvtAxis}})).get();
31+
pht[HIST_THN_PTETA] = std::get<std::shared_ptr<THnSparse>>(registry.add(Form("%s/h_pteta", folder.Data()), "(corrected) multiplicity/centrality, pT, eta, charge", {HistType::kTHnSparseF, {axisMultiplicity, ptAxis, etaAxis, chgAxis}})).get();
32+
pht[HIST_THN_PHIETA] = std::get<std::shared_ptr<THnSparse>>(registry.add(Form("%s/h_phieta", folder.Data()), "(corrected) multiplicity/centrality, phi, eta", {HistType::kTHnSparseF, {axisMultiplicity, phiAxis, etaAxis}})).get();
3533
AxisSpec hAxis = {kNH, -0.5, static_cast<double>(kNH - 1) + 0.5, "#it{n}"};
3634
AxisSpec kAxis = {nKL, -0.5, static_cast<double>(nKL - 1) + 0.5, "#it{k}"};
3735
AxisSpec vnAxis = {2048, -0.1, 0.1, "#it{V}_#it{n}"};
38-
pht[HIST_THN_SC_with_QC_4corr] = std::get<std::shared_ptr<THn>>(registry.add(Form("%s/h_SC_with_QC_4corr", folder.Data()), "SC_with_QC_4corr", {HistType::kTHnF, {axisMultiplicity, massAxis, hAxis, hAxis, {2048, -0.001, 0.001, "correlation"}}})).get();
39-
pht[HIST_THN_SC_with_QC_2corr] = std::get<std::shared_ptr<THn>>(registry.add(Form("%s/h_SC_with_QC_2corr", folder.Data()), "SC_with_QC_2corr", {HistType::kTHnF, {axisMultiplicity, massAxis, hAxis, {2048, -0.1, 0.1, "correlation"}}})).get();
40-
pht[HIST_THN_SC_with_QC_2corr_gap] = std::get<std::shared_ptr<THn>>(registry.add(Form("%s/h_SC_with_QC_2corr_gap", folder.Data()), "SC_with_QC_2corr_gap", {HistType::kTHnF, {axisMultiplicity, massAxis, hAxis, {2048, -0.1, 0.1, "correlation"}}})).get();
36+
pht[HIST_THN_SC_with_QC_4corr] = std::get<std::shared_ptr<THnSparse>>(registry.add(Form("%s/h_SC_with_QC_4corr", folder.Data()), "SC_with_QC_4corr", {HistType::kTHnSparseF, {axisMultiplicity, massAxis, hAxis, hAxis, {2048, -0.001, 0.001, "correlation"}}})).get();
37+
pht[HIST_THN_SC_with_QC_2corr] = std::get<std::shared_ptr<THnSparse>>(registry.add(Form("%s/h_SC_with_QC_2corr", folder.Data()), "SC_with_QC_2corr", {HistType::kTHnSparseF, {axisMultiplicity, massAxis, hAxis, {2048, -0.1, 0.1, "correlation"}}})).get();
38+
pht[HIST_THN_SC_with_QC_2corr_gap] = std::get<std::shared_ptr<THnSparse>>(registry.add(Form("%s/h_SC_with_QC_2corr_gap", folder.Data()), "SC_with_QC_2corr_gap", {HistType::kTHnSparseF, {axisMultiplicity, massAxis, hAxis, {2048, -0.1, 0.1, "correlation"}}})).get();
4139
for (UInt_t i = HIST_THN_V4V2star_2; i < HIST_THN_COUNT; ++i)
42-
pht[i] = std::get<std::shared_ptr<THn>>(registry.add(Form("%s/h_corrC%02u", folder.Data(), i - HIST_THN_V4V2star_2), "correlator", {HistType::kTHnF, {axisMultiplicity, massAxis, {2048, -3.0, 3.0, "correlation"}}})).get();
40+
pht[i] = std::get<std::shared_ptr<THnSparse>>(registry.add(Form("%s/h_corrC%02u", folder.Data(), i - HIST_THN_V4V2star_2), "correlator", {HistType::kTHnSparseF, {axisMultiplicity, massAxis, {2048, -3.0, 3.0, "correlation"}}})).get();
4341
for (UInt_t i = 0; i < HIST_THN_COUNT; ++i)
4442
pht[i]->Sumw2();
4543

PWGCF/JCorran/Core/JFFlucAnalysisO2Hist.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ using namespace o2::framework;
2323
class JFFlucAnalysisO2Hist : public JFFlucAnalysis
2424
{
2525
public:
26-
JFFlucAnalysisO2Hist(HistogramRegistry&, AxisSpec&, AxisSpec&, AxisSpec&, AxisSpec&, AxisSpec&, const TString&);
26+
JFFlucAnalysisO2Hist(HistogramRegistry&, AxisSpec&, AxisSpec&, AxisSpec&, AxisSpec&, AxisSpec&, AxisSpec&, const TString&);
2727
~JFFlucAnalysisO2Hist();
2828
};
2929

PWGCF/JCorran/Core/JQVectors.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ class JQVectors : public std::conditional_t<gap, JQVectorsGapBase<Q, nh, nk>, JQ
6565
continue;
6666
using JInputClassIter = typename JInputClass::iterator;
6767
if constexpr (std::experimental::is_detected<hasInvMass, const JInputClassIter>::value) {
68-
if (track.invMass() < massMin || track.invMass() > massMax)
68+
if (track.invMass() < massMin || track.invMass() >= massMax)
6969
continue;
7070
}
7171

PWGCF/JCorran/Tasks/jflucAnalysisTask.cxx

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ struct jflucAnalysisTask {
5757
ConfigurableAxis phiAxis{"axisPhi", {50, 0.0, o2::constants::math::TwoPI}, "phi axis for histograms"};
5858
ConfigurableAxis etaAxis{"axisEta", {40, -2.0, 2.0}, "eta axis for histograms"};
5959
ConfigurableAxis zvtAxis{"axisZvt", {20, -10.0, 10.0}, "zvertex axis for histograms"};
60+
ConfigurableAxis ptAxis{"axisPt", {60, 0.0, 300.0}, "pt axis for histograms"};
6061
ConfigurableAxis massAxis{"axisMass", {1, 0.0, 10.0}, "mass axis for histograms"};
6162

6263
Filter jtrackFilter = (aod::jtrack::pt > ptmin) && (aod::jtrack::pt < ptmax); // eta cuts done by jfluc
@@ -71,16 +72,17 @@ struct jflucAnalysisTask {
7172
auto axisSpecPhi = AxisSpec(phiAxis);
7273
auto axisSpecEta = AxisSpec(etaAxis);
7374
auto axisSpecZvt = AxisSpec(zvtAxis);
75+
auto axisSpecPt = AxisSpec(ptAxis);
7476
auto axisSpecMass = AxisSpec(massAxis);
7577
if (doprocessJDerived || doprocessJDerivedCorrected || doprocessCFDerived || doprocessCFDerivedCorrected) {
76-
pcf = new JFFlucAnalysisO2Hist(registry, axisSpecMult, axisSpecPhi, axisSpecEta, axisSpecZvt, axisSpecMass, "jfluc");
78+
pcf = new JFFlucAnalysisO2Hist(registry, axisSpecMult, axisSpecPhi, axisSpecEta, axisSpecZvt, axisSpecPt, axisSpecMass, "jfluc");
7779
pcf->AddFlags(JFFlucAnalysis::kFlucEbEWeighting);
7880
pcf->UserCreateOutputObjects();
7981
} else {
8082
pcf = 0;
8183
}
8284
if (doprocessCF2ProngDerived || doprocessCF2ProngDerivedCorrected) {
83-
pcf2Prong = new JFFlucAnalysisO2Hist(registry, axisSpecMult, axisSpecPhi, axisSpecEta, axisSpecZvt, axisSpecMass, "jfluc2prong");
85+
pcf2Prong = new JFFlucAnalysisO2Hist(registry, axisSpecMult, axisSpecPhi, axisSpecEta, axisSpecZvt, axisSpecPt, axisSpecMass, "jfluc2prong");
8486
pcf2Prong->AddFlags(JFFlucAnalysis::kFlucEbEWeighting);
8587
pcf2Prong->UserCreateOutputObjects();
8688

@@ -116,8 +118,8 @@ struct jflucAnalysisTask {
116118
pcf2Prong->Init();
117119
pcf2Prong->SetEventCentrality(collision.multiplicity());
118120
pcf2Prong->SetEventVertex(collision.posZ());
119-
pcf2Prong->FillQA(poiTracks, 1u); // type = 1, all POI tracks in this list are of the same type
120121
pcf2Prong->FillQA(refTracks, 0u);
122+
pcf2Prong->FillQA(poiTracks, 1u); // type = 1, all POI tracks in this list are of the same type
121123
qvecsRef.Calculate(refTracks, etamin, etamax);
122124
pcf2Prong->SetJQVectors(&qvecs, &qvecsRef);
123125
const AxisSpec& a = AxisSpec(massAxis);

PWGCF/JCorran/Tasks/jflucWeightsLoader.cxx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
/// \since May 2024
1313

1414
#include <experimental/type_traits>
15+
#include <string>
1516
#include <TFile.h>
1617
#include <THn.h>
1718

@@ -94,7 +95,8 @@ struct jflucWeightsLoader {
9495
float phiWeight, effWeight;
9596
if (ph) {
9697
UInt_t partType = 0; // partType 0 = all charged hadrons
97-
if constexpr (std::experimental::is_detected<hasDecay, typename TrackT::iterator>::value) {
98+
// TODO: code below to be enabled
99+
/*if constexpr (std::experimental::is_detected<hasDecay, typename TrackT::iterator>::value) {
98100
switch (track.decay()) {
99101
case aod::cf2prongtrack::D0ToPiK:
100102
case aod::cf2prongtrack::D0barToKPi:
@@ -103,7 +105,7 @@ struct jflucWeightsLoader {
103105
default:
104106
break;
105107
}
106-
}
108+
}*/
107109
const Double_t coords[] = {collision.multiplicity(), static_cast<Double_t>(partType), track.phi(), track.eta(), collision.posZ()};
108110
phiWeight = ph->GetBinContent(ph->GetBin(coords));
109111
} else {

PWGCF/TableProducer/filterCorrelations.cxx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222
#include "Common/DataModel/Centrality.h"
2323

2424
#include <TH3F.h>
25-
#include <TDatabasePDG.h>
2625

2726
using namespace o2;
2827
using namespace o2::framework;

0 commit comments

Comments
 (0)