|
| 1 | +// Copyright 2019-2025 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 femtoPairTrackD0.cxx |
| 13 | +/// \brief Tasks that computes correlation between tracks and D0 mesons |
| 14 | +/// \author igor.ptak.stud@pw.edu.pl, WUT, igor.ptak.stud@pw.edu.pl |
| 15 | + |
| 16 | +#include "PWGCF/Femto/Core/charmHadronBuilder.h" |
| 17 | +#include "PWGCF/Femto/Core/charmHadronHistManager.h" |
| 18 | +#include "PWGCF/Femto/Core/closePairRejection.h" |
| 19 | +#include "PWGCF/Femto/Core/collisionBuilder.h" |
| 20 | +#include "PWGCF/Femto/Core/collisionHistManager.h" |
| 21 | +#include "PWGCF/Femto/Core/modes.h" |
| 22 | +#include "PWGCF/Femto/Core/pairBuilder.h" |
| 23 | +#include "PWGCF/Femto/Core/pairHistManager.h" |
| 24 | +#include "PWGCF/Femto/Core/particleCleaner.h" |
| 25 | +#include "PWGCF/Femto/Core/partitions.h" |
| 26 | +#include "PWGCF/Femto/Core/trackBuilder.h" |
| 27 | +#include "PWGCF/Femto/Core/trackHistManager.h" |
| 28 | +#include "PWGCF/Femto/DataModel/FemtoTables.h" |
| 29 | + |
| 30 | +#include <Framework/ASoA.h> |
| 31 | +#include <Framework/AnalysisHelpers.h> |
| 32 | +#include <Framework/AnalysisTask.h> |
| 33 | +#include <Framework/BinningPolicy.h> |
| 34 | +#include <Framework/Configurable.h> |
| 35 | +#include <Framework/Expressions.h> |
| 36 | +#include <Framework/HistogramRegistry.h> |
| 37 | +#include <Framework/HistogramSpec.h> |
| 38 | +#include <Framework/InitContext.h> |
| 39 | +#include <Framework/OutputObjHeader.h> |
| 40 | +#include <Framework/runDataProcessing.h> |
| 41 | + |
| 42 | +#include <map> |
| 43 | +#include <vector> |
| 44 | + |
| 45 | +using namespace o2::analysis::femto; |
| 46 | + |
| 47 | +struct FemtoPairTrackD0 { |
| 48 | + |
| 49 | + // setup tables |
| 50 | + using FemtoCollisions = o2::soa::Join<o2::aod::FCols, o2::aod::FColMasks>; |
| 51 | + using FilteredFemtoCollisions = o2::soa::Filtered<FemtoCollisions>; |
| 52 | + using FilteredFemtoCollision = FilteredFemtoCollisions::iterator; |
| 53 | + |
| 54 | + using FemtoTracks = o2::soa::Join<o2::aod::FTracks, o2::aod::FTrackMasks>; |
| 55 | + using FemtoD0s = o2::soa::Join<o2::aod::FD0s, o2::aod::FD0Masks>; |
| 56 | + |
| 57 | + o2::framework::SliceCache cache; |
| 58 | + |
| 59 | + // setup collisions |
| 60 | + collisionbuilder::ConfCollisionSelection collisionSelection; |
| 61 | + o2::framework::expressions::Filter collisionFilter = MAKE_COLLISION_FILTER(collisionSelection); |
| 62 | + colhistmanager::ConfCollisionBinning confCollisionBinning; |
| 63 | + |
| 64 | + // setup tracks |
| 65 | + trackbuilder::ConfTrackSelection1 confTrackSelection; |
| 66 | + trackhistmanager::ConfTrackBinning1 confTrackBinning; |
| 67 | + particlecleaner::ConfTrackCleaner1 confTrackCleaner; |
| 68 | + |
| 69 | + o2::framework::Partition<FemtoTracks> trackPartition = MAKE_TRACK_PARTITION(confTrackSelection); |
| 70 | + o2::framework::Preslice<FemtoTracks> perColTracks = o2::aod::femtobase::stored::fColId; |
| 71 | + |
| 72 | + // setup for D0 daughters |
| 73 | + trackhistmanager::ConfD0PosDauBinning confPosDauBinning; |
| 74 | + trackhistmanager::ConfD0NegDauBinning confNegDauBinning; |
| 75 | + |
| 76 | + // setup D0s |
| 77 | + charmhadronbuilder::ConfD0Selection d0Selection; |
| 78 | + charmhadronhistmanager::ConfD0Binning1 confD0Binning; |
| 79 | + particlecleaner::ConfD0Cleaner1 confD0Cleaner; |
| 80 | + |
| 81 | + o2::framework::Partition<FemtoD0s> d0Partition = MAKE_D0_PARTITION(d0Selection); |
| 82 | + o2::framework::Preslice<FemtoD0s> perColD0s = o2::aod::femtobase::stored::fColId; |
| 83 | + |
| 84 | + // setup pairs |
| 85 | + pairhistmanager::ConfPairBinning confPairBinning; |
| 86 | + pairhistmanager::ConfPairCuts confPairCuts; |
| 87 | + |
| 88 | + pairbuilder::PairTrackD0Builder< |
| 89 | + trackhistmanager::PrefixTrack1, |
| 90 | + charmhadronhistmanager::PrefixD01, |
| 91 | + trackhistmanager::PrefixD01PosDaughter, |
| 92 | + trackhistmanager::PrefixD01NegDaughter, |
| 93 | + pairhistmanager::PrefixTrackD0Se, |
| 94 | + pairhistmanager::PrefixTrackD0Me, |
| 95 | + closepairrejection::PrefixTrackD0DaughterSe, |
| 96 | + closepairrejection::PrefixTrackD0DaughterMe, |
| 97 | + modes::CharmHadron::kD0> |
| 98 | + pairTrackD0Builder; |
| 99 | + |
| 100 | + // setup mixing |
| 101 | + std::vector<double> defaultVtxBins{10, -10, 10}; |
| 102 | + std::vector<double> defaultMultBins{50, 0, 200}; |
| 103 | + std::vector<double> defaultCentBins{10, 0, 100}; |
| 104 | + o2::framework::ColumnBinningPolicy<o2::aod::femtocollisions::PosZ, o2::aod::femtocollisions::Mult> mixBinsVtxMult{{defaultVtxBins, defaultMultBins}, true}; |
| 105 | + o2::framework::ColumnBinningPolicy<o2::aod::femtocollisions::PosZ, o2::aod::femtocollisions::Cent> mixBinsVtxCent{{defaultVtxBins, defaultCentBins}, true}; |
| 106 | + o2::framework::ColumnBinningPolicy<o2::aod::femtocollisions::PosZ, o2::aod::femtocollisions::Mult, o2::aod::femtocollisions::Cent> mixBinsVtxMultCent{{defaultVtxBins, defaultMultBins, defaultCentBins}, true}; |
| 107 | + pairhistmanager::ConfMixing confMixing; |
| 108 | + |
| 109 | + o2::framework::HistogramRegistry hRegistry{"FemtoTrackD0", {}, o2::framework::OutputObjHandlingPolicy::AnalysisObject}; |
| 110 | + |
| 111 | + // setup cpr |
| 112 | + closepairrejection::ConfCprTrackD0Daughter confCpr; |
| 113 | + |
| 114 | + void init(o2::framework::InitContext&) |
| 115 | + { |
| 116 | + // setup columnpolicy for binning |
| 117 | + // default values are used during instantiation, so we need to explicity update them here |
| 118 | + mixBinsVtxMult = {{confMixing.vtxBins, confMixing.multBins.value}, true}; |
| 119 | + mixBinsVtxCent = {{confMixing.vtxBins.value, confMixing.centBins.value}, true}; |
| 120 | + mixBinsVtxMultCent = {{confMixing.vtxBins.value, confMixing.multBins.value, confMixing.centBins.value}, true}; |
| 121 | + |
| 122 | + std::map<colhistmanager::ColHist, std::vector<o2::framework::AxisSpec>> colHistSpec = colhistmanager::makeColHistSpecMap(confCollisionBinning); |
| 123 | + std::map<trackhistmanager::TrackHist, std::vector<o2::framework::AxisSpec>> trackHistSpec = trackhistmanager::makeTrackHistSpecMap(confTrackBinning); |
| 124 | + std::map<trackhistmanager::TrackHist, std::vector<o2::framework::AxisSpec>> posDauSpec = trackhistmanager::makeTrackHistSpecMap(confPosDauBinning); |
| 125 | + std::map<trackhistmanager::TrackHist, std::vector<o2::framework::AxisSpec>> negDauSpec = trackhistmanager::makeTrackHistSpecMap(confNegDauBinning); |
| 126 | + std::map<charmhadronhistmanager::CharmHadronHist, std::vector<o2::framework::AxisSpec>> d0HistSpec = charmhadronhistmanager::makeD0HistSpecMap(confD0Binning); |
| 127 | + std::map<pairhistmanager::PairHist, std::vector<o2::framework::AxisSpec>> pairTrackD0HistSpec = pairhistmanager::makePairHistSpecMap(confPairBinning, confMixing); |
| 128 | + std::map<closepairrejection::CprHist, std::vector<o2::framework::AxisSpec>> cprHistSpec = closepairrejection::makeCprHistSpecMap(confCpr); |
| 129 | + |
| 130 | + pairTrackD0Builder.init<modes::Mode::kSe_Reco, modes::Mode::kMe_Reco>(&hRegistry, confCollisionBinning, confTrackSelection, confTrackCleaner, d0Selection, confD0Cleaner, confCpr, confMixing, confPairBinning, confPairCuts, colHistSpec, trackHistSpec, d0HistSpec, posDauSpec, negDauSpec, pairTrackD0HistSpec, cprHistSpec); |
| 131 | + |
| 132 | + hRegistry.print(); |
| 133 | + }; |
| 134 | + |
| 135 | + void processSameEvent(FilteredFemtoCollision const& col, FemtoTracks const& tracks, FemtoD0s const& d0s) |
| 136 | + { |
| 137 | + pairTrackD0Builder.processSameEvent<modes::Mode::kSe_Reco>(col, tracks, trackPartition, d0s, d0Partition, cache); |
| 138 | + } |
| 139 | + PROCESS_SWITCH(FemtoPairTrackD0, processSameEvent, "Enable processing same event processing for tracks and D0s", true); |
| 140 | + |
| 141 | + void processMixedEvent(FilteredFemtoCollisions const& cols, FemtoTracks const& tracks, FemtoD0s const& /*d0s*/) |
| 142 | + { |
| 143 | + pairTrackD0Builder.processMixedEvent<modes::Mode::kMe_Reco>(cols, tracks, trackPartition, d0Partition, cache, mixBinsVtxMult, mixBinsVtxCent, mixBinsVtxMultCent); |
| 144 | + } |
| 145 | + PROCESS_SWITCH(FemtoPairTrackD0, processMixedEvent, "Enable processing mixed event processing for tracks and D0s", true); |
| 146 | +}; |
| 147 | + |
| 148 | +o2::framework::WorkflowSpec defineDataProcessing(o2::framework::ConfigContext const& context) |
| 149 | +{ |
| 150 | + o2::framework::WorkflowSpec workflow{ |
| 151 | + adaptAnalysisTask<FemtoPairTrackD0>(context), |
| 152 | + }; |
| 153 | + return workflow; |
| 154 | +} |
0 commit comments