Skip to content

Commit

Permalink
Final adjustments for O2AT
Browse files Browse the repository at this point in the history
  • Loading branch information
romainschotter committed Oct 11, 2024
1 parent 39e2080 commit 4611313
Show file tree
Hide file tree
Showing 14 changed files with 275 additions and 62 deletions.
24 changes: 24 additions & 0 deletions Tutorials/PWGLF/Strangeness/PbPb/Analysis/run_skeleton.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#!/bin/bash
# log file where the terminal output will be saved
STEP="skeleton"
LOGFILE="log-${STEP}.txt"

#directory of this script
DIR_THIS=$PWD

OPTION="-b --configuration json://configuration_skeleton.json"

o2-analysistutorial-lf-strangeness-pbpb-skeleton ${OPTION} --aod-file @input_data.txt > "$LOGFILE" 2>&1

# report status
rc=$?
if [ $rc -eq 0 ]; then
echo "No problems!"
mkdir -p ${DIR_THIS}/results/${STEP}
mv AnalysisResults.root ${DIR_THIS}/results/${STEP}/AnalysisResults.root
mv dpl-config.json ${DIR_THIS}/results/${STEP}/${STEP}.json
else
echo "Error: Exit code ${rc}"
echo "Check the log file ${LOGFILE}"
exit ${rc}
fi
23 changes: 22 additions & 1 deletion Tutorials/PWGLF/Strangeness/PbPb/Analysis/run_step0.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,24 @@
#!/bin/bash
# log file where the terminal output will be saved
STEP="0"
LOGFILE="log-${STEP}.txt"

#directory of this script
DIR_THIS=$PWD

OPTION="-b --configuration json://configuration_step0.json"

o2-analysis-lf-cascadespawner ${OPTION} | o2-analysistutorial-lf-strangeness-pbpb-step0 ${OPTION} --aod-file @input_data.txt
o2-analysis-lf-cascadespawner ${OPTION} | o2-analysistutorial-lf-strangeness-pbpb-step0 ${OPTION} --aod-file @input_data.txt > "$LOGFILE" 2>&1

# report status
rc=$?
if [ $rc -eq 0 ]; then
echo "No problems!"
mkdir -p ${DIR_THIS}/results/step${STEP}
mv AnalysisResults.root ${DIR_THIS}/results/step${STEP}/AnalysisResults.root
mv dpl-config.json ${DIR_THIS}/results/step${STEP}/step${STEP}.json
else
echo "Error: Exit code ${rc}"
echo "Check the log file ${LOGFILE}"
exit ${rc}
fi
23 changes: 22 additions & 1 deletion Tutorials/PWGLF/Strangeness/PbPb/Analysis/run_step1.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,24 @@
#!/bin/bash
# log file where the terminal output will be saved
STEP="1"
LOGFILE="log-${STEP}.txt"

#directory of this script
DIR_THIS=$PWD

OPTION="-b --configuration json://configuration_step1.json"

o2-analysis-lf-cascadespawner ${OPTION} | o2-analysistutorial-lf-strangeness-pbpb-step1 ${OPTION} --aod-file @input_data.txt
o2-analysis-lf-cascadespawner ${OPTION} | o2-analysistutorial-lf-strangeness-pbpb-step1 ${OPTION} --aod-file @input_data.txt > "$LOGFILE" 2>&1

# report status
rc=$?
if [ $rc -eq 0 ]; then
echo "No problems!"
mkdir -p ${DIR_THIS}/results/step${STEP}
mv AnalysisResults.root ${DIR_THIS}/results/step${STEP}/AnalysisResults.root
mv dpl-config.json ${DIR_THIS}/results/step${STEP}/step${STEP}.json
else
echo "Error: Exit code ${rc}"
echo "Check the log file ${LOGFILE}"
exit ${rc}
fi
23 changes: 22 additions & 1 deletion Tutorials/PWGLF/Strangeness/PbPb/Analysis/run_step2.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,24 @@
#!/bin/bash
# log file where the terminal output will be saved
STEP="2"
LOGFILE="log-${STEP}.txt"

#directory of this script
DIR_THIS=$PWD

OPTION="-b --configuration json://configuration_step2.json"

o2-analysis-lf-cascadepid ${OPTION} | o2-analysis-lf-cascadespawner ${OPTION} | o2-analysistutorial-lf-strangeness-pbpb-step2 ${OPTION} --aod-file @input_data.txt
o2-analysis-lf-cascadespawner ${OPTION} | o2-analysistutorial-lf-strangeness-pbpb-step2 ${OPTION} --aod-file @input_data.txt > "$LOGFILE" 2>&1

