Skip to content
Closed
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 PWGJE/Tasks/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2019-2020 CERN and copyright holders of ALICE O2.

Check warning on line 1 in PWGJE/Tasks/CMakeLists.txt

View workflow job for this annotation

GitHub Actions / O2 linter

[name/o2-workflow]

Use kebab-case for names of workflows and match the name of the workflow file.
# See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
# All rights not expressly granted are reserved.
#
Expand All @@ -10,19 +10,19 @@
# or submit itself to any jurisdiction.


o2physics_add_dpl_workflow(emc-cellmonitor

Check warning on line 13 in PWGJE/Tasks/CMakeLists.txt

View workflow job for this annotation

GitHub Actions / O2 linter

[name/o2-workflow]

Workflow name emc-cellmonitor does not match its file name emcCellMonitor.cxx. (Matches emcCellmonitor.cxx.)
SOURCES emcCellMonitor.cxx
PUBLIC_LINK_LIBRARIES O2::Framework O2::EMCALBase O2::EMCALCalib O2Physics::AnalysisCore
COMPONENT_NAME Analysis)
o2physics_add_dpl_workflow(emc-clustermonitor

Check warning on line 17 in PWGJE/Tasks/CMakeLists.txt

View workflow job for this annotation

GitHub Actions / O2 linter

[name/o2-workflow]

Workflow name emc-clustermonitor does not match its file name emcClusterMonitor.cxx. (Matches emcClustermonitor.cxx.)
SOURCES emcClusterMonitor.cxx
PUBLIC_LINK_LIBRARIES O2::Framework O2::EMCALBase O2::EMCALCalib O2Physics::AnalysisCore
COMPONENT_NAME Analysis)
o2physics_add_dpl_workflow(emc-eventselection-qa

Check warning on line 21 in PWGJE/Tasks/CMakeLists.txt

View workflow job for this annotation

GitHub Actions / O2 linter

[name/o2-workflow]

Workflow name emc-eventselection-qa does not match its file name emcEventSelectionQA.cxx. (Matches emcEventselectionQa.cxx.)
SOURCES emcEventSelectionQA.cxx
PUBLIC_LINK_LIBRARIES O2::Framework O2::EMCALBase O2::EMCALCalib O2Physics::AnalysisCore
COMPONENT_NAME Analysis)
o2physics_add_dpl_workflow(emc-vertexselection-qa

Check warning on line 25 in PWGJE/Tasks/CMakeLists.txt

View workflow job for this annotation

GitHub Actions / O2 linter

[name/o2-workflow]

Workflow name emc-vertexselection-qa does not match its file name emcVertexSelectionQA.cxx. (Matches emcVertexselectionQa.cxx.)
SOURCES emcVertexSelectionQA.cxx
PUBLIC_LINK_LIBRARIES O2::Framework O2::EMCALBase O2::EMCALCalib O2Physics::AnalysisCore
COMPONENT_NAME Analysis)
Expand All @@ -30,11 +30,11 @@
SOURCES emcalGammaGammaBcWise.cxx
PUBLIC_LINK_LIBRARIES O2::Framework O2::EMCALBase O2::EMCALCalib O2Physics::AnalysisCore
COMPONENT_NAME Analysis)
o2physics_add_dpl_workflow(emc-pi0-energyscale-calib

Check warning on line 33 in PWGJE/Tasks/CMakeLists.txt

View workflow job for this annotation

GitHub Actions / O2 linter

[name/o2-workflow]

Workflow name emc-pi0-energyscale-calib does not match its file name emcalPi0EnergyScaleCalib.cxx. (Matches emcPi0EnergyscaleCalib.cxx.)
SOURCES emcalPi0EnergyScaleCalib.cxx
PUBLIC_LINK_LIBRARIES O2::Framework O2::EMCALBase O2::EMCALCalib O2Physics::AnalysisCore
COMPONENT_NAME Analysis)
o2physics_add_dpl_workflow(emc-tmmonitor

Check warning on line 37 in PWGJE/Tasks/CMakeLists.txt

View workflow job for this annotation

GitHub Actions / O2 linter

[name/o2-workflow]

Workflow name emc-tmmonitor does not match its file name emcTmMonitor.cxx. (Matches emcTmmonitor.cxx.)
SOURCES emcTmMonitor.cxx
PUBLIC_LINK_LIBRARIES O2::Framework O2::EMCALBase O2::EMCALCalib O2Physics::AnalysisCore
COMPONENT_NAME Analysis)
Expand All @@ -46,7 +46,7 @@
SOURCES mcGeneratorStudies.cxx
PUBLIC_LINK_LIBRARIES O2::Framework O2::EMCALBase O2::EMCALCalib O2Physics::AnalysisCore
COMPONENT_NAME Analysis)
o2physics_add_dpl_workflow(photon-isolation-qa

Check warning on line 49 in PWGJE/Tasks/CMakeLists.txt

View workflow job for this annotation

GitHub Actions / O2 linter

[name/o2-workflow]

Workflow name photon-isolation-qa does not match its file name photonIsolationQA.cxx. (Matches photonIsolationQa.cxx.)
SOURCES photonIsolationQA.cxx
PUBLIC_LINK_LIBRARIES O2::Framework O2::EMCALBase O2::EMCALCalib O2Physics::AnalysisCore
COMPONENT_NAME Analysis)
Expand All @@ -56,6 +56,10 @@
SOURCES jetBackgroundAnalysis.cxx
PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::PWGJECore O2Physics::AnalysisCore
COMPONENT_NAME Analysis)
o2physics_add_dpl_workflow(occupancy-qa
SOURCES occupancyQA.cxx
PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::PWGJECore O2Physics::AnalysisCore
COMPONENT_NAME Analysis)
o2physics_add_dpl_workflow(jet-substructure
SOURCES jetSubstructure.cxx
PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::PWGJECore O2Physics::AnalysisCore
Expand Down
118 changes: 118 additions & 0 deletions PWGJE/Tasks/occupancyQA.cxx
Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@
// 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.

Check warning on line 11 in PWGJE/Tasks/occupancyQA.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[doc/file]

Documentation for \file is missing, incorrect or misplaced.

Check warning on line 11 in PWGJE/Tasks/occupancyQA.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[doc/file]

Documentation for \brief is missing, incorrect or misplaced.
// QA task for occupancy in the jet framework
//
/// \author Aimeric Landou <aimeric.landou@cern.ch>

#include <cmath>
#include <TRandom3.h>
#include <string>

#include "Framework/ASoA.h"
#include "Framework/AnalysisDataModel.h"
#include "Framework/AnalysisTask.h"
#include "Framework/O2DatabasePDGPlugin.h"
#include "Framework/HistogramRegistry.h"
#include "Framework/runDataProcessing.h"

#include "Common/Core/TrackSelection.h"
#include "Common/Core/TrackSelectionDefaults.h"

#include "Common/DataModel/EventSelection.h"
#include "Common/DataModel/TrackSelectionTables.h"

#include "PWGJE/Core/FastJetUtilities.h"
#include "PWGJE/Core/JetFinder.h"
#include "PWGJE/Core/JetFindingUtilities.h"
#include "PWGJE/DataModel/Jet.h"

#include "PWGJE/Core/JetDerivedDataUtilities.h"

#include "EventFiltering/filterTables.h"

using namespace o2;
using namespace o2::framework;
using namespace o2::framework::expressions;

struct OccupancyQATask {

HistogramRegistry registry;

Configurable<std::string> eventSelections{"eventSelections", "sel8", "choose event selection"};
Configurable<float> vertexZCut{"vertexZCut", 10.0f, "Accepted z-vertex range"};
Configurable<float> centralityMin{"centralityMin", -999.0, "minimum centrality"};
Configurable<float> centralityMax{"centralityMax", 999.0, "maximum centrality"};
Configurable<std::string> trackSelections{"trackSelections", "globalTracks", "set track selections"};
Configurable<float> trackEtaMin{"trackEtaMin", -0.9, "minimum eta acceptance for tracks"};
Configurable<float> trackEtaMax{"trackEtaMax", 0.9, "maximum eta acceptance for tracks"};
Configurable<float> trackPtMin{"trackPtMin", 0.15, "minimum pT acceptance for tracks"};
Configurable<float> trackPtMax{"trackPtMax", 100.0, "maximum pT acceptance for tracks"};
// Configurable<float> pTHatMaxMCD{"pTHatMaxMCD", 999.0, "maximum fraction of hard scattering for jet acceptance in detector MC"};
// Configurable<float> pTHatMaxMCP{"pTHatMaxMCP", 999.0, "maximum fraction of hard scattering for jet acceptance in particle MC"};
// Configurable<float> pTHatExponent{"pTHatExponent", 6.0, "exponent of the event weight for the calculation of pTHat"};
// Configurable<bool> checkMcCollisionIsMatched{"checkMcCollisionIsMatched", false, "0: count whole MCcollisions, 1: select MCcollisions which only have their correspond collisions"};

int eventSelection = -1;
int trackSelection = -1;

void init(o2::framework::InitContext&)
{
eventSelection = jetderiveddatautilities::initialiseEventSelection(static_cast<std::string>(eventSelections));
trackSelection = jetderiveddatautilities::initialiseTrackSelection(static_cast<std::string>(trackSelections));

AxisSpec occupancyAxis = {142, -1.5, 14000.5, "occupancy"};
AxisSpec nTracksAxis = {16001, -1., 16000, "n tracks"};

if (doprocessEventsJetData) {
registry.add("h2_occupancy_ntracksall_presel8", "occupancy vs N_{tracks}; occupancy; N_{tracks}", {HistType::kTH2I, {occupancyAxis, nTracksAxis}});
registry.add("h2_occupancy_ntracksall_postsel8", "occupancy vs N_{tracks}; occupancy; N_{tracks}", {HistType::kTH2I, {occupancyAxis, nTracksAxis}});
registry.add("h2_occupancy_ntrackssel_presel8", "occupancy vs N_{tracks}; occupancy; N_{tracks}", {HistType::kTH2I, {occupancyAxis, nTracksAxis}});
registry.add("h2_occupancy_ntrackssel_postsel8", "occupancy vs N_{tracks}; occupancy; N_{tracks}", {HistType::kTH2I, {occupancyAxis, nTracksAxis}});
registry.add("h2_occupancy_ntracksselptetacuts_presel8", "occupancy vs N_{tracks}; occupancy; N_{tracks}", {HistType::kTH2I, {occupancyAxis, nTracksAxis}});
registry.add("h2_occupancy_ntracksselptetacuts_postsel8", "occupancy vs N_{tracks}; occupancy; N_{tracks}", {HistType::kTH2I, {occupancyAxis, nTracksAxis}});
}
}

// Filter trackCuts = (aod::jtrack::pt >= trackPtMin && aod::jtrack::pt < trackPtMax && aod::jtrack::eta > trackEtaMin && aod::jtrack::eta < trackEtaMax);
Filter eventCuts = (nabs(aod::jcollision::posZ) < vertexZCut && aod::jcollision::centrality >= centralityMin && aod::jcollision::centrality < centralityMax);
Filter eventCutsAOD = (nabs(aod::collision::posZ) < vertexZCut);

void processEventsJetData(soa::Filtered<aod::JetCollisions>::iterator const& collision, aod::JetTracks const& tracks)
{

// Before sel8-like selection
int occupancy = collision.trackOccupancyInTimeRange();
int nTracksAll = tracks.size();
int nTracksAllAcceptanceAndSelected = 0;
int nTracksInAcceptanceAndSelected = 0;
for (auto const& track : tracks) {
if (jetderiveddatautilities::selectTrack(track, trackSelection)) {
nTracksAllAcceptanceAndSelected += 1;
if (track.pt() >= trackPtMin && track.pt() < trackPtMax && track.eta() > trackEtaMin && track.eta() < trackEtaMax) {
nTracksInAcceptanceAndSelected += 1;
}
}
}

registry.fill(HIST("h2_occupancy_ntracksall_presel8"), occupancy, nTracksAll);
registry.fill(HIST("h2_occupancy_ntrackssel_presel8"), occupancy, nTracksAllAcceptanceAndSelected);
registry.fill(HIST("h2_occupancy_ntracksselptetacuts_presel8"), occupancy, nTracksInAcceptanceAndSelected);
if (jetderiveddatautilities::selectCollision(collision, eventSelection)) {
registry.fill(HIST("h2_occupancy_ntracksall_postsel8"), occupancy, nTracksAll);
registry.fill(HIST("h2_occupancy_ntrackssel_postsel8"), occupancy, nTracksAllAcceptanceAndSelected);
registry.fill(HIST("h2_occupancy_ntracksselptetacuts_postsel8"), occupancy, nTracksInAcceptanceAndSelected);
}
}
PROCESS_SWITCH(OccupancyQATask, processEventsJetData, "occupancy QA on jet derived data", true);
};

WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) { return WorkflowSpec{adaptAnalysisTask<OccupancyQATask>(cfgc, TaskName{"occupancy-qa"})}; }
Loading