// 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" using namespace o2; using namespace o2::framework; using namespace o2::framework::expressions; //STEP 0 //Starting point struct startingpoint { //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.}}}} } }; void process(aod::Collision const& collision) //<- this is the main change { //Fill the event counter //check getter here: https://aliceo2group.github.io/analysis-framework/docs/datamodel/ao2dTables.html registry.get(HIST("hVertexZ"))->Fill(collision.posZ()); } }; WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) { return WorkflowSpec{ adaptAnalysisTask(cfgc) }; }