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
24 changes: 18 additions & 6 deletions PWGEM/PhotonMeson/Core/V0PhotonCut.h
Original file line number Diff line number Diff line change
Expand Up @@ -246,8 +246,10 @@ class V0PhotonCut : public TNamed
fRegistry->add("QA/V0Photon/before/hConvZR", "Conversion point ZR", o2::framework::HistType::kTH2F, {thAxisConvZ, thAxisConvR}, true);
fRegistry->add("QA/V0Photon/before/hChi2", "Chi2/ndf from KFParticle;#chi^{2}_{KF}/ndf;counts", o2::framework::HistType::kTH1D, {thAxisChi2}, true);

// TODO: add psi_pair once available
// fRegistry->add("QA/V0Photon/before/hPsiPair", "Psi pair;#Psi_{pair};counts", o2::framework::HistType::kTH1D, {thAxisPsiPair}, true);
// psi_pair (V0PhotonsPhiVPsi) and the KF chi2 split (V0PhotonsKFChi2), filled only if the photon table joins them
fRegistry->add("QA/V0Photon/before/hPsiPair", "Psi pair;#Psi_{pair};counts", o2::framework::HistType::kTH1D, {thAxisPsiPair}, true);
fRegistry->add("QA/V0Photon/before/hChi2Vtx", "KF chi2/ndf of the conversion-vertex fit;#chi^{2}_{vtx}/ndf;counts", o2::framework::HistType::kTH1D, {thAxisChi2}, true);
fRegistry->add("QA/V0Photon/before/hChi2PV", "KF chi2 to the primary vertex;#chi^{2}_{PV};counts", o2::framework::HistType::kTH1D, {{100, 0., 200.}}, true);

fRegistry->add("QA/V0Photon/before/Pos/NSigmaE", "NSigmaE of pos leg vs momentum", o2::framework::HistType::kTH2F, {thAxisMomentum, thAxisNSigmaE}, true);
fRegistry->add("QA/V0Photon/before/Pos/NSigmaPi", "NSigmaE of pos leg vs momentum", o2::framework::HistType::kTH2F, {thAxisMomentum, thAxisNSigmaPi}, true);
Expand Down Expand Up @@ -316,8 +318,13 @@ class V0PhotonCut : public TNamed
fRegistry->fill(HIST("QA/V0Photon/before/hConvZR"), v0.vz(), v0.v0radius());
fRegistry->fill(HIST("QA/V0Photon/before/hChi2"), v0.chiSquareNDF());

// TODO: add psi_pair once available
// fRegistry->fill(HIST("QA/V0Photon/before/hPsiPair"), v0.psiPair());
if constexpr (requires { v0.psipair(); }) {
fRegistry->fill(HIST("QA/V0Photon/before/hPsiPair"), v0.psipair());
}
if constexpr (requires { v0.chi2PV(); }) {
fRegistry->fill(HIST("QA/V0Photon/before/hChi2Vtx"), v0.chi2NDFVtx());
fRegistry->fill(HIST("QA/V0Photon/before/hChi2PV"), v0.chi2PV());
}

fRegistry->fill(HIST("QA/V0Photon/before/Pos/NSigmaE"), pos.p(), pos.tpcNSigmaEl());
fRegistry->fill(HIST("QA/V0Photon/before/Pos/NSigmaPi"), pos.p(), pos.tpcNSigmaPi());
Expand Down Expand Up @@ -346,8 +353,13 @@ class V0PhotonCut : public TNamed
fRegistry->fill(HIST("QA/V0Photon/after/hConvZR"), v0.vz(), v0.v0radius());
fRegistry->fill(HIST("QA/V0Photon/after/hChi2"), v0.chiSquareNDF());

// TODO: add psi_pair once available
// fRegistry->fill(HIST("QA/V0Photon/after/hPsiPair"), v0.psiPair());
if constexpr (requires { v0.psipair(); }) {
fRegistry->fill(HIST("QA/V0Photon/after/hPsiPair"), v0.psipair());
}
if constexpr (requires { v0.chi2PV(); }) {
fRegistry->fill(HIST("QA/V0Photon/after/hChi2Vtx"), v0.chi2NDFVtx());
fRegistry->fill(HIST("QA/V0Photon/after/hChi2PV"), v0.chi2PV());
}

fRegistry->fill(HIST("QA/V0Photon/after/Pos/NSigmaE"), pos.p(), pos.tpcNSigmaEl());
fRegistry->fill(HIST("QA/V0Photon/after/Pos/NSigmaPi"), pos.p(), pos.tpcNSigmaPi());
Expand Down
247 changes: 247 additions & 0 deletions PWGEM/PhotonMeson/DataModel/gammaTables.h

Large diffs are not rendered by default.

10 changes: 10 additions & 0 deletions PWGEM/PhotonMeson/TableProducer/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,16 @@ o2physics_add_dpl_workflow(photon-conversion-builder-tmptable
PUBLIC_LINK_LIBRARIES O2::Framework O2::DCAFitter O2Physics::AnalysisCore O2Physics::MLCore KFParticle::KFParticle O2Physics::TPCDriftManager
COMPONENT_NAME Analysis)

