Skip to content
Snippets Groups Projects
Commit 158ad0f9 authored by Wouter Deconinck's avatar Wouter Deconinck
Browse files

dd4pod -> edm4hep

parent 711a946f
Branches
No related tags found
1 merge request!1dd4pod -> edm4hep
Pipeline #28506 failed
This commit is part of merge request !1. Comments created here will be created in the context of that merge request.
...@@ -26,8 +26,8 @@ R__LOAD_LIBRARY(libfmt.so) ...@@ -26,8 +26,8 @@ R__LOAD_LIBRARY(libfmt.so)
#include "DD4hep/Detector.h" #include "DD4hep/Detector.h"
#include "DDRec/CellIDPositionConverter.h" #include "DDRec/CellIDPositionConverter.h"
#include "dd4pod/Geant4ParticleCollection.h" #include "edm4hep/MCParticleCollection.h"
#include "dd4pod/TrackerHitCollection.h" #include "edm4hep/SimTrackerHitCollection.h"
/** Hit position example. /** Hit position example.
* *
...@@ -50,9 +50,9 @@ void tutorial1_hit_position(const char* fname = "gem_tracker_sim.root") { ...@@ -50,9 +50,9 @@ void tutorial1_hit_position(const char* fname = "gem_tracker_sim.root") {
dd4hep::rec::CellIDPositionConverter cellid_converter(detector); dd4hep::rec::CellIDPositionConverter cellid_converter(detector);
// Simple lambda to define nhits branch // Simple lambda to define nhits branch
auto nhits = [](const std::vector<dd4pod::TrackerHitData>& evt) { return (int)evt.size(); }; auto nhits = [](const std::vector<edm4hep::SimTrackerHitData>& evt) { return (int)evt.size(); };
auto local_position = [&](const std::vector<dd4pod::TrackerHitData>& hits) { auto local_position = [&](const std::vector<edm4hep::SimTrackerHitData>& hits) {
std::vector<std::array<double, 2>> result; std::vector<std::array<double, 2>> result;
for (const auto& h : hits) { for (const auto& h : hits) {
// The actual hit position: // The actual hit position:
...@@ -85,7 +85,7 @@ void tutorial1_hit_position(const char* fname = "gem_tracker_sim.root") { ...@@ -85,7 +85,7 @@ void tutorial1_hit_position(const char* fname = "gem_tracker_sim.root") {
}; };
auto d1 = d0.Define("nhits", nhits, {"GEMTrackerHits"}) auto d1 = d0.Define("nhits", nhits, {"GEMTrackerHits"})
//.Filter([=](const std::vector<dd4pod::TrackerHitData>& hits) { //.Filter([=](const std::vector<edm4hep::SimTrackerHitData>& hits) {
// for (auto h : hits) { // for (auto h : hits) {
// auto pos = ROOT::Math::XYZVector(h.position.x,h.position.y,h.position.z); // 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)) { // if ((pos.r() > 100.0) && (std::abs(pos.phi()-M_PI/2.0)< M_PI/6)) {
......
...@@ -26,8 +26,8 @@ R__LOAD_LIBRARY(libfmt.so) ...@@ -26,8 +26,8 @@ R__LOAD_LIBRARY(libfmt.so)
#include "DD4hep/Detector.h" #include "DD4hep/Detector.h"
#include "DDRec/CellIDPositionConverter.h" #include "DDRec/CellIDPositionConverter.h"
#include "dd4pod/Geant4ParticleCollection.h" #include "edm4hep/MCParticleCollection.h"
#include "dd4pod/TrackerHitCollection.h" #include "edm4hep/SimTrackerHitCollection.h"
/** Hit position example. /** Hit position example.
* *
...@@ -50,9 +50,9 @@ void tutorial2_cell_size(const char* fname = "gem_tracker_sim.root") { ...@@ -50,9 +50,9 @@ void tutorial2_cell_size(const char* fname = "gem_tracker_sim.root") {
dd4hep::rec::CellIDPositionConverter cellid_converter(detector); dd4hep::rec::CellIDPositionConverter cellid_converter(detector);
// Simple lambda to define nhits branch // Simple lambda to define nhits branch
auto nhits = [](const std::vector<dd4pod::TrackerHitData>& evt) { return (int)evt.size(); }; auto nhits = [](const std::vector<edm4hep::SimTrackerHitData>& evt) { return (int)evt.size(); };
auto local_position = [&](const std::vector<dd4pod::TrackerHitData>& hits) { auto local_position = [&](const std::vector<edm4hep::SimTrackerHitData>& hits) {
std::vector<std::array<double, 2>> result; std::vector<std::array<double, 2>> result;
for (const auto& h : hits) { for (const auto& h : hits) {
// The actual hit position: // The actual hit position:
...@@ -96,7 +96,7 @@ void tutorial2_cell_size(const char* fname = "gem_tracker_sim.root") { ...@@ -96,7 +96,7 @@ void tutorial2_cell_size(const char* fname = "gem_tracker_sim.root") {
}; };
auto d1 = d0.Define("nhits", nhits, {"GEMTrackerHits"}) auto d1 = d0.Define("nhits", nhits, {"GEMTrackerHits"})
//.Filter([=](const std::vector<dd4pod::TrackerHitData>& hits) { //.Filter([=](const std::vector<edm4hep::SimTrackerHitData>& hits) {
// for (auto h : hits) { // for (auto h : hits) {
// auto pos = ROOT::Math::XYZVector(h.position.x,h.position.y,h.position.z); // 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)) { // if ((pos.r() > 100.0) && (std::abs(pos.phi()-M_PI/2.0)< M_PI/6)) {
......
...@@ -26,8 +26,8 @@ R__LOAD_LIBRARY(libfmt.so) ...@@ -26,8 +26,8 @@ R__LOAD_LIBRARY(libfmt.so)
#include "DD4hep/Detector.h" #include "DD4hep/Detector.h"
#include "DDRec/CellIDPositionConverter.h" #include "DDRec/CellIDPositionConverter.h"
#include "dd4pod/Geant4ParticleCollection.h" #include "edm4hep/MCParticleCollection.h"
#include "dd4pod/TrackerHitCollection.h" #include "edm4hep/SimTrackerHitCollection.h"
/** Hit position example. /** Hit position example.
* *
...@@ -57,16 +57,16 @@ void tutorial3_id_spec(const char* fname = "gem_tracker_sim.root") { ...@@ -57,16 +57,16 @@ void tutorial3_id_spec(const char* fname = "gem_tracker_sim.root") {
fmt::print(" \"layer\" index is {}.\n", layer_index); fmt::print(" \"layer\" index is {}.\n", layer_index);
// Simple lambda to define nhits branch // Simple lambda to define nhits branch
auto nhits = [](const std::vector<dd4pod::TrackerHitData>& evt) { return (int)evt.size(); }; auto nhits = [](const std::vector<edm4hep::SimTrackerHitData>& evt) { return (int)evt.size(); };
auto all_z_pos = [&](const std::vector<dd4pod::TrackerHitData>& hits) { auto all_z_pos = [&](const std::vector<edm4hep::SimTrackerHitData>& hits) {
std::vector<double> result; std::vector<double> result;
for (const auto& h : hits) { for (const auto& h : hits) {
result.push_back(h.position.z / 10.0); result.push_back(h.position.z / 10.0);
} }
return result; return result;
}; };
auto local_position = [&](const std::vector<dd4pod::TrackerHitData>& hits) { auto local_position = [&](const std::vector<edm4hep::SimTrackerHitData>& hits) {
std::vector<std::array<double, 3>> result; std::vector<std::array<double, 3>> result;
for (const auto& h : hits) { for (const auto& h : hits) {
// The actual hit position: // The actual hit position:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment