-
Notifications
You must be signed in to change notification settings - Fork 0
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 benchmarks/u_rho #3
Draft
zsweger
wants to merge
173
commits into
master
Choose a base branch
from
pr/u_channel_sweger
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from 30 commits
Commits
Show all changes
173 commits
Select commit
Hold shift + click to select a range
4e084b5
add benchmarks/u_rho
0f6d327
Update config.yml for phy benchmark
zsweger 6841030
Updated config.yml to include results task
zsweger 91f2abe
Update config.yml
zsweger b622c99
Editing figures directory
33eaf51
Edited the compile rule in the Snakefile to actually compile the script
b35ecd8
Update config.yml
zsweger 3890737
Update config.yml
zsweger 543dc45
Update Snakefile
zsweger f44fd82
Update Snakefile
zsweger 873a0ca
Update Snakefile
zsweger 0c2496c
Update Snakefile
zsweger 3f0bead
Snakefile: include benchmarks/u_rho/Snakefile
veprbl 0d284a9
benchmarks/u_rho/Snakefile: change compile rule to use common definition
veprbl 27c4c07
Added B0 reco QA plots
2781a08
Attempt at loading common_bench
zsweger 1cf4d1a
Attempt at setting benchmark status flag
zsweger 77901e3
Update json file name
zsweger 72f7c11
changed benchmark status function from void to int
zsweger 6024dd5
fixed benchmark status definition location
zsweger 823a408
Update RiceStyle.h to include common_bench
zsweger 1ed0eb9
Moved benchmark status flag to plotting macro
zsweger 2d1d432
Removed status flag from analysis code
zsweger dcbb867
Removed unnecessary dependency from pleaseIncludeMe.h
zsweger 593e736
Added pdf explaining various benchmark plots
zsweger fceba97
Copy to plot explainer to artifacts
zsweger 42525a6
removed plot explainer from artifacts
zsweger a602994
Test reading produced json file
zsweger e9c1e49
Testing benchmark failure status
zsweger d77a9dc
Update plot_rho_physics_benchmark.C
zsweger 71106b8
Copying json file to results directory
zsweger 723d96f
Update .gitlab-ci.yml to include u_rho
zsweger 2e2bb10
Update .gitlab-ci.yml
zsweger 3151f34
Update .gitlab-ci.yml
zsweger 25ca116
Update results collection in u_rho
zsweger 709d1cc
Update snakefile json results
zsweger e279ac4
Test copying json from config.yml
zsweger b2ac92b
Update json filename
zsweger 9b00d4f
Update .gitlab-ci.yml with u_rho results
zsweger 7f95f8a
remove results task in config.yml
zsweger 03059ff
Create benchmark.json
zsweger 5dc6979
Update json file name
zsweger e087009
Update config.yml to have active results rule
zsweger dbc0b46
Update config.yml test
zsweger 30d5860
Test commenting out diffractive_vm bench
zsweger 8f30825
Dont copy json to results
zsweger 9be9a1b
Move json to benchmark_outputs
zsweger 84d3dc3
Update snakefile for json path
zsweger 0e8988a
Update results path
zsweger be8ad9a
Move json file to results/u_rho
zsweger 0126212
Update pipeline stages
zsweger 12780d4
Trigger pipeline again
zsweger 552c7cb
Trigger pipelines
zsweger 7122355
Create setup.config
zsweger e4b74c8
Update pipelines with setup.config
zsweger bceed87
Update setup.config path
zsweger d0a2789
While testing dont simulate all benchmarks
zsweger a6f152b
Update config.yml steps
zsweger e83c355
Update config.yml test
zsweger 6f4b747
Update Snakefile to get evgen files
zsweger 66ae24b
Test grabbing evgen files from S3
zsweger 37b2b05
Test not using simulation campaign
zsweger f78c710
Fix Snakefile get evgen
zsweger 16ba69e
Fix Snakefile again
zsweger 33949e9
Update Snakefile check
zsweger 9bdc0fa
Fix snakefile check
zsweger 47439f9
Test detector simulation response
zsweger 511fa03
ddsim attempt 2
zsweger 78cfaca
Create simulate.sh
zsweger f46baff
Update config.yml with simulate.sh
zsweger f6f2d81
Update setup.config
zsweger 3369486
Fix simulate.sh
zsweger 7a973b1
Update simulate.sh
zsweger 0af915f
Update simulate.sh --inputFiles
zsweger fed7c8a
Update simulate.sh
zsweger 28f548d
Update config.yml to require common:detector
zsweger ae4318e
Test update config.yml
zsweger 8a8bcfd
Test update config.yml again
zsweger 79886ae
Update config.yml
zsweger f225f83
Update Snakefile input path
zsweger ce5f8eb
Update setup.config input path
zsweger 77954ba
Update config.yml tasks
zsweger e28b7c0
Add simulate rule in Snakefile
zsweger a3ea2ab
Update config.yml with snakemake simulate rule
zsweger a405c87
Fix Snakefile
zsweger 7b3541c
Update Snakefile to refer to simulate.sh
zsweger d93ccaf
Update simulate.sh
zsweger 21fdaa3
Update setup.config
zsweger c71d1fa
Update config.yml reconstruction
zsweger b2c8cd9
Create reconstruct.sh
zsweger ca99ad4
Update setup.config
zsweger 787da25
Update config.yml
zsweger f0233f0
Update simulate.sh
zsweger 27989e6
Update config.yml
zsweger 0e70fb1
Update reconstruct.sh
zsweger bff2401
Update setup.config
zsweger 079078a
Update analyze rule
zsweger 26d9035
Update setup.config
zsweger 3d36c7f
Update setup.config
zsweger e5e1db8
Create analyze.sh
zsweger 85e85f3
Test getting mirrored file from XRootD
zsweger 3da8ee3
Update setup.config with sim_output
zsweger 6b82b2d
Update plot_rho_physics_benchmark.C with sim_output
zsweger 007b14a
Update Snakefile with sim_output
zsweger 2377170
Update config.yml with sim_output
zsweger 024bf75
Trigger pipelines
zsweger 9883e1f
Trigger pipelines again
zsweger 091e603
Update analyze.sh with sim_output
zsweger 844145b
Update config.yml with sim_output pdf path
zsweger 3fc00d3
Trigger pipelines
zsweger 2deb74d
Update Snakefile paths test
zsweger 5a814c4
Change config.yml with updated snakefile arg
zsweger 7722e27
Update reconstruct.sh rec file
zsweger d94a8eb
Update `mkdir` to `mkdir -p` to avoid errors
zsweger a684cd0
Fix quotes in analyze.sh
zsweger 59a88ab
Update quotes again in analyze.sh
zsweger 244cfcb
Update figures path
zsweger 811cf93
Update config.yml figures path
zsweger ed04459
Test using simulation campaign
zsweger 003369e
Update Snakefile paths
zsweger 11140d1
Update config.yml paths
zsweger b19dd56
Update Snakefile paths
zsweger abaf607
Update config.yml json path
zsweger 67a943a
Update Snakefile
zsweger 315548e
Update plot_rho_physics_benchmark.C
zsweger 70bedee
Update Snakefile
zsweger d92fac0
Update config.yml paths
zsweger 3f72be7
Update config.yml
zsweger 23f8594
Update config.yml path
zsweger 72d9573
Update config.yml test
zsweger bc0f334
Delete flake.lock
zsweger 204c208
Delete flake.nix
zsweger 4783623
Delete benchmarks/u_rho/benchmark_output/README
zsweger 6d201d1
Test dynamic simulations again
zsweger 80bc118
Update analyze.sh json path
zsweger 5eef385
Add latex files to explain the benchmark plots
zsweger 9b51d72
Add format file for latex file
zsweger e441e0a
compile manual with tectonic
veprbl 47cfb7c
use time from any path
veprbl 86e0c09
Change location of latex compilation
zsweger f22669e
Test 10k events
zsweger 2180676
Update config.yml with May sim campaign
zsweger af2f2f9
Update Snakefile with May sim campaign
zsweger 43dea4f
Test use May sim campaign
zsweger fa91afe
Update config.yml with April campaign
zsweger ec78fcf
Test April campaign
zsweger 66fc5f1
Test ReconstructedChargedRealPIDParticles
zsweger 95b18da
Test on live data
zsweger 09db4a9
Test truth PID using chargedParticleAssociations
zsweger c141582
Test on 100 samples
zsweger ae61bc9
Saeahram's fix to uchannelrho.cxx
zsweger 17c9415
Try 1000 events
zsweger 102f7b8
Test simulation campaign
zsweger fe4daee
Update to July sim campaign
zsweger cb83559
Update Snakefile to July campaign
zsweger e939bc5
Update z axis label sizes
zsweger ad0641f
July campaign has fewer files. Reduce to 45
zsweger a98485e
Editing benchmark plot labels
zsweger 46d8e3f
Update EPIC label
zsweger b4a6f2d
Get rid of dN/dt plot
zsweger 3338459
Test proton reco fix
zsweger 72d7324
Get rid of dN/dt plot second attempt
zsweger 73064ef
Update bench status test
zsweger 37a62d1
Update bench plot labels
zsweger 2fc026d
Update plots top margin
zsweger 1700b77
Final top margin fix
zsweger 2a7aa70
Test bench with 5k events
zsweger 4cd11cd
Hello California! (and John!)
zsweger 4e5830f
Hello tutorial attendees!
zsweger 2dc2aed
Hello tutorial attendees! :)
zsweger 69e8fc4
Hello tutorial attendees!
zsweger 10644c4
Try to trigger pipelines
zsweger 9f28e0c
Trigger pipelines again
zsweger File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,91 @@ | ||
import os | ||
|
||
from snakemake.remote.S3 import RemoteProvider as S3RemoteProvider | ||
|
||
|
||
S3 = S3RemoteProvider( | ||
endpoint_url="https://dtn01.sdcc.bnl.gov:9000", | ||
access_key_id=os.environ["S3_ACCESS_KEY"], | ||
secret_access_key=os.environ["S3_SECRET_KEY"], | ||
) | ||
|
||
|
||
rule uchannelrho_compile: | ||
input: | ||
ROOT_BUILD_DIR_PREFIX + "benchmarks/u_rho/analysis/uchannelrho_cxx.so", | ||
|
||
|
||
rule uchannelrho_campaign_reco_get: | ||
input: | ||
lambda wildcards: S3.remote(f"eictest/EPIC/RECO/23.12.0/epic_craterlake/EXCLUSIVE/UCHANNEL_RHO/10x100/rho_10x100_uChannel_Q2of0to10_hiDiv.{wildcards.INDEX}.eicrecon.tree.edm4eic.root"), | ||
output: | ||
"benchmark_output/campaign_23.12.0_rho_10x100_uChannel_Q2of0to10_hiDiv_{INDEX}_eicrecon.edm4eic.root", | ||
shell: | ||
""" | ||
echo "Getting file for INDEX {wildcards.INDEX}" | ||
ln {input} {output} | ||
""" | ||
|
||
|
||
rule uchannelrho_analysis: | ||
input: | ||
script="benchmarks/u_rho/analysis/uchannelrho.cxx", | ||
#script_compiled=ROOT_BUILD_DIR_PREFIX + "benchmarks/u_rho/analysis/uchannelrho_cxx.so", | ||
data="benchmark_output/campaign_23.12.0_rho_10x100_uChannel_Q2of0to10_hiDiv_{INDEX}_eicrecon.edm4eic.root", | ||
output: | ||
plots="benchmark_output/campaign_23.12.0_{INDEX}_eicrecon.edm4eic/plots.root", | ||
shell: | ||
""" | ||
mkdir -p $(dirname "{output.plots}") | ||
root -l -b -q '{input.script}+("{input.data}","{output.plots}")' | ||
""" | ||
|
||
|
||
rule uchannelrho_combine: | ||
input: | ||
#lambda wildcards: [f"benchmark_output/campaign_23.12.0_{ix:04d}_eicrecon.edm4eic/plots.root" for ix in range(int(wildcards.NUM_FILES))], | ||
lambda wildcards: expand( | ||
"benchmark_output/campaign_23.12.0_{INDEX:04d}_eicrecon.edm4eic/plots.root", | ||
zsweger marked this conversation as resolved.
Show resolved
Hide resolved
|
||
INDEX=range(int(wildcards.N)), | ||
), | ||
wildcard_constraints: | ||
N="\d+", | ||
output: | ||
"benchmark_output/campaign_23.12.0_combined_{N}files_eicrecon.edm4eic.plots.root", | ||
shell: | ||
""" | ||
hadd {output} {input} | ||
""" | ||
|
||
|
||
ruleorder: uchannelrho_combine > uchannelrho_analysis | ||
|
||
|
||
rule uchannelrho_plots: | ||
input: | ||
script="benchmarks/u_rho/macros/plot_rho_physics_benchmark.C", | ||
plots="benchmark_output/campaign_23.12.0_combined_{N}files_eicrecon.edm4eic.plots.root", | ||
output: | ||
"benchmark_output/campaign_23.12.0_combined_{N}files_eicrecon.edm4eic.plots_figures/benchmark_rho_mass.pdf", | ||
shell: | ||
""" | ||
if [ ! -d "{input.plots}_figures" ]; then | ||
mkdir "{input.plots}_figures" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Snakemake will pre-create all the directories for files you list in the |
||
echo "{input.plots}_figures directory created successfully." | ||
else | ||
echo "{input.plots}_figures directory already exists." | ||
fi | ||
root -l -b -q '{input.script}("{input.plots}")' | ||
cat *.json | ||
#cp {input.plots}_figures/*.pdf figures/ | ||
""" | ||
|
||
|
||
# Couple examples of invocation: | ||
|
||
rule uchannelrho_run_over_a_campaign: | ||
input: | ||
"benchmark_output/figures/plots_benchmark_rho_dsigmadt.pdf", | ||
message: | ||
"See output in {input[0]}" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,116 @@ | ||
#include <cmath> | ||
#include <fstream> | ||
#include <iostream> | ||
#include <string> | ||
#include <vector> | ||
#include <algorithm> | ||
#include <utility> | ||
|
||
#include "ROOT/RDataFrame.hxx" | ||
#include <TH1D.h> | ||
#include <TFitResult.h> | ||
#include <TRandom3.h> | ||
#include <TCanvas.h> | ||
#include <TSystem.h> | ||
|
||
#include "TFile.h" | ||
#include "TLorentzVector.h" | ||
|
||
#include "TLorentzRotation.h" | ||
#include "TVector2.h" | ||
#include "TVector3.h" | ||
|
||
#include "fmt/color.h" | ||
#include "fmt/core.h" | ||
|
||
// #include "nlohmann/json.hpp" | ||
#include "edm4eic/InclusiveKinematicsData.h" | ||
#include "edm4eic/ReconstructedParticleData.h" | ||
#include "edm4hep/MCParticleData.h" | ||
|
||
#define PI 3.1415926 | ||
#define MASS_ELECTRON 0.00051 | ||
#define MASS_PROTON 0.93827 | ||
#define MASS_PION 0.13957 | ||
#define MASS_KAON 0.493667 | ||
#define MASS_AU197 183.45406466643374 | ||
|
||
auto getNtrk(const std::vector<edm4eic::ReconstructedParticleData>& parts) | ||
{ | ||
std::vector<int> mult; | ||
int n=0; | ||
for(auto& i1 : parts){ | ||
if(i1.charge!=0) n++; | ||
} | ||
mult.push_back( n ); | ||
return mult; | ||
} | ||
auto getNtrkMC(const std::vector<edm4hep::MCParticleData>& parts) | ||
{ | ||
std::vector<int> mult; | ||
int n=0; | ||
for(auto& i1 : parts){ | ||
if(i1.charge!=0 && i1.generatorStatus==1) n++; | ||
} | ||
mult.push_back( n ); | ||
return mult; | ||
} | ||
auto momenta_from_chargedparticles(const std::vector<edm4eic::ReconstructedParticleData>& parts) { | ||
std::vector<TVector3> momenta; | ||
for(auto& i1 : parts){ | ||
TVector3 trk(i1.momentum.x,i1.momentum.y,i1.momentum.z); | ||
if(i1.charge!=0) momenta.push_back(trk); | ||
} | ||
return momenta; | ||
} | ||
auto momenta_from_mcparticles(const std::vector<edm4hep::MCParticleData>& parts) { | ||
std::vector<TVector3> momenta; | ||
for(auto& i1 : parts){ | ||
TVector3 trk(i1.momentum.x,i1.momentum.y,i1.momentum.z); | ||
if(i1.charge!=0 && i1.generatorStatus==1) momenta.push_back(trk); | ||
} | ||
return momenta; | ||
} | ||
auto pt_resolution(const std::vector<edm4hep::MCParticleData>& mcs, | ||
const std::vector<edm4eic::ReconstructedParticleData>& recos){ | ||
|
||
std::vector<double> resolution; | ||
for(auto& i1: recos){ | ||
TVector3 trk(i1.momentum.x,i1.momentum.y,i1.momentum.z); | ||
if(i1.charge==0) continue; | ||
double minR=99; | ||
TVector3 matchMCtrk(-99,-99,-99); | ||
for(auto& i2 : mcs){ | ||
TVector3 trkMC(i2.momentum.x,i2.momentum.y,i2.momentum.z); | ||
if(i2.charge!=0 && i2.generatorStatus==1){ | ||
if(trk.DeltaR(trkMC) < minR ){ | ||
minR=trk.DeltaR(trkMC); | ||
matchMCtrk=trkMC; | ||
} | ||
} | ||
} | ||
double res= (matchMCtrk.Perp()-trk.Perp()) / matchMCtrk.Perp(); | ||
resolution.push_back( res ); | ||
|
||
} | ||
|
||
return resolution; | ||
} | ||
auto getPt(const std::vector<TVector3>& tracks) | ||
{ | ||
std::vector<double> Pt; | ||
for(auto& i1 : tracks){Pt.push_back(i1.Perp());} | ||
return Pt; | ||
} | ||
auto getEta(const std::vector<TVector3>& tracks) | ||
{ | ||
std::vector<double> eta; | ||
for(auto& i1 : tracks){eta.push_back(i1.Eta());} | ||
return eta; | ||
} | ||
auto getPhi(const std::vector<TVector3>& tracks) | ||
{ | ||
std::vector<double> Phi; | ||
for(auto& i1 : tracks){Phi.push_back(i1.Phi());} | ||
return Phi; | ||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please, include the tex file for benchmarks/u_rho/BenchmarkPlotsExplained.pdf, maybe we can generate PDF on CI and store it artifacts along with the plots.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay I've now updated the latex file! I've tried the
pdflatex
command in eicshell to compile it and that didn't work. How can we generate the PDF on CI?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've pushed a hacky solution. Perhaps, we need to request some small latex engine to be added to the container.