# report status
rc=$?
if [ $rc -eq 0 ]; then
echo "No problems!"
mkdir -p ${DIR_THIS}/results/step${STEP}
mv AnalysisResults.root ${DIR_THIS}/results/step${STEP}/AnalysisResults.root
mv dpl-config.json ${DIR_THIS}/results/step${STEP}/step${STEP}.json
else
echo "Error: Exit code ${rc}"
echo "Check the log file ${LOGFILE}"
exit ${rc}
fi
23 changes: 22 additions & 1 deletion Tutorials/PWGLF/Strangeness/PbPb/Analysis/run_step3.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,24 @@
#!/bin/bash
# log file where the terminal output will be saved
STEP="3"
LOGFILE="log-${STEP}.txt"

#directory of this script
DIR_THIS=$PWD

OPTION="-b --configuration json://configuration_step3.json"

o2-analysis-lf-cascadepid ${OPTION} | o2-analysis-lf-cascadespawner ${OPTION} | o2-analysistutorial-lf-strangeness-pbpb-step3 ${OPTION} --aod-file @input_data.txt
o2-analysis-lf-cascadepid ${OPTION} | o2-analysis-lf-cascadespawner ${OPTION} | o2-analysistutorial-lf-strangeness-pbpb-step3 ${OPTION} --aod-file @input_data.txt > "$LOGFILE" 2>&1

# report status
rc=$?
if [ $rc -eq 0 ]; then
echo "No problems!"
mkdir -p ${DIR_THIS}/results/step${STEP}
mv AnalysisResults.root ${DIR_THIS}/results/step${STEP}/AnalysisResults.root
mv dpl-config.json ${DIR_THIS}/results/step${STEP}/step${STEP}.json
else
echo "Error: Exit code ${rc}"
echo "Check the log file ${LOGFILE}"
exit ${rc}
fi
23 changes: 22 additions & 1 deletion Tutorials/PWGLF/Strangeness/PbPb/Analysis/run_step4.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,24 @@
#!/bin/bash
# log file where the terminal output will be saved
STEP="4"
LOGFILE="log-${STEP}.txt"

#directory of this script
DIR_THIS=$PWD

OPTION="-b --configuration json://configuration_step4.json"

o2-analysis-lf-cascadepid ${OPTION} | o2-analysis-lf-cascadespawner ${OPTION} | o2-analysistutorial-lf-strangeness-pbpb-step4 ${OPTION} --aod-file @input_data.txt
o2-analysis-lf-cascadepid ${OPTION} | o2-analysis-lf-cascadespawner ${OPTION} | o2-analysistutorial-lf-strangeness-pbpb-step4 ${OPTION} --aod-file @input_data.txt > "$LOGFILE" 2>&1

# report status
rc=$?
if [ $rc -eq 0 ]; then
echo "No problems!"
mkdir -p ${DIR_THIS}/results/step${STEP}
mv AnalysisResults.root ${DIR_THIS}/results/step${STEP}/AnalysisResults.root
mv dpl-config.json ${DIR_THIS}/results/step${STEP}/step${STEP}.json
else
echo "Error: Exit code ${rc}"
echo "Check the log file ${LOGFILE}"
exit ${rc}
fi
Original file line number Diff line number Diff line change
Expand Up @@ -98,22 +98,14 @@ struct strangeness_pbpb_tutorial {
nabs(aod::cascdata::dcabachtopv) > cascadesetting_dcabachtopv &&
aod::cascdata::dcacascdaughters < cascadesetting_dcacascdau);

// Defining the type of the daughter tracks
using dauTracks = aod::DauTrackExtras;

