Skip to content

Commit 59b6e11

Browse files
yakparoYakiv
andauthored
[PWGLF] change in hStrangeCorrelation (#8745)
Co-authored-by: Yakiv <5348341@upjs.sk>
1 parent 1fe8ae7 commit 59b6e11

File tree

3 files changed

+211
-57
lines changed

3 files changed

+211
-57
lines changed

PWGLF/DataModel/LFHStrangeCorrelationTables.h

Lines changed: 26 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -50,26 +50,33 @@ DECLARE_SOA_INDEX_COLUMN(Collision, collision); //!
5050
DECLARE_SOA_INDEX_COLUMN_FULL(Track, track, int, Tracks, "_Assoc"); //!
5151
} // namespace assocPions
5252
DECLARE_SOA_TABLE(AssocPions, "AOD", "ASSOCPIONS", o2::soa::Index<>, assocPions::CollisionId, assocPions::TrackId);
53+
54+
namespace assocHadrons
55+
{
56+
DECLARE_SOA_INDEX_COLUMN(Collision, collision); //!
57+
DECLARE_SOA_INDEX_COLUMN_FULL(Track, track, int, Tracks, "_Assoc"); //!
58+
} // namespace assocHadrons
59+
DECLARE_SOA_TABLE(AssocHadrons, "AOD", "ASSOCHADRONS", o2::soa::Index<>, assocHadrons::CollisionId, assocHadrons::TrackId);
5360
/// _________________________________________
5461
/// Table for storing associated V0 indices
5562
namespace assocV0s
5663
{
57-
DECLARE_SOA_INDEX_COLUMN(Collision, collision); //!
58-
DECLARE_SOA_INDEX_COLUMN(V0Core, v0Core); //!
64+
DECLARE_SOA_INDEX_COLUMN(Collision, collision); //!
65+
DECLARE_SOA_INDEX_COLUMN(V0Core, v0Core); //!
5966

6067
// dEdx compatibility is done via encoded integer: 0: passes loose; 1: passes normal, 2: passes tight; definition of loose/normal/tight is in hStrangeCorrelationFilter
6168
DECLARE_SOA_COLUMN(CompatibleK0Short, compatibleK0Short, int); // compatible with K0Short dEdx, encoded syst checks
6269
DECLARE_SOA_COLUMN(CompatibleLambda, compatibleLambda, int); // compatible with Lambda dEdx, encoded syst checks
6370
DECLARE_SOA_COLUMN(CompatibleAntiLambda, compatibleAntiLambda, int); // compatible with AntiLambda dEdx, encoded syst checks
6471

65-
DECLARE_SOA_COLUMN(MCTrueK0Short, mcTrueK0Short, bool); // true K0Short in MC
66-
DECLARE_SOA_COLUMN(MCTrueLambda, mcTrueLambda, bool); // true Lambda in MC
67-
DECLARE_SOA_COLUMN(MCTrueAntiLambda, mcTrueAntiLambda, bool); // true AntiLambda in MC
68-
DECLARE_SOA_COLUMN(MCPhysicalPrimary, mcPhysicalPrimary, bool); // true physical primary flag
69-
DECLARE_SOA_COLUMN(NSigmaMassK0Short, nSigmaMassK0Short, float); //
70-
DECLARE_SOA_COLUMN(NSigmaMassLambda, nSigmaMassLambda, float); //
72+
DECLARE_SOA_COLUMN(MCTrueK0Short, mcTrueK0Short, bool); // true K0Short in MC
73+
DECLARE_SOA_COLUMN(MCTrueLambda, mcTrueLambda, bool); // true Lambda in MC
74+
DECLARE_SOA_COLUMN(MCTrueAntiLambda, mcTrueAntiLambda, bool); // true AntiLambda in MC
75+
DECLARE_SOA_COLUMN(MCPhysicalPrimary, mcPhysicalPrimary, bool); // true physical primary flag
76+
DECLARE_SOA_COLUMN(NSigmaMassK0Short, nSigmaMassK0Short, float); //
77+
DECLARE_SOA_COLUMN(NSigmaMassLambda, nSigmaMassLambda, float); //
7178
DECLARE_SOA_COLUMN(NSigmaMassAntiLambda, nSigmaMassAntiLambda, float); //
72-
DECLARE_SOA_DYNAMIC_COLUMN(Compatible, compatible, //! check compatibility with a hypothesis of a certain number (0 - K0, 1 - L, 2 - Lbar)
79+
DECLARE_SOA_DYNAMIC_COLUMN(Compatible, compatible, //! check compatibility with a hypothesis of a certain number (0 - K0, 1 - L, 2 - Lbar)
7380
[](int cK0Short, int cLambda, int cAntiLambda, int value, int compatibilityLevel) -> bool {
7481
if (value == 0 && bitcheck(cK0Short, compatibilityLevel))
7582
return true;
@@ -119,23 +126,23 @@ DECLARE_SOA_TABLE(AssocV0s, "AOD", "ASSOCV0S", o2::soa::Index<>,
119126
/// Table for storing associated casc indices
120127
namespace assocCascades
121128
{
122-
DECLARE_SOA_INDEX_COLUMN(Collision, collision); //!
123-
DECLARE_SOA_INDEX_COLUMN(CascData, cascData); //!
129+
DECLARE_SOA_INDEX_COLUMN(Collision, collision); //!
130+
DECLARE_SOA_INDEX_COLUMN(CascData, cascData); //!
124131

125132
// dEdx compatibility is done via encoded integer: 0: passes loose; 1: passes normal, 2: passes tight; definition of loose/normal/tight is in hStrangeCorrelationFilter
126133
DECLARE_SOA_COLUMN(CompatibleXiMinus, compatibleXiMinus, int); // compatible with XiMinus
127134
DECLARE_SOA_COLUMN(CompatibleXiPlus, compatibleXiPlus, int); // compatible with XiPlus
128135
DECLARE_SOA_COLUMN(CompatibleOmegaMinus, compatibleOmegaMinus, int); // compatible with OmegaMinus
129136
DECLARE_SOA_COLUMN(CompatibleOmegaPlus, compatibleOmegaPlus, int); // compatible with OmegaPlus
130137

131-
DECLARE_SOA_COLUMN(MCTrueXiMinus, mcTrueXiMinus, bool); // true XiMinus in mc
132-
DECLARE_SOA_COLUMN(MCTrueXiPlus, mcTrueXiPlus, bool); // true XiPlus in mc
133-
DECLARE_SOA_COLUMN(MCTrueOmegaMinus, mcTrueOmegaMinus, bool); // true OmegaMinus in mc
134-
DECLARE_SOA_COLUMN(MCTrueOmegaPlus, mcTrueOmegaPlus, bool); // true OmegaPlus in mc
135-
DECLARE_SOA_COLUMN(MCPhysicalPrimary, mcPhysicalPrimary, bool); // physical primary in MC
136-
DECLARE_SOA_COLUMN(NSigmaMassXi, nSigmaMassXi, float); //
137-
DECLARE_SOA_COLUMN(NSigmaMassOmega, nSigmaMassOmega, float); //
138-
DECLARE_SOA_DYNAMIC_COLUMN(Compatible, compatible, //! check compatibility with a hypothesis of a certain number (0 - K0, 1 - L, 2 - Lbar)
138+
DECLARE_SOA_COLUMN(MCTrueXiMinus, mcTrueXiMinus, bool); // true XiMinus in mc
139+
DECLARE_SOA_COLUMN(MCTrueXiPlus, mcTrueXiPlus, bool); // true XiPlus in mc
140+
DECLARE_SOA_COLUMN(MCTrueOmegaMinus, mcTrueOmegaMinus, bool); // true OmegaMinus in mc
141+
DECLARE_SOA_COLUMN(MCTrueOmegaPlus, mcTrueOmegaPlus, bool); // true OmegaPlus in mc
142+
DECLARE_SOA_COLUMN(MCPhysicalPrimary, mcPhysicalPrimary, bool); // physical primary in MC
143+
DECLARE_SOA_COLUMN(NSigmaMassXi, nSigmaMassXi, float); //
144+
DECLARE_SOA_COLUMN(NSigmaMassOmega, nSigmaMassOmega, float); //
145+
DECLARE_SOA_DYNAMIC_COLUMN(Compatible, compatible, //! check compatibility with a hypothesis of a certain number (0 - K0, 1 - L, 2 - Lbar)
139146
[](int cXiMinus, int cXiPlus, int cOmegaMinus, int cOmegaPlus, int value, int compatibilityLevel) -> bool {
140147
if (value == 0 && bitcheck(cXiMinus, compatibilityLevel))
141148
return true;

PWGLF/TableProducer/Strangeness/hStrangeCorrelationFilter.cxx

Lines changed: 37 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,7 @@ struct hstrangecorrelationfilter {
141141
Produces<aod::AssocPions> assocPion;
142142
Produces<aod::AssocV0s> assocV0;
143143
Produces<aod::AssocCascades> assocCascades;
144+
Produces<aod::AssocHadrons> assocHadrons;
144145

145146
TF1* fK0Mean = new TF1("fK0Mean", "[0]+[1]*x+[2]*TMath::Exp(-[3]*x)");
146147
TF1* fK0Width = new TF1("fK0Width", "[0]+[1]*x+[2]*TMath::Exp(-[3]*x)");
@@ -314,7 +315,41 @@ struct hstrangecorrelationfilter {
314315
continue;
315316
}
316317

317-
assocPion(
318+
assocHadrons(
319+
track.collisionId(),
320+
track.globalIndex());
321+
}
322+
}
323+
324+
void processAssocHadrons(soa::Join<aod::Collisions, aod::EvSels>::iterator const& collision, soa::Filtered<soa::Join<aod::Tracks, aod::TracksExtra, aod::TracksDCA>> const& tracks)
325+
{
326+
// Perform basic event selection
327+
if (!collision.sel8()) {
328+
return;
329+
}
330+
// No need to correlate stuff that's in far collisions
331+
if (TMath::Abs(collision.posZ()) > 10.0) {
332+
return;
333+
}
334+
335+
/// _________________________________________________
336+
/// Step 1: Populate table with trigger tracks
337+
for (auto const& track : tracks) {
338+
if (track.eta() > assocEtaMax || track.eta() < assocEtaMin) {
339+
continue;
340+
}
341+
// if (track.sign()= 1 ) {continue;}
342+
if (track.pt() > assocPtCutMax || track.pt() < assocPtCutMin) {
343+
continue;
344+
}
345+
if (track.tpcNClsCrossedRows() < minTPCNCrossedRows) {
346+
continue; // crossed rows
347+
}
348+
if (!track.hasITS() && triggerRequireITS) {
349+
continue; // skip, doesn't have ITS signal (skips lots of TPC-only!)
350+
}
351+
352+
assocHadrons(
318353
track.collisionId(),
319354
track.globalIndex());
320355
}
@@ -494,6 +529,7 @@ struct hstrangecorrelationfilter {
494529
PROCESS_SWITCH(hstrangecorrelationfilter, processV0s, "Produce associated V0 tables", true);
495530
PROCESS_SWITCH(hstrangecorrelationfilter, processAssocPions, "Produce associated Pion tables", true);
496531
PROCESS_SWITCH(hstrangecorrelationfilter, processCascades, "Produce associated cascade tables", true);
532+
PROCESS_SWITCH(hstrangecorrelationfilter, processAssocHadrons, "Produce associated Hadron tables", true);
497533
};
498534

499535
WorkflowSpec defineDataProcessing(ConfigContext const& cfgc)

0 commit comments

Comments
 (0)