Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions PWGEM/Dilepton/Tasks/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,22 +11,22 @@

add_subdirectory(Converters)

o2physics_add_dpl_workflow(efficiency-ee

Check failure on line 14 in PWGEM/Dilepton/Tasks/CMakeLists.txt

View workflow job for this annotation

GitHub Actions / O2 linter

[name/o2-workflow]

Workflow name efficiency-ee does not match its file name emEfficiencyEE.cxx. (Matches efficiencyEe.cxx.)
SOURCES emEfficiencyEE.cxx
PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore O2::DetectorsBase O2Physics::PWGDQCore
COMPONENT_NAME Analysis)

o2physics_add_dpl_workflow(lmee-lf-cocktail

Check failure on line 19 in PWGEM/Dilepton/Tasks/CMakeLists.txt

View workflow job for this annotation

GitHub Actions / O2 linter

[name/o2-workflow]

Workflow name lmee-lf-cocktail does not match its file name lmeeLFCocktail.cxx. (Matches lmeeLfCocktail.cxx.)
SOURCES lmeeLFCocktail.cxx
PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore
COMPONENT_NAME Analysis)

o2physics_add_dpl_workflow(lmee-hf-cocktail

Check failure on line 24 in PWGEM/Dilepton/Tasks/CMakeLists.txt

View workflow job for this annotation

GitHub Actions / O2 linter

[name/o2-workflow]

Workflow name lmee-hf-cocktail does not match its file name lmeeHFCocktail.cxx. (Matches lmeeHfCocktail.cxx.)
SOURCES lmeeHFCocktail.cxx
PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore
COMPONENT_NAME Analysis)

o2physics_add_dpl_workflow(mc-templates

Check failure on line 29 in PWGEM/Dilepton/Tasks/CMakeLists.txt

View workflow job for this annotation

GitHub Actions / O2 linter

[name/o2-workflow]

Workflow name mc-templates does not match its file name MCtemplates.cxx. (Matches mcTemplates.cxx.)
SOURCES MCtemplates.cxx
PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore O2::DetectorsBase O2Physics::PWGDQCore
COMPONENT_NAME Analysis)
Expand All @@ -51,32 +51,32 @@
PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore
COMPONENT_NAME Analysis)

o2physics_add_dpl_workflow(event-qc

Check failure on line 54 in PWGEM/Dilepton/Tasks/CMakeLists.txt

View workflow job for this annotation

GitHub Actions / O2 linter

[name/o2-workflow]

Workflow name event-qc does not match its file name eventQC.cxx. (Matches eventQc.cxx.)
SOURCES eventQC.cxx
PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore O2Physics::EventFilteringUtils
COMPONENT_NAME Analysis)

o2physics_add_dpl_workflow(single-electron-qc

Check failure on line 59 in PWGEM/Dilepton/Tasks/CMakeLists.txt

View workflow job for this annotation

GitHub Actions / O2 linter

[name/o2-workflow]

Workflow name single-electron-qc does not match its file name singleElectronQC.cxx. (Matches singleElectronQc.cxx.)
SOURCES singleElectronQC.cxx
PUBLIC_LINK_LIBRARIES O2::Framework O2::DetectorsBase O2Physics::AnalysisCore O2Physics::MLCore O2Physics::PWGEMDileptonCore
COMPONENT_NAME Analysis)

o2physics_add_dpl_workflow(single-electron-qc-mc

Check failure on line 64 in PWGEM/Dilepton/Tasks/CMakeLists.txt

View workflow job for this annotation

GitHub Actions / O2 linter

[name/o2-workflow]

Workflow name single-electron-qc-mc does not match its file name singleElectronQCMC.cxx. (Matches singleElectronQcMc.cxx.)
SOURCES singleElectronQCMC.cxx
PUBLIC_LINK_LIBRARIES O2::Framework O2::DetectorsBase O2Physics::AnalysisCore O2Physics::MLCore O2Physics::PWGEMDileptonCore
COMPONENT_NAME Analysis)

o2physics_add_dpl_workflow(vp-pair-qc

Check failure on line 69 in PWGEM/Dilepton/Tasks/CMakeLists.txt

View workflow job for this annotation

GitHub Actions / O2 linter

[name/o2-workflow]

Workflow name vp-pair-qc does not match its file name vpPairQC.cxx. (Matches vpPairQc.cxx.)
SOURCES vpPairQC.cxx
PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore O2Physics::MLCore O2Physics::PWGEMDileptonCore
COMPONENT_NAME Analysis)

