Skip to content

Commit 85c75c3

Browse files
Jinhyun ParkJinhyun Park
authored andcommitted
Merge branch 'master' of https://github.com/AliceO2Group/O2Physics into updateworkflow
2 parents c923aed + 3bf49b4 commit 85c75c3

27 files changed

Lines changed: 1197 additions & 447 deletions

Common/CCDB/ctpRateFetcher.cxx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -95,9 +95,7 @@ double ctpRateFetcher::pileUpCorrection(double triggerRate)
9595
if (mLHCIFdata == nullptr) {
9696
LOG(fatal) << "No filling" << std::endl;
9797
}
98-
auto bfilling = mLHCIFdata->getBunchFilling();
99-
std::vector<int> bcs = bfilling.getFilledBCs();
100-
double nbc = bcs.size();
98+
double nbc = mLHCIFdata->getBunchFilling().getPattern().count();
10199
double nTriggersPerFilledBC = triggerRate / nbc / constants::lhc::LHCRevFreq;
102100
double mu = -std::log(1 - nTriggersPerFilledBC);
103101
return mu * nbc * constants::lhc::LHCRevFreq;

PWGCF/EbyEFluctuations/Tasks/nchCumulantsId.cxx

Lines changed: 32 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -21,19 +21,30 @@
2121
#include "Common/DataModel/PIDResponseTPC.h"
2222
#include "Common/DataModel/TrackSelectionTables.h"
2323

24-
#include "CCDB/BasicCCDBManager.h"
25-
#include "Framework/ASoAHelpers.h"
26-
#include "Framework/AnalysisDataModel.h"
27-
#include "Framework/AnalysisTask.h"
28-
#include "Framework/HistogramRegistry.h"
29-
#include "Framework/HistogramSpec.h"
30-
#include "Framework/O2DatabasePDGPlugin.h"
31-
#include "Framework/runDataProcessing.h"
32-
24+
#include <CCDB/BasicCCDBManager.h>
25+
#include <CommonConstants/PhysicsConstants.h>
26+
#include <Framework/ASoAHelpers.h>
27+
#include <Framework/AnalysisDataModel.h>
28+
#include <Framework/AnalysisHelpers.h>
29+
#include <Framework/AnalysisTask.h>
30+
#include <Framework/Configurable.h>
31+
#include <Framework/HistogramRegistry.h>
32+
#include <Framework/HistogramSpec.h>
33+
#include <Framework/InitContext.h>
34+
#include <Framework/O2DatabasePDGPlugin.h>
35+
#include <Framework/OutputObjHeader.h>
36+
#include <Framework/runDataProcessing.h>
37+
38+
#include <TH2.h>
3339
#include <TPDGCode.h>
3440

3541
#include <algorithm>
42+
#include <array>
43+
#include <cstddef>
44+
#include <cstdint>
45+
#include <cstdlib>
3646
#include <string>
47+
#include <string_view>
3748
#include <vector>
3849

