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