Skip to content

Commit 763f06b

Browse files
SteffimroStefanie Mrozinski
authored andcommitted
[PWGEM] Add new overlay mixed event (#18621)
Co-authored-by: Stefanie Mrozinski <stefanie.mrozinski@stud.uni-frankfurt.de>
1 parent c5b4606 commit 763f06b

10 files changed

Lines changed: 4743 additions & 177 deletions

‎PWGEM/PhotonMeson/Core/V0PhotonCut.h‎

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -246,8 +246,10 @@ class V0PhotonCut : public TNamed
246246
fRegistry->add("QA/V0Photon/before/hConvZR", "Conversion point ZR", o2::framework::HistType::kTH2F, {thAxisConvZ, thAxisConvR}, true);
247247
fRegistry->add("QA/V0Photon/before/hChi2", "Chi2/ndf from KFParticle;#chi^{2}_{KF}/ndf;counts", o2::framework::HistType::kTH1D, {thAxisChi2}, true);
248248

249-
// TODO: add psi_pair once available
250-
// fRegistry->add("QA/V0Photon/before/hPsiPair", "Psi pair;#Psi_{pair};counts", o2::framework::HistType::kTH1D, {thAxisPsiPair}, true);
249+
// psi_pair (V0PhotonsPhiVPsi) and the KF chi2 split (V0PhotonsKFChi2), filled only if the photon table joins them
250+
fRegistry->add("QA/V0Photon/before/hPsiPair", "Psi pair;#Psi_{pair};counts", o2::framework::HistType::kTH1D, {thAxisPsiPair}, true);
251+
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);
252+
fRegistry->add("QA/V0Photon/before/hChi2PV", "KF chi2 to the primary vertex;#chi^{2}_{PV};counts", o2::framework::HistType::kTH1D, {{100, 0., 200.}}, true);
251253

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

319-
// TODO: add psi_pair once available
320-
// fRegistry->fill(HIST("QA/V0Photon/before/hPsiPair"), v0.psiPair());
321+
if constexpr (requires { v0.psipair(); }) {
322+
fRegistry->fill(HIST("QA/V0Photon/before/hPsiPair"), v0.psipair());
323+
}
324+
if constexpr (requires { v0.chi2PV(); }) {
325+
fRegistry->fill(HIST("QA/V0Photon/before/hChi2Vtx"), v0.chi2NDFVtx());
326+
fRegistry->fill(HIST("QA/V0Photon/before/hChi2PV"), v0.chi2PV());
327+
}
321328

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

349-
// TODO: add psi_pair once available
350-
// fRegistry->fill(HIST("QA/V0Photon/after/hPsiPair"), v0.psiPair());
356+
if constexpr (requires { v0.psipair(); }) {
357+
fRegistry->fill(HIST("QA/V0Photon/after/hPsiPair"), v0.psipair());
358+
}
359+
if constexpr (requires { v0.chi2PV(); }) {
360+
fRegistry->fill(HIST("QA/V0Photon/after/hChi2Vtx"), v0.chi2NDFVtx());
361+
fRegistry->fill(HIST("QA/V0Photon/after/hChi2PV"), v0.chi2PV());
362+
}
351363

352364
fRegistry->fill(HIST("QA/V0Photon/after/Pos/NSigmaE"), pos.p(), pos.tpcNSigmaEl());
353365
fRegistry->fill(HIST("QA/V0Photon/after/Pos/NSigmaPi"), pos.p(), pos.tpcNSigmaPi());

‎PWGEM/PhotonMeson/DataModel/gammaTables.h‎

Lines changed: 247 additions & 0 deletions
Large diffs are not rendered by default.

‎PWGEM/PhotonMeson/TableProducer/CMakeLists.txt‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,16 @@ o2physics_add_dpl_workflow(photon-conversion-builder-tmptable
2121
PUBLIC_LINK_LIBRARIES O2::Framework O2::DCAFitter O2Physics::AnalysisCore O2Physics::MLCore KFParticle::KFParticle O2Physics::TPCDriftManager
2222
COMPONENT_NAME Analysis)
2323

