Skip to content

Commit 871538b

Browse files
nasir mehdi maliknasirmehdimalik
authored andcommitted
added newfn for sl correction
1 parent 10c4a50 commit 871538b

File tree

4 files changed

+136
-14
lines changed

4 files changed

+136
-14
lines changed

PWGLF/DataModel/LFResonanceTables.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,7 @@ DECLARE_SOA_COLUMN(DecayVtxY, decayVtxY, float);
215215
DECLARE_SOA_COLUMN(DecayVtxZ, decayVtxZ, float); //! Z position of the decay vertex
216216
DECLARE_SOA_COLUMN(Alpha, alpha, float); //! Alpha of the decay vertex
217217
DECLARE_SOA_COLUMN(QtArm, qtarm, float); //! Armenteros Qt of the decay vertex
218-
DECLARE_SOA_COLUMN(TpcSignal10, tpcSignal10, int8_t); //! TPC signal of the track x10
218+
DECLARE_SOA_COLUMN(TpcSignal10, tpcSignal10, int16_t); //! TPC signal of the track x10
219219
DECLARE_SOA_COLUMN(DaughterTPCNSigmaPosPi10, daughterTPCNSigmaPosPi10, int8_t); //! TPC PID x10 of the positive daughter as Pion
220220
DECLARE_SOA_COLUMN(DaughterTPCNSigmaPosKa10, daughterTPCNSigmaPosKa10, int8_t); //! TPC PID x10 of the positive daughter as Kaon
221221
DECLARE_SOA_COLUMN(DaughterTPCNSigmaPosPr10, daughterTPCNSigmaPosPr10, int8_t); //! TPC PID x10 of the positive daughter as Proton
@@ -310,7 +310,7 @@ DECLARE_SOA_DYNAMIC_COLUMN(DaughterTOFNSigmaBachPr, daughterTOFNSigmaBachPr,
310310
[](int8_t daughterTOFNSigmaBachPr10) { return (float)daughterTOFNSigmaBachPr10 / 10.f; });
311311
// TPC signal x10
312312
DECLARE_SOA_DYNAMIC_COLUMN(TpcSignal, tpcSignal,
313-
[](int8_t tpcSignal10) { return (float)tpcSignal10 / 10.f; });
313+
[](int16_t tpcSignal10) { return (float)tpcSignal10 / 100.f; });
314314
// pT, Eta, Phi
315315
// DECLARE_SOA_DYNAMIC_COLUMN(Pt, pt, [](float px, float py) -> float { return RecoDecay::sqrtSumOfSquares(px, py); });
316316
DECLARE_SOA_DYNAMIC_COLUMN(Eta, eta, [](float px, float py, float pz) -> float { return RecoDecay::eta(std::array{px, py, pz}); });

