Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 21 additions & 21 deletions PWGLF/TableProducer/Strangeness/sigma0builder.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -231,15 +231,16 @@ struct sigma0builder {
histos.add("h3dMassSigmasBeforeSel", "h3dMassSigmasBeforeSel", kTH3F, {axisCentrality, axisPt, axisSigmaMass});
histos.add("h3dMassSigmasAfterSel", "h3dMassSigmasAfterSel", kTH3F, {axisCentrality, axisPt, axisSigmaMass});
}
template <typename TV0Object>
void runPi0QA(TV0Object const& gamma1, TV0Object const& gamma2) {
template <typename TV0Object>
void runPi0QA(TV0Object const& gamma1, TV0Object const& gamma2)
{

// Check if both V0s are made of the same tracks
if (gamma1.posTrackExtraId() == gamma2.posTrackExtraId() ||
gamma1.negTrackExtraId() == gamma2.negTrackExtraId() ||
gamma1.posTrackExtraId() == gamma2.negTrackExtraId() ||
if (gamma1.posTrackExtraId() == gamma2.posTrackExtraId() ||
gamma1.negTrackExtraId() == gamma2.negTrackExtraId() ||
gamma1.posTrackExtraId() == gamma2.negTrackExtraId() ||
gamma1.negTrackExtraId() == gamma2.posTrackExtraId()) {
return;
return;
}

// Calculate pi0 properties
Expand All @@ -255,15 +256,15 @@ void runPi0QA(TV0Object const& gamma1, TV0Object const& gamma2) {

// Check if MC data and populate fIsMC, fIsPi0
if constexpr (requires { gamma1.pdgCode(); gamma2.pdgCode(); }) {
fIsMC = true;
if (gamma1.pdgCode() == 22 && gamma2.pdgCode() == 22 &&
gamma1.pdgCodeMother() == 111 && gamma2.pdgCodeMother() == 111 &&
gamma1.motherMCPartId() == gamma2.motherMCPartId()) {
fIsPi0 = true;
histos.fill(HIST("MC/h2dPtVsMassPi0BeforeSel_SignalOnly"), pi0Pt, pi0Mass);
}
fIsMC = true;
if (gamma1.pdgCode() == 22 && gamma2.pdgCode() == 22 &&
gamma1.pdgCodeMother() == 111 && gamma2.pdgCodeMother() == 111 &&
gamma1.motherMCPartId() == gamma2.motherMCPartId()) {
fIsPi0 = true;
histos.fill(HIST("MC/h2dPtVsMassPi0BeforeSel_SignalOnly"), pi0Pt, pi0Mass);
}
} else {
histos.fill(HIST("GeneralQA/h2dPtVsMassPi0BeforeSel_Candidates"), pi0Pt, pi0Mass);
histos.fill(HIST("GeneralQA/h2dPtVsMassPi0BeforeSel_Candidates"), pi0Pt, pi0Mass);
}

// Photon-specific selections
Expand All @@ -290,7 +291,7 @@ void runPi0QA(TV0Object const& gamma1, TV0Object const& gamma2) {
posTrackGamma1.tpcCrossedRows() < Pi0PhotonMinTPCCrossedRows ||
negTrackGamma1.tpcCrossedRows() < Pi0PhotonMinTPCCrossedRows ||
!passedTPCGamma1) {
return;
return;
}

// Gamma2 Selection
Expand All @@ -311,7 +312,7 @@ void runPi0QA(TV0Object const& gamma1, TV0Object const& gamma2) {
posTrackGamma2.tpcCrossedRows() < Pi0PhotonMinTPCCrossedRows ||
negTrackGamma2.tpcCrossedRows() < Pi0PhotonMinTPCCrossedRows ||
!passedTPCGamma2) {
return;
return;
}

// Pi0-specific selections:
Expand All @@ -323,8 +324,7 @@ void runPi0QA(TV0Object const& gamma1, TV0Object const& gamma2) {
if (fIsMC) {
if (fIsPi0)
histos.fill(HIST("MC/h2dPtVsMassPi0AfterSel_SignalOnly"), pi0Pt, pi0Mass);
}
else
} else
histos.fill(HIST("GeneralQA/h2dPtVsMassPi0AfterSel_Candidates"), pi0Pt, pi0Mass);
}

Expand Down Expand Up @@ -464,7 +464,7 @@ void runPi0QA(TV0Object const& gamma1, TV0Object const& gamma2) {
histos.fill(HIST("hCandidateBuilderSelection"), 13.);
return true;
}

// Fill tables with reconstructed sigma0 candidate
template <typename TV0Object, typename TCollision>
void fillTables(TV0Object const& lambda, TV0Object const& gamma, TCollision const& coll)
Expand Down Expand Up @@ -646,7 +646,7 @@ void runPi0QA(TV0Object const& gamma1, TV0Object const& gamma2) {
}

for (auto& lambda : V0Table_thisCollision) { // selecting lambdas from Sigma0
if (doPi0QA) // Pi0 QA study
if (doPi0QA) // Pi0 QA study
runPi0QA(gamma, lambda);

// Sigma0 candidate properties
Expand Down Expand Up @@ -711,7 +711,7 @@ void runPi0QA(TV0Object const& gamma1, TV0Object const& gamma2) {
// V0 table sliced
for (auto& gamma : V0Table_thisCollision) { // selecting photons from Sigma0
for (auto& lambda : V0Table_thisCollision) { // selecting lambdas from Sigma0
if (doPi0QA) // Pi0 QA study
if (doPi0QA) // Pi0 QA study
runPi0QA(gamma, lambda);

// Sigma0 candidate properties
Expand Down
26 changes: 12 additions & 14 deletions PWGLF/Tasks/Strangeness/sigmaanalysis.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -344,11 +344,11 @@ struct sigmaanalysis {
return false;
histos.fill(HIST("GeneralQA/hPhotonPosTPCNSigma"), cand.photonPosTPCNSigma());
histos.fill(HIST("GeneralQA/hCandidateAnalysisSelection"), 6.);
if ((cand.photonPosTPCNSigma()!=-999.f) && ((cand.photonPosTPCNSigma() < PhotonMinTPCNSigmas) || (cand.photonPosTPCNSigma() > PhotonMaxTPCNSigmas)))
if ((cand.photonPosTPCNSigma() != -999.f) && ((cand.photonPosTPCNSigma() < PhotonMinTPCNSigmas) || (cand.photonPosTPCNSigma() > PhotonMaxTPCNSigmas)))
return false;
histos.fill(HIST("GeneralQA/hPhotonNegTPCNSigma"), cand.photonNegTPCNSigma());
histos.fill(HIST("GeneralQA/hCandidateAnalysisSelection"), 7.);
if ((cand.photonNegTPCNSigma()!=-999.f) && ((cand.photonNegTPCNSigma() < PhotonMinTPCNSigmas) || (cand.photonNegTPCNSigma() > PhotonMaxTPCNSigmas)))
if ((cand.photonNegTPCNSigma() != -999.f) && ((cand.photonNegTPCNSigma() < PhotonMinTPCNSigmas) || (cand.photonNegTPCNSigma() > PhotonMaxTPCNSigmas)))
return false;
histos.fill(HIST("GeneralQA/hPhotonpT"), cand.photonPt());
histos.fill(HIST("GeneralQA/hCandidateAnalysisSelection"), 8.);
Expand Down Expand Up @@ -428,7 +428,7 @@ struct sigmaanalysis {
bool passedTPC = true;
bool passedTOF = true;

if (isLambdalike){ // Lambda PID selection
if (isLambdalike) { // Lambda PID selection
// TPC Selection
if (fselLambdaTPCPID && (cand.lambdaPosPrTPCNSigma() != -999.f) && (TMath::Abs(cand.lambdaPosPrTPCNSigma()) > LambdaMaxTPCNSigmas))
passedTPC = false;
Expand All @@ -441,25 +441,24 @@ struct sigmaanalysis {
if (fselLambdaTOFPID && (cand.lambdaPiTOFNSigma() != -1e+3) && (TMath::Abs(cand.lambdaPiTOFNSigma()) > LambdaMaxTOFNSigmas))
passedTOF = false;

if constexpr (requires { cand.lambdaCandPDGCode(); }){
if (doPIDQA && passedTPC){
if constexpr (requires { cand.lambdaCandPDGCode(); }) {
if (doPIDQA && passedTPC) {
histos.fill(HIST("MC/hPtLambdaCandidates_passedTPCPID"), cand.lambdaPt());
if (cand.lambdaCandPDGCode() == 3122)
histos.fill(HIST("MC/hPtTrueLambda_passedTPCPID"), cand.lambdaPt());
histos.fill(HIST("MC/hPtTrueLambda_passedTPCPID"), cand.lambdaPt());
}
if (doPIDQA && passedTOF){
if (doPIDQA && passedTOF) {
histos.fill(HIST("MC/hPtLambdaCandidates_passedTOFPID"), cand.lambdaPt());
if (cand.lambdaCandPDGCode() == 3122)
histos.fill(HIST("MC/hPtTrueLambda_passedTOFPID"), cand.lambdaPt());
}
if (doPIDQA && passedTPC && passedTOF){
if (doPIDQA && passedTPC && passedTOF) {
histos.fill(HIST("MC/hPtLambdaCandidates_passedTPCTOFPID"), cand.lambdaPt());
if (cand.lambdaCandPDGCode() == 3122)
histos.fill(HIST("MC/hPtTrueLambda_passedTPCTOFPID"), cand.lambdaPt());
}
}
}
else{ // AntiLambda PID selection
} else { // AntiLambda PID selection
// TPC Selection
if (fselLambdaTPCPID && (cand.lambdaPosPiTPCNSigma() != -999.f) && (TMath::Abs(cand.lambdaPosPiTPCNSigma()) > LambdaMaxTPCNSigmas))
passedTPC = false;
Expand Down Expand Up @@ -558,7 +557,7 @@ struct sigmaanalysis {
histos.fill(HIST("MC/hMassSigma0"), sigma.sigmaMass());
histos.fill(HIST("MC/hPtSigma0"), sigma.sigmapT());
histos.fill(HIST("MC/h3dMassSigma0"), sigma.sigmaCentrality(), sigma.sigmapT(), sigma.sigmaMass());

} else {
// TPC + TOF PID Selections
if (!doLambdaPIDSel(sigma, false, false))
Expand Down Expand Up @@ -606,9 +605,8 @@ struct sigmaanalysis {
histos.fill(HIST("Sigma0/hMassSigma0"), sigma.sigmaMass());
histos.fill(HIST("Sigma0/hPtSigma0"), sigma.sigmapT());
histos.fill(HIST("Sigma0/hRapiditySigma0"), sigma.sigmaRapidity());
histos.fill(HIST("Sigma0/h3dMassSigma0"), sigma.sigmaCentrality(), sigma.sigmapT(), sigma.sigmaMass());
}
else {
histos.fill(HIST("Sigma0/h3dMassSigma0"), sigma.sigmaCentrality(), sigma.sigmapT(), sigma.sigmaMass());
} else {
// PID selections
histos.fill(HIST("GeneralQA/h2dTPCvsTOFNSigma_ALambdaPr"), sigma.lambdaNegPrTPCNSigma(), sigma.aLambdaPrTOFNSigma());
histos.fill(HIST("GeneralQA/h2dTPCvsTOFNSigma_ALambdaPi"), sigma.lambdaPosPiTPCNSigma(), sigma.aLambdaPiTOFNSigma());
Expand Down
Loading