Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add configuration for HF jets #422

Merged
merged 26 commits into from
Sep 9, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
a9831e9
Add first version of HF jet finding and matching
qgp Jul 1, 2022
aead5e5
Fix bugs and improve task logic
qgp Jul 4, 2022
01645ef
adding jets to Run 3 Validation
Jul 21, 2022
835a51b
adding tree output for HF substructure task
Feb 8, 2023
0db04df
Merge remote-tracking branch 'nima/hfjets' into hfjets
vkucera Sep 8, 2023
19cc985
Fix configuration for jets
vkucera Sep 8, 2023
beb9a01
Rename jet variables
vkucera Sep 8, 2023
1766dcc
Move jets to a separate group
vkucera Sep 8, 2023
5d4f2b0
Simplify jet options
vkucera Sep 8, 2023
7ae8707
Fix jet finders
vkucera Sep 8, 2023
e7580bf
Fix jet matching
vkucera Sep 8, 2023
1da831a
Fix jet substructure
vkucera Sep 8, 2023
294eee7
Fix jet substructure output
vkucera Sep 8, 2023
ca46497
Organise jet workflows
vkucera Sep 8, 2023
d8e5489
Add matching tables
vkucera Sep 8, 2023
b7a13b6
Only warn for duplicate workflows
vkucera Sep 8, 2023
ce0180c
Set process function switches for jet substructure
vkucera Sep 8, 2023
13ed884
Move jet json block
vkucera Sep 8, 2023
d5757a1
Add configuration for jet substructure output
vkucera Sep 8, 2023
bf49199
Add jet finder QA
vkucera Sep 8, 2023
ff40798
Fix workflow suffixes
vkucera Sep 8, 2023
2483cd6
Move correlation json block
vkucera Sep 8, 2023
01c78d8
Fix workflow suffixes
vkucera Sep 8, 2023
36c0b8b
Restore default settings
vkucera Sep 8, 2023
8769db4
[MegaLinter] Apply linters automatic fixes (#11)
github-actions[bot] Sep 8, 2023
0c0aa42
Merge branch 'master' into hfjets
vkucera Sep 9, 2023
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
40 changes: 40 additions & 0 deletions codeHF/Compare.C
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,38 @@ Int_t Compare(TString fileO2 = "AnalysisResults_O2.root", TString fileAli = "Ana
AddHistogram(vecHisJpsi, "decay length error (cm)", "hDecLenErrJpsi", "hf-task-jpsi/hDecLenErr", 1, 1, 0);
AddHistogram(vecHisJpsi, "decay length XY error (cm)", "hDecLenXYErrJpsi", "hf-task-jpsi/hDecLenXYErr", 1, 1, 0);

VecSpecHis vecHisJets;
AddHistogram(vecHisJets, "#it{p}_{T}^{jet} (GeV/#it{c})", "fHistJetPt", "jet-finder-hf-data/h_jet_pt", 1, 1, 0);
AddHistogram(vecHisJets, "#phi", "fHistJetPhi", "jet-finder-hf-data/h_jet_phi", 1, 1, 0);
AddHistogram(vecHisJets, "#eta", "fHistJetEta", "jet-finder-hf-data/h_jet_eta", 1, 1, 0);
AddHistogram(vecHisJets, "#it{N}_{tracks}", "fHistJetNConstituents", "jet-finder-hf-data/h_jet_ntracks", 1, 1, 0);
AddHistogram(vecHisJets, "#it{p}_{T}^{cand} (GeV/#it{c})", "fHistJetCandPt", "jet-finder-hf-data/h_D0_pt", 1, 1, 0);

VecSpecHis vecHisJetSubstructure;
AddHistogram(vecHisJetSubstructure, "#it{z}_{g}", "fHistJetZg", "jet-substructure-hf-data/h_jet_zg", 1, 0, 0);
AddHistogram(vecHisJetSubstructure, "#it{R}_{g}", "fHistJetRg", "jet-substructure-hf-data/h_jet_rg", 1, 0, 0);
AddHistogram(vecHisJetSubstructure, "#it{n}_{SD}", "fHistJetNsd", "jet-substructure-hf-data/h_jet_nsd", 1, 0, 0);

VecSpecHis vecHisJetsMC;
AddHistogram(vecHisJetsMC, "#it{p}_{T,det}^{jet} (GeV/#it{c})", "fHistJetPt", "jet-finder-hf-mcd/h_jet_pt", 1, 1, 0);
AddHistogram(vecHisJetsMC, "#it{p}_{T,gen}^{jet} (GeV/#it{c})", "fHistJetPt_Part", "jet-finder-hf-mcp/h_jet_pt", 1, 1, 0);
AddHistogram(vecHisJetsMC, "#phi_{det}", "fHistJetPhi", "jet-finder-hf-mcd/h_jet_phi", 1, 1, 0);
AddHistogram(vecHisJetsMC, "#phi_{gen}", "fHistJetPhi_Part", "jet-finder-hf-mcp/h_jet_phi", 1, 1, 0);
AddHistogram(vecHisJetsMC, "#eta_{det}", "fHistJetEta", "jet-finder-hf-mcd/h_jet_eta", 1, 1, 0);
AddHistogram(vecHisJetsMC, "#eta_{gen}", "fHistJetEta_Part", "jet-finder-hf-mcp/h_jet_eta", 1, 1, 0);
AddHistogram(vecHisJetsMC, "#it{N}_{tracks,det}", "fHistJetNConstituents", "jet-finder-hf-mcd/h_jet_ntracks", 1, 1, 0);
AddHistogram(vecHisJetsMC, "#it{N}_{tracks,gen}", "fHistJetNConstituents_Part", "jet-finder-hf-mcp/h_jet_ntracks", 1, 1, 0);
AddHistogram(vecHisJetsMC, "#it{p}_{T,det}^{cand} (GeV/#it{c})", "fHistJetCandPt", "jet-finder-hf-mcd/h_D0_pt", 1, 1, 0);
AddHistogram(vecHisJetsMC, "#it{p}_{T,gen}^{cand} (GeV/#it{c})", "fHistJetCandPt_Part", "jet-finder-hf-mcp/h_D0_pt", 1, 1, 0);

VecSpecHis vecHisJetSubstructureMC;
AddHistogram(vecHisJetSubstructureMC, "#it{z}_{g,det}", "fHistJetZg", "jet-substructure-hf-mcd/h_jet_zg", 1, 0, 0);
AddHistogram(vecHisJetSubstructureMC, "#it{z}_{g,gen}", "fHistJetZg_Part", "jet-substructure-hf-mcp/h_jet_zg", 1, 0, 0);
AddHistogram(vecHisJetSubstructureMC, "#it{R}_{g,det}", "fHistJetRg", "jet-substructure-hf-mcd/h_jet_rg", 1, 0, 0);
AddHistogram(vecHisJetSubstructureMC, "#it{R}_{g,gen}", "fHistJetRg_Part", "jet-substructure-hf-mcp/h_jet_rg", 1, 0, 0);
AddHistogram(vecHisJetSubstructureMC, "#it{n}_{SD,det}", "fHistJetNsd", "jet-substructure-hf-mcd/h_jet_nsd", 1, 0, 0);
AddHistogram(vecHisJetSubstructureMC, "#it{n}_{SD,gen}", "fHistJetNsd_Part", "jet-substructure-hf-mcp/h_jet_nsd", 1, 0, 0);

// vector of specifications of vectors: name, VecSpecHis, pads X, pads Y
std::vector<std::tuple<TString, VecSpecHis, int, int>> vecSpecVecSpec;

Expand Down Expand Up @@ -254,6 +286,14 @@ Int_t Compare(TString fileO2 = "AnalysisResults_O2.root", TString fileAli = "Ana
vecSpecVecSpec.push_back(std::make_tuple("lc-mc-nonprompt", vecHisLcMCNonPrompt, 5, 3));
if (options.Contains(" jpsi "))
vecSpecVecSpec.push_back(std::make_tuple("jpsi", vecHisJpsi, 5, 3));
if (options.Contains(" jets-data "))
vecSpecVecSpec.push_back(std::make_tuple("jets-data", vecHisJets, 5, 3));
if (options.Contains(" jets-mc "))
vecSpecVecSpec.push_back(std::make_tuple("jets-mc", vecHisJetsMC, 5, 3));
if (options.Contains(" jets-substructure-data "))
vecSpecVecSpec.push_back(std::make_tuple("jets-substructure-data", vecHisJetSubstructure, 5, 3));
if (options.Contains(" jets-substructure-mc "))
vecSpecVecSpec.push_back(std::make_tuple("jets-substructure-mc", vecHisJetSubstructureMC, 5, 3));

// Histogram plot vertical margins
Float_t marginHigh = 0.05;
Expand Down
8 changes: 7 additions & 1 deletion codeHF/RunHFTaskLocal.C
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@ Long64_t RunHFTaskLocal(TString txtfile = "./list_ali.txt",
TString jsonfilename = "dpl-config_std.json",
Bool_t isMC = kFALSE,
Bool_t useO2Vertexer = kFALSE,
Bool_t useAliEventCuts = kFALSE)
Bool_t useAliEventCuts = kFALSE,
Bool_t doJets = kFALSE,
Bool_t doJetMatching = kFALSE,
Bool_t doJetSubstructure = kFALSE)
{
// Load common libraries
gSystem->Load("libCore.so");
Expand Down Expand Up @@ -47,6 +50,9 @@ Long64_t RunHFTaskLocal(TString txtfile = "./list_ali.txt",
tasktr3->SetUseO2Vertexer();
}
tasktr3->SetUseCandidateAnalysisCuts();
tasktr3->SetDoJetFinding(doJets);
tasktr3->SetJetMatching(doJetMatching);
tasktr3->SetDoJetSubstructure(doJetSubstructure);

mgr->InitAnalysis();
mgr->PrintStatus();
Expand Down
82 changes: 68 additions & 14 deletions codeHF/config_tasks.sh
Original file line number Diff line number Diff line change
Expand Up @@ -96,22 +96,28 @@ DOO2_TREE_CHIC=0 # hf-tree-creator-chic-to-jpsi-gamma
DOO2_TREE_BPLUS=0 # hf-tree-creator-bplus-to-d0-pi
# Correlations
DOO2_CORR_D0D0BAR_DATA=0 # hf-correlator-d0-d0bar
DOO2_CORR_D0D0BAR_MCREC=0 # hf-correlator-d0-d0bar-mc-rec
DOO2_CORR_D0D0BAR_MCGEN=0 # hf-correlator-d0-d0bar-mc-gen
DOO2_CORR_D0D0BAR_MCREC=0 # hf-correlator-d0-d0bar_mc-rec
DOO2_CORR_D0D0BAR_MCGEN=0 # hf-correlator-d0-d0bar_mc-gen
DOO2_CORR_DPLUSDMINUS_DATA=0 # hf-correlator-dplus-dminus
DOO2_CORR_DPLUSDMINUS_MCREC=0 # hf-correlator-dplus-dminus-mc-rec
DOO2_CORR_DPLUSDMINUS_MCGEN=0 # hf-correlator-dplus-dminus-mc-gen
DOO2_CORR_DPLUSDMINUS_MCREC=0 # hf-correlator-dplus-dminus_mc-rec
DOO2_CORR_DPLUSDMINUS_MCGEN=0 # hf-correlator-dplus-dminus_mc-gen
DOO2_CORR_D0HADRON=0 # hf-correlator-d0-hadrons
DOO2_CORR_DPLUSHADRON=0 # hf-correlator-dplus-hadrons
DOO2_CORR_DSHADRON=0 # hf-correlator-ds-hadrons
DOO2_TASK_D0HADRON=0 # hf-task-correlation-d0-hadrons
DOO2_TASK_FLOW=0 # hf-task-flow
# Jets
DOO2_JET_FIND=0 # je-jet-finder-d0
DOO2_JET_FIND_QA=0 # je-jet-finder-hf-qa
DOO2_JET_MATCH=0 # je-jet-matching
DOO2_JET_SUB=0 # je-jet-substructure-hf
DOO2_JET_SUB_OUT=0 # je-jet-substructure-hf-output
# Converters
DOO2_CONV_MC=0 # mc-converter
DOO2_CONV_FDD=0 # fdd-converter
DOO2_CONV_COLL=0 # collision-converter
DOO2_CONV_ZDC=1 # zdc-converter
DOO2_CONV_BC=1 # bc-converter
DOO2_CONV_MC=0 # mc-converter
DOO2_CONV_FDD=0 # fdd-converter
DOO2_CONV_COLL=0 # collision-converter
DOO2_CONV_ZDC=1 # zdc-converter
DOO2_CONV_BC=1 # bc-converter

# Selection cuts
APPLYCUTS_D0=1 # Apply D0 selection cuts.
Expand Down Expand Up @@ -253,6 +259,37 @@ function AdjustJson {
ReplaceString "\"processSameRun2\": \"false\"" "\"processSameRun2\": \"true\"" "$JSON" || ErrExit "Failed to edit $JSON."
fi

# jet-finder-charged-d0-qa
if [ "$INPUT_IS_MC" -eq 1 ]; then
ReplaceString "\"processJetsData\": \"true\"" "\"processJetsData\": \"false\"" "$JSON" || ErrExit "Failed to edit $JSON."
else
ReplaceString "\"processJetsMCD\": \"true\"" "\"processJetsMCD\": \"false\"" "$JSON" || ErrExit "Failed to edit $JSON."
ReplaceString "\"processJetsMCP\": \"true\"" "\"processJetsMCP\": \"false\"" "$JSON" || ErrExit "Failed to edit $JSON."
fi

# jet-substructure...
if [ "$INPUT_IS_MC" -eq 1 ]; then
ReplaceString "\"processChargedJetsHF_data\": \"true\"" "\"processChargedJetsHF_data\": \"false\"" "$JSON" || ErrExit "Failed to edit $JSON."
ReplaceString "\"processOutput_data\": \"true\"" "\"processOutput_data\": \"false\"" "$JSON" || ErrExit "Failed to edit $JSON."
ReplaceString "\"processDummy_data\": \"false\"" "\"processDummy_data\": \"true\"" "$JSON" || ErrExit "Failed to edit $JSON."
else
ReplaceString "\"processChargedJetsHF_mcd\": \"true\"" "\"processChargedJetsHF_mcd\": \"false\"" "$JSON" || ErrExit "Failed to edit $JSON."
ReplaceString "\"processChargedJetsHFMCP_mcp\": \"true\"" "\"processChargedJetsHFMCP_mcp\": \"false\"" "$JSON" || ErrExit "Failed to edit $JSON."
ReplaceString "\"processOutput_mcd\": \"true\"" "\"processOutput_mcd\": \"false\"" "$JSON" || ErrExit "Failed to edit $JSON."
ReplaceString "\"processOutput_mcp\": \"true\"" "\"processOutput_mcp\": \"false\"" "$JSON" || ErrExit "Failed to edit $JSON."
ReplaceString "\"processDummy_mcd\": \"false\"" "\"processDummy_mcd\": \"true\"" "$JSON" || ErrExit "Failed to edit $JSON."
ReplaceString "\"processDummy_mcp\": \"false\"" "\"processDummy_mcp\": \"true\"" "$JSON" || ErrExit "Failed to edit $JSON."
fi
ReplaceString "\"processChargedJetsHF_data\"" "\"processChargedJetsHF\"" "$JSON" || ErrExit "Failed to edit $JSON."
ReplaceString "\"processChargedJetsHF_mcd\"" "\"processChargedJetsHF\"" "$JSON" || ErrExit "Failed to edit $JSON."
ReplaceString "\"processChargedJetsHFMCP_mcp\"" "\"processChargedJetsHFMCP\"" "$JSON" || ErrExit "Failed to edit $JSON."
ReplaceString "\"processOutput_data\"" "\"processOutput\"" "$JSON" || ErrExit "Failed to edit $JSON."
ReplaceString "\"processOutput_mcd\"" "\"processOutput\"" "$JSON" || ErrExit "Failed to edit $JSON."
ReplaceString "\"processOutput_mcp\"" "\"processOutput\"" "$JSON" || ErrExit "Failed to edit $JSON."
ReplaceString "\"processDummy_data\"" "\"processDummy\"" "$JSON" || ErrExit "Failed to edit $JSON."
ReplaceString "\"processDummy_mcd\"" "\"processDummy\"" "$JSON" || ErrExit "Failed to edit $JSON."
ReplaceString "\"processDummy_mcp\"" "\"processDummy\"" "$JSON" || ErrExit "Failed to edit $JSON."

# Enable D0 selection.
if [ $APPLYCUTS_D0 -eq 1 ]; then
MsgWarn "Using D0 selection cuts"
Expand Down Expand Up @@ -406,11 +443,11 @@ function MakeScriptO2 {
# Correlations
WF_CORR=""
[ $DOO2_CORR_D0D0BAR_DATA -eq 1 ] && WF_CORR="o2-analysis-hf-correlator-d0-d0bar o2-analysis-hf-task-correlation-d-dbar"
[ $DOO2_CORR_D0D0BAR_MCREC -eq 1 ] && WF_CORR="o2-analysis-hf-correlator-d0-d0bar-mc-rec o2-analysis-hf-task-correlation-d-dbar-mc-rec"
[ $DOO2_CORR_D0D0BAR_MCGEN -eq 1 ] && WF_CORR="o2-analysis-hf-correlator-d0-d0bar-mc-gen o2-analysis-hf-task-correlation-d-dbar-mc-gen"
[ $DOO2_CORR_D0D0BAR_MCREC -eq 1 ] && WF_CORR="o2-analysis-hf-correlator-d0-d0bar_mc-rec o2-analysis-hf-task-correlation-d-dbar_mc-rec"
[ $DOO2_CORR_D0D0BAR_MCGEN -eq 1 ] && WF_CORR="o2-analysis-hf-correlator-d0-d0bar_mc-gen o2-analysis-hf-task-correlation-d-dbar_mc-gen"
[ $DOO2_CORR_DPLUSDMINUS_DATA -eq 1 ] && WF_CORR="o2-analysis-hf-correlator-dplus-dminus o2-analysis-hf-task-correlation-d-dbar"
[ $DOO2_CORR_DPLUSDMINUS_MCREC -eq 1 ] && WF_CORR="o2-analysis-hf-correlator-dplus-dminus-mc-rec o2-analysis-hf-task-correlation-d-dbar-mc-rec"
[ $DOO2_CORR_DPLUSDMINUS_MCGEN -eq 1 ] && WF_CORR="o2-analysis-hf-correlator-dplus-dminus-mc-gen o2-analysis-hf-task-correlation-d-dbar-mc-gen"
[ $DOO2_CORR_DPLUSDMINUS_MCREC -eq 1 ] && WF_CORR="o2-analysis-hf-correlator-dplus-dminus_mc-rec o2-analysis-hf-task-correlation-d-dbar_mc-rec"
[ $DOO2_CORR_DPLUSDMINUS_MCGEN -eq 1 ] && WF_CORR="o2-analysis-hf-correlator-dplus-dminus_mc-gen o2-analysis-hf-task-correlation-d-dbar_mc-gen"
[ "$WF_CORR" ] && WORKFLOWS+=" $WF_CORR"
[ $DOO2_CORR_D0HADRON -eq 1 ] && WORKFLOWS+=" o2-analysis-hf-correlator-d0-hadrons"
[ $DOO2_CORR_DPLUSHADRON -eq 1 ] && WORKFLOWS+=" o2-analysis-hf-correlator-dplus-hadrons"
Expand All @@ -425,6 +462,19 @@ function MakeScriptO2 {
[ $DOO2_TREE_XICC -eq 1 ] && WORKFLOWS+=" o2-analysis-hf-tree-creator-xicc-to-p-k-pi-pi"
[ $DOO2_TREE_CHIC -eq 1 ] && WORKFLOWS+=" o2-analysis-hf-tree-creator-chic-to-jpsi-gamma"
[ $DOO2_TREE_BPLUS -eq 1 ] && WORKFLOWS+=" o2-analysis-hf-tree-creator-bplus-to-d0-pi"
# Jets
if [ "$INPUT_IS_MC" -eq 1 ]; then
[ $DOO2_JET_FIND -eq 1 ] && WORKFLOWS+=" o2-analysis-je-jet-finder-d0-mcd-charged o2-analysis-je-jet-finder-d0-mcp-charged"
[ $DOO2_JET_FIND_QA -eq 1 ] && WORKFLOWS+=" o2-analysis-je-jet-finder-hf-qa_mc"
[ $DOO2_JET_SUB -eq 1 ] && WORKFLOWS+=" o2-analysis-je-jet-substructure-hf_mcd o2-analysis-je-jet-substructure-hf_mcp"
[ $DOO2_JET_SUB_OUT -eq 1 ] && WORKFLOWS+=" o2-analysis-je-jet-substructure-hf-output_mcd o2-analysis-je-jet-substructure-hf-output_mcp"
else
[ $DOO2_JET_FIND -eq 1 ] && WORKFLOWS+=" o2-analysis-je-jet-finder-d0-data-charged"
[ $DOO2_JET_FIND_QA -eq 1 ] && WORKFLOWS+=" o2-analysis-je-jet-finder-hf-qa_data"
[ $DOO2_JET_SUB -eq 1 ] && WORKFLOWS+=" o2-analysis-je-jet-substructure-hf_data"
[ $DOO2_JET_SUB_OUT -eq 1 ] && WORKFLOWS+=" o2-analysis-je-jet-substructure-hf-output_data"
fi
[ $DOO2_JET_MATCH -eq 1 ] && WORKFLOWS+=" o2-analysis-je-jet-matching"
# Converters
[ $DOO2_CONV_MC -eq 1 ] && WORKFLOWS+=" o2-analysis-mc-converter"
[ $DOO2_CONV_FDD -eq 1 ] && WORKFLOWS+=" o2-analysis-fdd-converter"
Expand Down Expand Up @@ -465,7 +515,7 @@ EOF
}

function MakeScriptAli {
ALIEXEC="root -b -q -l \"$DIR_TASKS/RunHFTaskLocal.C(\\\"\$FileIn\\\", \\\"\$JSON\\\", $INPUT_IS_MC, $USEO2VERTEXER, $USEALIEVCUTS)\""
ALIEXEC="root -b -q -l \"$DIR_TASKS/RunHFTaskLocal.C(\\\"\$FileIn\\\", \\\"\$JSON\\\", $INPUT_IS_MC, $USEO2VERTEXER, $USEALIEVCUTS, $DOO2_JET_FIND, $DOO2_JET_MATCH, $DOO2_JET_SUB)\""
cat << EOF > "$SCRIPT_ALI"
#!/bin/bash
FileIn="\$1"
Expand All @@ -488,6 +538,10 @@ function MakeScriptPostprocess {
[ $DOO2_TASK_LC -eq 1 ] && { OPT_COMPARE+=" lc "; [ "$INPUT_IS_MC" -eq 1 ] && OPT_COMPARE+=" lc-mc-pt lc-mc-prompt lc-mc-nonprompt lc-mc-eta lc-mc-phi "; }
[ $DOO2_TASK_XIC -eq 1 ] && OPT_COMPARE+=" xic "
[ $DOO2_TASK_JPSI -eq 1 ] && OPT_COMPARE+=" jpsi "
# Jets
[ "$INPUT_IS_MC" -eq 1 ] && SUFFIX_JET="mc" || SUFFIX_JET="data"
[ $DOO2_JET_FIND -eq 1 ] && OPT_COMPARE+=" jets-${SUFFIX_JET} "
[ $DOO2_JET_SUB -eq 1 ] && OPT_COMPARE+=" jets-substructure-${SUFFIX_JET} "
[ "$OPT_COMPARE" ] && POSTEXEC+=" && root -b -q -l \"$DIR_TASKS/Compare.C(\\\"\$FileO2\\\", \\\"\$FileAli\\\", \\\"$OPT_COMPARE\\\", $DORATIO)\""
}
# Plot particle reconstruction efficiencies.
Expand Down
Loading