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
2 changes: 1 addition & 1 deletion PWGEM/PhotonMeson/TableProducer/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# 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.
Expand All @@ -14,27 +14,27 @@
PUBLIC_LINK_LIBRARIES O2::Framework O2::DCAFitter O2Physics::AnalysisCore KFParticle::KFParticle
COMPONENT_NAME Analysis)

o2physics_add_dpl_workflow(skimmer-gamma-conversion-truthonlymc

Check warning on line 17 in PWGEM/PhotonMeson/TableProducer/CMakeLists.txt

View workflow job for this annotation

GitHub Actions / O2 linter

Workflow name skimmer-gamma-conversion-truthonlymc does not match its file name skimmerGammaConversionTruthOnlyMc.cxx. (Matches skimmerGammaConversionTruthonlymc.cxx.)
SOURCES skimmerGammaConversionTruthOnlyMc.cxx
PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore
COMPONENT_NAME Analysis)

o2physics_add_dpl_workflow(photon-conversion-builder

Check warning on line 22 in PWGEM/PhotonMeson/TableProducer/CMakeLists.txt

View workflow job for this annotation

GitHub Actions / O2 linter

Workflow name photon-conversion-builder does not match its file name photonconversionbuilder.cxx. (Matches photonConversionBuilder.cxx.)
SOURCES photonconversionbuilder.cxx
PUBLIC_LINK_LIBRARIES O2::Framework O2::DCAFitter O2Physics::AnalysisCore KFParticle::KFParticle O2Physics::TPCDriftManager
COMPONENT_NAME Analysis)

o2physics_add_dpl_workflow(create-pcm

Check warning on line 27 in PWGEM/PhotonMeson/TableProducer/CMakeLists.txt

View workflow job for this annotation

GitHub Actions / O2 linter

Workflow name create-pcm does not match its file name createPCM.cxx. (Matches createPcm.cxx.)
SOURCES createPCM.cxx
PUBLIC_LINK_LIBRARIES O2::Framework O2::DCAFitter O2Physics::AnalysisCore
COMPONENT_NAME Analysis)

o2physics_add_dpl_workflow(create-emevent-photon

Check warning on line 32 in PWGEM/PhotonMeson/TableProducer/CMakeLists.txt

View workflow job for this annotation

GitHub Actions / O2 linter

Workflow name create-emevent-photon does not match its file name createEMEventPhoton.cxx. (Matches createEmeventPhoton.cxx.)
SOURCES createEMEventPhoton.cxx
PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore
PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore O2Physics::PWGJECore
COMPONENT_NAME Analysis)

o2physics_add_dpl_workflow(associate-mc-info-photon

Check warning on line 37 in PWGEM/PhotonMeson/TableProducer/CMakeLists.txt

View workflow job for this annotation

GitHub Actions / O2 linter

Workflow name associate-mc-info-photon does not match its file name associateMCinfoPhoton.cxx. (Matches associateMcInfoPhoton.cxx.)
SOURCES associateMCinfoPhoton.cxx
PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore
COMPONENT_NAME Analysis)
Expand All @@ -44,22 +44,22 @@
PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore
COMPONENT_NAME Analysis)

o2physics_add_dpl_workflow(skimmer-phos

Check warning on line 47 in PWGEM/PhotonMeson/TableProducer/CMakeLists.txt

View workflow job for this annotation

GitHub Actions / O2 linter

Workflow name skimmer-phos does not match its file name skimmerPHOS.cxx. (Matches skimmerPhos.cxx.)
SOURCES skimmerPHOS.cxx
PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore O2::PHOSBase
COMPONENT_NAME Analysis)

o2physics_add_dpl_workflow(skimmer-primary-electron-from-dalitzee

Check warning on line 52 in PWGEM/PhotonMeson/TableProducer/CMakeLists.txt

View workflow job for this annotation

GitHub Actions / O2 linter

Workflow name skimmer-primary-electron-from-dalitzee does not match its file name skimmerPrimaryElectronFromDalitzEE.cxx. (Matches skimmerPrimaryElectronFromDalitzee.cxx.)
SOURCES skimmerPrimaryElectronFromDalitzEE.cxx
PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore
COMPONENT_NAME Analysis)

o2physics_add_dpl_workflow(skimmer-dalitz-ee

Check warning on line 57 in PWGEM/PhotonMeson/TableProducer/CMakeLists.txt

View workflow job for this annotation

GitHub Actions / O2 linter

Workflow name skimmer-dalitz-ee does not match its file name skimmerDalitzEE.cxx. (Matches skimmerDalitzEe.cxx.)
SOURCES skimmerDalitzEE.cxx
PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore
COMPONENT_NAME Analysis)

o2physics_add_dpl_workflow(gamma-table-producer

Check warning on line 62 in PWGEM/PhotonMeson/TableProducer/CMakeLists.txt

View workflow job for this annotation

GitHub Actions / O2 linter

Workflow name gamma-table-producer does not match its file name gammaSelection.cxx. (Matches gammaTableProducer.cxx.)
SOURCES gammaSelection.cxx
PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore
COMPONENT_NAME Analysis)
Expand Down
35 changes: 29 additions & 6 deletions PWGEM/PhotonMeson/TableProducer/createEMEventPhoton.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@

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

