Skip to content

Commit

Permalink
Update
Browse files Browse the repository at this point in the history
  • Loading branch information
bschmookler committed Sep 20, 2024
1 parent 20323e6 commit 399d2fe
Show file tree
Hide file tree
Showing 5 changed files with 50 additions and 10 deletions.
2 changes: 2 additions & 0 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,7 @@ include:
- local: 'benchmarks/barrel_hcal/config.yml'
- local: 'benchmarks/zdc/config.yml'
- local: 'benchmarks/zdc_lyso/config.yml'
- local: 'benchmarks/zdc_neutron/config.yml'
- local: 'benchmarks/material_scan/config.yml'
- local: 'benchmarks/pid/config.yml'
- local: 'benchmarks/timing/config.yml'
Expand All @@ -162,6 +163,7 @@ deploy_results:
- "collect_results:tracking_performances_dis"
- "collect_results:zdc"
- "collect_results:zdc_lyso"
- "collect_results:zdc_neutron"
script:
- echo "deploy results!"
- find results -print | sort | tee summary.txt
Expand Down
2 changes: 1 addition & 1 deletion benchmarks/zdc_neutron/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Detector Benchmark for single neutron in the ZDC
=================================================

## Overview
This benchmark generates single-neutron events. The neutrons are generated with 100 GeV total momentum; polar angles of 0-6.5 mRad with respect to the proton/ion beam direction, uniform over cosine of the polar angle; and uniform azimuthal angles with respect to the proton/ion beam direction. The benchmark creates acceptance and reconstruction performance plots.
This benchmark generates single-neutron events. The neutrons are generated with 100 GeV total momentum; polar angles of 0-6 mRad with respect to the proton/ion beam direction, uniform over cosine of the polar angle; and uniform azimuthal angles with respect to the proton/ion beam direction. The benchmark creates acceptance and reconstruction performance plots.

