|
| 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/Core/TrackSelection.h" |
| 16 | +#include "Common/DataModel/Centrality.h" |
| 17 | +#include "Common/DataModel/EventSelection.h" |
| 18 | +#include "Common/DataModel/FT0Corrected.h" |
| 19 | +#include "Common/DataModel/Multiplicity.h" |
| 20 | +#include "Common/DataModel/TrackSelectionTables.h" |
| 21 | + |
| 22 | +#include <Framework/ASoAHelpers.h> |
| 23 | +#include <Framework/AnalysisDataModel.h> |
| 24 | +#include <Framework/AnalysisTask.h> |
| 25 | +#include <Framework/HistogramRegistry.h> |
| 26 | +#include <Framework/HistogramSpec.h> |
| 27 | +#include <Framework/runDataProcessing.h> |
| 28 | + |
| 29 | +#include <TProfile.h> |
| 30 | + |
| 31 | +#include <vector> |
| 32 | + |
| 33 | +using namespace o2; |
| 34 | +using namespace o2::framework; |
| 35 | +using namespace o2::aod; |
| 36 | +using namespace o2::framework::expressions; |
| 37 | + |
| 38 | +struct MultandptFluctuations { |
| 39 | + |
| 40 | + // ------ Histogram binning |
| 41 | + |
| 42 | + Configurable<int> nBinsPt{"nBinsPt", 100, "pT bins"}; |
| 43 | + Configurable<int> ndcaXY{"ndcaXY", 100, "DCAxy bins"}; |
| 44 | + Configurable<int> ndcaZ{"ndcaZ", 100, "DCAz bins"}; |
| 45 | + Configurable<int> nCentBins{"nCentBins", 100, "Number of centrality bins"}; |
| 46 | + |
| 47 | + // ------ Event Cuts |
| 48 | + Configurable<float> vtxZcut{"vtxZcut", 10.0f, "vertex Z"}; |
| 49 | + Configurable<bool> cfgNoSameBunchPileup{"cfgNoSameBunchPileup", true, "kNoSameBunchPileup"}; |
| 50 | + Configurable<bool> cfgEvSelUseGoodZvtxFT0vsPV{"cfgEvSelUseGoodZvtxFT0vsPV", true, "Good Zvtx FT0 vs PV"}; |
| 51 | + Configurable<bool> cfgUseGoodITSLayerAllCut{"cfgUseGoodITSLayerAllCut", true, "Good ITS Layers"}; |
| 52 | + |
| 53 | + // ----- Centrality estimator |
| 54 | + Configurable<bool> cFT0M{"cFT0M", false, "FT0M centrality"}; // for pp |
| 55 | + Configurable<bool> cFT0C{"cFT0C", true, "Use FT0C centrality"}; |
| 56 | + |
| 57 | + // ------ Track cuts |
| 58 | + Configurable<float> ptMinCut{"ptMinCut", 0.2f, "Minimum pT"}; |
| 59 | + Configurable<float> ptMaxCut{"ptMaxCut", 5.0f, "Maximum pT"}; |
| 60 | + Configurable<float> etaCut{"etaCut", 0.8f, "Maximum |eta|"}; |
| 61 | + Configurable<int> itsNClsCut{"itsNClsCut", 4, "Minimum ITS clusters"}; |
| 62 | + Configurable<float> tpcCrossCut{"tpcCrossCut", 70.0f, "TPC crossed rows"}; |
| 63 | + Configurable<float> crossedRowsOverFindableCut{"crossedRowsOverFindableCut", 0.8f, "TPC crossed rows over findable"}; |
| 64 | + Configurable<float> dcaZCut{"dcaZCut", 2.0f, "Maximum DCAz"}; |
| 65 | + Configurable<float> dcaXYCut{"dcaXYCut", 0.2f, "Maximum DCAxy"}; |
| 66 | + Configurable<float> tpcChiCut{"tpcChiCut", 4.0f, "TPC chi2/NCls"}; |
| 67 | + Configurable<float> itsChiCut{"itsChiCut", 36.0f, "ITS chi2/NCls"}; |
| 68 | + Configurable<bool> requireITS{"requireITS", true, "Require ITS hit"}; |
| 69 | + Configurable<bool> requireTPC{"requireTPC", true, "Require TPC hit"}; |
| 70 | + Configurable<bool> requireInnerITS{"requireInnerITS", true, "At least one hit in ITS layers 0,1,2"}; |
| 71 | + |
| 72 | + //----- Histogram Registry |
| 73 | + HistogramRegistry histos{"histos", {}, OutputObjHandlingPolicy::AnalysisObject}; |
| 74 | + void init(InitContext const&) |
| 75 | + { |
| 76 | + const AxisSpec axisEta{30, -1.5, +1.5, "#eta"}; |
| 77 | + const AxisSpec axisPt{nBinsPt, 0.15, 10.0, "p_{T}"}; |
| 78 | + const AxisSpec axisVtxz{80, -20, 20, "V_{Z} (cm)"}; |
| 79 | + const AxisSpec axisPhi{40, -1, 7, "#phi"}; |
| 80 | + const AxisSpec axisdcaXY{ndcaXY, -0.3, 0.3, "DCAxy"}; |
| 81 | + const AxisSpec axisdcaZ{ndcaZ, -3.0, 3.0, "DCAz"}; |
| 82 | + const AxisSpec axisNch{500, 0, 500, "Nch"}; |
| 83 | + const AxisSpec axisCent{nCentBins, 0.0, 100.0, "Centrality (%)"}; // ------------- centrality bins |
| 84 | + histos.add("QA/BeforeCut/VtxZ", "Vertex Z", kTH1F, {axisVtxz}); |
| 85 | + histos.add("QA/AfterCut/VtxZ", "Vertex Z", kTH1F, {axisVtxz}); |
| 86 | + histos.add("QA/BeforeCut/Cent", "Centrality", kTH1F, {axisCent}); |
| 87 | + histos.add("QA/AfterCut/Cent", "Centrality", kTH1F, {axisCent}); |
| 88 | + histos.add("QA/BeforeCut/Eta", "Eta", kTH1F, {axisEta}); |
| 89 | + histos.add("QA/AfterCut/Eta", "Eta", kTH1F, {axisEta}); |
| 90 | + histos.add("QA/BeforeCut/Pt", "Pt", kTH1F, {axisPt}); |
| 91 | + histos.add("QA/AfterCut/Pt", "Pt", kTH1F, {axisPt}); |
| 92 | + histos.add("QA/BeforeCut/Phi", "Phi", kTH1F, {axisPhi}); |
| 93 | + histos.add("QA/AfterCut/Phi", "Phi", kTH1F, {axisPhi}); |
| 94 | + histos.add("QA/BeforeCut/DcaXY", "DCAxy", kTH1F, {axisdcaXY}); |
| 95 | + histos.add("QA/AfterCut/DcaXY", "DCAxy", kTH1F, {axisdcaXY}); |
| 96 | + histos.add("QA/BeforeCut/DcaZ", "DCAz", kTH1F, {axisdcaZ}); |
| 97 | + histos.add("QA/AfterCut/DcaZ", "DCAz", kTH1F, {axisdcaZ}); |
| 98 | + histos.add("hNch", "Nch", kTH1F, {axisNch}); |
| 99 | + histos.add("h2_DcaZ", "DCA_{Z}", kTH2D, {{axisPt}, {axisdcaZ}}); |
| 100 | + histos.add("h2_DcaXY", "DCA_{XY}", kTH2D, {{axisPt}, {axisdcaXY}}); |
| 101 | + histos.add("hEventCounter", "Number of events vs centrality", kTH1F, {axisCent}); |
| 102 | + histos.add("p_a", "<A> vs centrality", kTProfile, {axisCent}); |
| 103 | + histos.add("p_b", "<B> vs centrality", kTProfile, {axisCent}); |
| 104 | + histos.add("p_a2", "<A^{2}> vs centrality", kTProfile, {axisCent}); |
| 105 | + histos.add("p_b2", "<B^{2}> vs centrality", kTProfile, {axisCent}); |
| 106 | + histos.add("p_ab", "<AB> vs centrality", kTProfile, {axisCent}); |
| 107 | + histos.add("p_asumb", "<A+B> vs centrality", kTProfile, {axisCent}); |
| 108 | + } |
| 109 | + |
| 110 | + //---------- Filters |
| 111 | + Filter ptFilter = (aod::track::pt > ptMinCut) && (aod::track::pt < ptMaxCut); |
| 112 | + Filter etaFilter = nabs(aod::track::eta) < etaCut; |
| 113 | + Filter posZFilter = nabs(aod::collision::posZ) < vtxZcut; |
| 114 | + |
| 115 | + using MyColsData = soa::Join<aod::Collisions, aod::EvSels, aod::CentFT0Ms, aod::CentFT0Cs>; |
| 116 | + using MyTracksData = soa::Join<aod::Tracks, aod::TrackSelection, aod::TracksExtra, aod::TracksDCA>; |
| 117 | + using MyFilteredTracksData = soa::Filtered<MyTracksData>; |
| 118 | + |
| 119 | + void process(MyColsData::iterator const& col, MyFilteredTracksData const& tracks) |
| 120 | + { |
| 121 | + histos.fill(HIST("QA/BeforeCut/VtxZ"), col.posZ()); |
| 122 | + float cent = -1.0f; |
| 123 | + if (cFT0M) { |
| 124 | + cent = col.centFT0M(); |
| 125 | + } |
| 126 | + if (cFT0C) { |
| 127 | + cent = col.centFT0C(); |
| 128 | + // if (!track.isGlobalTrack()) continue; |
| 129 | + } |
| 130 | + if (cent < 0) { |
| 131 | + return; |
| 132 | + } |
| 133 | + |
| 134 | + histos.fill(HIST("QA/BeforeCut/Cent"), cent); |
| 135 | + if (!col.sel8()) |
| 136 | + return; |
| 137 | + if (std::abs(col.posZ()) > vtxZcut) |
| 138 | + return; |
| 139 | + if (cfgNoSameBunchPileup && !col.selection_bit(o2::aod::evsel::kNoSameBunchPileup)) |
| 140 | + return; |
| 141 | + if (cfgEvSelUseGoodZvtxFT0vsPV && !col.selection_bit(o2::aod::evsel::kIsGoodZvtxFT0vsPV)) |
| 142 | + return; |
| 143 | + if (cfgUseGoodITSLayerAllCut && !col.selection_bit(o2::aod::evsel::kIsGoodITSLayersAll)) |
| 144 | + return; |
| 145 | + |
| 146 | + histos.fill(HIST("hEventCounter"), cent); |
| 147 | + histos.fill(HIST("QA/AfterCut/VtxZ"), col.posZ()); |
| 148 | + histos.fill(HIST("QA/AfterCut/Cent"), cent); |
| 149 | + |
| 150 | + double a = 0.0; |
| 151 | + double b = 0.0; |
| 152 | + |
| 153 | + // if (!track.isGlobalTrack()) continue; |
| 154 | + for (const auto& track : tracks) { |
| 155 | + |
| 156 | + histos.fill(HIST("QA/BeforeCut/Eta"), track.eta()); |
| 157 | + histos.fill(HIST("QA/BeforeCut/Pt"), track.pt()); |
| 158 | + histos.fill(HIST("QA/BeforeCut/Phi"), track.phi()); |
| 159 | + histos.fill(HIST("QA/BeforeCut/DcaXY"), track.dcaXY()); |
| 160 | + histos.fill(HIST("QA/BeforeCut/DcaZ"), track.dcaZ()); |
| 161 | + |
| 162 | + // Track quality cuts |
| 163 | + |
| 164 | + if (requireITS && !track.hasITS()) |
| 165 | + continue; |
| 166 | + if (requireTPC && !track.hasTPC()) |
| 167 | + continue; |
| 168 | + if (track.itsNCls() < itsNClsCut) |
| 169 | + continue; |
| 170 | + if (track.tpcNClsCrossedRows() < tpcCrossCut) |
| 171 | + continue; |
| 172 | + if (track.tpcCrossedRowsOverFindableCls() < crossedRowsOverFindableCut) |
| 173 | + continue; |
| 174 | + if (std::abs(track.dcaZ()) > dcaZCut) |
| 175 | + continue; |
| 176 | + if (std::abs(track.dcaXY()) > dcaXYCut) |
| 177 | + continue; |
| 178 | + if (track.tpcChi2NCl() > tpcChiCut) |
| 179 | + continue; |
| 180 | + if (track.itsChi2NCl() > itsChiCut) |
| 181 | + continue; |
| 182 | + if (std::abs(track.eta()) > etaCut) |
| 183 | + continue; |
| 184 | + if (requireInnerITS) { |
| 185 | + auto itsMap = track.itsClusterMap(); |
| 186 | + if (!(itsMap & (1 << 0)) && |
| 187 | + !(itsMap & (1 << 1)) && |
| 188 | + !(itsMap & (1 << 2))) { |
| 189 | + continue; |
| 190 | + } |
| 191 | + } |
| 192 | + |
| 193 | + // After cuts QA |
| 194 | + histos.fill(HIST("QA/AfterCut/Eta"), track.eta()); |
| 195 | + histos.fill(HIST("QA/AfterCut/Pt"), track.pt()); |
| 196 | + histos.fill(HIST("QA/AfterCut/Phi"), track.phi()); |
| 197 | + histos.fill(HIST("QA/AfterCut/DcaXY"), track.dcaXY()); |
| 198 | + histos.fill(HIST("QA/AfterCut/DcaZ"), track.dcaZ()); |
| 199 | + histos.fill(HIST("h2_DcaZ"), track.pt(), track.dcaZ()); |
| 200 | + histos.fill(HIST("h2_DcaXY"), track.pt(), track.dcaXY()); |
| 201 | + a++; // A-nch, B =pt |
| 202 | + b += track.pt(); |
| 203 | + } |
| 204 | + |
| 205 | + // ---- Fill TProfiles (once per event) |
| 206 | + histos.fill(HIST("p_a"), cent, a); |
| 207 | + histos.fill(HIST("p_b"), cent, b); |
| 208 | + histos.fill(HIST("p_a2"), cent, a * a); |
| 209 | + histos.fill(HIST("p_b2"), cent, b * b); |
| 210 | + histos.fill(HIST("p_ab"), cent, a * b); |
| 211 | + histos.fill(HIST("p_asumb"), cent, a + b); |
| 212 | + } |
| 213 | +}; |
| 214 | + |
| 215 | +WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) |
| 216 | +{ |
| 217 | + return WorkflowSpec{adaptAnalysisTask<MultandPtFluctuations>(cfgc)}; |
| 218 | +} |
0 commit comments