o2physics_add_dpl_workflow(photon-conversion-builder-mixed
SOURCES photonconversionbuilderMixed.cxx
PUBLIC_LINK_LIBRARIES O2::Framework O2::DCAFitter O2Physics::AnalysisCore O2Physics::MLCore KFParticle::KFParticle O2Physics::TPCDriftManager
COMPONENT_NAME Analysis)

o2physics_add_dpl_workflow(photon-mixed-event-producer
SOURCES photonMixedEventProducer.cxx
PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore
COMPONENT_NAME Analysis)

o2physics_add_dpl_workflow(create-emevent-photon
SOURCES createEMEventPhoton.cxx
PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore O2Physics::PWGJECore
Expand Down
24 changes: 23 additions & 1 deletion PWGEM/PhotonMeson/TableProducer/createEMEventPhoton.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
#include <cstddef>
#include <cstdint>
#include <string>
#include <unordered_map>

using namespace o2;
using namespace o2::framework;
Expand All @@ -67,6 +68,8 @@ struct CreateEMEventPhoton {
Produces<o2::aod::EMSWTriggerBits> emswtbit;
Produces<o2::aod::EMEventNormInfos_001> event_norm_info;
Produces<o2::aod::EMEventsWeight> eventWeights;
Produces<o2::aod::EMEventsXY> eventXY; // filled only with fillVertex
Produces<o2::aod::EMEventsCov> eventCov; // filled only with fillVertex

enum class EMEventType : int {
kEvent = 0,
Expand All @@ -75,6 +78,7 @@ struct CreateEMEventPhoton {
kEvent_JJ = 3,
};

Configurable<bool> fillVertex{"fillVertex", false, "fill EMEventsXY and EMEventsCov (primary vertex x, y, covariance, chi2; the tables are written in any case, empty if false), joinable to PMEvents: needed by the co-reconstructed mixed event on derived data (photon-mixed-event-producer processDerived)"};
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"};
Expand Down Expand Up @@ -149,7 +153,10 @@ struct CreateEMEventPhoton {
collision.numContrib(), collision.trackOccupancyInTimeRange(), collision.ft0cOccupancyInTimeRange());
eventalias(collision.alias_raw());

// eventCov(collision.covXX(), collision.covXY(), collision.covXZ(), collision.covYY(), collision.covYZ(), collision.covZZ(), collision.chi2());
if (fillVertex) {
eventXY(collision.posX(), collision.posY());
eventCov(collision.covXX(), collision.covXY(), collision.covXZ(), collision.covYY(), collision.covYZ(), collision.covZZ(), collision.chi2());
}

eventMult(collision.multFT0A(), collision.multFT0C(), collision.multNTracksPV(), collision.multNTracksPVeta1(), collision.multNTracksPVetaHalf());

Expand Down Expand Up @@ -279,6 +286,7 @@ struct CreateEMEventPhoton {
};
struct AssociatePhotonToEMEvent {
Produces<o2::aod::V0KFEMEventIds> v0kfeventid;
Produces<o2::aod::PCMFreeLegEMEventIds> freelegeventid;
Produces<o2::aod::EMPrimaryElectronDaEMEventIds> prmeleventid;
Produces<o2::aod::PHOSEMEventIds> phoseventid;
Produces<o2::aod::EMCEMEventIds> emceventid;
Expand Down Expand Up @@ -312,6 +320,19 @@ struct AssociatePhotonToEMEvent {
fillEventId(collisions, photons, v0kfeventid, perCollisionPCM);
}

// free legs of run 1 (PCMFreeLegIds, linked derived data): one row per free leg, in its order; -1 when the collision has no PMEvent
void processPCMFreeLegs(aod::PMEvents const& collisions, aod::PCMFreeLegIds const& freeLegs)
{
std::unordered_map<int, int> eventOf;
for (const auto& collision : collisions) {
eventOf[collision.collisionId()] = collision.globalIndex();
}
for (const auto& leg : freeLegs) {
const auto it = eventOf.find(leg.collisionId());
freelegeventid(it == eventOf.end() ? -1 : it->second);
}
}

void processElectronFromDalitz(aod::PMEvents const& collisions, aod::EMPrimaryElectronsFromDalitz const& tracks)
{
fillEventId(collisions, tracks, prmeleventid, perCollisionEl);
Expand All @@ -335,6 +356,7 @@ struct AssociatePhotonToEMEvent {
void processDummy(aod::PMEvents const&) {}

PROCESS_SWITCH(AssociatePhotonToEMEvent, processPCM, "process pcm-event indexing", false);
PROCESS_SWITCH(AssociatePhotonToEMEvent, processPCMFreeLegs, "free legs of run 1 (PCMFreeLegIds) -> derived event index, for the mixer on linked derived data", false);
PROCESS_SWITCH(AssociatePhotonToEMEvent, processElectronFromDalitz, "process dalitzee-event indexing", false);
PROCESS_SWITCH(AssociatePhotonToEMEvent, processPHOS, "process phos-event indexing", false);
PROCESS_SWITCH(AssociatePhotonToEMEvent, processEMC, "process emc-event indexing", false);
Expand Down
Loading
Loading