|
| 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 | +/// \brief Step4 of the Strangeness tutorial |
| 13 | +/// \author Romain Schotter |
| 14 | +/// based on the original codes from: |
| 15 | +/// \author Nepeivoda Roman (roman.nepeivoda@cern.ch) |
| 16 | +/// \author Chiara De Martin (chiara.de.martin@cern.ch) |
| 17 | + |
| 18 | +#include "Framework/runDataProcessing.h" |
| 19 | +#include "Framework/AnalysisTask.h" |
| 20 | +#include "Common/DataModel/EventSelection.h" |
| 21 | +#include "PWGLF/DataModel/LFStrangenessTables.h" |
| 22 | +#include "Framework/O2DatabasePDGPlugin.h" |
| 23 | + |
| 24 | +using namespace o2; |
| 25 | +using namespace o2::framework; |
| 26 | +using namespace o2::framework::expressions; |
| 27 | + |
| 28 | +// STEP 0 |
| 29 | +// Starting point: loop over all cascades and fill invariant mass histogram |
| 30 | + |
| 31 | +struct strangeness_pbpb_tutorial { |
| 32 | + // Histograms are defined with HistogramRegistry |
| 33 | + HistogramRegistry rEventSelection{"eventSelection", {}, OutputObjHandlingPolicy::AnalysisObject, true, true}; |
| 34 | + HistogramRegistry rXi{"xi", {}, OutputObjHandlingPolicy::AnalysisObject, true, true}; |
| 35 | + HistogramRegistry rOmega{"omega", {}, OutputObjHandlingPolicy::AnalysisObject, true, true}; |
| 36 | + |
| 37 | + // Configurable for histograms |
| 38 | + Configurable<int> nBins{"nBins", 100, "N bins in all histos"}; |
| 39 | + |
| 40 | + // Configurable for event selection |
| 41 | + Configurable<float> cutzvertex{"cutzvertex", 10.0f, "Accepted z-vertex range (cm)"}; |
| 42 | + |
| 43 | + // PDG data base |
| 44 | + Service<o2::framework::O2DatabasePDG> pdgDB; |
| 45 | + |
| 46 | + void init(InitContext const&) |
| 47 | + { |
| 48 | + // Axes |
| 49 | + AxisSpec XiMassAxis = {100, 1.28f, 1.36f, "#it{M}_{inv} [GeV/#it{c}^{2}]"}; |
| 50 | + AxisSpec OmegaMassAxis = {100, 1.63f, 1.7f, "#it{M}_{inv} [GeV/#it{c}^{2}]"}; |
| 51 | + AxisSpec vertexZAxis = {nBins, -15., 15., "vrtx_{Z} [cm]"}; |
| 52 | + |
| 53 | + // Histograms |
| 54 | + // Event selection |
| 55 | + rEventSelection.add("hVertexZRec", "hVertexZRec", {HistType::kTH1F, {vertexZAxis}}); |
| 56 | + |
| 57 | + // Xi/Omega reconstruction |
| 58 | + rXi.add("hMassXi", "hMassXi", {HistType::kTH1F, {XiMassAxis}}); |
| 59 | + |
| 60 | + rOmega.add("hMassOmega", "hMassOmega", {HistType::kTH1F, {OmegaMassAxis}}); |
| 61 | + } |
| 62 | + |
| 63 | + // Defining filters for events (event selection) |
| 64 | + // Processed events will be already fulfilling the event selection requirements |
| 65 | + Filter eventFilter = (o2::aod::evsel::sel8 == true); |
| 66 | + Filter posZFilter = (nabs(o2::aod::collision::posZ) < cutzvertex); |
| 67 | + |
| 68 | + void process(soa::Filtered<soa::Join<aod::StraCollisions, aod::StraEvSels>>::iterator const& collision, |
| 69 | + aod::CascCores const& Cascades) |
| 70 | + { |
| 71 | + // Fill the event counter |
| 72 | + rEventSelection.fill(HIST("hVertexZRec"), collision.posZ()); |
| 73 | + |
| 74 | + // Cascades |
| 75 | + for (const auto& casc : Cascades) { |
| 76 | + rXi.fill(HIST("hMassXi"), casc.mXi()); |
| 77 | + rOmega.fill(HIST("hMassOmega"), casc.mOmega()); |
| 78 | + } |
| 79 | + } |
| 80 | +}; |
| 81 | + |
| 82 | +WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) |
| 83 | +{ |
| 84 | + return WorkflowSpec{ |
| 85 | + adaptAnalysisTask<strangeness_pbpb_tutorial>(cfgc)}; |
| 86 | +} |
0 commit comments