Skip to content
Snippets Groups Projects

Resolve "Check ZDC particle gun acceptance"

Merged Alex Jentsch requested to merge 64-check-zdc-particle-gun-acceptance into master
Compare and
4 files
+ 49
6
Compare changes
  • Side-by-side
  • Inline
Files
4
@@ -60,6 +60,30 @@ void analysis_zdc_particles(
@@ -60,6 +60,30 @@ void analysis_zdc_particles(
return sampled / thrown;
return sampled / thrown;
};
};
 
// Hit position X
 
auto hit_x_position = [&] (const std::vector<eicd::CalorimeterHit>& hits) {
 
std::vector<double> result;
 
for(const auto& h: hits)
 
result.push_back(h.local.x()); //mm
 
return result;
 
};
 
 
// Hit position Y
 
auto hit_y_position = [&] (const std::vector<eicd::CalorimeterHit>& hits) {
 
std::vector<double> result;
 
for(const auto& h: hits)
 
result.push_back(h.local.y()); //mm
 
return result;
 
};
 
 
// Hit position Z
 
auto hit_z_position = [&] (const std::vector<eicd::CalorimeterHit>& hits) {
 
std::vector<double> result;
 
for(const auto& h: hits)
 
result.push_back(h.local.z()); //mm
 
return result;
 
};
 
// Define variables
// Define variables
auto d1 = d0
auto d1 = d0
.Define("Ethr", Ethr, {"MCParticles"})
.Define("Ethr", Ethr, {"MCParticles"})
@@ -69,6 +93,8 @@ void analysis_zdc_particles(
@@ -69,6 +93,8 @@ void analysis_zdc_particles(
.Define("nhits_Hcal", nhits, {"ZDCHcalHits"})
.Define("nhits_Hcal", nhits, {"ZDCHcalHits"})
.Define("Esim_Hcal", Esim, {"ZDCHcalHits"})
.Define("Esim_Hcal", Esim, {"ZDCHcalHits"})
.Define("fsam_Hcal", fsam, {"Esim_Hcal", "Ethr"})
.Define("fsam_Hcal", fsam, {"Esim_Hcal", "Ethr"})
 
.Define("hit_x_position", hit_x_position, {"ZDCHcalHits"})
 
.Define("hit_y_position", hit_y_position, {"ZDCHcalHits"})
;
;
// Define Histograms
// Define Histograms
@@ -96,6 +122,9 @@ void analysis_zdc_particles(
@@ -96,6 +122,9 @@ void analysis_zdc_particles(
{"hfsam_Hcal", "Hcal Sampling Fraction; Hcal Sampling Fraction; Events", 100, 0.0, 0.1},
{"hfsam_Hcal", "Hcal Sampling Fraction; Hcal Sampling Fraction; Events", 100, 0.0, 0.1},
"fsam_Hcal");
"fsam_Hcal");
 
auto hXY_HitMap_Hcal = d1.Histo2D({"hXY_HitMap_Hcal", "hit position Y vs. X histogram; hit position X [mm]; hit position Y [mm]", 100,-30,30, 100, -30, 30}, "hit_x_position", "hit_y_position");
 
 
// Event Counts
// Event Counts
auto nevents_thrown = d1.Count();
auto nevents_thrown = d1.Count();
std::cout << "Number of Thrown Events: " << (*nevents_thrown) << "\n";
std::cout << "Number of Thrown Events: " << (*nevents_thrown) << "\n";
@@ -187,4 +216,10 @@ void analysis_zdc_particles(
@@ -187,4 +216,10 @@ void analysis_zdc_particles(
c4->SaveAs(TString(results_path + "/zdc_fsam_Hcal.png"));
c4->SaveAs(TString(results_path + "/zdc_fsam_Hcal.png"));
c4->SaveAs(TString(results_path + "/zdc_fsam_Hcal.pdf"));
c4->SaveAs(TString(results_path + "/zdc_fsam_Hcal.pdf"));
}
}
 
{
 
TCanvas* c5 = new TCanvas("c5", "c5", 600, 500);
 
hXY_HitMap_Hcal->Draw("COLZ");
 
c5->SaveAs(TString(results_path + "/zdc_xy_map_Hcal.png"));
 
c5->SaveAs(TString(results_path + "/zdc_xy_map_Hcal.pdf"));
 
}
}
}
Loading