o2physics_add_dpl_workflow(vp-pair-qc-mc

Check failure on line 74 in PWGEM/Dilepton/Tasks/CMakeLists.txt

View workflow job for this annotation

GitHub Actions / O2 linter

[name/o2-workflow]

Workflow name vp-pair-qc-mc does not match its file name vpPairQCMC.cxx. (Matches vpPairQcMc.cxx.)
SOURCES vpPairQCMC.cxx
PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore O2Physics::MLCore O2Physics::PWGEMDileptonCore
COMPONENT_NAME Analysis)

o2physics_add_dpl_workflow(single-muon-qc

Check failure on line 79 in PWGEM/Dilepton/Tasks/CMakeLists.txt

View workflow job for this annotation

GitHub Actions / O2 linter

[name/o2-workflow]

Workflow name single-muon-qc does not match its file name singleMuonQC.cxx. (Matches singleMuonQc.cxx.)
SOURCES singleMuonQC.cxx
PUBLIC_LINK_LIBRARIES O2::Framework O2::DetectorsBase O2Physics::AnalysisCore O2Physics::PWGEMDileptonCore
COMPONENT_NAME Analysis)
Expand Down Expand Up @@ -161,3 +161,7 @@
PUBLIC_LINK_LIBRARIES O2::Framework O2::DetectorsBase O2Physics::AnalysisCore O2Physics::MLCore O2Physics::PWGEMDileptonCore
COMPONENT_NAME Analysis)

o2physics_add_dpl_workflow(mc-particle-predictions-otf
SOURCES mcParticlePredictionsOTF.cxx
PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore
COMPONENT_NAME Analysis)
98 changes: 98 additions & 0 deletions PWGEM/Dilepton/Tasks/mcParticlePredictionsOTF.cxx
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
// 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.

///
/// \file mcParticlePrediction.cxx
/// \author Sebastian Scheid, s.scheid@cern.ch
/// \brief Task to build the predictions from the models based on the generated particles
///

#include "Framework/AnalysisTask.h"
#include "Framework/HistogramRegistry.h"
#include "Framework/runDataProcessing.h"

using namespace o2;
using namespace o2::framework;

struct otfParticlePrediction {
// histogram registry
HistogramRegistry histos{"Histos", {}, OutputObjHandlingPolicy::AnalysisObject};
// define configurables
ConfigurableAxis binsEta{"binsEta", {100, -5, 5}, "Binning of the Eta axis"};
ConfigurableAxis binsPt{"binsPt", {100, 0, 10}, "Binning of the Pt axis"};

Configurable<float> maxEtaParticle{"maxEtaParticle", 5.f, "Max eta of particles considered"};

// init function
void
init()
{

const AxisSpec axisEta{binsEta, "#eta"};
const AxisSpec axisPt{binsPt, "#it{p}_{T} (GeV/#it{c})"};

histos.add<TH1>("collisions/generated", "collisions", kTH1D, {{2, -0.5, 1.5}});
histos.add<TH2>("particles/generated/pi0", "pi0", kTH2D, {axisPt, axisEta});
histos.add<TH2>("particles/generated/eta", "eta", kTH2D, {axisPt, axisEta});
histos.add<TH2>("particles/generated/etaP", "etaP", kTH2D, {axisPt, axisEta});
histos.add<TH2>("particles/generated/rho", "rho", kTH2D, {axisPt, axisEta});
histos.add<TH2>("particles/generated/omega", "omega", kTH2D, {axisPt, axisEta});
histos.add<TH2>("particles/generated/phi", "phi", kTH2D, {axisPt, axisEta});
}

void process(aod::McCollisions const& mcCollisions,
aod::McParticles const& mcParticles)
{

histos.fill(HIST("collisions/generated"), 0, mcCollisions.size());

for (const auto& particle : mcParticles) {
auto pdg = std::abs(particle.pdgCode());
if (particle.eta() < maxEtaParticle) {
continue;
}
if (pdg < 100) {
continue;
}
if (pdg > 1000) {
continue;
}
switch (pdg) {
case 111:
histos.fill(HIST("particles/generated/pi0"), particle.pt(), particle.eta());
break;
case 221:
histos.fill(HIST("particles/generated/eta"), particle.pt(), particle.eta());
break;
case 331:
histos.fill(HIST("particles/generated/etaP"), particle.pt(), particle.eta());
break;
case 223:
histos.fill(HIST("particles/generated/omega"), particle.pt(), particle.eta());
break;
case 113:
histos.fill(HIST("particles/generated/rho"), particle.pt(), particle.eta());
break;
case 333:
histos.fill(HIST("particles/generated/phi"), particle.pt(), particle.eta());
break;
default:
break;
}
}
}
};

WorkflowSpec
defineDataProcessing(ConfigContext const& cfgc)
{
return WorkflowSpec{adaptAnalysisTask<otfParticlePrediction>(cfgc)};
}
Loading