Skip to content
Open
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
5 changes: 5 additions & 0 deletions PWGEM/PhotonMeson/Tasks/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
PUBLIC_LINK_LIBRARIES O2::Framework O2::EMCALBase O2::EMCALCalib O2Physics::AnalysisCore
COMPONENT_NAME Analysis)

o2physics_add_dpl_workflow(emc-bc-wise-gammagamma

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

View workflow job for this annotation

GitHub Actions / O2 linter

[name/o2-workflow]

Workflow name emc-bc-wise-gammagamma does not match its file name emcalBcWiseGammaGamma.cxx. (Matches emcBcWiseGammagamma.cxx.)
SOURCES emcalBcWiseGammaGamma.cxx
PUBLIC_LINK_LIBRARIES O2::Framework O2::EMCALBase O2::EMCALCalib O2Physics::AnalysisCore
COMPONENT_NAME Analysis)
Expand All @@ -26,47 +26,47 @@
PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore
COMPONENT_NAME Analysis)

o2physics_add_dpl_workflow(pcm-qc

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

View workflow job for this annotation

GitHub Actions / O2 linter

[name/o2-workflow]

Workflow name pcm-qc does not match its file name pcmQC.cxx. (Matches pcmQc.cxx.)
SOURCES pcmQC.cxx
PUBLIC_LINK_LIBRARIES O2::Framework O2::DetectorsBase O2Physics::AnalysisCore O2Physics::PWGEMPhotonMesonCore
COMPONENT_NAME Analysis)

o2physics_add_dpl_workflow(dalitz-ee-qc

Check failure on line 34 in PWGEM/PhotonMeson/Tasks/CMakeLists.txt

View workflow job for this annotation

GitHub Actions / O2 linter

[name/o2-workflow]

Workflow name dalitz-ee-qc does not match its file name dalitzEEQC.cxx. (Matches dalitzEeQc.cxx.)
SOURCES dalitzEEQC.cxx
PUBLIC_LINK_LIBRARIES O2::Framework O2::DetectorsBase O2Physics::AnalysisCore O2Physics::PWGEMPhotonMesonCore O2Physics::MLCore O2Physics::PWGEMDileptonCore
COMPONENT_NAME Analysis)

o2physics_add_dpl_workflow(dalitz-ee-qc-mc

Check failure on line 39 in PWGEM/PhotonMeson/Tasks/CMakeLists.txt

View workflow job for this annotation

GitHub Actions / O2 linter

[name/o2-workflow]

Workflow name dalitz-ee-qc-mc does not match its file name dalitzEEQCMC.cxx. (Matches dalitzEeQcMc.cxx.)
SOURCES dalitzEEQCMC.cxx
PUBLIC_LINK_LIBRARIES O2::Framework O2::DetectorsBase O2Physics::AnalysisCore O2Physics::PWGEMPhotonMesonCore O2Physics::MLCore O2Physics::PWGEMDileptonCore
COMPONENT_NAME Analysis)

o2physics_add_dpl_workflow(emcal-qc

Check failure on line 44 in PWGEM/PhotonMeson/Tasks/CMakeLists.txt

View workflow job for this annotation

GitHub Actions / O2 linter

[name/o2-workflow]

Workflow name emcal-qc does not match its file name emcalQC.cxx. (Matches emcalQc.cxx.)
SOURCES emcalQC.cxx
PUBLIC_LINK_LIBRARIES O2::Framework O2::DetectorsBase O2Physics::AnalysisCore O2Physics::PWGEMPhotonMesonCore
COMPONENT_NAME Analysis)

o2physics_add_dpl_workflow(heavy-neutral-meson

Check failure on line 49 in PWGEM/PhotonMeson/Tasks/CMakeLists.txt

View workflow job for this annotation

GitHub Actions / O2 linter

[name/o2-workflow]

Workflow name heavy-neutral-meson does not match its file name HeavyNeutralMeson.cxx. (Matches heavyNeutralMeson.cxx.)
SOURCES HeavyNeutralMeson.cxx
PUBLIC_LINK_LIBRARIES O2::Framework O2::EMCALBase O2::EMCALCalib O2Physics::AnalysisCore O2Physics::PWGEMPhotonMesonCore
COMPONENT_NAME Analysis)

o2physics_add_dpl_workflow(omega-meson-emc

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

View workflow job for this annotation

GitHub Actions / O2 linter

[name/o2-workflow]

Workflow name omega-meson-emc does not match its file name OmegaMesonEMC.cxx. (Matches omegaMesonEmc.cxx.)
SOURCES OmegaMesonEMC.cxx
PUBLIC_LINK_LIBRARIES O2::Framework O2::EMCALBase O2::EMCALCalib O2Physics::AnalysisCore O2Physics::PWGEMPhotonMesonCore
COMPONENT_NAME Analysis)