## Contacts
[Barak Schmookler]([email protected])
Expand Down
16 changes: 8 additions & 8 deletions benchmarks/zdc_neutron/analysis/fwd_neutrons_geant.C
Original file line number Diff line number Diff line change
Expand Up @@ -90,13 +90,13 @@ void fwd_neutrons_geant(std::string inputfile, std::string outputfile){
h3a_hcal->GetYaxis()->SetTitle("Number of cells hit per event");h3a_hcal->GetYaxis()->CenterTitle();
h3a_hcal->SetLineColor(kBlue);h3a_hcal->SetLineWidth(3);

//Cut on theta* < 3.5mRad
//Cut on theta* < 3.5 mRad
TH1 *h3b_hcal = new TH1D("h3b_hcal","Cells w/ non-zero energy deposit ",100,0,64);
h3b_hcal->GetXaxis()->SetTitle("Layer Number in ZDC HCal"); h3b_hcal->GetXaxis()->CenterTitle();
h3b_hcal->GetYaxis()->SetTitle("Number of cells hit per event");h3b_hcal->GetYaxis()->CenterTitle();
h3b_hcal->SetLineColor(kBlue);h3b_hcal->SetLineWidth(3);

//Cut on 6mRad < theta* < 8mRad
//Cut on 3.5 mRad < theta* < 6 mRad
TH1 *h3c_hcal = new TH1D("h3c_hcal","Cells w/ non-zero energy deposit ",100,0,64);
h3c_hcal->GetXaxis()->SetTitle("Layer Number in ZDC HCal"); h3c_hcal->GetXaxis()->CenterTitle();
h3c_hcal->GetYaxis()->SetTitle("Number of cells hit per event");h3c_hcal->GetYaxis()->CenterTitle();
Expand Down Expand Up @@ -135,7 +135,7 @@ void fwd_neutrons_geant(std::string inputfile, std::string outputfile){
TTreeReaderArray<float> hcal_hit_z(tr, "HcalFarForwardZDCHits.position.z");

//Other variables
int counter(0),counter_3p5(0),counter_6to8(0);
int counter(0),counter_3p5(0),counter_3p5to6(0);

TLorentzVector neut_true; //True neutron in lab coordinates
TLorentzVector neut_true_rot; //True neutron wrt proton beam direction
Expand Down Expand Up @@ -188,7 +188,7 @@ void fwd_neutrons_geant(std::string inputfile, std::string outputfile){

h3a_hcal->Fill(layer_number);
if( neut_true_rot.Theta()*1000. < 3.5 ) h3b_hcal->Fill(layer_number);
if( neut_true_rot.Theta()*1000. > 6 && neut_true_rot.Theta()*1000 < 8) h3c_hcal->Fill(layer_number);
if( neut_true_rot.Theta()*1000. > 3.5 && neut_true_rot.Theta()*1000 < 6.) h3c_hcal->Fill(layer_number);

} //End loop over HCal hits

Expand Down Expand Up @@ -217,16 +217,16 @@ void fwd_neutrons_geant(std::string inputfile, std::string outputfile){
counter_3p5++;
}

if( neut_true_rot.Theta()*1000. > 6 && neut_true_rot.Theta()*1000 < 8){
counter_6to8++;
if( neut_true_rot.Theta()*1000. > 3.5 && neut_true_rot.Theta()*1000 < 6.){
counter_3p5to6++;
}

} //End loop over events

//Scale histograms
h3a_hcal->Scale(1./counter);
h3b_hcal->Scale(1./counter_3p5);
h3c_hcal->Scale(1./counter_6to8);
h3c_hcal->Scale(1./counter_3p5to6);

//Make plots
TCanvas *c1 = new TCanvas("c1");
Expand Down Expand Up @@ -309,7 +309,7 @@ void fwd_neutrons_geant(std::string inputfile, std::string outputfile){

TLegend *leg6c = new TLegend(0.5,0.6,0.9,0.8);
leg6c->SetBorderSize(0);leg6c->SetFillStyle(0);
leg6c->SetHeader("Average over events w/ neutron 6 < #theta^{*} < 8 mRad");
leg6c->SetHeader("Average over events w/ neutron 3.5 < #theta^{*} < 6 mRad");
leg6c->Draw();

//Print plots to file
Expand Down
38 changes: 38 additions & 0 deletions benchmarks/zdc_neutron/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
sim:zdc_neutron:
extends: .det_benchmark
stage: simulate
script:
- snakemake --cache --cores 1 sim_output/zdc_neutron/epic_craterlake/fwd_neutrons.edm4eic.root
retry:
max: 2
when:
- runner_system_failure

bench:zdc_neutron:
extends: .det_benchmark
stage: benchmarks
needs:
- ["sim:zdc_neutron"]
script:
- snakemake --cores 1 results/zdc_neutron/epic_craterlake/fwd_neutrons_geant.pdf

collect_results:zdc_neutron:
extends: .det_benchmark
stage: collect
needs:
- "bench:zdc_neutron"
script:
- ls -lrht
- mv results{,_save}/ # move results directory out of the way to preserve it
- snakemake --cores 1 --delete-all-output results/zdc_neutron/epic_craterlake/fwd_neutrons_geant.pdf
- mv results{_save,}/
# convert to png
- |
gs -sDEVICE=pngalpha -dUseCropBox -r144 \
-o 'results/zdc_neutron/epic_craterlake/geant_plots_%03d.png' \
results/zdc_neutron/epic_craterlake/fwd_neutrons_geant.pdf
- |
gs -sDEVICE=pngalpha -dUseCropBox -r144 \
-o 'results/zdc_neutron/epic_craterlake/recon_plots_%03d.png' \
results/zdc_neutron/epic_craterlake/fwd_neutrons_recon.pdf
2 changes: 1 addition & 1 deletion benchmarks/zdc_neutron/gen_forward_neutrons.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ void gen_forward_neutrons(int n_events = 10000, UInt_t seed = 0, const char* out
{

double theta_min = 0.0; //in mRad
double theta_max = 6.5; //in mRad
double theta_max = 6.0; //in mRad
double cost_min = std::cos(theta_max/1000.) ; //Minimum value of cos(theta)
double cost_max = std::cos(theta_min/1000.) ; //Maximum value of cos(theta)

Expand Down

0 comments on commit 399d2fe

Please sign in to comment.