void process(soa::Filtered<soa::Join<aod::StraCollisions, aod::StraEvSels>>::iterator const& collision,
soa::Filtered<soa::Join<aod::CascCores, aod::CascExtras>> const& Cascades,
dauTracks const&)
soa::Filtered<soa::Join<aod::CascCores, aod::CascExtras>> const& Cascades)
{
// Fill the event counter
rEventSelection.fill(HIST("hVertexZRec"), collision.posZ());

// Cascades
for (const auto& casc : Cascades) {
const auto& bachDaughterTrackCasc = casc.bachTrackExtra_as<dauTracks>();
const auto& posDaughterTrackCasc = casc.posTrackExtra_as<dauTracks>();
const auto& negDaughterTrackCasc = casc.negTrackExtra_as<dauTracks>();

rXi.fill(HIST("hMassXi"), casc.mXi());
rOmega.fill(HIST("hMassOmega"), casc.mOmega());

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ struct strangeness_pbpb_tutorial {
aod::cascdata::dcacascdaughters < cascadesetting_dcacascdau);

// Defining the type of the daughter tracks
using dauTracks = soa::Join<aod::DauTrackExtras, aod::DauTrackTPCPIDs, aod::DauTrackTOFPIDs>;
using dauTracks = soa::Join<aod::DauTrackExtras, aod::DauTrackTPCPIDs>;

void process(soa::Filtered<soa::Join<aod::StraCollisions, aod::StraEvSels>>::iterator const& collision,
soa::Filtered<soa::Join<aod::CascCores, aod::CascExtras, aod::CascTOFNSigmas>> const& Cascades,
Expand Down Expand Up @@ -166,62 +166,57 @@ struct strangeness_pbpb_tutorial {
}

// TOF PID check
bool bachXiPassTOFSelection = true;
bool posXiPassTOFSelection = true;
bool negXiPassTOFSelection = true;
bool bachOmegaPassTOFSelection = true;
bool posOmegaPassTOFSelection = true;
bool negOmegaPassTOFSelection = true;
bool atLeastOneTOF = bachDaughterTrackCasc.hasTOF() || posDaughterTrackCasc.hasTOF() || negDaughterTrackCasc.hasTOF();
bool xiPassTOFSelection = true;
bool omegaPassTOFSelection = true;
if (casc.sign() < 0) {
if (posDaughterTrackCasc.hasTOF()) {
if (TMath::Abs(casc.tofNSigmaXiLaPr()) > NSigmaTOFProton) {
posXiPassTOFSelection = false;
xiPassTOFSelection &= false;
}
if (TMath::Abs(casc.tofNSigmaOmLaPr()) > NSigmaTOFProton) {
posOmegaPassTOFSelection = false;
omegaPassTOFSelection &= false;
}
}
if (negDaughterTrackCasc.hasTOF()) {
if (TMath::Abs(casc.tofNSigmaXiLaPi()) > NSigmaTOFPion) {
negXiPassTOFSelection = false;
xiPassTOFSelection &= false;
}
if (TMath::Abs(casc.tofNSigmaOmLaPi()) > NSigmaTOFPion) {
negOmegaPassTOFSelection = false;
omegaPassTOFSelection &= false;
}
}
} else {
if (posDaughterTrackCasc.hasTOF()) {
if (TMath::Abs(casc.tofNSigmaXiLaPi()) > NSigmaTOFPion) {
posXiPassTOFSelection = false;
xiPassTOFSelection &= false;
}
if (TMath::Abs(casc.tofNSigmaOmLaPi()) > NSigmaTOFPion) {
posOmegaPassTOFSelection = false;
omegaPassTOFSelection &= false;
}
}
if (negDaughterTrackCasc.hasTOF()) {
if (TMath::Abs(casc.tofNSigmaXiLaPr()) > NSigmaTOFProton) {
negXiPassTOFSelection = false;
xiPassTOFSelection &= false;
}
if (TMath::Abs(casc.tofNSigmaOmLaPr()) > NSigmaTOFProton) {
negOmegaPassTOFSelection = false;
omegaPassTOFSelection &= false;
}
}
}

if (bachDaughterTrackCasc.hasTOF()) {
if (TMath::Abs(casc.tofNSigmaXiPi()) > NSigmaTOFPion) {
bachXiPassTOFSelection = false;
xiPassTOFSelection &= false;
}
if (TMath::Abs(casc.tofNSigmaOmKa()) > NSigmaTOFKaon) {
bachOmegaPassTOFSelection = false;
omegaPassTOFSelection &= false;
}
}

// Fill histograms! (if possible)
if (TMath::Abs(bachDaughterTrackCasc.tpcNSigmaPi()) < NSigmaTPCPion) { // Xi case
rXi.fill(HIST("hMassXiSelected"), casc.mXi());
if (atLeastOneTOF && bachXiPassTOFSelection && posXiPassTOFSelection && negXiPassTOFSelection)
if (xiPassTOFSelection)
rXi.fill(HIST("hMassXiSelectedWithTOF"), casc.mXi());

rXi.fill(HIST("hCascDCAV0Daughters"), casc.dcaV0daughters());
Expand All @@ -230,7 +225,7 @@ struct strangeness_pbpb_tutorial {
if (TMath::Abs(bachDaughterTrackCasc.tpcNSigmaKa()) < NSigmaTPCKaon) { // Omega case
if (TMath::Abs(casc.mXi() - pdgDB->Mass(3312)) > cascadesetting_competingmassrej) { // competing mass rejection, only in case of Omega
rOmega.fill(HIST("hMassOmegaSelected"), casc.mOmega());
if (atLeastOneTOF && bachOmegaPassTOFSelection && posOmegaPassTOFSelection && negOmegaPassTOFSelection)
if (omegaPassTOFSelection)
rOmega.fill(HIST("hMassOmegaSelectedWithTOF"), casc.mOmega());

rOmega.fill(HIST("hCascDCAV0Daughters"), casc.dcaV0daughters());
Expand Down
Loading

0 comments on commit 4611313

Please sign in to comment.