Skip to content
Snippets Groups Projects
Commit 420afc7a authored by Whitney Armstrong's avatar Whitney Armstrong
Browse files

modified: gps.mac

	modified:   scripts/tutorial1_hit_position.cxx
	modified:   scripts/tutorial2_cell_size.cxx
	modified:   scripts/tutorial3_id_spec.cxx
parent 9ca858d9
No related branches found
No related tags found
No related merge requests found
Pipeline #10132 failed
......@@ -6,14 +6,14 @@
/gps/number 1
/gps/ene/type Gauss
/gps/ene/mono 3.5 GeV
/gps/ene/mono 4.0 GeV
/gps/ene/sigma 3.0 GeV
/gps/pos/type Volume
/gps/pos/shape Cylinder
/gps/pos/centre 0.0 0.0 0.0 cm
/gps/pos/radius 0.01 cm
/gps/pos/halfz 0.01 cm
/gps/pos/halfz 10 cm
/gps/position 0 0 0 cm
#/gps/direction 0 0.1 1.0
......
......@@ -99,9 +99,9 @@ void tutorial1_hit_position(const char* fname = "gem_tracker_sim.root") {
.Define("x_pos", x_pos, {"xy_hit_pos"})
.Define("y_pos", y_pos, {"xy_hit_pos"});
auto h_local_pos = d1.Histo2D(TH2D("h_local_pos", ";x [cm]; y [cm] ", 100, -5.0, 5.0, 100, -5.0, 5.0), "x_pos", "y_pos");
auto h_local_pos = d1.Histo2D({"h_local_pos", ";x [cm]; y [cm] ", 100, -5.0, 5.0, 100, -5.0, 5.0}, "x_pos", "y_pos");
TCanvas* c = new TCanvas();
h_local_pos->DrawClone("colz");
auto h = h_local_pos->DrawCopy("colz");
c->SaveAs("results/hit_position.png");
}
......@@ -96,23 +96,23 @@ void tutorial2_cell_size(const char* fname = "gem_tracker_sim.root") {
};
auto d1 = d0.Define("nhits", nhits, {"GEMTrackerHits"})
.Filter([=](const std::vector<dd4pod::TrackerHitData>& hits) {
for (auto h : hits) {
auto pos = ROOT::Math::XYZVector(h.position.x,h.position.y,h.position.z);
if ((pos.r() > 100.0) && (std::abs(pos.phi()-M_PI/2.0)< M_PI/6)) {
return true;
}
}
return false;
},
{"GEMTrackerHits"})
//.Filter([=](const std::vector<dd4pod::TrackerHitData>& hits) {
// for (auto h : hits) {
// auto pos = ROOT::Math::XYZVector(h.position.x,h.position.y,h.position.z);
// if ((pos.r() > 100.0) && (std::abs(pos.phi()-M_PI/2.0)< M_PI/6)) {
// return true;
// }
// }
// return false;
// },
// {"GEMTrackerHits"})
.Define("xy_hit_pos", local_position, {"GEMTrackerHits"})
.Define("x_pos", x_pos, {"xy_hit_pos"})
.Define("y_pos", y_pos, {"xy_hit_pos"});
auto h_local_pos = d1.Histo2D(TH2D("h_local_pos", ";x [cm]; y [cm] ", 100, -5.0, 5.0, 100, -5.0, 5.0), "x_pos", "y_pos");
auto h_local_pos = d1.Histo2D({"h_local_pos", " ;x [cm]; y [cm]", 100, -5.0, 5.0, 100, -5.0, 5.0}, "x_pos", "y_pos");
TCanvas* c = new TCanvas();
h_local_pos->DrawClone("colz");
h_local_pos->DrawCopy("colz");
c->SaveAs("results/cell_size.png");
}
......@@ -128,12 +128,12 @@ void tutorial3_id_spec(const char* fname = "gem_tracker_sim.root") {
.Define("y_pos", y_pos, {"xy_hit_pos"})
.Define("z_pos", z_pos, {"xy_hit_pos"});
auto h_local_pos = d1.Histo2D(TH2D("h_local_pos", ";x [cm]; y [cm] ", 100, -5.0, 5.0, 100, -5.0, 5.0), "x_pos", "y_pos");
auto h_z_position0 = d1.Histo1D(TH1D("h_z_position0", ";z [cm]", 55, -110.0, 110.0), "all_z_pos");
auto h_z_position = d1.Histo1D(TH1D("h_z_position", ";z [cm]", 55, -110.0, 110.0), "z_pos");
auto h_local_pos = d1.Histo2D({"h_local_pos", ";x [cm]; y [cm] ", 100, -5.0, 5.0, 100, -5.0, 5.0}, "x_pos", "y_pos");
auto h_z_position0 = d1.Histo1D({"h_z_position0", ";z [cm]", 55, -110.0, 110.0}, "all_z_pos");
auto h_z_position = d1.Histo1D({"h_z_position", ";z [cm]", 55, -110.0, 110.0}, "z_pos");
TCanvas* c = new TCanvas();
h_local_pos->DrawClone("colz");
h_local_pos->DrawCopy("colz");
c->SaveAs("results/hit_position.png");
h_z_position0->SetLineColor(1);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment