From 21e0f254c2349cc02967158291fe99e36c16229c Mon Sep 17 00:00:00 2001 From: Philip Chang Date: Fri, 17 Mar 2023 18:27:59 -0700 Subject: [PATCH] Fix duplicate rate bug --- code/core/write_sdl_ntuple.cc | 9 ++++----- setup_hpg.sh | 2 +- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/code/core/write_sdl_ntuple.cc b/code/core/write_sdl_ntuple.cc index 8199080d..4258a597 100644 --- a/code/core/write_sdl_ntuple.cc +++ b/code/core/write_sdl_ntuple.cc @@ -226,6 +226,7 @@ void setOutputBranches(SDL::Event* event) // Intermediate variables to keep track of matched track candidates for a given sim track std::vector sim_TC_matched(n_accepted_simtrk); std::vector sim_TC_matched_mask(n_accepted_simtrk); + std::vector sim_TC_matched_for_duplicate(trk.sim_pt().size()); // Intermediate variables to keep track of matched sim tracks for a given track candidate std::vector> tc_matched_simIdx; @@ -258,6 +259,7 @@ void setOutputBranches(SDL::Event* event) sim_TC_matched.at(idx) += 1; sim_TC_matched_mask.at(idx) |= (1 << type); } + sim_TC_matched_for_duplicate.at(idx) += 1; } } @@ -272,12 +274,9 @@ void setOutputBranches(SDL::Event* event) { // Using the sim_TC_matched to see whether this track candidate is matched to a sim track that is matched to more than one int simidx = tc_matched_simIdx[i][isim]; - if (simidx < n_accepted_simtrk) + if (sim_TC_matched_for_duplicate[simidx] > 1) { - if (sim_TC_matched[simidx] > 1) - { - isDuplicate = true; - } + isDuplicate = true; } } tc_isDuplicate[i] = isDuplicate; diff --git a/setup_hpg.sh b/setup_hpg.sh index 2949900c..408ba5a3 100644 --- a/setup_hpg.sh +++ b/setup_hpg.sh @@ -31,7 +31,7 @@ export TRACKLOOPERDIR=$DIR export TRACKINGNTUPLEDIR=/blue/p.chang/p.chang/data/lst/CMSSW_12_2_0_pre2 export PIXELMAPDIR=/blue/p.chang/p.chang/data/lst/pixelmap_neta20_nphi72_nz24_ipt2 export LSTOUTPUTDIR=. -export LSTPERFORMANCEWEBDIR=/blue/p.chang/users/phchang/public_html/LSTPerformanceWeb +export LSTPERFORMANCEWEBDIR=/home/users/phchang/public_html/LSTPerformanceWeb ########################################################################################################### # Validation scripts