Skip to content

Commit

Permalink
Merge pull request #11 from alibuild/alibot-cleanup-8072
Browse files Browse the repository at this point in the history
Please consider the following formatting changes to AliceO2Group#8072
  • Loading branch information
gianniliveraro authored Oct 21, 2024
2 parents cccb7c7 + b4c6e2e commit 7569a93
Show file tree
Hide file tree
Showing 3 changed files with 58 additions and 60 deletions.
4 changes: 2 additions & 2 deletions PWGLF/DataModel/LFSigmaTables.h
Original file line number Diff line number Diff line change
Expand Up @@ -204,8 +204,8 @@ DECLARE_SOA_COLUMN(IsAntiSigma, isAntiSigma, bool);
} // namespace sigmaMCCore

DECLARE_SOA_TABLE(SigmaMCCores, "AOD", "SIGMA0MCCORES",
sigmaMCCore::IsSigma,
sigmaMCCore::IsSigma,
sigmaMCCore::IsAntiSigma);
} // namespace o2::aod

#endif // PWGLF_DATAMODEL_LFSIGMATABLES_H_
#endif // PWGLF_DATAMODEL_LFSIGMATABLES_H_
87 changes: 43 additions & 44 deletions PWGLF/TableProducer/Strangeness/sigma0builder.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,9 @@ using V0StandardDerivedDatas = soa::Join<aod::V0Cores, aod::V0CollRefs, aod::V0E
struct sigma0builder {
SliceCache cache;

Produces<aod::Sigma0Collision> sigma0Coll; // characterises collisions
Produces<aod::Sigma0CollRefs> sigma0CollRefs; // characterises collisions
Produces<aod::Sigma0Cores> sigma0cores; // save sigma0 candidates for analysis
Produces<aod::Sigma0Collision> sigma0Coll; // characterises collisions
Produces<aod::Sigma0CollRefs> sigma0CollRefs; // characterises collisions
Produces<aod::Sigma0Cores> sigma0cores; // save sigma0 candidates for analysis
Produces<aod::SigmaPhotonExtras> sigmaPhotonExtras; // save sigma0 candidates for analysis
Produces<aod::SigmaLambdaExtras> sigmaLambdaExtras; // save sigma0 candidates for analysis
Produces<aod::SigmaMCCores> sigma0mccores;
Expand Down Expand Up @@ -114,7 +114,6 @@ struct sigma0builder {
ConfigurableAxis axisSigmaMass{"axisSigmaMass", {200, 1.16f, 1.23f}, "M_{#Sigma^{0}} (GeV/c^{2})"};
ConfigurableAxis axisDeltaPt{"axisDeltaPt", {100, -1.0, +1.0}, "#Delta(p_{T})"};


int nSigmaCandidates = 0;
void init(InitContext const&)
{
Expand Down Expand Up @@ -152,7 +151,7 @@ struct sigma0builder {

histos.add("Efficiency/h2dLambdaPtResolution", "h2dLambdaPtResolution", kTH2D, {axisPt, axisDeltaPt});
histos.add("Efficiency/h2dGammaPtResolution", "h2dGammaPtResolution", kTH2D, {axisPt, axisDeltaPt});

histos.add("h3dMassSigmasAll", "h3dMassSigmasAll", kTH3F, {axisCentrality, axisPt, axisSigmaMass});
histos.add("h3dMassSigmasAfterSel", "h3dMassSigmasAfterSel", kTH3F, {axisCentrality, axisPt, axisSigmaMass});
}
Expand Down Expand Up @@ -225,7 +224,7 @@ struct sigma0builder {
return false;

if (TMath::Abs(sigmarap) > SigmaMaxRap)
return false;
return false;

histos.fill(HIST("hCandidateBuilderSelection"), 10.);

Expand Down Expand Up @@ -344,21 +343,21 @@ struct sigma0builder {
sigma0cores(fSigmapT, fSigmaMass, fSigmaRap);

sigmaPhotonExtras(fPhotonPt, fPhotonMass, fPhotonQt, fPhotonAlpha, fPhotonRadius,
fPhotonCosPA, fPhotonDCADau, fPhotonDCANegPV, fPhotonDCAPosPV, fPhotonZconv,
fPhotonEta, fPhotonY, fPhotonPosTPCNSigma, fPhotonNegTPCNSigma, fPhotonPosTPCCrossedRows,
fPhotonNegTPCCrossedRows, fPhotonPosPt, fPhotonNegPt, fPhotonPosEta,
fPhotonNegEta, fPhotonPosY, fPhotonNegY, fPhotonPsiPair,
fPhotonPosITSCls, fPhotonNegITSCls, fPhotonPosITSClSize, fPhotonNegITSClSize,
fPhotonV0Type, GammaBDTScore);
fPhotonCosPA, fPhotonDCADau, fPhotonDCANegPV, fPhotonDCAPosPV, fPhotonZconv,
fPhotonEta, fPhotonY, fPhotonPosTPCNSigma, fPhotonNegTPCNSigma, fPhotonPosTPCCrossedRows,
fPhotonNegTPCCrossedRows, fPhotonPosPt, fPhotonNegPt, fPhotonPosEta,
fPhotonNegEta, fPhotonPosY, fPhotonNegY, fPhotonPsiPair,
fPhotonPosITSCls, fPhotonNegITSCls, fPhotonPosITSClSize, fPhotonNegITSClSize,
fPhotonV0Type, GammaBDTScore);

sigmaLambdaExtras(fLambdaPt, fLambdaMass, fAntiLambdaMass, fLambdaQt, fLambdaAlpha,
fLambdaRadius, fLambdaCosPA, fLambdaDCADau, fLambdaDCANegPV,
fLambdaDCAPosPV, fLambdaEta, fLambdaY, fLambdaPosPrTPCNSigma,
fLambdaPosPiTPCNSigma, fLambdaNegPrTPCNSigma, fLambdaNegPiTPCNSigma, fLambdaPosTPCCrossedRows,
fLambdaNegTPCCrossedRows, fLambdaPosPt, fLambdaNegPt, fLambdaPosEta,
fLambdaNegEta, fLambdaPosPrY, fLambdaPosPiY, fLambdaNegPrY, fLambdaNegPiY,
fLambdaPosITSCls, fLambdaNegITSCls, fLambdaPosITSClSize, fLambdaNegITSClSize,
fLambdaV0Type, LambdaBDTScore, AntiLambdaBDTScore);
fLambdaRadius, fLambdaCosPA, fLambdaDCADau, fLambdaDCANegPV,
fLambdaDCAPosPV, fLambdaEta, fLambdaY, fLambdaPosPrTPCNSigma,
fLambdaPosPiTPCNSigma, fLambdaNegPrTPCNSigma, fLambdaNegPiTPCNSigma, fLambdaPosTPCCrossedRows,
fLambdaNegTPCCrossedRows, fLambdaPosPt, fLambdaNegPt, fLambdaPosEta,
fLambdaNegEta, fLambdaPosPrY, fLambdaPosPiY, fLambdaNegPrY, fLambdaNegPiY,
fLambdaPosITSCls, fLambdaNegITSCls, fLambdaPosITSClSize, fLambdaNegITSClSize,
fLambdaV0Type, LambdaBDTScore, AntiLambdaBDTScore);
}

void processMonteCarlo(soa::Join<aod::StraCollisions, aod::StraCents> const& collisions, V0DerivedMCDatas const& V0s)
Expand All @@ -372,42 +371,42 @@ struct sigma0builder {
for (auto& gamma : V0Table_thisCollision) { // selecting photons from Sigma0

float centrality = coll.centFT0C();

// Auxiliary histograms:
if (gamma.pdgCode() == 22){
if (gamma.pdgCode() == 22) {
float GammaY = TMath::Abs(RecoDecay::y(std::array{gamma.px(), gamma.py(), gamma.pz()}, o2::constants::physics::MassGamma));

if (GammaY < 0.5){ // rapidity selection
histos.fill(HIST("Efficiency/h2dPtVsCentrality_GammaAll"), centrality, gamma.pt()); // isgamma
if (GammaY < 0.5) { // rapidity selection
histos.fill(HIST("Efficiency/h2dPtVsCentrality_GammaAll"), centrality, gamma.pt()); // isgamma
histos.fill(HIST("Efficiency/h2dGammaPtResolution"), gamma.pt(), gamma.pt() - RecoDecay::pt(array{gamma.pxMC(), gamma.pyMC()})); // pT resolution

if (gamma.pdgCodeMother() == 3212){
if (gamma.pdgCodeMother() == 3212) {
histos.fill(HIST("Efficiency/h2dPtVsCentrality_GammaSigma0"), centrality, gamma.pt()); // isgamma from sigma
}
if (gamma.pdgCodeMother() == -3212){
if (gamma.pdgCodeMother() == -3212) {
histos.fill(HIST("Efficiency/h2dPtVsCentrality_GammaAntiSigma0"), centrality, gamma.pt()); // isgamma from sigma
}
}
}
if (gamma.pdgCode() == 3122){ // Is Lambda
}
if (gamma.pdgCode() == 3122) { // Is Lambda
float LambdaY = TMath::Abs(RecoDecay::y(std::array{gamma.px(), gamma.py(), gamma.pz()}, o2::constants::physics::MassLambda));
if (LambdaY < 0.5){ // rapidity selection
histos.fill(HIST("Efficiency/h2dPtVsCentrality_LambdaAll"), centrality, gamma.pt());
if (LambdaY < 0.5) { // rapidity selection
histos.fill(HIST("Efficiency/h2dPtVsCentrality_LambdaAll"), centrality, gamma.pt());
histos.fill(HIST("Efficiency/h2dLambdaPtResolution"), gamma.pt(), gamma.pt() - RecoDecay::pt(array{gamma.pxMC(), gamma.pyMC()})); // pT resolution
if (gamma.pdgCodeMother() == 3212){
histos.fill(HIST("Efficiency/h2dPtVsCentrality_LambdaSigma0"), centrality, gamma.pt());
if (gamma.pdgCodeMother() == 3212) {
histos.fill(HIST("Efficiency/h2dPtVsCentrality_LambdaSigma0"), centrality, gamma.pt());
}
}
}
if (gamma.pdgCode() == -3122){ // Is AntiLambda
if (gamma.pdgCode() == -3122) { // Is AntiLambda
float AntiLambdaY = TMath::Abs(RecoDecay::y(std::array{gamma.px(), gamma.py(), gamma.pz()}, o2::constants::physics::MassLambda));
if (AntiLambdaY < 0.5){ // rapidity selection
histos.fill(HIST("Efficiency/h2dPtVsCentrality_AntiLambdaAll"), centrality, gamma.pt());
if (gamma.pdgCodeMother() == -3212){
if (AntiLambdaY < 0.5) { // rapidity selection
histos.fill(HIST("Efficiency/h2dPtVsCentrality_AntiLambdaAll"), centrality, gamma.pt());
if (gamma.pdgCodeMother() == -3212) {
histos.fill(HIST("Efficiency/h2dPtVsCentrality_LambdaAntiSigma0"), centrality, gamma.pt()); // isantilambda from antisigma
}
}
}
}

for (auto& lambda : V0Table_thisCollision) { // selecting lambdas from Sigma0

Expand All @@ -418,29 +417,28 @@ struct sigma0builder {
float SigmaMass = RecoDecay::m(arrMom, std::array{o2::constants::physics::MassPhoton, o2::constants::physics::MassLambda0});
float SigmapT = RecoDecay::pt(array{gamma.px() + lambda.px(), gamma.py() + lambda.py()});
float SigmaY = TMath::Abs(RecoDecay::y(std::array{gamma.px() + lambda.px(), gamma.py() + lambda.py(), gamma.pz() + lambda.pz()}, o2::constants::physics::MassSigma0));

histos.fill(HIST("h3dMassSigmasAll"), centrality, SigmapT, SigmaMass);

if ((gamma.pdgCode() == 22) && (gamma.pdgCodeMother() == 3212) && (lambda.pdgCode() == 3122) && (lambda.pdgCodeMother() == 3212) && (gamma.motherMCPartId() == lambda.motherMCPartId()) && (SigmaY<0.5)){
if ((gamma.pdgCode() == 22) && (gamma.pdgCodeMother() == 3212) && (lambda.pdgCode() == 3122) && (lambda.pdgCodeMother() == 3212) && (gamma.motherMCPartId() == lambda.motherMCPartId()) && (SigmaY < 0.5)) {
histos.fill(HIST("Efficiency/h2dPtVsCentrality_Sigma0All"), centrality, RecoDecay::pt(array{gamma.px() + lambda.px(), gamma.py() + lambda.py()}));
histos.fill(HIST("Efficiency/h2dSigmaPtVsLambdaPt"), SigmapT, lambda.pt());
histos.fill(HIST("Efficiency/h2dSigmaPtVsGammaPt"), SigmapT, gamma.pt());

}
if ((gamma.pdgCode() == 22) && (gamma.pdgCodeMother() == -3212) && (lambda.pdgCode() == -3122) && (lambda.pdgCodeMother() == -3212) && (gamma.motherMCPartId() == lambda.motherMCPartId()) && (SigmaY<0.5))
if ((gamma.pdgCode() == 22) && (gamma.pdgCodeMother() == -3212) && (lambda.pdgCode() == -3122) && (lambda.pdgCodeMother() == -3212) && (gamma.motherMCPartId() == lambda.motherMCPartId()) && (SigmaY < 0.5))
histos.fill(HIST("Efficiency/h2dPtVsCentrality_AntiSigma0All"), centrality, SigmapT);

if (!processSigmaCandidate(lambda, gamma)) // basic selection
continue;

bool fIsSigma = false;
bool fIsAntiSigma = false;
histos.fill(HIST("h3dMassSigmasAfterSel"), centrality, SigmapT, SigmaMass);
if ((gamma.pdgCode() == 22) && (gamma.pdgCodeMother() == 3212) && (lambda.pdgCode() == 3122) && (lambda.pdgCodeMother() == 3212) && (gamma.motherMCPartId() == lambda.motherMCPartId())){
if ((gamma.pdgCode() == 22) && (gamma.pdgCodeMother() == 3212) && (lambda.pdgCode() == 3122) && (lambda.pdgCodeMother() == 3212) && (gamma.motherMCPartId() == lambda.motherMCPartId())) {
fIsSigma = true;
histos.fill(HIST("Efficiency/h2dPtVsCentrality_Sigma0AfterSel"), centrality, RecoDecay::pt(array{gamma.px() + lambda.px(), gamma.py() + lambda.py()}));
}
if ((gamma.pdgCode() == 22) && (gamma.pdgCodeMother() == -3212) && (lambda.pdgCode() == -3122) && (lambda.pdgCodeMother() == -3212) && (gamma.motherMCPartId() == lambda.motherMCPartId())){
if ((gamma.pdgCode() == 22) && (gamma.pdgCodeMother() == -3212) && (lambda.pdgCode() == -3122) && (lambda.pdgCodeMother() == -3212) && (gamma.motherMCPartId() == lambda.motherMCPartId())) {
fIsAntiSigma = true;
histos.fill(HIST("Efficiency/h2dPtVsCentrality_AntiSigma0AfterSel"), centrality, RecoDecay::pt(array{gamma.px() + lambda.px(), gamma.py() + lambda.py()}));
}
Expand Down Expand Up @@ -513,4 +511,5 @@ struct sigma0builder {
WorkflowSpec defineDataProcessing(ConfigContext const& cfgc)
{
return WorkflowSpec{adaptAnalysisTask<sigma0builder>(cfgc)};
}
}

27 changes: 13 additions & 14 deletions PWGLF/Tasks/Strangeness/sigmaanalysis.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ struct sigmaanalysis {
Configurable<float> LambdaMaxRap{"LambdaMaxRap", 0.5, "Max lambda rapidity"};

//// Photon standard criteria:
//Configurable<float> PhotonMaxDauPseudoRap{"PhotonMaxDauPseudoRap", 0.9, "Max pseudorapidity of daughter tracks"};
// Configurable<float> PhotonMaxDauPseudoRap{"PhotonMaxDauPseudoRap", 0.9, "Max pseudorapidity of daughter tracks"};
Configurable<float> PhotonDauMinPt{"PhotonDauMinPt", 0.05, "Min daughter pT (GeV/c)"};
Configurable<float> PhotonMinDCADauToPv{"PhotonMinDCADauToPv", 0.05, "Min DCA daughter To PV (cm)"};
Configurable<float> PhotonMaxDCAV0Dau{"PhotonMaxDCAV0Dau", 2.5, "Max DCA V0 Daughters (cm)"};
Expand All @@ -111,7 +111,7 @@ struct sigmaanalysis {
// TODO: Include PsiPair selection

Configurable<float> SigmaMaxRap{"SigmaMaxRap", 0.5, "Max sigma0 rapidity"};

// Axis
// base properties
ConfigurableAxis axisCentrality{"axisCentrality", {VARIABLE_WIDTH, 0.0f, 5.0f, 10.0f, 20.0f, 30.0f, 40.0f, 50.0f, 60.0f, 70.0f, 80.0f, 90.0f}, "Centrality"};
Expand Down Expand Up @@ -177,14 +177,14 @@ struct sigmaanalysis {
histos.get<TH1>(HIST("GeneralQA/hCandidateAnalysisSelection"))->GetXaxis()->SetBinLabel(22, "Lambda Y Cut");

// For Signal Extraction
// Sigma0

// Sigma0
histos.add("Sigma0/h3dMassSigma0", "h3dMassSigma0", kTH3F, {axisCentrality, axisPt, axisSigmaMass});
histos.add("Sigma0/hMassSigma0", "hMassSigma0", kTH1F, {axisSigmaMass});
histos.add("Sigma0/hPtSigma0", "hPtSigma0", kTH1F, {axisPt});
histos.add("Sigma0/hRapiditySigma0", "hRapiditySigma0", kTH1F, {axisRapidity});

// AntiSigma0
// AntiSigma0
histos.add("AntiSigma0/h3dMassAntiSigma0", "h3dMassAntiSigma0", kTH3F, {axisCentrality, axisPt, axisSigmaMass});
histos.add("AntiSigma0/hMassAntiSigma0", "hMassAntiSigma0", kTH1F, {axisSigmaMass});
histos.add("AntiSigma0/hPtAntiSigma0", "hPtAntiSigma0", kTH1F, {axisPt});
Expand Down Expand Up @@ -276,7 +276,7 @@ struct sigmaanalysis {

// Lambda selection
if ((TMath::Abs(cand.lambdaMass() - 1.115683) > LambdaWindow) && (TMath::Abs(cand.antilambdaMass() - 1.115683) > LambdaWindow))
return false;
return false;
histos.fill(HIST("GeneralQA/hCandidateAnalysisSelection"), 14.);
if ((TMath::Abs(cand.lambdaDCAPosPV()) < LambdaMinDCAPosToPv) || (TMath::Abs(cand.lambdaDCANegPV()) < LambdaMinDCANegToPv))
return false;
Expand Down Expand Up @@ -334,16 +334,15 @@ struct sigmaanalysis {
histos.fill(HIST("MC/h2dArmenterosSelected"), sigma.photonAlpha(), sigma.photonQt());
histos.fill(HIST("MC/h2dArmenterosSelected"), sigma.lambdaAlpha(), sigma.lambdaQt());

if (sigma.isSigma()){
if (sigma.isSigma()) {
histos.fill(HIST("MC/hMassSigma0"), sigma.sigmaMass());
histos.fill(HIST("MC/hPtSigma0"), sigma.sigmapT());
histos.fill(HIST("MC/h3dMassSigma0"), coll.centFT0C(), sigma.sigmapT(), sigma.sigmaMass());
}
else{
} else {
histos.fill(HIST("MC/hMassAntiSigma0"), sigma.sigmaMass());
histos.fill(HIST("MC/hPtAntiSigma0"), sigma.sigmapT());
histos.fill(HIST("MC/h3dMassAntiSigma0"), coll.centFT0C(), sigma.sigmapT(), sigma.sigmaMass());
}
}
}
}
}
Expand All @@ -366,13 +365,12 @@ struct sigmaanalysis {
histos.fill(HIST("GeneralQA/h2dArmenterosSelected"), sigma.photonAlpha(), sigma.photonQt());
histos.fill(HIST("GeneralQA/h2dArmenterosSelected"), sigma.lambdaAlpha(), sigma.lambdaQt());

if (sigma.lambdaAlpha()>0){
if (sigma.lambdaAlpha() > 0) {
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"), coll.centFT0C(), sigma.sigmapT(), sigma.sigmaMass());
}
else{
} else {
histos.fill(HIST("AntiSigma0/hMassAntiSigma0"), sigma.sigmaMass());
histos.fill(HIST("AntiSigma0/hPtAntiSigma0"), sigma.sigmapT());
histos.fill(HIST("AntiSigma0/hRapidityAntiSigma0"), sigma.sigmaRapidity());
Expand All @@ -389,4 +387,5 @@ struct sigmaanalysis {
WorkflowSpec defineDataProcessing(ConfigContext const& cfgc)
{
return WorkflowSpec{adaptAnalysisTask<sigmaanalysis>(cfgc)};
}
}

0 comments on commit 7569a93

Please sign in to comment.