PWGLF/TableProducer/Resonances/resonanceInitializer.cxx

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,6 @@ struct ResonanceInitializer {
106106
Configurable<double> dBzInput{"dBzInput", -999, "bz field, -999 is automatic"};
107107
Configurable<bool> cfgFillQA{"cfgFillQA", false, "Fill QA histograms"};
108108
Configurable<bool> cfgBypassCCDB{"cfgBypassCCDB", true, "Bypass loading CCDB part to save CPU time and memory"}; // will be affected to b_z value.
109-
110109
// Track filter from tpcSkimsTableCreator
111110
Configurable<int> trackSelection{"trackSelection", 0, "Track selection: 0 -> No Cut, 1 -> kGlobalTrack, 2 -> kGlobalTrackWoPtEta, 3 -> kGlobalTrackWoDCA, 4 -> kQualityTracks, 5 -> kInAcceptanceTracks"};
112111
Configurable<int> trackSphDef{"trackSphDef", 0, "Spherocity Definition: |pT| = 1 -> 0, otherwise -> 1"};
@@ -237,6 +236,7 @@ struct ResonanceInitializer {
237236
Configurable<int> pdgTruthMother{"pdgTruthMother", 3324, "pdgcode for the truth mother e.g. Xi(1530) (3324)"};
238237
Configurable<int> pdgTruthDaughter1{"pdgTruthDaughter1", 3312, "pdgcode for the daughter 1, e.g. Xi- 3312"};
239238
Configurable<int> pdgTruthDaughter2{"pdgTruthDaughter2", 211, "pdgcode for the daughter 2, e.g. pi+ 211"};
239+
Configurable<bool> cfgDoSignalLoss{"cfgDoSignalLoss", false, "Save reference particles for mT scaling signal loss"};
240240
} GenCuts;
241241
Configurable<bool> checkIsRecINELgt0{"checkIsRecINELgt0", true, "Check rec INEL>0 for the Rec. Collision"};
242242

@@ -277,8 +277,13 @@ struct ResonanceInitializer {
277277
|| (nabs(aod::mcparticle::pdgCode) == 3324) // Xi(1530)0
278278
|| (nabs(aod::mcparticle::pdgCode) == 10323) // K1(1270)+
279279
|| (nabs(aod::mcparticle::pdgCode) == 123314) // Xi(1820)0
280-
|| (nabs(aod::mcparticle::pdgCode) == 123324); // Xi(1820)-0
281-
280+
|| (nabs(aod::mcparticle::pdgCode) == 123324) // Xi(1820)-0
281+
|| (nabs(aod::mcparticle::pdgCode) == 2212) // Proton
282+
|| (nabs(aod::mcparticle::pdgCode) == 3122) // Lambda0
283+
|| (nabs(aod::mcparticle::pdgCode) == 3312) // Xi-
284+
|| (nabs(aod::mcparticle::pdgCode) == 3322) // Xi0
285+
|| (nabs(aod::mcparticle::pdgCode) == 3334); // Omega-
286+
//
282287
using ResoEvents = soa::Join<aod::Collisions, aod::EvSels, aod::CentFT0Ms, aod::CentFT0Cs, aod::CentFT0As, aod::CentFV0As, aod::Mults>;
283288
using ResoEvents001 = soa::Join<aod::Collisions, aod::EvSels, aod::CentFT0Ms, aod::CentFT0Cs, aod::CentFT0As, aod::CentFV0As, aod::Mults, aod::MultsExtra, aod::PVMults>;
284289
using ResoRun2Events = soa::Join<aod::Collisions, aod::EvSels, aod::CentRun2V0Ms>;
@@ -759,7 +764,7 @@ struct ResonanceInitializer {
759764
static_cast<int8_t>(std::round(track.tofNSigmaPi() * 10)),
760765
static_cast<int8_t>(std::round(track.tofNSigmaKa() * 10)),
761766
static_cast<int8_t>(std::round(track.tofNSigmaPr() * 10)),
762-
static_cast<int8_t>(std::round(track.tpcSignal() * 10)),
767+
static_cast<int16_t>(std::round(track.tpcSignal() * 100)),
763768
trackFlags);
764769
if (!cfgBypassTrackIndexFill) {
765770
resoTrackTracks(track.globalIndex());
@@ -1182,6 +1187,12 @@ struct ResonanceInitializer {
11821187
void fillMCParticles(SelectedMCPartType const& mcParts, TotalMCParts const& mcParticles)
11831188
{
11841189
for (auto const& mcPart : mcParts) {
1190+
if (!GenCuts.cfgDoSignalLoss) {
1191+
int absPdg = std::abs(mcPart.pdgCode());
1192+
if (absPdg == 2212 || absPdg == 3122 || absPdg == 3312 || absPdg == 3322 || absPdg == 3334) {
1193+
continue;
1194+
}
1195+
}
11851196
std::vector<int> daughterPDGs;
11861197
if (mcPart.has_daughters()) {
11871198
auto daughter01 = mcParticles.rawIteratorAt(mcPart.daughtersIds()[0] - mcParticles.offset());

PWGLF/TableProducer/Resonances/resonanceMergeDF.cxx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ struct ResonanceMergeDF {
159159
(int8_t)(track.tofNSigmaPi() * 10),
160160
(int8_t)(track.tofNSigmaKa() * 10),
161161
(int8_t)(track.tofNSigmaPr() * 10),
162-
(int8_t)(track.tpcSignal() * 10),
162+
static_cast<int16_t>(track.tpcSignal() * 100),
163163
track.trackFlags()));
164164
}
165165

@@ -271,7 +271,7 @@ struct ResonanceMergeDF {
271271
(int8_t)(track.tofNSigmaPi() * 10),
272272
(int8_t)(track.tofNSigmaKa() * 10),
273273
(int8_t)(track.tofNSigmaPr() * 10),
274-
(int8_t)(track.tpcSignal() * 10),
274+
static_cast<int16_t>(track.tpcSignal() * 100),
275275
track.trackFlags()));
276276
}
277277

@@ -458,7 +458,7 @@ struct ResonanceMergeDF {
458458
(int8_t)(track.tofNSigmaPi() * 10),
459459
(int8_t)(track.tofNSigmaKa() * 10),
460460
(int8_t)(track.tofNSigmaPr() * 10),
461-
(int8_t)(track.tpcSignal() * 10),
461+
static_cast<int16_t>(track.tpcSignal() * 100),
462462
track.trackFlags());
463463
}
464464
}
@@ -521,7 +521,7 @@ struct ResonanceMergeDF {
521521
(int8_t)(track.tofNSigmaPi() * 10),
522522
(int8_t)(track.tofNSigmaKa() * 10),
523523
(int8_t)(track.tofNSigmaPr() * 10),
524-
(int8_t)(track.tpcSignal() * 10),
524+
static_cast<int16_t>(track.tpcSignal() * 100),
525525
track.trackFlags());
526526
}
527527
// Cascade candidate

