Skip to content

Commit a8343fd

Browse files
ddobrigkalibuild
andauthored
PWGLF / h-Str correlations: allow for subwagons for systematics (#7155)
* PWGLF / h-Str correlations: allow for subwagons for systematics * Please consider the following formatting changes (#314) * PWGLF: Changes to allow for systematics via subwagons * Fix types * Please consider the following formatting changes (#315) * Fix typo * Megalinter fix --------- Co-authored-by: ALICE Builder <alibuild@users.noreply.github.com>
1 parent 59536df commit a8343fd

3 files changed

Lines changed: 278 additions & 75 deletions

File tree

PWGLF/DataModel/LFHStrangeCorrelationTables.h

Lines changed: 26 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,13 @@
2222
#ifndef PWGLF_DATAMODEL_LFHSTRANGECORRELATIONTABLES_H_
2323
#define PWGLF_DATAMODEL_LFHSTRANGECORRELATIONTABLES_H_
2424

25+
#include <cmath>
2526
#include "Framework/AnalysisDataModel.h"
2627
#include "Common/Core/RecoDecay.h"
2728
#include "CommonConstants/PhysicsConstants.h"
28-
#include <cmath>
29+
30+
// Simple checker
31+
#define bitcheck(var, nbit) ((var) & (1 << (nbit)))
2932

3033
namespace o2::aod
3134
{
@@ -52,9 +55,12 @@ namespace assocV0s
5255
{
5356
DECLARE_SOA_INDEX_COLUMN(Collision, collision); //!
5457
DECLARE_SOA_INDEX_COLUMN(V0Core, v0Core); //!
55-
DECLARE_SOA_COLUMN(CompatibleK0Short, compatibleK0Short, bool); // compatible with K0Short
56-
DECLARE_SOA_COLUMN(CompatibleLambda, compatibleLambda, bool); // compatible with Lambda
57-
DECLARE_SOA_COLUMN(CompatibleAntiLambda, compatibleAntiLambda, bool); // compatible with AntiLambda
58+
59+
// dEdx compatibility is done via encoded integer: 0: passes loose; 1: passes normal, 2: passes tight; definition of loose/normal/tight is in hStrangeCorrelationFilter
60+
DECLARE_SOA_COLUMN(CompatibleK0Short, compatibleK0Short, int); // compatible with K0Short dEdx, encoded syst checks
61+
DECLARE_SOA_COLUMN(CompatibleLambda, compatibleLambda, int); // compatible with Lambda dEdx, encoded syst checks
62+
DECLARE_SOA_COLUMN(CompatibleAntiLambda, compatibleAntiLambda, int); // compatible with AntiLambda dEdx, encoded syst checks
63+
5864
DECLARE_SOA_COLUMN(MCTrueK0Short, mcTrueK0Short, bool); // true K0Short in MC
5965
DECLARE_SOA_COLUMN(MCTrueLambda, mcTrueLambda, bool); // true Lambda in MC
6066
DECLARE_SOA_COLUMN(MCTrueAntiLambda, mcTrueAntiLambda, bool); // true AntiLambda in MC
@@ -63,12 +69,12 @@ DECLARE_SOA_COLUMN(MassRegionK0Short, massRegionK0Short, int); //
6369
DECLARE_SOA_COLUMN(MassRegionLambda, massRegionLambda, int); //
6470
DECLARE_SOA_COLUMN(MassRegionAntiLambda, massRegionAntiLambda, int); //
6571
DECLARE_SOA_DYNAMIC_COLUMN(Compatible, compatible, //! check compatibility with a hypothesis of a certain number (0 - K0, 1 - L, 2 - Lbar)
66-
[](bool cK0Short, bool cLambda, bool cAntiLambda, int value) -> bool {
67-
if (value == 0 && cK0Short)
72+
[](int cK0Short, int cLambda, int cAntiLambda, int value, int compatibilityLevel) -> bool {
73+
if (value == 0 && bitcheck(cK0Short, compatibilityLevel))
6874
return true;
69-
if (value == 1 && cLambda)
75+
if (value == 1 && bitcheck(cLambda, compatibilityLevel))
7076
return true;
71-
if (value == 2 && cAntiLambda)
77+
if (value == 2 && bitcheck(cAntiLambda, compatibilityLevel))
7278
return true;
7379
return false;
7480
});
@@ -125,10 +131,13 @@ namespace assocCascades
125131
{
126132
DECLARE_SOA_INDEX_COLUMN(Collision, collision); //!
127133
DECLARE_SOA_INDEX_COLUMN(CascData, cascData); //!
128-
DECLARE_SOA_COLUMN(CompatibleXiMinus, compatibleXiMinus, bool); // compatible with XiMinus
129-
DECLARE_SOA_COLUMN(CompatibleXiPlus, compatibleXiPlus, bool); // compatible with XiPlus
130-
DECLARE_SOA_COLUMN(CompatibleOmegaMinus, compatibleOmegaMinus, bool); // compatible with OmegaMinus
131-
DECLARE_SOA_COLUMN(CompatibleOmegaPlus, compatibleOmegaPlus, bool); // compatible with OmegaPlus
134+
135+
// dEdx compatibility is done via encoded integer: 0: passes loose; 1: passes normal, 2: passes tight; definition of loose/normal/tight is in hStrangeCorrelationFilter
136+
DECLARE_SOA_COLUMN(CompatibleXiMinus, compatibleXiMinus, int); // compatible with XiMinus
137+
DECLARE_SOA_COLUMN(CompatibleXiPlus, compatibleXiPlus, int); // compatible with XiPlus
138+
DECLARE_SOA_COLUMN(CompatibleOmegaMinus, compatibleOmegaMinus, int); // compatible with OmegaMinus
139+
DECLARE_SOA_COLUMN(CompatibleOmegaPlus, compatibleOmegaPlus, int); // compatible with OmegaPlus
140+
132141
DECLARE_SOA_COLUMN(MCTrueXiMinus, mcTrueXiMinus, bool); // true XiMinus in mc
133142
DECLARE_SOA_COLUMN(MCTrueXiPlus, mcTrueXiPlus, bool); // true XiPlus in mc
134143
DECLARE_SOA_COLUMN(MCTrueOmegaMinus, mcTrueOmegaMinus, bool); // true OmegaMinus in mc
@@ -137,14 +146,14 @@ DECLARE_SOA_COLUMN(MCPhysicalPrimary, mcPhysicalPrimary, bool); // physica
137146
DECLARE_SOA_COLUMN(MassRegionXi, massRegionXi, int); //
138147
DECLARE_SOA_COLUMN(MassRegionOmega, massRegionOmega, int); //
139148
DECLARE_SOA_DYNAMIC_COLUMN(Compatible, compatible, //! check compatibility with a hypothesis of a certain number (0 - K0, 1 - L, 2 - Lbar)
140-
[](bool cXiMinus, bool cXiPlus, bool cOmegaMinus, bool cOmegaPlus, int value) -> bool {
141-
if (value == 0 && cXiMinus)
149+
[](int cXiMinus, int cXiPlus, int cOmegaMinus, int cOmegaPlus, int value, int compatibilityLevel) -> bool {
150+
if (value == 0 && bitcheck(cXiMinus, compatibilityLevel))
142151
return true;
143-
if (value == 1 && cXiPlus)
152+
if (value == 1 && bitcheck(cXiPlus, compatibilityLevel))
144153
return true;
145-
if (value == 2 && cOmegaMinus)
154+
if (value == 2 && bitcheck(cOmegaMinus, compatibilityLevel))
146155
return true;
147-
if (value == 3 && cOmegaPlus)
156+
if (value == 3 && bitcheck(cOmegaPlus, compatibilityLevel))
148157
return true;
149158
return false;
150159
});

PWGLF/TableProducer/Strangeness/hStrangeCorrelationFilter.cxx

Lines changed: 71 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -33,14 +33,17 @@ using namespace o2;
3333
using namespace o2::framework;
3434
using namespace o2::framework::expressions;
3535

36+
#define bitset(var, nbit) ((var) |= (1 << (nbit)))
3637
#define bitcheck(var, nbit) ((var) & (1 << (nbit)))
3738

3839
struct hstrangecorrelationfilter {
3940
HistogramRegistry histos{"Histos", {}, OutputObjHandlingPolicy::AnalysisObject};
4041

4142
// Operational
4243
Configurable<bool> fillTableOnlyWithCompatible{"fillTableOnlyWithCompatible", true, "pre-apply dE/dx, broad mass window in table filling"};
43-
Configurable<float> strangedEdxNSigma{"strangedEdxNSigma", 5, "Nsigmas for strange decay daughters"};
44+
Configurable<float> strangedEdxNSigmaLoose{"strangedEdxNSigmaLoose", 5, "Nsigmas for strange decay daughters"};
45+
Configurable<float> strangedEdxNSigma{"strangedEdxNSigma", 4, "Nsigmas for strange decay daughters"};
46+
Configurable<float> strangedEdxNSigmaTight{"strangedEdxNSigmaTight", 3, "Nsigmas for strange decay daughters"};
4447

4548
// Trigger particle selections in phase space
4649
Configurable<float> triggerEtaMin{"triggerEtaCutMin", -0.8, "triggeretamin"};
@@ -329,9 +332,9 @@ struct hstrangecorrelationfilter {
329332
continue;
330333
}
331334
// check dE/dx compatibility
332-
bool compatibleK0Short = false;
333-
bool compatibleLambda = false;
334-
bool compatibleAntiLambda = false;
335+
int compatibleK0Short = 0;
336+
int compatibleLambda = 0;
337+
int compatibleAntiLambda = 0;
335338

336339
auto posdau = v0.posTrack_as<DauTracks>();
337340
auto negdau = v0.negTrack_as<DauTracks>();
@@ -342,19 +345,33 @@ struct hstrangecorrelationfilter {
342345
if (posdau.tpcNClsCrossedRows() < minTPCNCrossedRows)
343346
continue;
344347

345-
if (TMath::Abs(posdau.tpcNSigmaPi()) < strangedEdxNSigma && TMath::Abs(negdau.tpcNSigmaPi()) < strangedEdxNSigma) {
346-
compatibleK0Short = true;
347-
}
348-
if (TMath::Abs(posdau.tpcNSigmaPr()) < strangedEdxNSigma && TMath::Abs(negdau.tpcNSigmaPi()) < strangedEdxNSigma) {
349-
if (v0.v0cosPA() > lambdaCospa) {
350-
compatibleLambda = true;
351-
}
352-
}
353-
if (TMath::Abs(posdau.tpcNSigmaPi()) < strangedEdxNSigma && TMath::Abs(negdau.tpcNSigmaPr()) < strangedEdxNSigma) {
354-
if (v0.v0cosPA() > lambdaCospa) {
355-
compatibleAntiLambda = true;
356-
}
357-
}
348+
if (TMath::Abs(posdau.tpcNSigmaPi()) < strangedEdxNSigmaLoose && TMath::Abs(negdau.tpcNSigmaPi()) < strangedEdxNSigmaLoose)
349+
bitset(compatibleK0Short, 0);
350+
if (TMath::Abs(posdau.tpcNSigmaPi()) < strangedEdxNSigma && TMath::Abs(negdau.tpcNSigmaPi()) < strangedEdxNSigma)
351+
bitset(compatibleK0Short, 1);
352+
if (TMath::Abs(posdau.tpcNSigmaPi()) < strangedEdxNSigmaTight && TMath::Abs(negdau.tpcNSigmaPi()) < strangedEdxNSigmaTight)
353+
bitset(compatibleK0Short, 2);
354+
355+
if (TMath::Abs(posdau.tpcNSigmaPr()) < strangedEdxNSigmaLoose && TMath::Abs(negdau.tpcNSigmaPi()) < strangedEdxNSigmaLoose)
356+
if (v0.v0cosPA() > lambdaCospa)
357+
bitset(compatibleLambda, 0);
358+
if (TMath::Abs(posdau.tpcNSigmaPr()) < strangedEdxNSigma && TMath::Abs(negdau.tpcNSigmaPi()) < strangedEdxNSigma)
359+
if (v0.v0cosPA() > lambdaCospa)
360+
bitset(compatibleLambda, 1);
361+
if (TMath::Abs(posdau.tpcNSigmaPr()) < strangedEdxNSigmaTight && TMath::Abs(negdau.tpcNSigmaPi()) < strangedEdxNSigmaTight)
362+
if (v0.v0cosPA() > lambdaCospa)
363+
bitset(compatibleLambda, 2);
364+
365+
if (TMath::Abs(posdau.tpcNSigmaPi()) < strangedEdxNSigmaLoose && TMath::Abs(negdau.tpcNSigmaPr()) < strangedEdxNSigmaLoose)
366+
if (v0.v0cosPA() > lambdaCospa)
367+
bitset(compatibleAntiLambda, 0);
368+
if (TMath::Abs(posdau.tpcNSigmaPi()) < strangedEdxNSigma && TMath::Abs(negdau.tpcNSigmaPr()) < strangedEdxNSigma)
369+
if (v0.v0cosPA() > lambdaCospa)
370+
bitset(compatibleAntiLambda, 1);
371+
if (TMath::Abs(posdau.tpcNSigmaPi()) < strangedEdxNSigmaTight && TMath::Abs(negdau.tpcNSigmaPr()) < strangedEdxNSigmaTight)
372+
if (v0.v0cosPA() > lambdaCospa)
373+
bitset(compatibleAntiLambda, 2);
374+
358375
// check whether V0s are in the regin
359376
int massRegK0Short = -1;
360377
if (TMath::Abs(v0.mK0Short() - fK0Mean->Eval(v0.pt()) < peakNsigma * fK0Width->Eval(v0.pt()))) {
@@ -416,9 +433,9 @@ struct hstrangecorrelationfilter {
416433

417434
if (!fillTableOnlyWithCompatible ||
418435
( // start major condition check
419-
(compatibleK0Short && massRegK0Short > 0 && massRegK0Short < 4) ||
420-
(compatibleLambda && massRegLambda > 0 && massRegLambda < 4) ||
421-
(compatibleAntiLambda && massRegAntiLambda > 0 && massRegAntiLambda < 4)) // end major condition check
436+
(compatibleK0Short > 0 && massRegK0Short > 0 && massRegK0Short < 4) ||
437+
(compatibleLambda > 0 && massRegLambda > 0 && massRegLambda < 4) ||
438+
(compatibleAntiLambda > 0 && massRegAntiLambda > 0 && massRegAntiLambda < 4)) // end major condition check
422439
) {
423440
assocV0(v0.collisionId(), v0.globalIndex(),
424441
compatibleK0Short, compatibleLambda, compatibleAntiLambda,
@@ -454,23 +471,38 @@ struct hstrangecorrelationfilter {
454471
continue;
455472

456473
// check dE/dx compatibility
457-
bool compatibleXiMinus = false;
458-
bool compatibleXiPlus = false;
459-
bool compatibleOmegaMinus = false;
460-
bool compatibleOmegaPlus = false;
461-
462-
if (TMath::Abs(posTrackCast.tpcNSigmaPr()) < strangedEdxNSigma && TMath::Abs(negTrackCast.tpcNSigmaPi()) < strangedEdxNSigma && TMath::Abs(bachTrackCast.tpcNSigmaPi()) < strangedEdxNSigma && casc.sign() < 0) {
463-
compatibleXiMinus = true;
464-
}
465-
if (TMath::Abs(posTrackCast.tpcNSigmaPi()) < strangedEdxNSigma && TMath::Abs(negTrackCast.tpcNSigmaPr()) < strangedEdxNSigma && TMath::Abs(bachTrackCast.tpcNSigmaPi()) < strangedEdxNSigma && casc.sign() > 0) {
466-
compatibleXiPlus = true;
467-
}
468-
if (TMath::Abs(posTrackCast.tpcNSigmaPr()) < strangedEdxNSigma && TMath::Abs(negTrackCast.tpcNSigmaPi()) < strangedEdxNSigma && TMath::Abs(bachTrackCast.tpcNSigmaKa()) < strangedEdxNSigma && casc.sign() < 0) {
469-
compatibleOmegaMinus = true;
470-
}
471-
if (TMath::Abs(posTrackCast.tpcNSigmaPi()) < strangedEdxNSigma && TMath::Abs(negTrackCast.tpcNSigmaPr()) < strangedEdxNSigma && TMath::Abs(bachTrackCast.tpcNSigmaKa()) < strangedEdxNSigma && casc.sign() > 0) {
472-
compatibleOmegaPlus = true;
473-
}
474+
int compatibleXiMinus = 0;
475+
int compatibleXiPlus = 0;
476+
int compatibleOmegaMinus = 0;
477+
int compatibleOmegaPlus = 0;
478+
479+
if (TMath::Abs(posTrackCast.tpcNSigmaPr()) < strangedEdxNSigmaLoose && TMath::Abs(negTrackCast.tpcNSigmaPi()) < strangedEdxNSigmaLoose && TMath::Abs(bachTrackCast.tpcNSigmaPi()) < strangedEdxNSigmaLoose && casc.sign() < 0)
480+
bitset(compatibleXiMinus, 0);
481+
if (TMath::Abs(posTrackCast.tpcNSigmaPr()) < strangedEdxNSigma && TMath::Abs(negTrackCast.tpcNSigmaPi()) < strangedEdxNSigma && TMath::Abs(bachTrackCast.tpcNSigmaPi()) < strangedEdxNSigma && casc.sign() < 0)
482+
bitset(compatibleXiMinus, 1);
483+
if (TMath::Abs(posTrackCast.tpcNSigmaPr()) < strangedEdxNSigmaTight && TMath::Abs(negTrackCast.tpcNSigmaPi()) < strangedEdxNSigmaTight && TMath::Abs(bachTrackCast.tpcNSigmaPi()) < strangedEdxNSigmaTight && casc.sign() < 0)
484+
bitset(compatibleXiMinus, 2);
485+
486+
if (TMath::Abs(posTrackCast.tpcNSigmaPi()) < strangedEdxNSigmaLoose && TMath::Abs(negTrackCast.tpcNSigmaPr()) < strangedEdxNSigmaLoose && TMath::Abs(bachTrackCast.tpcNSigmaPi()) < strangedEdxNSigmaLoose && casc.sign() > 0)
487+
bitset(compatibleXiPlus, 0);
488+
if (TMath::Abs(posTrackCast.tpcNSigmaPi()) < strangedEdxNSigma && TMath::Abs(negTrackCast.tpcNSigmaPr()) < strangedEdxNSigma && TMath::Abs(bachTrackCast.tpcNSigmaPi()) < strangedEdxNSigma && casc.sign() > 0)
489+
bitset(compatibleXiPlus, 1);
490+
if (TMath::Abs(posTrackCast.tpcNSigmaPi()) < strangedEdxNSigmaTight && TMath::Abs(negTrackCast.tpcNSigmaPr()) < strangedEdxNSigmaTight && TMath::Abs(bachTrackCast.tpcNSigmaPi()) < strangedEdxNSigmaTight && casc.sign() > 0)
491+
bitset(compatibleXiPlus, 2);
492+
493+
if (TMath::Abs(posTrackCast.tpcNSigmaPr()) < strangedEdxNSigmaLoose && TMath::Abs(negTrackCast.tpcNSigmaPi()) < strangedEdxNSigmaLoose && TMath::Abs(bachTrackCast.tpcNSigmaKa()) < strangedEdxNSigmaLoose && casc.sign() < 0)
494+
bitset(compatibleOmegaMinus, 0);
495+
if (TMath::Abs(posTrackCast.tpcNSigmaPr()) < strangedEdxNSigma && TMath::Abs(negTrackCast.tpcNSigmaPi()) < strangedEdxNSigma && TMath::Abs(bachTrackCast.tpcNSigmaKa()) < strangedEdxNSigma && casc.sign() < 0)
496+
bitset(compatibleOmegaMinus, 1);
497+
if (TMath::Abs(posTrackCast.tpcNSigmaPr()) < strangedEdxNSigmaTight && TMath::Abs(negTrackCast.tpcNSigmaPi()) < strangedEdxNSigmaTight && TMath::Abs(bachTrackCast.tpcNSigmaKa()) < strangedEdxNSigmaTight && casc.sign() < 0)
498+
bitset(compatibleOmegaMinus, 2);
499+
500+
if (TMath::Abs(posTrackCast.tpcNSigmaPi()) < strangedEdxNSigmaLoose && TMath::Abs(negTrackCast.tpcNSigmaPr()) < strangedEdxNSigmaLoose && TMath::Abs(bachTrackCast.tpcNSigmaKa()) < strangedEdxNSigmaLoose && casc.sign() > 0)
501+
bitset(compatibleOmegaPlus, 0);
502+
if (TMath::Abs(posTrackCast.tpcNSigmaPi()) < strangedEdxNSigma && TMath::Abs(negTrackCast.tpcNSigmaPr()) < strangedEdxNSigma && TMath::Abs(bachTrackCast.tpcNSigmaKa()) < strangedEdxNSigma && casc.sign() > 0)
503+
bitset(compatibleOmegaPlus, 1);
504+
if (TMath::Abs(posTrackCast.tpcNSigmaPi()) < strangedEdxNSigmaTight && TMath::Abs(negTrackCast.tpcNSigmaPr()) < strangedEdxNSigmaTight && TMath::Abs(bachTrackCast.tpcNSigmaKa()) < strangedEdxNSigmaTight && casc.sign() > 0)
505+
bitset(compatibleOmegaPlus, 2);
474506

475507
int massRegXi = -1;
476508
if (TMath::Abs(casc.mXi() - fXiMean->Eval(casc.pt()) < peakNsigma * fXiWidth->Eval(casc.pt()))) {
@@ -517,8 +549,8 @@ struct hstrangecorrelationfilter {
517549

518550
if (!fillTableOnlyWithCompatible ||
519551
( // start major condition check
520-
((compatibleXiMinus || compatibleXiPlus) && massRegXi > 0 && massRegXi < 4) ||
521-
((compatibleOmegaMinus || compatibleOmegaPlus) && massRegOmega > 0 && massRegOmega < 4)) // end major condition check
552+
((compatibleXiMinus > 0 || compatibleXiPlus > 0) && massRegXi > 0 && massRegXi < 4) ||
553+
((compatibleOmegaMinus > 0 || compatibleOmegaPlus > 0) && massRegOmega > 0 && massRegOmega < 4)) // end major condition check
522554
) {
523555
assocCascades(casc.collisionId(), casc.globalIndex(),
524556
compatibleXiMinus, compatibleXiPlus, compatibleOmegaMinus, compatibleOmegaPlus,

0 commit comments

Comments
 (0)