Skip to content

Commit 8790e2a

Browse files
authored
[PWGCF] add multiplicity and pT fluctuations task (#17534)
1 parent 211d2df commit 8790e2a

2 files changed

Lines changed: 238 additions & 0 deletions

File tree

PWGCF/EbyEFluctuations/Tasks/CMakeLists.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,3 +88,9 @@ o2physics_add_dpl_workflow(strongly-intensive-corr
8888
SOURCES stronglyIntensiveCorr.cxx
8989
PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore O2Physics::PWGCFCore
9090
COMPONENT_NAME Analysis)
91+
92+
o2physics_add_dpl_workflow(mult-and-pt-fluctuations
93+
SOURCES multAndPtFluctuations.cxx
94+
PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore O2Physics::PWGCFCore
95+
COMPONENT_NAME Analysis)
96+
Lines changed: 232 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,232 @@
1+
// Copyright 2019-2020 CERN and copyright holders of ALICE O2.
2+
// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
3+
// All rights not expressly granted are reserved.
4+
//
5+
// This software is distributed under the terms of the GNU General Public
6+
// License v3 (GPL Version 3), copied verbatim in the file "COPYING".
7+
//
8+
// In applying this license CERN does not waive the privileges and immunities
9+
// granted to it by virtue of its status as an Intergovernmental Organization
10+
// or submit itself to any jurisdiction.
11+
12+
/// \file multAndPtFluctuations.cxx
13+
/// \brief Calculate multiplicity and transverse momentum fluctuations using strongly intensive observables
14+
/// \author Omama Rubza
15+
#include "Common/CCDB/EventSelectionParams.h"
16+
#include "Common/DataModel/Centrality.h"
17+
#include "Common/DataModel/EventSelection.h"
18+
#include "Common/DataModel/TrackSelectionTables.h"
19+
20+
#include <Framework/AnalysisDataModel.h>
21+
#include <Framework/AnalysisTask.h>
22+
#include <Framework/Configurable.h>
23+
#include <Framework/HistogramRegistry.h>
24+
#include <Framework/HistogramSpec.h>
25+
#include <Framework/InitContext.h>
26+
#include <Framework/OutputObjHeader.h>
27+
#include <Framework/runDataProcessing.h>
28+
29+
#include <cmath>
30+
#include <vector>
31+
32+
using namespace o2;
33+
using namespace o2::framework;
34+
using namespace o2::aod;
35+
using namespace o2::framework::expressions;
36+
37+
struct MultAndPtFluctuations {
38+
39+
// ------ Histogram binning
40+
41+
Configurable<int> nBinsPt{"nBinsPt", 100, "pT bins"};
42+
Configurable<int> ndcaXY{"ndcaXY", 100, "DCAxy bins"};
43+
Configurable<int> ndcaZ{"ndcaZ", 100, "DCAz bins"};
44+
Configurable<int> nCentBins{"nCentBins", 100, "Number of centrality bins"};
45+
46+
// ------ Event Cuts
47+
Configurable<float> vtxZcut{"vtxZcut", 10.0f, "vertex Z"};
48+
Configurable<bool> cfgNoSameBunchPileup{"cfgNoSameBunchPileup", true, "kNoSameBunchPileup"};
49+
Configurable<bool> cfgEvSelUseGoodZvtxFT0vsPV{"cfgEvSelUseGoodZvtxFT0vsPV", true, "Good Zvtx FT0 vs PV"};
50+
Configurable<bool> cfgUseGoodITSLayerAllCut{"cfgUseGoodITSLayerAllCut", true, "Good ITS Layers"};
51+
52+
// ----- Centrality estimator
53+
Configurable<bool> cFT0M{"cFT0M", false, "FT0M centrality"}; // for pp
54+
Configurable<bool> cFT0C{"cFT0C", true, "Use FT0C centrality"};
55+
56+
// ------ Track cuts
57+
Configurable<float> ptMinCut{"ptMinCut", 0.2f, "Minimum pT"};
58+
Configurable<float> ptMaxCut{"ptMaxCut", 5.0f, "Maximum pT"};
59+
Configurable<float> etaCut{"etaCut", 0.8f, "Maximum |eta|"};
60+
Configurable<int> itsNClsCut{"itsNClsCut", 4, "Minimum ITS clusters"};
61+
Configurable<float> tpcCrossCut{"tpcCrossCut", 70.0f, "TPC crossed rows"};
62+
Configurable<float> crossedRowsOverFindableCut{"crossedRowsOverFindableCut", 0.8f, "TPC crossed rows over findable"};
63+
Configurable<float> dcaZCut{"dcaZCut", 2.0f, "Maximum DCAz"};
64+
Configurable<float> dcaXYCut{"dcaXYCut", 0.2f, "Maximum DCAxy"};
65+
Configurable<float> tpcChiCut{"tpcChiCut", 4.0f, "TPC chi2/NCls"};
66+
Configurable<float> itsChiCut{"itsChiCut", 36.0f, "ITS chi2/NCls"};
67+
Configurable<bool> requireITS{"requireITS", true, "Require ITS hit"};
68+
Configurable<bool> requireTPC{"requireTPC", true, "Require TPC hit"};
69+
Configurable<bool> requireInnerITS{"requireInnerITS", true, "At least one hit in ITS layers 0,1,2"};
70+
71+
//----- Histogram Registry
72+
HistogramRegistry histos{"histos", {}, OutputObjHandlingPolicy::AnalysisObject};
73+
void init(InitContext const&)
74+
{
75+
const AxisSpec axisEta{30, -1.5, +1.5, "#eta"};
76+
const AxisSpec axisPt{nBinsPt, 0.15, 10.0, "p_{T}"};
77+
const AxisSpec axisVtxz{80, -20, 20, "V_{Z} (cm)"};
78+
const AxisSpec axisPhi{40, -1, 7, "#phi"};
79+
const AxisSpec axisdcaXY{ndcaXY, -0.3, 0.3, "DCAxy"};
80+
const AxisSpec axisdcaZ{ndcaZ, -3.0, 3.0, "DCAz"};
81+
const AxisSpec axisNch{500, 0, 500, "Nch"};
82+
const AxisSpec axisCent{nCentBins, 0.0, 100.0, "Centrality (%)"}; // ------------- centrality bins
83+
histos.add("QA/BeforeCut/VtxZ", "Vertex Z", kTH1F, {axisVtxz});
84+
histos.add("QA/AfterCut/VtxZ", "Vertex Z", kTH1F, {axisVtxz});
85+
histos.add("QA/BeforeCut/Cent", "Centrality", kTH1F, {axisCent});
86+
histos.add("QA/AfterCut/Cent", "Centrality", kTH1F, {axisCent});
87+
histos.add("QA/BeforeCut/Eta", "Eta", kTH1F, {axisEta});
88+
histos.add("QA/AfterCut/Eta", "Eta", kTH1F, {axisEta});
89+
histos.add("QA/BeforeCut/Pt", "Pt", kTH1F, {axisPt});
90+
histos.add("QA/AfterCut/Pt", "Pt", kTH1F, {axisPt});
91+
histos.add("QA/BeforeCut/Phi", "Phi", kTH1F, {axisPhi});
92+
histos.add("QA/AfterCut/Phi", "Phi", kTH1F, {axisPhi});
93+
histos.add("QA/BeforeCut/DcaXY", "DCAxy", kTH1F, {axisdcaXY});
94+
histos.add("QA/AfterCut/DcaXY", "DCAxy", kTH1F, {axisdcaXY});
95+
histos.add("QA/BeforeCut/DcaZ", "DCAz", kTH1F, {axisdcaZ});
96+
histos.add("QA/AfterCut/DcaZ", "DCAz", kTH1F, {axisdcaZ});
97+
histos.add("hNch", "Nch", kTH1F, {axisNch});
98+
histos.add("h2_DcaZ", "DCA_{Z}", kTH2D, {{axisPt}, {axisdcaZ}});
99+
histos.add("h2_DcaXY", "DCA_{XY}", kTH2D, {{axisPt}, {axisdcaXY}});
100+
histos.add("hEventCounter", "Number of events vs centrality", kTH1F, {axisCent});
101+
histos.add("p_a", "<A> vs centrality", kTProfile, {axisCent});
102+
histos.add("p_b", "<B> vs centrality", kTProfile, {axisCent});
103+
histos.add("p_a2", "<A^{2}> vs centrality", kTProfile, {axisCent});
104+
histos.add("p_b2", "<B^{2}> vs centrality", kTProfile, {axisCent});
105+
histos.add("p_ab", "<AB> vs centrality", kTProfile, {axisCent});
106+
histos.add("p_asumb", "<A+B> vs centrality", kTProfile, {axisCent});
107+
}
108+
109+
//---------- Filters
110+
Filter ptFilter = (aod::track::pt > ptMinCut) && (aod::track::pt < ptMaxCut);
111+
Filter etaFilter = nabs(aod::track::eta) < etaCut;
112+
Filter posZFilter = nabs(aod::collision::posZ) < vtxZcut;
113+
114+
using MyColsData = soa::Join<aod::Collisions, aod::EvSels, aod::CentFT0Ms, aod::CentFT0Cs>;
115+
using MyTracksData = soa::Join<aod::Tracks, aod::TrackSelection, aod::TracksExtra, aod::TracksDCA>;
116+
using MyFilteredTracksData = soa::Filtered<MyTracksData>;
117+
118+
void process(MyColsData::iterator const& col, MyFilteredTracksData const& tracks)
119+
{
120+
histos.fill(HIST("QA/BeforeCut/VtxZ"), col.posZ());
121+
float cent = -1.0f;
122+
if (cFT0M) {
123+
cent = col.centFT0M();
124+
}
125+
if (cFT0C) {
126+
cent = col.centFT0C();
127+
// if (!track.isGlobalTrack()) continue;
128+
}
129+
if (cent < 0) {
130+
return;
131+
}
132+
133+
histos.fill(HIST("QA/BeforeCut/Cent"), cent);
134+
if (!col.sel8()) {
135+
return;
136+
}
137+
if (std::abs(col.posZ()) > vtxZcut) {
138+
return;
139+
}
140+
if (cfgNoSameBunchPileup && !col.selection_bit(o2::aod::evsel::kNoSameBunchPileup)) {
141+
return;
142+
}
143+
if (cfgEvSelUseGoodZvtxFT0vsPV && !col.selection_bit(o2::aod::evsel::kIsGoodZvtxFT0vsPV)) {
144+
return;
145+
}
146+
if (cfgUseGoodITSLayerAllCut && !col.selection_bit(o2::aod::evsel::kIsGoodITSLayersAll)) {
147+
return;
148+
}
149+
150+
histos.fill(HIST("hEventCounter"), cent);
151+
histos.fill(HIST("QA/AfterCut/VtxZ"), col.posZ());
152+
histos.fill(HIST("QA/AfterCut/Cent"), cent);
153+
154+
double a = 0.0;
155+
double b = 0.0;
156+
157+
// if (!track.isGlobalTrack()) continue;
158+
for (const auto& track : tracks) {
159+
160+
histos.fill(HIST("QA/BeforeCut/Eta"), track.eta());
161+
histos.fill(HIST("QA/BeforeCut/Pt"), track.pt());
162+
histos.fill(HIST("QA/BeforeCut/Phi"), track.phi());
163+
histos.fill(HIST("QA/BeforeCut/DcaXY"), track.dcaXY());
164+
histos.fill(HIST("QA/BeforeCut/DcaZ"), track.dcaZ());
165+
166+
// Track quality cuts
167+
168+
if (requireITS && !track.hasITS()) {
169+
continue;
170+
}
171+
if (requireTPC && !track.hasTPC()) {
172+
continue;
173+
}
174+
if (track.itsNCls() < itsNClsCut) {
175+
continue;
176+
}
177+
if (track.tpcNClsCrossedRows() < tpcCrossCut) {
178+
continue;
179+
}
180+
if (track.tpcCrossedRowsOverFindableCls() < crossedRowsOverFindableCut) {
181+
continue;
182+
}
183+
if (std::abs(track.dcaZ()) > dcaZCut) {
184+
continue;
185+
}
186+
if (std::abs(track.dcaXY()) > dcaXYCut) {
187+
continue;
188+
}
189+
if (track.tpcChi2NCl() > tpcChiCut) {
190+
continue;
191+
}
192+
if (track.itsChi2NCl() > itsChiCut) {
193+
continue;
194+
}
195+
if (std::abs(track.eta()) > etaCut) {
196+
continue;
197+
}
198+
if (requireInnerITS) {
199+
auto itsMap = track.itsClusterMap();
200+
if (((itsMap & (1 << 0)) == 0) &&
201+
((itsMap & (1 << 1)) == 0) &&
202+
((itsMap & (1 << 2)) == 0)) {
203+
continue;
204+
}
205+
}
206+
207+
// After cuts QA
208+
histos.fill(HIST("QA/AfterCut/Eta"), track.eta());
209+
histos.fill(HIST("QA/AfterCut/Pt"), track.pt());
210+
histos.fill(HIST("QA/AfterCut/Phi"), track.phi());
211+
histos.fill(HIST("QA/AfterCut/DcaXY"), track.dcaXY());
212+
histos.fill(HIST("QA/AfterCut/DcaZ"), track.dcaZ());
213+
histos.fill(HIST("h2_DcaZ"), track.pt(), track.dcaZ());
214+
histos.fill(HIST("h2_DcaXY"), track.pt(), track.dcaXY());
215+
a++; // A-nch, B =pt
216+
b += track.pt();
217+
}
218+
219+
// ---- Fill TProfiles (once per event)
220+
histos.fill(HIST("p_a"), cent, a);
221+
histos.fill(HIST("p_b"), cent, b);
222+
histos.fill(HIST("p_a2"), cent, a * a);
223+
histos.fill(HIST("p_b2"), cent, b * b);
224+
histos.fill(HIST("p_ab"), cent, a * b);
225+
histos.fill(HIST("p_asumb"), cent, a + b);
226+
}
227+
};
228+
229+
WorkflowSpec defineDataProcessing(ConfigContext const& cfgc)
230+
{
231+
return WorkflowSpec{adaptAnalysisTask<MultAndPtFluctuations>(cfgc)};
232+
}

0 commit comments

Comments
 (0)