// 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" using namespace o2; using namespace o2::framework; using namespace o2::framework::expressions; //STEP 1 //Subscription to composite analysis object: V0! //Note: numbers are not allowed in task names struct vzeroexample { //Configurable for number of bins Configurable nBins{"nBins", 100, "N bins in all histos"}; // histogram defined with HistogramRegistry HistogramRegistry registry{ "registry", { {"hVertexZ", "hVertexZ", {HistType::kTH1F, {{nBins, -15., 15.}}}}, {"hMassK0Short", "hMassK0Short", {HistType::kTH1F, {{200, 0.450f, 0.550f}}}} } }; void process(soa::Join::iterator const& collision, aod::V0Datas const& V0s) { //Basic event selection (all helper tasks are now included!) if (!collision.sel8()) { return; } //Fill the event counter //check getter here: https://aliceo2group.github.io/analysis-framework/docs/datamodel/ao2dTables.html registry.get(HIST("hVertexZ"))->Fill(collision.posZ()); for (auto& v0 : V0s) { registry.fill(HIST("hMassK0Short"), v0.mK0Short()); } } }; WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) { return WorkflowSpec{ adaptAnalysisTask(cfgc) }; }