Skip to content
Snippets Groups Projects
Commit d6668f47 authored by Alex Jentsch's avatar Alex Jentsch
Browse files

Still working.

parent 2bb9d0ba
No related branches found
No related tags found
No related merge requests found
This commit is part of merge request !195. Comments created here will be created in the context of that merge request.
......@@ -19,6 +19,11 @@ R__LOAD_LIBRARY(libDD4pod.so)
using ROOT::RDataFrame;
using namespace ROOT::VecOps;
dd4hep::Detector& detector = dd4hep::Detector::getInstance();
detector.fromCompact("eic_ip6.xml");
dd4hep::rec::CellIDPositionConverter cellid_converter(detector);
auto p_track = [](std::vector<eic::TrackParametersData> const& in) {
std::vector<double> result;
for (size_t i = 0; i < in.size(); ++i) {
......@@ -80,7 +85,7 @@ auto delta_p_over_p = [](const std::vector<double>& tracks, const std::vector<do
return res;
};
auto local_position = [&](const std::vector<dd4pod::TrackerHitData>& hits) {
auto local_position = [](const std::vector<dd4pod::TrackerHitData>& hits) {
std::vector<std::array<double, 2>> result;
for (const auto& h : hits) {
// The actual hit position:
......@@ -97,6 +102,21 @@ auto local_position = [&](const std::vector<dd4pod::TrackerHitData>& hits) {
return result;
};
auto x_pos = [](const std::vector<std::array<double, 2>>& xypos) {
std::vector<double> result;
for (const auto& h : xypos) {
result.push_back(h.at(0));
}
return result;
};
auto y_pos = [](const std::vector<std::array<double, 2>>& xypos) {
std::vector<double> result;
for (auto h : xypos) {
result.push_back(h.at(1));
}
return result;
};
int hits_far_forward_protons(const char* fname = "sim_far_forward_protons.root")
{
......@@ -130,7 +150,7 @@ int hits_far_forward_protons(const char* fname = "sim_far_forward_protons.root")
.Define("y_pos", y_pos, {"xy_hit_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_local_pos = df0.Histo2D({"h_local_pos", ";x [cm]; y [cm] ", 100, -5.0, 5.0, 100, -5.0, 5.0}, "x_pos", "y_pos");
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment