Skip to content

Commit d0814e2

Browse files
authored
Refactor registry parameter to hReg in functions
1 parent 82628a3 commit d0814e2

1 file changed

Lines changed: 81 additions & 81 deletions

File tree

PWGCF/EbyEFluctuations/Tasks/nchCumulantsId.cxx

Lines changed: 81 additions & 81 deletions
Original file line numberDiff line numberDiff line change
@@ -405,42 +405,42 @@ struct NchCumulantsId {
405405
}
406406

407407
template <FCPrefixEnum Prefix, typename Registry>
408-
void fillFCBasis(const EffPowerSums& p, float cent, Registry& registry)
408+
void fillFCBasis(const EffPowerSums& p, float cent, Registry& hReg)
409409
{
410410
auto base = HIST(FCRecoDir[static_cast<int>(Prefix)]);
411411

412412
// Fill Factorial Moments for Reco directly to ensure Reco stores the same type of data as Gen
413413
// Compute Efficiency Corrected Factorial Moments from power sums
414414
// These formulas come from elementary symmetric polynomials and their relation to power sums
415-
registry.fill(base + HIST("Q1"), cent, p.q1);
416-
registry.fill(base + HIST("Q1Sq"), cent, p.q1 * p.q1);
417-
registry.fill(base + HIST("Q2"), cent, p.q2);
418-
registry.fill(base + HIST("Q1Cube"), cent, p.q1 * p.q1 * p.q1);
419-
registry.fill(base + HIST("Q1Q2"), cent, p.q1 * p.q2);
420-
registry.fill(base + HIST("Q3"), cent, p.q3);
421-
registry.fill(base + HIST("Q1Pow4"), cent, p.q1 * p.q1 * p.q1 * p.q1);
422-
registry.fill(base + HIST("Q1SqQ2"), cent, p.q1 * p.q1 * p.q2);
423-
registry.fill(base + HIST("Q2Sq"), cent, p.q2 * p.q2);
424-
registry.fill(base + HIST("Q1Q3"), cent, p.q1 * p.q3);
425-
registry.fill(base + HIST("Q4"), cent, p.q4);
415+
hReg.fill(base + HIST("Q1"), cent, p.q1);
416+
hReg.fill(base + HIST("Q1Sq"), cent, p.q1 * p.q1);
417+
hReg.fill(base + HIST("Q2"), cent, p.q2);
418+
hReg.fill(base + HIST("Q1Cube"), cent, p.q1 * p.q1 * p.q1);
419+
hReg.fill(base + HIST("Q1Q2"), cent, p.q1 * p.q2);
420+
hReg.fill(base + HIST("Q3"), cent, p.q3);
421+
hReg.fill(base + HIST("Q1Pow4"), cent, p.q1 * p.q1 * p.q1 * p.q1);
422+
hReg.fill(base + HIST("Q1SqQ2"), cent, p.q1 * p.q1 * p.q2);
423+
hReg.fill(base + HIST("Q2Sq"), cent, p.q2 * p.q2);
424+
hReg.fill(base + HIST("Q1Q3"), cent, p.q1 * p.q3);
425+
hReg.fill(base + HIST("Q4"), cent, p.q4);
426426
if (cfgEventSelection.cfgDoSubsampling) {
427-
registry.fill(base + HIST("Q1_subsample"), cent, cfgEventSelection.currentSubsample, p.q1);
428-
registry.fill(base + HIST("Q1Sq_subsample"), cent, cfgEventSelection.currentSubsample, p.q1 * p.q1);
429-
registry.fill(base + HIST("Q2_subsample"), cent, cfgEventSelection.currentSubsample, p.q2);
430-
registry.fill(base + HIST("Q1Cube_subsample"), cent, cfgEventSelection.currentSubsample, p.q1 * p.q1 * p.q1);
431-
registry.fill(base + HIST("Q1Q2_subsample"), cent, cfgEventSelection.currentSubsample, p.q1 * p.q2);
432-
registry.fill(base + HIST("Q3_subsample"), cent, cfgEventSelection.currentSubsample, p.q3);
433-
registry.fill(base + HIST("Q1Pow4_subsample"), cent, cfgEventSelection.currentSubsample, p.q1 * p.q1 * p.q1 * p.q1);
434-
registry.fill(base + HIST("Q1SqQ2_subsample"), cent, cfgEventSelection.currentSubsample, p.q1 * p.q1 * p.q2);
435-
registry.fill(base + HIST("Q2Sq_subsample"), cent, cfgEventSelection.currentSubsample, p.q2 * p.q2);
436-
registry.fill(base + HIST("Q1Q3_subsample"), cent, cfgEventSelection.currentSubsample, p.q1 * p.q3);
437-
registry.fill(base + HIST("Q4_subsample"), cent, cfgEventSelection.currentSubsample, p.q4);
427+
hReg.fill(base + HIST("Q1_subsample"), cent, cfgEventSelection.currentSubsample, p.q1);
428+
hReg.fill(base + HIST("Q1Sq_subsample"), cent, cfgEventSelection.currentSubsample, p.q1 * p.q1);
429+
hReg.fill(base + HIST("Q2_subsample"), cent, cfgEventSelection.currentSubsample, p.q2);
430+
hReg.fill(base + HIST("Q1Cube_subsample"), cent, cfgEventSelection.currentSubsample, p.q1 * p.q1 * p.q1);
431+
hReg.fill(base + HIST("Q1Q2_subsample"), cent, cfgEventSelection.currentSubsample, p.q1 * p.q2);
432+
hReg.fill(base + HIST("Q3_subsample"), cent, cfgEventSelection.currentSubsample, p.q3);
433+
hReg.fill(base + HIST("Q1Pow4_subsample"), cent, cfgEventSelection.currentSubsample, p.q1 * p.q1 * p.q1 * p.q1);
434+
hReg.fill(base + HIST("Q1SqQ2_subsample"), cent, cfgEventSelection.currentSubsample, p.q1 * p.q1 * p.q2);
435+
hReg.fill(base + HIST("Q2Sq_subsample"), cent, cfgEventSelection.currentSubsample, p.q2 * p.q2);
436+
hReg.fill(base + HIST("Q1Q3_subsample"), cent, cfgEventSelection.currentSubsample, p.q1 * p.q3);
437+
hReg.fill(base + HIST("Q4_subsample"), cent, cfgEventSelection.currentSubsample, p.q4);
438438
}
439439
}
440440

