Skip to content

Commit 6648874

Browse files
Update kaonIsospinFluctuations.cxx
1 parent c5b9553 commit 6648874

File tree

1 file changed

+98
-97
lines changed

1 file changed

+98
-97
lines changed

PWGCF/EbyEFluctuations/Tasks/kaonIsospinFluctuations.cxx

Lines changed: 98 additions & 97 deletions
Original file line numberDiff line numberDiff line change
@@ -2283,12 +2283,12 @@ struct KaonIsospinFluctuations {
22832283
template <typename T>
22842284
bool selKaonTOF(const T& track)
22852285
{
2286-
static constexpr float ThresholdPLow = 0.75f; // π-K separation
2287-
static constexpr float ThresholdPUp = 1.30f; // K-p separation
2288-
static const float nSigmaTPCLowP = getCfg<float>(cfgIdCut.pidConfigSetting, kKa, kNSigmaTPCLowP);
2289-
static const float nSigmaTOFLowP = getCfg<float>(cfgIdCut.pidConfigSetting, kKa, kNSigmaTOFLowP);
2290-
static const float nSigmaTPCHighP = getCfg<float>(cfgIdCut.pidConfigSetting, kKa, kNSigmaTPCHighP);
2291-
static const float nSigmaTOFHighP = getCfg<float>(cfgIdCut.pidConfigSetting, kKa, kNSigmaTOFHighP);
2286+
static constexpr float ThresholdPLow = 0.75f; // π-K separation
2287+
static constexpr float ThresholdPUp = 1.30f; // K-p separation
2288+
static const float nSigmaTPCLowP = getCfg<float>(cfgIdCut.pidConfigSetting, kKa, kNSigmaTPCLowP);
2289+
static const float nSigmaTOFLowP = getCfg<float>(cfgIdCut.pidConfigSetting, kKa, kNSigmaTOFLowP);
2290+
static const float nSigmaTPCHighP = getCfg<float>(cfgIdCut.pidConfigSetting, kKa, kNSigmaTPCHighP);
2291+
static const float nSigmaTOFHighP = getCfg<float>(cfgIdCut.pidConfigSetting, kKa, kNSigmaTOFHighP);
22922292

22932293
if (vetoIdOthersTOF<kKa>(track)) {
22942294
if (track.p() <= ThresholdPLow && std::abs(track.tpcNSigmaKa()) < nSigmaTPCLowP && std::abs(track.tofNSigmaKa()) < nSigmaTOFLowP) {
@@ -2322,7 +2322,7 @@ struct KaonIsospinFluctuations {
23222322
if (track.p() <= ThresholdPLow && std::abs(track.tpcNSigmaPr()) < nSigmaTPCLowP && std::abs(track.tofNSigmaPr()) < nSigmaTOFLowP) {
23232323
return true;
23242324
}
2325-
if (ThresholdPLow < track.p() && track.p() <= ThresholdPUp // after 1.30 Pr and Ka lines of nSigma 3.0 will start intersecting
2325+
if (ThresholdPLow < track.p() && track.p() <= ThresholdPUp // after 1.30 Pr and Ka lines of nSigma 3.0 will start intersecting
23262326
&& std::abs(track.tpcNSigmaPr()) < nSigmaTPCLowP && std::abs(track.tofNSigmaPr()) < nSigmaTOFLowP // Some Deuteron contamination is still coming in p dependent cuts
23272327
) {
23282328
return true;
@@ -3114,7 +3114,7 @@ struct KaonIsospinFluctuations {
31143114
}
31153115
// K0s mass cut
31163116
if (cfgFill.cfgFill03v0TablePostK0sMassCut) {
3117-
static const float k0sMassLow = getCfg<float>(cfgV0ParticleCuts, kV0TrkK0s, kV0MLow);
3117+
static const float k0sMassLow = getCfg<float>(cfgV0ParticleCuts, kV0TrkK0s, kV0MLow);
31183118
static const float k0sMassHigh = getCfg<float>(cfgV0ParticleCuts, kV0TrkK0s, kV0MUp);
31193119
if (k0sMassLow < v0.mK0Short() && v0.mK0Short() < k0sMassHigh) {
31203120
fillV0QA<v0TablePostK0sMassCut, kFillSimple, kPi, kPi>(recoV0sPostMassCut, v0, posDaughterTrack, negDaughterTrack, posDauPtEtaBin, negDauPtEtaBin, v0Tag, v0DauCollisionIndexTag, v0DauBCTag, idMethodPi[kPos], idMethodPi[kNeg], v0K0sEffWeight, fillMotherQA, fillDauTrackQA);
@@ -3188,9 +3188,9 @@ struct KaonIsospinFluctuations {
31883188
{
31893189
static const bool checkPrimVtxContm = getCfg<bool>(cfgV0ParticleCuts, row, kV0CheckPrimVtxContm);
31903190
static const bool checkV0DecayContm = getCfg<bool>(cfgV0ParticleCuts, row, kV0CheckV0DecayContm);
3191-
static const bool checkMPMSigma = getCfg<bool>(cfgV0ParticleCuts, row, kV0CheckMPMSigma);
3192-
static const bool fillPostSel = getCfg<bool>(cfgV0ParticleCuts, row, kV0FillPostSel);
3193-
static const bool fillPostSelDau = getCfg<bool>(cfgV0ParticleCuts, row, kV0FillPostSelDau);
3191+
static const bool checkMPMSigma = getCfg<bool>(cfgV0ParticleCuts, row, kV0CheckMPMSigma);
3192+
static const bool fillPostSel = getCfg<bool>(cfgV0ParticleCuts, row, kV0FillPostSel);
3193+
static const bool fillPostSelDau = getCfg<bool>(cfgV0ParticleCuts, row, kV0FillPostSelDau);
31943194

31953195
float v0EffWeight = 0;
31963196
if constexpr (particleMode == recoK0sPostSel) {
@@ -3434,17 +3434,17 @@ struct KaonIsospinFluctuations {
34343434
{
34353435

34363436
// Cache config values once per template instantiation
3437-
static const float massLow = getCfg<float>(cfgPrimVtxParticleCuts, row, kPrimMassLow);
3437+
static const float massLow = getCfg<float>(cfgPrimVtxParticleCuts, row, kPrimMassLow);
34383438
static const float massHigh = getCfg<float>(cfgPrimVtxParticleCuts, row, kPrimMassUp);
34393439

34403440
static const bool checkPrimVtxContm = getCfg<bool>(cfgPrimVtxParticleCuts, row, kPrimCheckPrimVtxContm);
34413441
static const bool checkV0DecayContm = getCfg<bool>(cfgPrimVtxParticleCuts, row, kPrimCheckV0DecayContm);
3442-
static const bool checkMPMSigma = getCfg<bool>(cfgPrimVtxParticleCuts, row, kPrimCheckMPMSigma);
3442+
static const bool checkMPMSigma = getCfg<bool>(cfgPrimVtxParticleCuts, row, kPrimCheckMPMSigma);
34433443

3444-
static const bool fillPreSel = getCfg<bool>(cfgPrimVtxParticleCuts, row, kPrimFillPreSel);
3445-
static const bool fillPreSelDau = getCfg<bool>(cfgPrimVtxParticleCuts, row, kPrimFillPreSelDau);
3446-
static const bool fillPostSel = getCfg<bool>(cfgPrimVtxParticleCuts, row, kPrimFillPostSel);
3447-
static const bool fillPostSelDau = getCfg<bool>(cfgPrimVtxParticleCuts, row, kPrimFillPostSelDau);
3444+
static const bool fillPreSel = getCfg<bool>(cfgPrimVtxParticleCuts, row, kPrimFillPreSel);
3445+
static const bool fillPreSelDau = getCfg<bool>(cfgPrimVtxParticleCuts, row, kPrimFillPreSelDau);
3446+
static const bool fillPostSel = getCfg<bool>(cfgPrimVtxParticleCuts, row, kPrimFillPostSel);
3447+
static const bool fillPostSelDau = getCfg<bool>(cfgPrimVtxParticleCuts, row, kPrimFillPostSelDau);
34483448

34493449
static LorentzVector vecMother;
34503450
uint16_t flagBit = 0;
@@ -3550,7 +3550,7 @@ struct KaonIsospinFluctuations {
35503550
C& checkTrackId, B& posDauIs, B& negDauIs,
35513551
auto& iNTrkPrim, auto& fNTrkPrim, auto& effWeightSum,
35523552
const auto posTrackPrimVtxMotherFlag, const auto negTrackPrimVtxMotherFlag, const auto posTrackV0MotherFlag, const auto negTrackV0MotherFlag, const int requiredBit, const auto mpBit,
3553-
const bool doPhi1020, const bool doJPsiToEE, const bool doJPsiToMuMu, const bool doKStar892, const bool doKStar892Bar, const bool doRho770,
3553+
const bool doPhi1020, const bool doJPsiToEE, const bool doJPsiToMuMu, const bool doKStar892, const bool doKStar892Bar, const bool doRho770,
35543554
const auto primVtxCndtMcTag)
35553555
{
35563556
for (int i = kPi; i <= kMu; i++) {
@@ -3663,48 +3663,50 @@ struct KaonIsospinFluctuations {
36633663
bool doV0K0s, bool doV0Lambda, bool doV0AntiLambda, bool doV0Gamma,
36643664
bool doPhi1020, bool doJPsiToEE, bool doJPsiToMuMu, bool doKStar892, bool doKStar892Bar, bool doRho770)
36653665
{
3666-
decayDauTagBit = 0;
3667-
const int chargeIndex = (track.signed1Pt() > 0) ? kPos : (track.signed1Pt() < 0) ? kNeg : -1;
3668-
if (chargeIndex == -1) LOG(fatal)<<"DEBUG :: Unsigned track found";
3666+
decayDauTagBit = 0;
3667+
const int chargeIndex = (track.signed1Pt() > 0) ? kPos : (track.signed1Pt() < 0) ? kNeg
3668+
: -1;
3669+
if (chargeIndex == -1)
3670+
LOG(fatal) << "DEBUG :: Unsigned track found";
36693671

36703672
const auto globalIdx = track.globalIndex();
36713673
// V0 channel checks (kPos/kNeg differ by chargeIndex)
36723674
if (doV0K0s && binarySearchAnyList(v0CndtDauList[kV0K0s][chargeIndex], globalIdx) != -1)
3673-
BITSET(decayDauTagBit, ID_BIT_PI);
3675+
BITSET(decayDauTagBit, ID_BIT_PI);
36743676

36753677
if (doV0Lambda) {
3676-
if (binarySearchAnyList(v0CndtDauList[kV0Lambda][chargeIndex], globalIdx) != -1) {
3677-
BITSET(decayDauTagBit, (chargeIndex == kPos) ? ID_BIT_PR : ID_BIT_PI);
3678-
}
3678+
if (binarySearchAnyList(v0CndtDauList[kV0Lambda][chargeIndex], globalIdx) != -1) {
3679+
BITSET(decayDauTagBit, (chargeIndex == kPos) ? ID_BIT_PR : ID_BIT_PI);
3680+
}
36793681
}
36803682

36813683
if (doV0AntiLambda) {
3682-
if (binarySearchAnyList(v0CndtDauList[kV0AntiLambda][chargeIndex], globalIdx) != -1) {
3683-
BITSET(decayDauTagBit, (chargeIndex == kPos) ? ID_BIT_PI : ID_BIT_PR);
3684-
}
3684+
if (binarySearchAnyList(v0CndtDauList[kV0AntiLambda][chargeIndex], globalIdx) != -1) {
3685+
BITSET(decayDauTagBit, (chargeIndex == kPos) ? ID_BIT_PI : ID_BIT_PR);
3686+
}
36853687
}
36863688

36873689
if (doV0Gamma && binarySearchAnyList(v0CndtDauList[kV0Gamma][chargeIndex], globalIdx) != -1)
3688-
BITSET(decayDauTagBit, ID_BIT_EL);
3690+
BITSET(decayDauTagBit, ID_BIT_EL);
36893691

36903692
// PrimVtx candidate decays
36913693
if (doPhi1020 && binarySearchAnyList(primVtxCndtDauList[kPrimTrkPhi1020][chargeIndex], globalIdx) != -1)
3692-
BITSET(decayDauTagBit, ID_BIT_KA);
3694+
BITSET(decayDauTagBit, ID_BIT_KA);
36933695

36943696
if (doJPsiToEE && binarySearchAnyList(primVtxCndtDauList[kPrimTrkJPsiToEE][chargeIndex], globalIdx) != -1)
3695-
BITSET(decayDauTagBit, ID_BIT_EL);
3697+
BITSET(decayDauTagBit, ID_BIT_EL);
36963698

36973699
if (doJPsiToMuMu && binarySearchAnyList(primVtxCndtDauList[kPrimTrkJPsiToMuMu][chargeIndex], globalIdx) != -1)
3698-
BITSET(decayDauTagBit, ID_BIT_MU);
3700+
BITSET(decayDauTagBit, ID_BIT_MU);
36993701

37003702
if (doKStar892 && binarySearchAnyList(primVtxCndtDauList[kPrimTrkKStar892][chargeIndex], globalIdx) != -1)
3701-
BITSET(decayDauTagBit, (chargeIndex == kPos) ? ID_BIT_KA : ID_BIT_PI);
3703+
BITSET(decayDauTagBit, (chargeIndex == kPos) ? ID_BIT_KA : ID_BIT_PI);
37023704

37033705
if (doKStar892Bar && binarySearchAnyList(primVtxCndtDauList[kPrimTrkKStar892Bar][chargeIndex], globalIdx) != -1)
3704-
BITSET(decayDauTagBit, (chargeIndex == kPos) ? ID_BIT_PI : ID_BIT_KA);
3706+
BITSET(decayDauTagBit, (chargeIndex == kPos) ? ID_BIT_PI : ID_BIT_KA);
37053707

37063708
if (doRho770 && binarySearchAnyList(primVtxCndtDauList[kPrimTrkRho770][chargeIndex], globalIdx) != -1)
3707-
BITSET(decayDauTagBit, ID_BIT_PI);
3709+
BITSET(decayDauTagBit, ID_BIT_PI);
37083710
}
37093711

37103712
template <int Mode, int fillMode, int pidMode, int signMode, int detMode, typename H, typename T>
@@ -3986,13 +3988,13 @@ struct KaonIsospinFluctuations {
39863988
const int negCode = negDauMcPart.pdgCode();
39873989

39883990
if (v0Code == kK0Short && posCode == kPiPlus && negCode == kPiMinus) {
3989-
BITSET(v0DecayTrueMcTag, kV0TrkK0s);
3991+
BITSET(v0DecayTrueMcTag, kV0TrkK0s);
39903992
} else if (v0Code == kLambda0 && posCode == kProton && negCode == kPiMinus) {
3991-
BITSET(v0DecayTrueMcTag, kV0TrkLambda);
3993+
BITSET(v0DecayTrueMcTag, kV0TrkLambda);
39923994
} else if (v0Code == kLambda0Bar && posCode == kPiPlus && negCode == kProtonBar) {
3993-
BITSET(v0DecayTrueMcTag, kV0TrkAntiLambda);
3995+
BITSET(v0DecayTrueMcTag, kV0TrkAntiLambda);
39943996
} else if (v0Code == kGamma && posCode == kPositron && negCode == kElectron) {
3995-
BITSET(v0DecayTrueMcTag, kV0TrkGamma);
3997+
BITSET(v0DecayTrueMcTag, kV0TrkGamma);
39963998
}
39973999
}
39984000

@@ -4007,77 +4009,77 @@ struct KaonIsospinFluctuations {
40074009
if constexpr (Mode) {
40084010
const int pvcCode = pvcMcParticle.pdgCode();
40094011
if (pvcCode == kPhi && posCode == kKPlus && negCode == kKMinus) {
4010-
BITSET(primVtxCndtMcTag, kPrimPhi1020);
4011-
return;
4012-
}
4013-
if (pvcCode == kJPsi && posCode == kPositron && negCode == kElectron) {
4014-
BITSET(primVtxCndtMcTag, kPrimJPsiToEE);
4015-
return;
4016-
}
4017-
if (pvcCode == kJPsi && posCode == kMuonPlus && negCode == kMuonMinus) {
4018-
BITSET(primVtxCndtMcTag, kPrimJPsiToMuMu);
4019-
return;
4020-
}
4021-
if (pvcCode == kK0Star892 && posCode == kKPlus && negCode == kPiMinus) {
4022-
BITSET(primVtxCndtMcTag, kPrimKStar892);
4023-
return;
4024-
}
4025-
if (pvcCode == -kK0Star892 && posCode == kPiPlus && negCode == kKMinus) {
4026-
BITSET(primVtxCndtMcTag, kPrimKStar892Bar);
4027-
return;
4028-
}
4029-
if (pvcCode == kRho770_0 && posCode == kPiPlus && negCode == kPiMinus) {
4030-
BITSET(primVtxCndtMcTag, kPrimRho770);
4031-
return;
4032-
}
4012+
BITSET(primVtxCndtMcTag, kPrimPhi1020);
4013+
return;
4014+
}
4015+
if (pvcCode == kJPsi && posCode == kPositron && negCode == kElectron) {
4016+
BITSET(primVtxCndtMcTag, kPrimJPsiToEE);
4017+
return;
4018+
}
4019+
if (pvcCode == kJPsi && posCode == kMuonPlus && negCode == kMuonMinus) {
4020+
BITSET(primVtxCndtMcTag, kPrimJPsiToMuMu);
4021+
return;
4022+
}
4023+
if (pvcCode == kK0Star892 && posCode == kKPlus && negCode == kPiMinus) {
4024+
BITSET(primVtxCndtMcTag, kPrimKStar892);
4025+
return;
4026+
}
4027+
if (pvcCode == -kK0Star892 && posCode == kPiPlus && negCode == kKMinus) {
4028+
BITSET(primVtxCndtMcTag, kPrimKStar892Bar);
4029+
return;
4030+
}
4031+
if (pvcCode == kRho770_0 && posCode == kPiPlus && negCode == kPiMinus) {
4032+
BITSET(primVtxCndtMcTag, kPrimRho770);
4033+
return;
4034+
}
40334035
} else {
4034-
if (posCode == kKPlus && negCode == kKMinus) {
4035-
BITSET(primVtxCndtMcTag, kPrimPhi1020);
4036-
return;
4037-
}
4038-
if (posCode == kPositron && negCode == kElectron) {
4039-
BITSET(primVtxCndtMcTag, kPrimJPsiToEE);
4040-
return;
4041-
}
4042-
if (posCode == kMuonPlus && negCode == kMuonMinus) {
4043-
BITSET(primVtxCndtMcTag, kPrimJPsiToMuMu);
4044-
return;
4045-
}
4046-
if (posCode == kKPlus && negCode == kPiMinus) {
4047-
BITSET(primVtxCndtMcTag, kPrimKStar892);
4048-
return;
4049-
}
4050-
if (posCode == kPiPlus && negCode == kKMinus) {
4051-
BITSET(primVtxCndtMcTag, kPrimKStar892Bar);
4052-
return;
4053-
}
4054-
if (posCode == kPiPlus && negCode == kPiMinus) {
4055-
BITSET(primVtxCndtMcTag, kPrimRho770);
4056-
return;
4057-
}
4036+
if (posCode == kKPlus && negCode == kKMinus) {
4037+
BITSET(primVtxCndtMcTag, kPrimPhi1020);
4038+
return;
4039+
}
4040+
if (posCode == kPositron && negCode == kElectron) {
4041+
BITSET(primVtxCndtMcTag, kPrimJPsiToEE);
4042+
return;
4043+
}
4044+
if (posCode == kMuonPlus && negCode == kMuonMinus) {
4045+
BITSET(primVtxCndtMcTag, kPrimJPsiToMuMu);
4046+
return;
4047+
}
4048+
if (posCode == kKPlus && negCode == kPiMinus) {
4049+
BITSET(primVtxCndtMcTag, kPrimKStar892);
4050+
return;
4051+
}
4052+
if (posCode == kPiPlus && negCode == kKMinus) {
4053+
BITSET(primVtxCndtMcTag, kPrimKStar892Bar);
4054+
return;
4055+
}
4056+
if (posCode == kPiPlus && negCode == kPiMinus) {
4057+
BITSET(primVtxCndtMcTag, kPrimRho770);
4058+
return;
4059+
}
40584060
}
40594061
}
40604062

4061-
void getTrackMcBitTag(auto& trackTrueMcTag, const auto& mcPart)
4062-
{
4063+
void getTrackMcBitTag(auto& trackTrueMcTag, const auto& mcPart)
4064+
{
40634065
trackTrueMcTag = 0;
40644066
const int absPdg = std::abs(mcPart.pdgCode());
40654067

40664068
// Use if-else ladder for faster branch prediction
40674069
if (absPdg == kPiPlus) {
4068-
BITSET(trackTrueMcTag, ID_BIT_PI);
4070+
BITSET(trackTrueMcTag, ID_BIT_PI);
40694071
} else if (absPdg == kKPlus) {
4070-
BITSET(trackTrueMcTag, ID_BIT_KA);
4072+
BITSET(trackTrueMcTag, ID_BIT_KA);
40714073
} else if (absPdg == kProton) {
4072-
BITSET(trackTrueMcTag, ID_BIT_PR);
4074+
BITSET(trackTrueMcTag, ID_BIT_PR);
40734075
} else if (absPdg == kElectron) {
4074-
BITSET(trackTrueMcTag, ID_BIT_EL);
4076+
BITSET(trackTrueMcTag, ID_BIT_EL);
40754077
} else if (absPdg == kMuonMinus) {
4076-
BITSET(trackTrueMcTag, ID_BIT_MU);
4078+
BITSET(trackTrueMcTag, ID_BIT_MU);
40774079
} else if (absPdg == kDeuteron) {
4078-
BITSET(trackTrueMcTag, ID_BIT_DE);
4080+
BITSET(trackTrueMcTag, ID_BIT_DE);
40794081
}
4080-
}
4082+
}
40814083

40824084
template <typename T>
40834085
void getV0MCount(const T& mcTrack, auto& multV0M)
@@ -4985,7 +4987,7 @@ void getTrackMcBitTag(auto& trackTrueMcTag, const auto& mcPart)
49854987
executeAnalysis<doDataProcessing>(collisions, V0s, tracks, primVtxCndts);
49864988
}
49874989
PROCESS_SWITCH(KaonIsospinFluctuations, processData, "Process for Data", true);
4988-
/*
4990+
49894991
void processReco(aod::BCsWithTimestamps const&, MyCollisionsWithMcLabels const& collisions, MyV0sWithMcLabels const& V0s, MyTracksWithMcLabels const& tracks, MyPrimVtxCndts const& primVtxCndts, aod::McParticles const&)
49904992
{
49914993
recoEvent.fill(HIST("recoEvent/ProcessType"), doRecoProcessing);
@@ -5013,7 +5015,6 @@ void getTrackMcBitTag(auto& trackTrueMcTag, const auto& mcPart)
50135015
executeAnalysis<doSimProcessing>(mcCollisions, nullptr, mcParticles, nullptr);
50145016
}
50155017
PROCESS_SWITCH(KaonIsospinFluctuations, processSim, "Process for Sim", false);
5016-
*/
50175018
};
50185019

50195020
WorkflowSpec defineDataProcessing(ConfigContext const& cfgc)

0 commit comments

Comments
 (0)