o2physics_add_dpl_workflow(phos-qc

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

View workflow job for this annotation

GitHub Actions / O2 linter

[name/o2-workflow]

Workflow name phos-qc does not match its file name phosQC.cxx. (Matches phosQc.cxx.)
SOURCES phosQC.cxx
PUBLIC_LINK_LIBRARIES O2::Framework O2::DetectorsBase O2Physics::AnalysisCore O2Physics::PWGEMPhotonMesonCore
COMPONENT_NAME Analysis)

o2physics_add_dpl_workflow(single-photon

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

View workflow job for this annotation

GitHub Actions / O2 linter

[name/o2-workflow]

Workflow name single-photon does not match its file name SinglePhoton.cxx. (Matches singlePhoton.cxx.)
SOURCES SinglePhoton.cxx
PUBLIC_LINK_LIBRARIES O2::Framework O2::EMCALBase O2::EMCALCalib O2Physics::AnalysisCore O2Physics::PWGEMPhotonMesonCore
COMPONENT_NAME Analysis)

o2physics_add_dpl_workflow(single-photon-mc

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

View workflow job for this annotation

GitHub Actions / O2 linter

[name/o2-workflow]

Workflow name single-photon-mc does not match its file name SinglePhotonMC.cxx. (Matches singlePhotonMc.cxx.)
SOURCES SinglePhotonMC.cxx
PUBLIC_LINK_LIBRARIES O2::Framework O2::EMCALBase O2::EMCALCalib O2Physics::AnalysisCore O2Physics::PWGEMPhotonMesonCore
COMPONENT_NAME Analysis)
Expand Down Expand Up @@ -190,3 +190,8 @@
SOURCES emcalMcTask.cxx
PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore O2Physics::PWGEMPhotonMesonCore
COMPONENT_NAME Analysis)

o2physics_add_dpl_workflow(event-normalization-task
SOURCES eventNormalizationTask.cxx
PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore
COMPONENT_NAME Analysis)
82 changes: 82 additions & 0 deletions PWGEM/PhotonMeson/Tasks/eventNormalizationTask.cxx
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
// 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 eventNormalizationTask.cxx
/// \brief task to produce histogram with event counter information
/// \author Joshua Konig, joshua.konig@cern.ch

#include "PWGEM/PhotonMeson/DataModel/EventTables.h"

#include <Framework/AnalysisDataModel.h>
#include <Framework/AnalysisTask.h>
#include <Framework/HistogramRegistry.h>
#include <Framework/HistogramSpec.h>
#include <Framework/InitContext.h>
#include <Framework/runDataProcessing.h>

#include <TH1D.h>

#include <string>
#include <vector>

using namespace o2;
using namespace o2::aod;
using namespace o2::framework;
using namespace o2::framework::expressions;
using namespace o2::soa;

struct EventNormalizationTask {

HistogramRegistry fRegistry{"output", {}, OutputObjHandlingPolicy::AnalysisObject, false, false};

void init(InitContext& /*context*/)
{
// Names derived from EventAcceptance bits in EventTables.h
std::vector<std::string> vecLabelNames = {
"all",
"has MC coll",
"good zVtx",
"is FT0AND",
"No TFB",
"ITS ROFB",
"Same bunch Pileup",
"ZVtxFT0PV",
"No coll in time range",
"good track occi",
"Good FT0 occupancy",
"kTVXinEMC",
"Good centrality",
"Good RCT",
"Good Sel8"};
fRegistry.add("EventNormalization/hEventCounter", "Event Counter;category;#it{N}_{evt}", kTH1D, {{static_cast<int>(vecLabelNames.size()), -0.5, -0.5 + static_cast<int>(vecLabelNames.size())}}, false);
for (size_t i = 0; i < vecLabelNames.size(); ++i) {
fRegistry.get<TH1>(HIST("EventNormalization/hEventCounter"))->GetXaxis()->SetBinLabel(i + 1, vecLabelNames[i].c_str());
}
}

// Process function only takes the entries and fills them into the histogram. This is done per DF and not per collision
void processNorm(o2::aod::PMEvSelBit const& evSelBit)
{

auto vecEvSelBits = evSelBit.eventSelectionBit();
for (size_t i = 0; i < vecEvSelBits.size(); ++i) {
fRegistry.fill(HIST("EventNormalization/hEventCounter"), i, vecEvSelBits[i]);
}
}

PROCESS_SWITCH(EventNormalizationTask, processNorm, "run event normalization task", true);
};

WorkflowSpec defineDataProcessing(ConfigContext const& context)
{
return WorkflowSpec{
adaptAnalysisTask<EventNormalizationTask>(context, TaskName{"event-normalization-task"})};
}
Loading