24+
o2physics_add_dpl_workflow(photon-conversion-builder-mixed
25+
SOURCES photonconversionbuilderMixed.cxx
26+
PUBLIC_LINK_LIBRARIES O2::Framework O2::DCAFitter O2Physics::AnalysisCore O2Physics::MLCore KFParticle::KFParticle O2Physics::TPCDriftManager
27+
COMPONENT_NAME Analysis)
28+
29+
o2physics_add_dpl_workflow(photon-mixed-event-producer
30+
SOURCES photonMixedEventProducer.cxx
31+
PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore
32+
COMPONENT_NAME Analysis)
33+
2434
o2physics_add_dpl_workflow(create-emevent-photon
2535
SOURCES createEMEventPhoton.cxx
2636
PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore O2Physics::PWGJECore

‎PWGEM/PhotonMeson/TableProducer/createEMEventPhoton.cxx‎

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@
4141
#include <cstddef>
4242
#include <cstdint>
4343
#include <string>
44+
#include <unordered_map>
4445

4546
using namespace o2;
4647
using namespace o2::framework;
@@ -67,6 +68,8 @@ struct CreateEMEventPhoton {
6768
Produces<o2::aod::EMSWTriggerBits> emswtbit;
6869
Produces<o2::aod::EMEventNormInfos_001> event_norm_info;
6970
Produces<o2::aod::EMEventsWeight> eventWeights;
71+
Produces<o2::aod::EMEventsXY> eventXY; // filled only with fillVertex
72+
Produces<o2::aod::EMEventsCov> eventCov; // filled only with fillVertex
7073

7174
enum class EMEventType : int {
7275
kEvent = 0,
@@ -75,6 +78,7 @@ struct CreateEMEventPhoton {
7578
kEvent_JJ = 3,
7679
};
7780

81+
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)"};
7882
Configurable<bool> needEMCTrigger{"needEMCTrigger", false, "flag to only save events which have kTVXinEMC trigger bit. To reduce PbPb derived data size"};
7983
Configurable<bool> needPHSTrigger{"needPHSTrigger", false, "flag to only save events which have kTVXinPHOS trigger bit. To reduce PbPb derived data size"};
8084
Configurable<bool> enableJJHistograms{"enableJJHistograms", false, "flag to fill JJ QA histograms for outlier rejection"};
@@ -149,7 +153,10 @@ struct CreateEMEventPhoton {
149153
collision.numContrib(), collision.trackOccupancyInTimeRange(), collision.ft0cOccupancyInTimeRange());
150154
eventalias(collision.alias_raw());
151155

152-
// eventCov(collision.covXX(), collision.covXY(), collision.covXZ(), collision.covYY(), collision.covYZ(), collision.covZZ(), collision.chi2());
156+
if (fillVertex) {
157+
eventXY(collision.posX(), collision.posY());
158+
eventCov(collision.covXX(), collision.covXY(), collision.covXZ(), collision.covYY(), collision.covYZ(), collision.covZZ(), collision.chi2());
159+
}
153160

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

@@ -279,6 +286,7 @@ struct CreateEMEventPhoton {
279286
};
280287
struct AssociatePhotonToEMEvent {
281288
Produces<o2::aod::V0KFEMEventIds> v0kfeventid;
289+
Produces<o2::aod::PCMFreeLegEMEventIds> freelegeventid;
282290
Produces<o2::aod::EMPrimaryElectronDaEMEventIds> prmeleventid;
283291
Produces<o2::aod::PHOSEMEventIds> phoseventid;
284292
Produces<o2::aod::EMCEMEventIds> emceventid;
@@ -312,6 +320,19 @@ struct AssociatePhotonToEMEvent {
312320
fillEventId(collisions, photons, v0kfeventid, perCollisionPCM);
313321
}
314322

323+
// free legs of run 1 (PCMFreeLegIds, linked derived data): one row per free leg, in its order; -1 when the collision has no PMEvent
324+
void processPCMFreeLegs(aod::PMEvents const& collisions, aod::PCMFreeLegIds const& freeLegs)
325+
{
326+
std::unordered_map<int, int> eventOf;
327+
for (const auto& collision : collisions) {
328+
eventOf[collision.collisionId()] = collision.globalIndex();
329+
}
330+
for (const auto& leg : freeLegs) {
331+
const auto it = eventOf.find(leg.collisionId());
332+
freelegeventid(it == eventOf.end() ? -1 : it->second);
333+
}
334+
}
335+
315336
void processElectronFromDalitz(aod::PMEvents const& collisions, aod::EMPrimaryElectronsFromDalitz const& tracks)
316337
{
317338
fillEventId(collisions, tracks, prmeleventid, perCollisionEl);
@@ -335,6 +356,7 @@ struct AssociatePhotonToEMEvent {
335356
void processDummy(aod::PMEvents const&) {}
336357

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

0 commit comments

Comments
 (0)