#include "PWGJE/DataModel/Jet.h"

using namespace o2;
using namespace o2::framework;
using namespace o2::framework::expressions;
Expand Down Expand Up @@ -70,13 +72,19 @@ struct CreateEMEventPhoton {
Configurable<bool> applyEveSelAtSkimming{"applyEveSel_at_skimming", false, "flag to apply minimal event selection at the skimming level"};
Configurable<bool> needEMCTrigger{"needEMCTrigger", false, "flag to only save events which have kTVXinEMC trigger bit. To reduce PbPb derived data size"};
Configurable<bool> needPHSTrigger{"needPHSTrigger", false, "flag to only save events which have kTVXinPHOS trigger bit. To reduce PbPb derived data size"};
Configurable<bool> enableJJHistograms{"enableJJHistograms", false, "flag to fill JJ QA histograms for outlier rejection"};
Configurable<float> maxpTJetOverpTHard{"maxpTJetOverpTHard", 2., "set weight to 0 for JJ events with larger pTJet/pTHard"};

HistogramRegistry registry{"registry"};
void init(o2::framework::InitContext&)
{
auto hEventCounter = registry.add<TH1>("hEventCounter", "hEventCounter", kTH1I, {{7, 0.5f, 7.5f}});
hEventCounter->GetXaxis()->SetBinLabel(1, "all");
hEventCounter->GetXaxis()->SetBinLabel(2, "sel8");

if (enableJJHistograms) {
auto hJJ_pTHardVsJetpT = registry.add<TH2>("hJJ_pTHardVsJetpT", "hJJ_pTHardVsJetpT;#bf{#it{p}_{T}^{hard}};#bf{#it{p}_{T}^{leading jet}}", kTH2F, {{500, 0, 1000}, {500, 0, 1000}});
}
}

int mRunNumber;
Expand Down Expand Up @@ -132,7 +140,7 @@ struct CreateEMEventPhoton {
}
}

const auto& bc = collision.template foundBC_as<TBCs>();
auto bc = collision.template foundBC_as<TBCs>();
initCCDB(bc);

if (applyEveSelAtSkimming && (!collision.selection_bit(o2::aod::evsel::kIsTriggerTVX) || !collision.selection_bit(o2::aod::evsel::kNoTimeFrameBorder) || !collision.selection_bit(o2::aod::evsel::kNoITSROFrameBorder))) {
Expand Down Expand Up @@ -192,7 +200,11 @@ struct CreateEMEventPhoton {

} // end of skimEvent

void fillEventWeights(MyCollisionsMC const& collisions, aod::McCollisions const&, MyBCs const&)
Preslice<aod::FullMCParticleLevelJets> perCollision_jet = aod::jet::mcCollisionId;

using MyJJCollisions = soa::Join<aod::McCollisions, aod::HepMCXSections>;

void fillEventWeights(MyCollisionsMC const& collisions, MyJJCollisions const&, MyBCs const&, aod::FullMCParticleLevelJets const& jets)
{
for (const auto& collision : collisions) {
if (!collision.has_mcCollision()) {
Expand All @@ -205,8 +217,19 @@ struct CreateEMEventPhoton {
if (applyEveSelAtSkimming && (!collision.selection_bit(o2::aod::evsel::kIsTriggerTVX) || !collision.selection_bit(o2::aod::evsel::kNoTimeFrameBorder) || !collision.selection_bit(o2::aod::evsel::kNoITSROFrameBorder))) {
continue;
}
auto mcCollision = collision.mcCollision();
eventWeights(mcCollision.weight());
auto mcCollision = collision.mcCollision_as<MyJJCollisions>();

// Outlier rejection: Set weight to 0 for events with large pTJet/pTHard
// ----------------------------------------------------------------------
auto jetsInThisCollision = jets.sliceBy(perCollision_jet, mcCollision.globalIndex());
float collisionWeight = mcCollision.weight();
for (const auto& jet : jetsInThisCollision) {
if (jet.pt() > maxpTJetOverpTHard * mcCollision.ptHard())
collisionWeight = 0.f;
registry.fill(HIST("hJJ_pTHardVsJetpT"), mcCollision.ptHard(), jet.pt());
}

eventWeights(collisionWeight);
}
}

Expand All @@ -222,10 +245,10 @@ struct CreateEMEventPhoton {
}
PROCESS_SWITCH(CreateEMEventPhoton, processEventMC, "process event info", false);

void processEventJJMC(MyCollisionsMC const& collisions, aod::McCollisions const& mcCollisions, MyBCs const& bcs)
void processEventJJMC(MyCollisionsMC const& collisions, MyJJCollisions const& mcCollisions, MyBCs const& bcs, aod::FullMCParticleLevelJets const& jets)
{
skimEvent<true, EMEventType::kEvent_JJ>(collisions, bcs);
fillEventWeights(collisions, mcCollisions, bcs);
fillEventWeights(collisions, mcCollisions, bcs, jets);
}
PROCESS_SWITCH(CreateEMEventPhoton, processEventJJMC, "process event info", false);

Expand Down
Loading