// Copyright 2019-2020 CERN and copyright holders of ALICE O2. // See https://alice-o2.web.cern.ch/copyright for details of the copyright holders. // All rights not expressly granted are reserved. // // This software is distributed under the terms of the GNU General Public // License v3 (GPL Version 3), copied verbatim in the file "COPYING". // // In applying this license CERN does not waive the privileges and immunities // granted to it by virtue of its status as an Intergovernmental Organization // or submit itself to any jurisdiction. /// /// \brief this is a starting point for the third session of the tutorial /// \author /// \since #include "Framework/runDataProcessing.h" #include "Framework/AnalysisTask.h" #include "Common/DataModel/TrackSelectionTables.h" #include "PWGLF/DataModel/LFStrangenessTables.h" #include "Common/DataModel/EventSelection.h" #include "Common/DataModel/PIDResponse.h" using namespace o2; using namespace o2::framework; using namespace o2::framework::expressions; //STEP 3 //Now adding particle identification //by using the tpcNSigma track variable using MyTracks = soa::Join; struct vzeropidexample { //Configurable for number of bins Configurable nBins{"nBins", 100, "N bins in all histos"}; // Selection criteria: 5 basic V0 selection criteria! Configurable v0cospa{"v0cospa", 0.97, "V0 CosPA"}; // double -> N.B. dcos(x)/dx = 0 at x=0) Configurable dcav0dau{"dcav0dau", 1.0, "DCA V0 Daughters"}; Configurable dcanegtopv{"dcanegtopv", .1, "DCA Neg To PV"}; Configurable dcapostopv{"dcapostopv", .1, "DCA Pos To PV"}; Configurable v0radius{"v0radius", 0.5, "v0radius"}; //Cannot filter on dynamic columns, so we cut on DCA to PV and DCA between daus only! Filter preFilterV0 = nabs(aod::v0data::dcapostopv) > dcapostopv&& nabs(aod::v0data::dcanegtopv) > dcanegtopv&& aod::v0data::dcaV0daughters < dcav0dau; // histogram defined with HistogramRegistry HistogramRegistry registry{ "registry", { {"hVertexZ", "hVertexZ", {HistType::kTH1F, {{nBins, -15., 15.}}}}, {"hMassK0Short", "hMassK0Short", {HistType::kTH1F, {{200, 0.450f, 0.550f}}}}, {"hMassLambda", "hMassLambda", {HistType::kTH1F, {{200, 1.015f, 1.215f}}}}, {"hMassAntiLambda", "hMassAntiLambda", {HistType::kTH1F, {{200, 1.015f, 1.215f}}}} } }; void process(soa::Join::iterator const& collision, soa::Filtered const& V0s, MyTracks const& tracks) { //Basic event selection (all helper tasks are now included!) if (!collision.sel8()) { return; } //check getter here: https://aliceo2group.github.io/analysis-framework/docs/datamodel/ao2dTables.html registry.get(HIST("hVertexZ"))->Fill(collision.posZ()); for (auto& v0 : V0s) { float nsigma_pos_proton = TMath::Abs(v0.posTrack_as().tpcNSigmaPr()); float nsigma_neg_proton = TMath::Abs(v0.negTrack_as().tpcNSigmaPr()); float nsigma_pos_pion = TMath::Abs(v0.posTrack_as().tpcNSigmaPi()); float nsigma_neg_pion = TMath::Abs(v0.negTrack_as().tpcNSigmaPi()); if (v0.v0radius() > v0radius && v0.v0cosPA(collision.posX(), collision.posY(), collision.posZ()) > v0cospa){ if( nsigma_pos_pion < 4 && nsigma_neg_pion < 4 ){ registry.fill(HIST("hMassK0Short"), v0.mK0Short()); } if( nsigma_pos_proton < 4 && nsigma_neg_pion < 4 ){ registry.fill(HIST("hMassLambda"), v0.mLambda()); } if( nsigma_pos_pion < 4 && nsigma_neg_proton < 4 ){ registry.fill(HIST("hMassAntiLambda"), v0.mAntiLambda()); } } } } }; WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) { return WorkflowSpec{ adaptAnalysisTask(cfgc) }; }