|
| 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 | +// This code calculates output histograms for centrality calibration |
| 13 | +// as well as vertex-Z dependencies of raw variables (either for calibration |
| 14 | +// of vtx-Z dependencies or for the calibration of those). |
| 15 | +// |
| 16 | +// This task is not strictly necessary in a typical analysis workflow, |
| 17 | +// except for centrality calibration! The necessary task is the multiplicity |
| 18 | +// tables. |
| 19 | +// |
| 20 | +// Comments, suggestions, questions? Please write to: |
| 21 | + |
| 22 | + |
| 23 | +// |
| 24 | + |
| 25 | +#include "Framework/runDataProcessing.h" |
| 26 | +#include "Framework/AnalysisTask.h" |
| 27 | +#include "Framework/AnalysisDataModel.h" |
| 28 | +#include "Common/DataModel/McCollisionExtra.h" |
| 29 | +#include "Common/DataModel/Centrality.h" |
| 30 | +#include "Common/DataModel/EventSelection.h" |
| 31 | +#include "Framework/O2DatabasePDGPlugin.h" |
| 32 | +#include "TH1F.h" |
| 33 | +#include "TH2F.h" |
| 34 | + |
| 35 | +using namespace o2; |
| 36 | +using namespace o2::framework; |
| 37 | + |
| 38 | +struct CentQA { |
| 39 | + // Raw multiplicities |
| 40 | + HistogramRegistry histos{"Histos", {}, OutputObjHandlingPolicy::AnalysisObject}; |
| 41 | + |
| 42 | + void init(InitContext&) |
| 43 | + { |
| 44 | + const AxisSpec axisCentrality{205, 0, 205, "centrality"}; |
| 45 | + |
| 46 | + // Base histograms |
| 47 | + histos.add("hV0M", "V0M centrality", kTH1F, {axisCentrality}); |
| 48 | + histos.add("hV0A", "V0A centrality", kTH1F, {axisCentrality}); |
| 49 | + histos.add("hCL0", "CL0 centrality", kTH1F, {axisCentrality}); |
| 50 | + histos.add("hCL1", "CL1 centrality", kTH1F, {axisCentrality}); |
| 51 | + histos.add("hRefMult5", "RefMult5 centrality", kTH1F, {axisCentrality}); |
| 52 | + histos.add("hRefMult8", "RefMult8 centrality", kTH1F, {axisCentrality}); |
| 53 | + } |
| 54 | + |
| 55 | + void processV0M(soa::Join<aod::Collision, aod::CentRun2V0Ms>::iterator const& col) |
| 56 | + { |
| 57 | + histos.fill(HIST("hV0M"), col.centRun2V0M()); |
| 58 | + } |
| 59 | + void processV0A(soa::Join<aod::Collision, aod::CentRun2V0As>::iterator const& col) |
| 60 | + { |
| 61 | + histos.fill(HIST("hV0A"), col.centRun2V0A()); |
| 62 | + } |
| 63 | + void processCL0(soa::Join<aod::Collision, aod::CentRun2CL0s>::iterator const& col) |
| 64 | + { |
| 65 | + histos.fill(HIST("hCL0"), col.centRun2CL0()); |
| 66 | + } |
| 67 | + void processCL1(soa::Join<aod::Collision, aod::CentRun2CL1s>::iterator const& col) |
| 68 | + { |
| 69 | + histos.fill(HIST("hCL1"), col.centRun2CL1()); |
| 70 | + } |
| 71 | + void processRefMult5(soa::Join<aod::Collision, aod::CentRun2RefMult5s>::iterator const& col) |
| 72 | + { |
| 73 | + histos.fill(HIST("hRefMult5"), col.centRun2RefMult5()); |
| 74 | + } |
| 75 | + void processRefMult8(soa::Join<aod::Collision, aod::CentRun2RefMult8s>::iterator const& col) |
| 76 | + { |
| 77 | + histos.fill(HIST("hRefMult8"), col.centRun2RefMult8()); |
| 78 | + } |
| 79 | + |
| 80 | + PROCESS_SWITCH(CentQA, processV0M, "QA V0M centrality", true); |
| 81 | + PROCESS_SWITCH(CentQA, processV0A, "QA V0A centrality", false); |
| 82 | + PROCESS_SWITCH(CentQA, processCL0, "QA CL0 centrality", false); |
| 83 | + PROCESS_SWITCH(CentQA, processCL1, "QA CL1 centrality", false); |
| 84 | + PROCESS_SWITCH(CentQA, processRefMult5, "QA RefMult5 centrality", false); |
| 85 | + PROCESS_SWITCH(CentQA, processRefMult8, "QA RefMult8 centrality", false); |
| 86 | +}; |
| 87 | + |
| 88 | +WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) |
| 89 | +{ |
| 90 | + return WorkflowSpec{ |
| 91 | + adaptAnalysisTask<CentQA>(cfgc)}; |
| 92 | +} |
0 commit comments