PWGLF/Tasks/Resonances/lambda1520_PbPb.cxx

Lines changed: 115 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ struct lambdaAnalysis_pb {
140140
Configurable<bool> cEvtMCVtxIn10{"cEvtMCVtxIn10", false, "MC event sel: isVtxIn10"};
141141
Configurable<bool> cEvtMCTriggerTVX{"cEvtMCTriggerTVX", false, "MC event sel: isTriggerTVX"};
142142
Configurable<bool> cEvtMCRecINELgt0{"cEvtMCRecINELgt0", false, "MC event sel: isRecINELgt0"};
143-
// Histogram Registry.
143+
// Histogram Registry.
144144
HistogramRegistry histos{"histos", {}, OutputObjHandlingPolicy::AnalysisObject};
145145

146146
void init(InitContext const&)
@@ -239,6 +239,24 @@ struct lambdaAnalysis_pb {
239239
histos.add("Analysis/h3d_reso_lstar_PM", "Resolution #Lambda(1520) p_{T}", kTHnSparseF, {{200, -0.05, 0.05}, axisPt, axisCent});
240240
histos.add("Analysis/h3d_reso_lstar_MP", "Resolution #bar{#Lambda}(1520) p_{T}", kTHnSparseF, {{200, -0.05, 0.05}, axisPt, axisCent});
241241
}
242+
243+
if (doprocessMCGen) {
244+
histos.add("SignalLoss/hMCEventCutflow", "MC Event Cutflow", kTH1F, {{7, 0, 7}});
245+
histos.add("SignalLoss/hGen_mT_scaled_Proton", "mT Scaled #Lambda(1520) from Proton", kTHnSparseF, {axisPt, axisCent});
246+
histos.add("SignalLoss/hGen_mT_scaled_AntiProton", "mT Scaled #bar{#Lambda}(1520) from AntiProton", kTHnSparseF, {axisPt, axisCent});
247+
248+
histos.add("SignalLoss/hGen_mT_scaled_Lambda0", "mT Scaled #Lambda(1520) from Lambda0", kTHnSparseF, {axisPt, axisCent});
249+
histos.add("SignalLoss/hGen_mT_scaled_AntiLambda0", "mT Scaled #bar{#Lambda}(1520) from AntiLambda0", kTHnSparseF, {axisPt, axisCent});
250+
251+
histos.add("SignalLoss/hGen_mT_scaled_XiMinus", "mT Scaled #Lambda(1520) from Xi-", kTHnSparseF, {axisPt, axisCent});
252+
histos.add("SignalLoss/hGen_mT_scaled_XiPlus", "mT Scaled #bar{#Lambda}(1520) from Xi+", kTHnSparseF, {axisPt, axisCent});
253+
254+
histos.add("SignalLoss/hGen_mT_scaled_Xi0", "mT Scaled #Lambda(1520) from Xi0", kTHnSparseF, {axisPt, axisCent});
255+
histos.add("SignalLoss/hGen_mT_scaled_AntiXi0", "mT Scaled #bar{#Lambda}(1520) from AntiXi0", kTHnSparseF, {axisPt, axisCent});
256+
257+
histos.add("SignalLoss/hGen_mT_scaled_OmegaMinus", "mT Scaled #Lambda(1520) from Omega-", kTHnSparseF, {axisPt, axisCent});
258+
histos.add("SignalLoss/hGen_mT_scaled_OmegaPlus", "mT Scaled #bar{#Lambda}(1520) from Omega+", kTHnSparseF, {axisPt, axisCent});
259+
}
242260
}
243261