441441
// fill function for reco net species
442442
template <FCPrefixEnum Prefix, typename Registry>
443-
void fillNetQVectorProfileHistograms(const EffPowerSums& posPow, const EffPowerSums& negPow, float cent, Registry& registry)
443+
void fillNetQVectorProfileHistograms(const EffPowerSums& posPow, const EffPowerSums& negPow, float cent, Registry& hReg)
444444
{
445445
// Construct base directory path
446446
auto base = HIST(FCRecoDir[static_cast<int>(Prefix)]);
@@ -456,50 +456,50 @@ struct NchCumulantsId {
456456

457457
// Fill joint pos-neg correction profiles
458458
// capture inline from pos and neg
459-
double jointF11 = posPow.q1 * negPow.q1;
460-
double cf2pos = posPow.q1 * posPow.q1 - posPow.q2;
461-
double cf2neg = negPow.q1 * negPow.q1 - negPow.q2;
462-
double jointF12 = posPow.q1 * cf2neg;
463-
double jointF21 = negPow.q1 * cf2pos;
459+
double jointF11 = posPow.q1 * negPow.q1;
460+
double cf2pos = posPow.q1 * posPow.q1 - posPow.q2;
461+
double cf2neg = negPow.q1 * negPow.q1 - negPow.q2;
462+
double jointF12 = posPow.q1 * cf2neg;
463+
double jointF21 = negPow.q1 * cf2pos;
464464
// ─── Fill raw q-vectors (for cross-verification)
465-
registry.fill(base + HIST("Q_net_1"), cent, qNet1);
466-
registry.fill(base + HIST("Q_net_1Sq"), cent, qNet1 * qNet1);
467-
registry.fill(base + HIST("Q_net_2"), cent, qNet2);
468-
registry.fill(base + HIST("Q_net_1Cube"), cent, qNet1 * qNet1 * qNet1);
469-
registry.fill(base + HIST("Q_net_1Q_net_2"), cent, qNet1 * qNet2);
470-
registry.fill(base + HIST("Q_net_3"), cent, qNet3);
471-
registry.fill(base + HIST("Q_net_1Pow4"), cent, qNet1 * qNet1 * qNet1 * qNet1);
472-
registry.fill(base + HIST("Q_net_1SqQ_net_2"), cent, qNet1 * qNet1 * qNet2);
473-
registry.fill(base + HIST("Q_net_2Sq"), cent, qNet2 * qNet2);
474-
registry.fill(base + HIST("Q_net_1Q_net_3"), cent, qNet1 * qNet3);
475-
registry.fill(base + HIST("Q_net_4"), cent, qNet4);
465+
hReg.fill(base + HIST("Q_net_1"), cent, qNet1);
466+
hReg.fill(base + HIST("Q_net_1Sq"), cent, qNet1 * qNet1);
467+
hReg.fill(base + HIST("Q_net_2"), cent, qNet2);
468+
hReg.fill(base + HIST("Q_net_1Cube"), cent, qNet1 * qNet1 * qNet1);
469+
hReg.fill(base + HIST("Q_net_1Q_net_2"), cent, qNet1 * qNet2);
470+
hReg.fill(base + HIST("Q_net_3"), cent, qNet3);
471+
hReg.fill(base + HIST("Q_net_1Pow4"), cent, qNet1 * qNet1 * qNet1 * qNet1);
472+
hReg.fill(base + HIST("Q_net_1SqQ_net_2"), cent, qNet1 * qNet1 * qNet2);
473+
hReg.fill(base + HIST("Q_net_2Sq"), cent, qNet2 * qNet2);
474+
hReg.fill(base + HIST("Q_net_1Q_net_3"), cent, qNet1 * qNet3);
475+
hReg.fill(base + HIST("Q_net_4"), cent, qNet4);
476476

477477
// ─── Fill factorial moments ───
478-
registry.fill(base + HIST("JointF11"), cent, jointF11);
479-
registry.fill(base + HIST("JointF12"), cent, jointF12);
480-
registry.fill(base + HIST("JointF21"), cent, jointF21);
478+
hReg.fill(base + HIST("JointF11"), cent, jointF11);
479+
hReg.fill(base + HIST("JointF12"), cent, jointF12);
480+
hReg.fill(base + HIST("JointF21"), cent, jointF21);
481481

482482
if (cfgEventSelection.cfgDoSubsampling) {
483-
registry.fill(base + HIST("Q_net_1_subsample"), cent, cfgEventSelection.currentSubsample, qNet1);
484-
registry.fill(base + HIST("Q_net_1Sq_subsample"), cent, cfgEventSelection.currentSubsample, qNet1 * qNet1);
485-
registry.fill(base + HIST("Q_net_2_subsample"), cent, cfgEventSelection.currentSubsample, qNet2);
486-
registry.fill(base + HIST("Q_net_1Cube_subsample"), cent, cfgEventSelection.currentSubsample, qNet1 * qNet1 * qNet1);
487-
registry.fill(base + HIST("Q_net_1Q_net_2_subsample"), cent, cfgEventSelection.currentSubsample, qNet1 * qNet2);
488-
registry.fill(base + HIST("Q_net_3_subsample"), cent, cfgEventSelection.currentSubsample, qNet3);
489-
registry.fill(base + HIST("Q_net_1Pow4_subsample"), cent, cfgEventSelection.currentSubsample, qNet1 * qNet1 * qNet1 * qNet1);
490-
registry.fill(base + HIST("Q_net_1SqQ_net_2_subsample"), cent, cfgEventSelection.currentSubsample, qNet1 * qNet1 * qNet2);
491-
registry.fill(base + HIST("Q_net_2Sq_subsample"), cent, cfgEventSelection.currentSubsample, qNet2 * qNet2);
492-
registry.fill(base + HIST("Q_net_1Q_net_3_subsample"), cent, cfgEventSelection.currentSubsample, qNet1 * qNet3);
493-
registry.fill(base + HIST("Q_net_4_subsample"), cent, cfgEventSelection.currentSubsample, qNet4);
494-
495-
registry.fill(base + HIST("JointF11_subsample"), cent, cfgEventSelection.currentSubsample, jointF11);
496-
registry.fill(base + HIST("JointF12_subsample"), cent, cfgEventSelection.currentSubsample, jointF12);
497-
registry.fill(base + HIST("JointF21_subsample"), cent, cfgEventSelection.currentSubsample, jointF21);
483+
hReg.fill(base + HIST("Q_net_1_subsample"), cent, cfgEventSelection.currentSubsample, qNet1);
484+
hReg.fill(base + HIST("Q_net_1Sq_subsample"), cent, cfgEventSelection.currentSubsample, qNet1 * qNet1);
485+
hReg.fill(base + HIST("Q_net_2_subsample"), cent, cfgEventSelection.currentSubsample, qNet2);
486+
hReg.fill(base + HIST("Q_net_1Cube_subsample"), cent, cfgEventSelection.currentSubsample, qNet1 * qNet1 * qNet1);
487+
hReg.fill(base + HIST("Q_net_1Q_net_2_subsample"), cent, cfgEventSelection.currentSubsample, qNet1 * qNet2);
488+
hReg.fill(base + HIST("Q_net_3_subsample"), cent, cfgEventSelection.currentSubsample, qNet3);
489+
hReg.fill(base + HIST("Q_net_1Pow4_subsample"), cent, cfgEventSelection.currentSubsample, qNet1 * qNet1 * qNet1 * qNet1);
490+
hReg.fill(base + HIST("Q_net_1SqQ_net_2_subsample"), cent, cfgEventSelection.currentSubsample, qNet1 * qNet1 * qNet2);
491+
hReg.fill(base + HIST("Q_net_2Sq_subsample"), cent, cfgEventSelection.currentSubsample, qNet2 * qNet2);
492+
hReg.fill(base + HIST("Q_net_1Q_net_3_subsample"), cent, cfgEventSelection.currentSubsample, qNet1 * qNet3);
493+
hReg.fill(base + HIST("Q_net_4_subsample"), cent, cfgEventSelection.currentSubsample, qNet4);
494+
495+
hReg.fill(base + HIST("JointF11_subsample"), cent, cfgEventSelection.currentSubsample, jointF11);
496+
hReg.fill(base + HIST("JointF12_subsample"), cent, cfgEventSelection.currentSubsample, jointF12);
497+
hReg.fill(base + HIST("JointF21_subsample"), cent, cfgEventSelection.currentSubsample, jointF21);
498498
}
499499
}
500500

501501
template <FCPrefixEnum Prefix, typename Registry>
502-
void fillGenFactorialMoments(int n, float cent, Registry& registry)
502+
void fillGenFactorialMoments(int n, float cent, Registry& hReg)
503503
{
504504
auto base = HIST(FCGenDir[static_cast<int>(Prefix)]);
505505

@@ -508,21 +508,21 @@ struct NchCumulantsId {
508508
double f3 = n * (n - 1.) * (n - 2.);
509509
double f4 = n * (n - 1.) * (n - 2.) * (n - 3.);
510510

511-
registry.fill(base + HIST("F1"), cent, f1);
512-
registry.fill(base + HIST("F2"), cent, f2);
513-
registry.fill(base + HIST("F3"), cent, f3);
514-
registry.fill(base + HIST("F4"), cent, f4);
511+
hReg.fill(base + HIST("F1"), cent, f1);
512+
hReg.fill(base + HIST("F2"), cent, f2);
513+
hReg.fill(base + HIST("F3"), cent, f3);
514+
hReg.fill(base + HIST("F4"), cent, f4);
515515

516516
if (cfgEventSelection.cfgDoSubsampling) {
517-
registry.fill(base + HIST("F1_subsample"), cent, cfgEventSelection.currentSubsample, f1);
518-
registry.fill(base + HIST("F2_subsample"), cent, cfgEventSelection.currentSubsample, f2);
519-
registry.fill(base + HIST("F3_subsample"), cent, cfgEventSelection.currentSubsample, f3);
520-
registry.fill(base + HIST("F4_subsample"), cent, cfgEventSelection.currentSubsample, f4);
517+
hReg.fill(base + HIST("F1_subsample"), cent, cfgEventSelection.currentSubsample, f1);
518+
hReg.fill(base + HIST("F2_subsample"), cent, cfgEventSelection.currentSubsample, f2);
519+
hReg.fill(base + HIST("F3_subsample"), cent, cfgEventSelection.currentSubsample, f3);
520+
hReg.fill(base + HIST("F4_subsample"), cent, cfgEventSelection.currentSubsample, f4);
521521
}
522522
}
523523
// ─── GEN level (net speciestruth) ───
524524
template <FCPrefixEnum Prefix, typename Registry>
525-
void fillGenNetFactorialMoments(float nPos, float nNeg, float cent, Registry& registry)
525+
void fillGenNetFactorialMoments(float nPos, float nNeg, float cent, Registry& hReg)
526526
{
527527
auto base = HIST(FCGenDir[static_cast<int>(Prefix)]);
528528

@@ -533,16 +533,16 @@ struct NchCumulantsId {
533533
double f3 = nNet * (nNet - 1.0) * (nNet - 2.0);
534534
double f4 = nNet * (nNet - 1.0) * (nNet - 2.0) * (nNet - 3.0);
535535

536-
registry.fill(base + HIST("F1"), cent, f1);
537-
registry.fill(base + HIST("F2"), cent, f2);
538-
registry.fill(base + HIST("F3"), cent, f3);
539-
registry.fill(base + HIST("F4"), cent, f4);
536+
hReg.fill(base + HIST("F1"), cent, f1);
537+
hReg.fill(base + HIST("F2"), cent, f2);
538+
hReg.fill(base + HIST("F3"), cent, f3);
539+
hReg.fill(base + HIST("F4"), cent, f4);
540540

541541
if (cfgEventSelection.cfgDoSubsampling) {
542-
registry.fill(base + HIST("F1_subsample"), cent, cfgEventSelection.currentSubsample, f1);
543-
registry.fill(base + HIST("F2_subsample"), cent, cfgEventSelection.currentSubsample, f2);
544-
registry.fill(base + HIST("F3_subsample"), cent, cfgEventSelection.currentSubsample, f3);
545-
registry.fill(base + HIST("F4_subsample"), cent, cfgEventSelection.currentSubsample, f4);
542+
hReg.fill(base + HIST("F1_subsample"), cent, cfgEventSelection.currentSubsample, f1);
543+
hReg.fill(base + HIST("F2_subsample"), cent, cfgEventSelection.currentSubsample, f2);
544+
hReg.fill(base + HIST("F3_subsample"), cent, cfgEventSelection.currentSubsample, f3);
545+
hReg.fill(base + HIST("F4_subsample"), cent, cfgEventSelection.currentSubsample, f4);
546546
}
547547
}
548548

@@ -1257,15 +1257,15 @@ struct NchCumulantsId {
12571257
}
12581258

12591259
template <int mode, typename T>
1260-
void fillCollQA(const T& col, const int& nCh, const int& nT)
1260+
void fillCollQA(const T& coll, const int& nCh, const int& nT)
12611261
{
1262-
hist.fill(HIST(HistRegDire[mode]) + HIST("h_VtxZ"), col.posZ());
1262+
hist.fill(HIST(HistRegDire[mode]) + HIST("h_VtxZ"), coll.posZ());
12631263
hist.fill(HIST(HistRegDire[mode]) + HIST("h_Counts"), 0.5);
1264-
hist.fill(HIST(HistRegDire[mode]) + HIST("multFT0"), col.multFT0C());
1265-
hist.fill(HIST(HistRegDire[mode]) + HIST("centFT0"), col.centFT0M());
1264+
hist.fill(HIST(HistRegDire[mode]) + HIST("multFT0"), coll.multFT0C());
1265+
hist.fill(HIST(HistRegDire[mode]) + HIST("centFT0"), coll.centFT0M());
12661266
if (mode == qaEventPostSel) {
12671267
hist.fill(HIST(HistRegDire[mode]) + HIST("net_charge"), nCh);
1268-
hist.fill(HIST(HistRegDire[mode]) + HIST("Nt_centFT"), col.centFT0M(), nT);
1268+
hist.fill(HIST(HistRegDire[mode]) + HIST("Nt_centFT"), coll.centFT0M(), nT);
12691269
}
12701270
}
12711271

0 commit comments

Comments
 (0)