3950
using namespace o2;
@@ -112,6 +123,17 @@ struct NchCumulantsId {
112123
Configurable<float> cfgCutPtMax{"cfgCutPtMax", 3.0, "max cut for pT"};
113124
Configurable<float> cfgCutPtMin{"cfgCutPtMin", 0.15, "min cut for pT"};
114125

126+
ConfigurableAxis axisNch{"axisNch", {1200, -60.0, 60.0}, "Net_charge_dN"};
127+
ConfigurableAxis axisPosCh{"axisPosCh", {3010, -0.5, 300.5}, "Pos_charge"};
128+
ConfigurableAxis axisNegCh{"axisNegCh", {3010, -0.5, 300.5}, "Neg_charge"};
129+
ConfigurableAxis axisNt{"axisNt", {8010, -0.5, 800.5}, "Mult_midRap_Nch"};
130+
ConfigurableAxis axisPrCh{"axisPrCh", {3010, -0.5, 300.5}, "Pr_charge"};
131+
ConfigurableAxis axisAPrCh{"axisAPrCh", {3010, -0.5, 300.5}, "APr_charge"};
132+
ConfigurableAxis axisKaCh{"axisKaCh", {3010, -0.5, 300.5}, "Ka_charge"};
133+
ConfigurableAxis axisAKaCh{"axisAKaCh", {3010, -0.5, 300.5}, "AKa_charge"};
134+
ConfigurableAxis axisPiCh{"axisPiCh", {3010, -0.5, 300.5}, "Pion_Positive"};
135+
ConfigurableAxis axisAPiCh{"axisAPiCh", {3010, -0.5, 300.5}, "Pion_Negative"};
136+
115137
Configurable<bool> checkCollPosZMc{"checkCollPosZMc", false, "checkCollPosZMc"};
116138
Configurable<bool> flagUnusedVariableError{"flagUnusedVariableError", false, "flagUnusedVariableError"};
117139
Configurable<bool> cfgDoRejectionForId{"cfgDoRejectionForId", false, "Apply rejection cut before PID selection (selTrackForId)"};
@@ -121,7 +143,7 @@ struct NchCumulantsId {
121143
Configurable<bool> cfgEvSel03doIsGoodITSLayersAll{"cfgEvSel03doIsGoodITSLayersAll", true, "apply kIsGoodITSLayersAll"};
122144

123145
// Configurables for particle Identification
124-
Configurable<bool> cfgId01CheckVetoCut{"cfgId01CheckVetoCut", false, "cfgId01CheckVetoCut"};
146+
Configurable<bool> cfgId01CheckVetoCut{"cfgId01CheckVetoCut", true, "cfgId01CheckVetoCut"};
125147
Configurable<bool> cfgId02DoElRejection{"cfgId02DoElRejection", true, "cfgId02DoElRejection"};
126148
Configurable<bool> cfgId03DoDeRejection{"cfgId03DoDeRejection", false, "cfgId03DoDeRejection"};
127149
Configurable<bool> cfgId04DoPdependentId{"cfgId04DoPdependentId", true, "cfgId04DoPdependentId"};
@@ -246,17 +268,6 @@ struct NchCumulantsId {
246268
const AxisSpec axisTOFNSigma = {200, -10.0, 10.0, "n#sigma_{TOF}"};
247269
const AxisSpec axisTOFExpMom = {200, 0.0f, 10.0f, "#it{p}_{tofExpMom} (GeV/#it{c})"};
248270

249-
const AxisSpec axisNch(100, -50, 50, "Net_charge_dN");
250-
const AxisSpec axisPosCh(101, -1, 100, "Pos_charge");
251-
const AxisSpec axisNegCh(101, -1, 100, "Neg_charge");
252-
const AxisSpec axisNt(201, -1, 200, "Mult_midRap_Nch");
253-
const AxisSpec axisPrCh(101, -1, 100, "Pr_charge");
254-
const AxisSpec axisAPrCh(101, -1, 100, "APr_charge");
255-
const AxisSpec axisKaCh(101, -1, 100, "Ka_charge");
256-
const AxisSpec axisAKaCh(101, -1, 100, "AKa_charge");
257-
const AxisSpec axisPiCh(101, -1, 100, "Pion_Positive");
258-
const AxisSpec axisAPiCh(101, -1, 100, "Pion_Negative");
259-
260271
const AxisSpec axisIdTag = {32, -0.5f, 31.5f, "idTag"};
261272
const AxisSpec axisMcTag = {32, -0.5f, 31.5f, "mcTag"};
262273

PWGCF/EbyEFluctuations/Tasks/radialFlowDecorr.cxx

Lines changed: 58 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ struct RadialFlowDecorr {
7676
static constexpr int KnFt0cCell = 96;
7777
static constexpr int KIntM = 3;
7878
static constexpr int KIntK = 3;
79-
static constexpr int KNEta = 17;
79+
static constexpr int KNEta = 9;
8080
static constexpr float KFloatEpsilon = 1e-6f;
8181
static constexpr int KPiPlus = 211;
8282
static constexpr int KKPlus = 321;
@@ -151,10 +151,10 @@ struct RadialFlowDecorr {
151151
static constexpr float KinvalidCentrality = -1.0f;
152152
inline static const std::vector<float> etaLw = {
153153
-0.8,
154-
-0.8, -0.7, -0.6, -0.5, -0.4, -0.3, -0.2, -0.1, 0.0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7};
154+
-0.8, -0.6, -0.4, -0.2, 0.0, 0.2, 0.4, 0.6};
155155
inline static const std::vector<float> etaUp = {
156156
0.8,
157-
-0.7, -0.6, -0.5, -0.4, -0.3, -0.2, -0.1, 0.0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8};
157+
-0.6, -0.4, -0.2, 0.0, 0.2, 0.4, 0.6, 0.8};
158158

159159
Configurable<float> cfgVtxZCut{"cfgVtxZCut", 10.f, "z-vertex range"};
160160
Configurable<float> cfgPtMin{"cfgPtMin", 0.2f, "min pT"};
@@ -187,6 +187,7 @@ struct RadialFlowDecorr {
187187
Configurable<float> cfgCutPtUpper{"cfgCutPtUpper", 10.0f, "Higher pT cut for inclusive hadron analysis"};
188188
Configurable<float> cfgCutPtUpperPID{"cfgCutPtUpperPID", 6.0f, "Higher pT cut for identified particle analysis"};
189189
Configurable<float> cfgCutEta{"cfgCutEta", 0.8f, "absolute Eta cut"};
190+
Configurable<int> cfgMinTracksPerEtaBin{"cfgMinTracksPerEtaBin", 0, "Min weighted-track sum required in every narrow eta bin for inclusive species (0 = disabled)"};
190191
Configurable<int> cfgNsubsample{"cfgNsubsample", 10, "Number of subsamples"};
191192
Configurable<int> cfgCentralityChoice{"cfgCentralityChoice", 1, "Which centrality estimator? 1-->FT0C, 2-->FT0M, 3-->FDDM, 4-->FV0A"};
192193
Configurable<bool> cfgEvSelNoSameBunchPileup{"cfgEvSelNoSameBunchPileup", true, "Pileup removal"};
@@ -201,7 +202,7 @@ struct RadialFlowDecorr {
201202
Configurable<float> cfgLinPupParam2{"cfgLinPupParam2", 3.0f, "(Lower) Linear Pileup Cut Const"};
202203
Configurable<float> cfgLinPupParam3{"cfgLinPupParam3", 3.0f, "(Lower) Linear Pileup Slope"};
203204

204-
Configurable<int> cfgNchPbMax{"cfgNchPbMax", 4000, "Max Nch range for PbPb collisions"};
205+
Configurable<int> cfgNchPbMax{"cfgNchPbMax", 5000, "Max Nch range for PbPb collisions"};
205206
Configurable<int> cfgNchOMax{"cfgNchOMax", 800, "Max Nch range for OO collisions"};
206207

207208
Configurable<int> cfgSys{"cfgSys", 1, "Efficiency to be used for which system? 1-->PbPb, 2-->NeNe, 3-->OO, 4-->pp"};
@@ -222,21 +223,17 @@ struct RadialFlowDecorr {
222223
const AxisSpec vzAxis{5, -12.5, 12.5, "Vz"};
223224
const AxisSpec chgAxis{3, -1.5, 1.5};
224225
const AxisSpec pTAxis{{0.0, 0.2, 0.4, 0.6, 0.8, 1, 3, 5, 7, 10}, "pT Axis"};
225-
const AxisSpec etaAxis{{-0.9, -0.8, -0.7, -0.6, -0.5, -0.4, -0.3, -0.2, -0.1, 0.0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9}, "Eta"};
226+
const AxisSpec etaAxis{{-0.8, -0.6, -0.4, -0.2, 0.0, 0.2, 0.4, 0.6, 0.8}, "Eta"};
226227
const AxisSpec phiAxis{KNbinsPhi, KPhiMin, TwoPI, "#phi"};
227228
const AxisSpec etaBinAxis{KNEta + 1, -0.5, KNEta + 0.5, "#eta bin Number"};
228229
const AxisSpec spBinAxis{KNsp + 1, -KBinOffset, static_cast<float>(KNsp) + KBinOffset, "species index Number"};
229230

230-
const AxisSpec gapAxis{{-1.55, -1.45, -1.35, -1.25, -1.15, -1.05, -0.95, -0.85,
231-
-0.75, -0.65, -0.55, -0.45, -0.35, -0.25, -0.15, -0.05,
232-
0.05, 0.15, 0.25, 0.35, 0.45, 0.55, 0.65, 0.75,
233-
0.85, 0.95, 1.05, 1.15, 1.25, 1.35, 1.45, 1.55},
231+
const AxisSpec gapAxis{{-1.5, -1.3, -1.1, -0.9, -0.7, -0.5, -0.3, -0.1,
232+
0.1, 0.3, 0.5, 0.7, 0.9, 1.1, 1.3, 1.5},
234233
"Gap"};
235234

236-
const AxisSpec sumAxis{{-1.55, -1.45, -1.35, -1.25, -1.15, -1.05, -0.95, -0.85,
237-
-0.75, -0.65, -0.55, -0.45, -0.35, -0.25, -0.15, -0.05,
238-
0.05, 0.15, 0.25, 0.35, 0.45, 0.55, 0.65, 0.75,
239-
0.85, 0.95, 1.05, 1.15, 1.25, 1.35, 1.45, 1.55},
235+
const AxisSpec sumAxis{{-1.5, -1.3, -1.1, -0.9, -0.7, -0.5, -0.3, -0.1,
236+
0.1, 0.3, 0.5, 0.7, 0.9, 1.1, 1.3, 1.5},
240237
"Sum"};
241238

242239
Configurable<bool> cfgRunMCGetNSig{"cfgRunMCGetNSig", false, "Run MC pass to get mean of Nsig Plots"};
@@ -552,6 +549,32 @@ struct RadialFlowDecorr {
552549
return true;
553550
}
554551

552+
template <std::size_t NspT, std::size_t NetaT, std::size_t NkT>
553+
bool hasMinTracksInAllEtaBins(const double (&sw)[NspT][NetaT][NkT])
554+
{
555+
const int minTracks = cfgMinTracksPerEtaBin;
556+
if (minTracks <= 0)
557+
return true;
558+
for (std::size_t ieta = 1; ieta < NetaT; ++ieta) {
559+
if (sw[kInclusiveIdx][ieta][1] < static_cast<double>(minTracks))
560+
return false;
561+
}
562+
return true;
563+
}
564+
565+
template <std::size_t NspT, std::size_t NetaT>
566+
bool hasMinTracksInAllEtaBins(const double (&sw)[NspT][NetaT])
567+
{
568+
const int minTracks = cfgMinTracksPerEtaBin;
569+
if (minTracks <= 0)
570+
return true;
571+
for (std::size_t ieta = 1; ieta < NetaT; ++ieta) {
572+
if (sw[kInclusiveIdx][ieta] < static_cast<double>(minTracks))
573+
return false;
574+
}
575+
return true;
576+
}
577+
555578
template <typename T>
556579
bool isTrackSelected(const T& trk)
557580
{
@@ -1996,6 +2019,9 @@ struct RadialFlowDecorr {
19962019
}
19972020
}
19982021

2022+
if (!hasMinTracksInAllEtaBins(sumWiTruth) || !hasMinTracksInAllEtaBins(sumWiReco))
2023+
return;
2024+
19992025
for (int isp = 0; isp < KNsp; ++isp) {
20002026
histos.fill(HIST("MCReco/Prof_Cent_Nsp_Nchrec"), cent, isp, sumWiReco[isp][0]);
20012027
histos.fill(HIST("MCReco/Prof_Mult_Nsp_Nchrec"), multPV, isp, sumWiReco[isp][0]);
@@ -2352,6 +2378,9 @@ struct RadialFlowDecorr {
23522378
}
23532379
} // trkslice
23542380

2381+
if (!hasMinTracksInAllEtaBins(sumWkTru) || !hasMinTracksInAllEtaBins(sumWkReco))
2382+
return;
2383+
23552384
for (int ieta = 0; ieta < KNEta; ++ieta) {
23562385
const int ibx = state.pmeanTruNchEtabinSpbinStep2->GetXaxis()->FindBin(mcCollision.multNTracksPV());
23572386
const int iby = ieta + 1;
@@ -2546,9 +2575,12 @@ struct RadialFlowDecorr {
25462575
float sum = (etaValA + etaValB);
25472576
for (int isp = 0; isp < KNsp; ++isp) {
25482577

2549-
float c2SubTru = p1kBarTru[isp][ietaA] * p1kBarTru[isp][ietaC];
2550-
float c2SubReco = p1kBarReco[isp][ietaA] * p1kBarReco[isp][ietaC];
2551-
float c2SubRecoEffCor = p1kBarRecoEffCor[isp][ietaA] * p1kBarRecoEffCor[isp][ietaC];
2578+
float c2SubTru = (ietaA == ietaC) ? static_cast<float>(c2Tru[isp][ietaA])
2579+
: p1kBarTru[isp][ietaA] * p1kBarTru[isp][ietaC];
2580+
float c2SubReco = (ietaA == ietaC) ? static_cast<float>(c2Reco[isp][ietaA])
2581+
: p1kBarReco[isp][ietaA] * p1kBarReco[isp][ietaC];
2582+
float c2SubRecoEffCor = (ietaA == ietaC) ? static_cast<float>(c2RecoEffCor[isp][ietaA])
2583+
: p1kBarRecoEffCor[isp][ietaA] * p1kBarRecoEffCor[isp][ietaC];
25522584

25532585
float covTru = p1kBarTruMult[isp][ietaA] * p1kBarTru[isp][ietaC];
25542586
float covReco = p1kBarRecoMult[isp][ietaA] * p1kBarReco[isp][ietaC];
@@ -3200,6 +3232,9 @@ struct RadialFlowDecorr {
32003232
}
32013233
}
32023234

3235+
if (!hasMinTracksInAllEtaBins(sumWi))
3236+
return;
3237+
32033238
for (int isp = 0; isp < KNsp; ++isp) {
32043239
if (sumWi[isp][0] < 1.0f)
32053240
continue;
@@ -3373,6 +3408,9 @@ struct RadialFlowDecorr {
33733408
}
33743409
}
33753410

3411+
if (!hasMinTracksInAllEtaBins(sumwk))
3412+
return;
3413+
33763414
double amplFT0A = 0, amplFT0C = 0;
33773415
if (coll.has_foundFT0()) {
33783416
const auto& ft0 = coll.foundFT0();
@@ -3440,8 +3478,8 @@ struct RadialFlowDecorr {
34403478
histos.fill(HIST("Prof_Cov_Mult_etabin_spbin"), coll.multNTracksPV(), ietaA, isp, covAC);
34413479
}
34423480
if (std::isfinite(covCA)) {
3443-
histos.fill(HIST("Prof_Cov_Cent_etabin_spbin"), cent, ietaA, isp, covCA);
3444-
histos.fill(HIST("Prof_Cov_Mult_etabin_spbin"), coll.multNTracksPV(), ietaA, isp, covCA);
3481+
histos.fill(HIST("Prof_Cov_Cent_etabin_spbin"), cent, ietaC, isp, covCA);
3482+
histos.fill(HIST("Prof_Cov_Mult_etabin_spbin"), coll.multNTracksPV(), ietaC, isp, covCA);
34453483
}
34463484
if (std::isfinite(covFT0A)) {
34473485
histos.fill(HIST("Prof_CovFT0A_Cent_etabin_spbin"), cent, ietaA, isp, covFT0A);
@@ -3464,7 +3502,8 @@ struct RadialFlowDecorr {
34643502

34653503
for (int isp = 0; isp < KNsp; ++isp) {
34663504

3467-
float c2Sub = p1kBar[isp][ietaA] * p1kBar[isp][ietaC];
3505+
float c2Sub = (ietaA == ietaC) ? static_cast<float>(c2[isp][ietaA])
3506+
: p1kBar[isp][ietaA] * p1kBar[isp][ietaC];
34683507
float cov = p1kBarMult[isp][ietaA] * p1kBar[isp][ietaC];
34693508
float covFT0A = p1kBarFt0A * p1kBar[isp][ietaC];
34703509
float covFT0C = p1kBarFt0C * p1kBar[isp][ietaA];

0 commit comments

Comments
 (0)