|
| 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 alice3-strangeness.cxx |
| 13 | +/// |
| 14 | +/// \brief This task produces invariant mass distributions for strange hadrons |
| 15 | +/// |
| 16 | +/// \author Lucia Anna Tarasovičová, Pavol Jozef Šafárik University (SK) |
| 17 | +/// \since November 20, 2025 |
| 18 | +/// |
| 19 | + |
| 20 | +#include "ALICE3/DataModel/OTFStrangeness.h" |
| 21 | +#include "ALICE3/DataModel/tracksAlice3.h" |
| 22 | +#include "Common/DataModel/TrackSelectionTables.h" |
| 23 | + |
| 24 | +#include "Framework/AnalysisDataModel.h" |
| 25 | +#include "Framework/AnalysisTask.h" |
| 26 | +#include "Framework/runDataProcessing.h" |
| 27 | +#include <CommonConstants/MathConstants.h> |
| 28 | +#include <CommonConstants/PhysicsConstants.h> |
| 29 | +#include <DCAFitter/DCAFitterN.h> |
| 30 | +#include <DataFormatsParameters/GRPMagField.h> |
| 31 | +#include <DetectorsBase/Propagator.h> |
| 32 | +#include <DetectorsVertexing/PVertexer.h> |
| 33 | +#include <DetectorsVertexing/PVertexerHelpers.h> |
| 34 | +#include <Field/MagneticField.h> |
| 35 | +#include <Framework/AnalysisDataModel.h> |
| 36 | +#include <Framework/AnalysisTask.h> |
| 37 | +#include <Framework/HistogramRegistry.h> |
| 38 | +#include <Framework/O2DatabasePDGPlugin.h> |
| 39 | +#include <Framework/runDataProcessing.h> |
| 40 | +#include <ReconstructionDataFormats/DCA.h> |
| 41 | +#include <SimulationDataFormat/InteractionSampler.h> |
| 42 | + |
| 43 | +#include <TGenPhaseSpace.h> |
| 44 | +#include <TGeoGlobalMagField.h> |
| 45 | +#include <TLorentzVector.h> |
| 46 | +#include <TPDGCode.h> |
| 47 | +#include <TRandom3.h> |
| 48 | + |
| 49 | +#include <string> |
| 50 | +#include <vector> |
| 51 | + |
| 52 | +using namespace o2; |
| 53 | +using namespace o2::framework; |
| 54 | + |
| 55 | +using alice3tracks = soa::Join<aod::Tracks, aod::TracksCov, aod::McTrackLabels, aod::TracksDCA, aod::TracksExtraA3>; |
| 56 | + |
| 57 | +struct alice3strangeness { |
| 58 | + HistogramRegistry histos{"histos", {}, OutputObjHandlingPolicy::AnalysisObject}; |
| 59 | + ConfigurableAxis axisPt{"axisPt", {VARIABLE_WIDTH, 0.0f, 0.1f, 0.2f, 0.3f, 0.4f, 0.5f, 0.6f, 0.7f, 0.8f, 0.9f, 1.0f, 1.1f, 1.2f, 1.3f, 1.4f, 1.5f, 1.6f, 1.7f, 1.8f, 1.9f, 2.0f, 2.2f, 2.4f, 2.6f, 2.8f, 3.0f, 3.2f, 3.4f, 3.6f, 3.8f, 4.0f, 4.4f, 4.8f, 5.2f, 5.6f, 6.0f, 6.5f, 7.0f, 7.5f, 8.0f, 9.0f, 10.0f, 11.0f, 12.0f, 13.0f, 14.0f, 15.0f, 17.0f, 19.0f, 21.0f, 23.0f, 25.0f, 30.0f, 35.0f, 40.0f, 50.0f}, "pt axis for QA histograms"}; |
| 60 | + ConfigurableAxis axisK0Mass{"axisK0Mass", {200, 0.4f, 0.6f}, ""}; |
| 61 | + ConfigurableAxis axisVertexZ{"axisVertexZ", {40, -20, 20}, "vertex Z (cm)"}; |
| 62 | + |
| 63 | + void init(InitContext&) |
| 64 | + { |
| 65 | + histos.add("K0/hMassAllCandidates", "", kTH2D, {axisK0Mass, axisPt}); |
| 66 | + histos.add("K0/hMassSelected", "", kTH2D, {axisK0Mass, axisPt}); |
| 67 | + histos.add("K0/hSelections", "", kTH1D, {{10, 0, 10}}); |
| 68 | + histos.add("K0/hDCANegDaughter", "", kTH1D, {{200, -5, 5}}); |
| 69 | + histos.add("K0/hDCAPosDaughter", "", kTH1D, {{200, -5, 5}}); |
| 70 | + histos.add("hPVz", "hPVz", kTH1F, {axisVertexZ}); |
| 71 | + } |
| 72 | + long int nEvents = 0; |
| 73 | + void process(aod::Collisions const& collisions, aod::McCollisions const& mcCollisions, aod::UpgradeV0s const& v0Recos, alice3tracks const&) |
| 74 | + { |
| 75 | + LOG(info) << "Event processed " << nEvents++ << " :" << collisions.size() << " " << mcCollisions.size(); |
| 76 | + for (const auto& collision : collisions) { |
| 77 | + float collisionZ = collision.posZ(); |
| 78 | + // std::cout << "______ process V0_______" << collision.size() << std::endl; |
| 79 | + histos.fill(HIST("hPVz"), collisionZ); |
| 80 | + for (const auto& v0Cand : v0Recos) { |
| 81 | + |
| 82 | + auto negV0Daughter = v0Cand.negTrack_as<alice3tracks>(); // de-reference neg track |
| 83 | + auto posV0Daughter = v0Cand.posTrack_as<alice3tracks>(); // de-reference pos track |
| 84 | + |
| 85 | + bool isK0 = v0Cand.mK0() > 0; |
| 86 | + if (isK0) { |
| 87 | + histos.fill(HIST("K0/hMassAllCandidates"), v0Cand.mK0(), v0Cand.pt()); |
| 88 | + histos.fill(HIST("K0/hSelections"), 0); // all candidates |
| 89 | + histos.fill(HIST("K0/hDCANegDaughter"), negV0Daughter.dcaXY()); |
| 90 | + histos.fill(HIST("K0/hDCAPosDaughter"), posV0Daughter.dcaXY()); |
| 91 | + if (std::abs(negV0Daughter.dcaXY()) < 0.05) |
| 92 | + continue; |
| 93 | + histos.fill(HIST("K0/hSelections"), 1); // dcaXY cut |
| 94 | + if (std::abs(posV0Daughter.dcaXY()) < 0.05) |
| 95 | + continue; |
| 96 | + histos.fill(HIST("K0/hSelections"), 2); // dcaXY cut |
| 97 | + if (v0Cand.dcaV0Daughters() > 1.0) |
| 98 | + continue; |
| 99 | + histos.fill(HIST("K0/hSelections"), 3); // dca between daughters |
| 100 | + if (v0Cand.v0Radius() < 0.5) |
| 101 | + continue; |
| 102 | + histos.fill(HIST("K0/hSelections"), 4); // radius cut |
| 103 | + if (std::abs(negV0Daughter.eta()) > 0.8 || std::abs(posV0Daughter.eta()) > 0.8) |
| 104 | + continue; |
| 105 | + histos.fill(HIST("K0/hSelections"), 5); // eta cut |
| 106 | + histos.fill(HIST("K0/hMassSelected"), v0Cand.mK0(), v0Cand.pt()); |
| 107 | + } |
| 108 | + } |
| 109 | + } |
| 110 | + } |
| 111 | + PROCESS_SWITCH(alice3strangeness, process, "", true); |
| 112 | +}; |
| 113 | + |
| 114 | +WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) |
| 115 | +{ |
| 116 | + return WorkflowSpec{ |
| 117 | + adaptAnalysisTask<alice3strangeness>(cfgc)}; |
| 118 | +} |
0 commit comments