244262
template <typename T>
@@ -771,10 +789,11 @@ struct lambdaAnalysis_pb {
771789
for (auto const& part : resoParents) {
772790
if (std::abs(part.pdgCode()) != lambda1520id) // // L* pdg_code = 3124
773791
continue;
774-
// if (std::abs(part.y()) > 0.5) { // rapidity cut
775-
// continue;
776-
// }
777792

793+
float yshift = std::abs(part.y()) - cfgRapidityShift;
794+
795+
if (std::abs(yshift) > cfgRapidityCut)
796+
continue;
778797
bool pass1 = false;
779798
bool pass2 = false;
780799

@@ -797,6 +816,98 @@ struct lambdaAnalysis_pb {
797816
}
798817
PROCESS_SWITCH(lambdaAnalysis_pb, processMC, "Process Event for MC", false);
799818

819+
void processMCGen(resoMCCols::iterator const& collision,
820+
aod::ResoMCParents const& resoParents)
821+
{
822+
823+
float centrality = collision.cent();
824+
825+
histos.fill(HIST("SignalLoss/hMCEventCutflow"), 0); // All collisions
826+
827+
if (cEvtMCTriggerTVX && !collision.isTriggerTVX())
828+
return;
829+
histos.fill(HIST("SignalLoss/hMCEventCutflow"), 1); // After TriggerTVX
830+
831+
if (cEvtMCVtxIn10 && !collision.isVtxIn10())
832+
return;
833+
histos.fill(HIST("SignalLoss/hMCEventCutflow"), 2); // After VtxIn10
834+
835+
if (cEvtMCINELgt0 && !collision.isINELgt0())
836+
return;
837+
histos.fill(HIST("SignalLoss/hMCEventCutflow"), 3); // After INELgt0
838+
839+
if (cEvtMCSel8 && !collision.isInSel8())
840+
return;
841+
histos.fill(HIST("SignalLoss/hMCEventCutflow"), 4); // After Sel8
842+
843+
if (cEvtMCRecINELgt0 && !collision.isRecINELgt0())
844+
return;
845+
histos.fill(HIST("SignalLoss/hMCEventCutflow"), 5); // After RecINELgt0
846+
847+
if (cEvtMCAfterAllCuts && !collision.isInAfterAllCuts())
848+
return;
849+
histos.fill(HIST("SignalLoss/hMCEventCutflow"), 6); // After AfterAllCuts
850+
851+
for (auto const& part : resoParents) {
852+
853+
float yshift = std::abs(part.y()) - cfgRapidityShift;
854+
855+
if (std::abs(yshift) > cfgRapidityCut)
856+
continue;
857+
858+
int pdg = part.pdgCode();
859+
float ptRef = part.pt();
860+
double ptSq = -1.0;
861+
862+
std::array<float, 3> pvec = {part.px(), part.py(), part.pz()};
863+
float mass = RecoDecay::m(pvec, part.e());
864+
auto mMassLambda1520 = o2::constants::physics::MassLambda1520;
865+
if (pdg == 2212) {
866+
ptSq = (ptRef * ptRef) + (mass * mass) - (mMassLambda1520 * mMassLambda1520);
867+
if (ptSq > 0)
868+
histos.fill(HIST("SignalLoss/hGen_mT_scaled_Proton"), std::sqrt(ptSq), centrality);
869+
} else if (pdg == -2212) {
870+
ptSq = (ptRef * ptRef) + (mass * mass) - (mMassLambda1520 * mMassLambda1520);
871+
if (ptSq > 0)
872+
histos.fill(HIST("SignalLoss/hGen_mT_scaled_AntiProton"), std::sqrt(ptSq), centrality);
873+
} else if (pdg == 3122) {
874+
ptSq = (ptRef * ptRef) + (mass * mass) - (mMassLambda1520 * mMassLambda1520);
875+
if (ptSq > 0)
876+
histos.fill(HIST("SignalLoss/hGen_mT_scaled_Lambda0"), std::sqrt(ptSq), centrality);
877+
} else if (pdg == -3122) {
878+
ptSq = (ptRef * ptRef) + (mass * mass) - (mMassLambda1520 * mMassLambda1520);
879+
if (ptSq > 0)
880+
histos.fill(HIST("SignalLoss/hGen_mT_scaled_AntiLambda0"), std::sqrt(ptSq), centrality);
881+
} else if (pdg == 3312) {
882+
ptSq = (ptRef * ptRef) + (mass * mass) - (mMassLambda1520 * mMassLambda1520);
883+
if (ptSq > 0)
884+
histos.fill(HIST("SignalLoss/hGen_mT_scaled_XiMinus"), std::sqrt(ptSq), centrality);
885+
} else if (pdg == -3312) {
886+
ptSq = (ptRef * ptRef) + (mass * mass) - (mMassLambda1520 * mMassLambda1520);
887+
if (ptSq > 0)
888+
histos.fill(HIST("SignalLoss/hGen_mT_scaled_XiPlus"), std::sqrt(ptSq), centrality);
889+
} else if (pdg == 3322) {
890+
ptSq = (ptRef * ptRef) + (mass * mass) - (mMassLambda1520 * mMassLambda1520);
891+
if (ptSq > 0)
892+
histos.fill(HIST("SignalLoss/hGen_mT_scaled_Xi0"), std::sqrt(ptSq), centrality);
893+
} else if (pdg == -3322) {
894+
ptSq = (ptRef * ptRef) + (mass * mass) - (mMassLambda1520 * mMassLambda1520);
895+
if (ptSq > 0)
896+
histos.fill(HIST("SignalLoss/hGen_mT_scaled_AntiXi0"), std::sqrt(ptSq), centrality);
897+
} else if (pdg == 3334) {
898+
ptSq = (ptRef * ptRef) + (mass * mass) - (mMassLambda1520 * mMassLambda1520);
899+
if (ptSq > 0)
900+
histos.fill(HIST("SignalLoss/hGen_mT_scaled_OmegaMinus"), std::sqrt(ptSq), centrality);
901+
} else if (pdg == -3334) {
902+
ptSq = (ptRef * ptRef) + (mass * mass) - (mMassLambda1520 * mMassLambda1520);
903+
if (ptSq > 0)
904+
histos.fill(HIST("SignalLoss/hGen_mT_scaled_OmegaPlus"), std::sqrt(ptSq), centrality);
905+
}
906+
}
907+
}
908+
909+
PROCESS_SWITCH(lambdaAnalysis_pb, processMCGen, "Process Event for MC", false);
910+
800911
using BinningType2 = ColumnBinningPolicy<aod::collision::PosZ, aod::resocollision::Cent>;
801912

802913
void processMix(resoCols& collisions, resoTracks const& tracks)

0 commit comments

Comments
 (0)