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

Merge branch 'update-to-edm4hep' into 'master'

dd4pod -> edm4hep

See merge request !1
parents 711a946f 158ad0f9
No related branches found
No related tags found
1 merge request!1dd4pod -> edm4hep
Pipeline #37375 failed
......@@ -26,8 +26,8 @@ R__LOAD_LIBRARY(libfmt.so)
#include "DD4hep/Detector.h"
#include "DDRec/CellIDPositionConverter.h"
#include "dd4pod/Geant4ParticleCollection.h"
#include "dd4pod/TrackerHitCollection.h"
#include "edm4hep/MCParticleCollection.h"
#include "edm4hep/SimTrackerHitCollection.h"
/** Hit position example.
*
......@@ -50,9 +50,9 @@ void tutorial1_hit_position(const char* fname = "gem_tracker_sim.root") {
dd4hep::rec::CellIDPositionConverter cellid_converter(detector);
// 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;
for (const auto& h : hits) {
// The actual hit position:
......@@ -85,7 +85,7 @@ void tutorial1_hit_position(const char* fname = "gem_tracker_sim.root") {
};
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) {
// 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)) {
......
......@@ -26,8 +26,8 @@ R__LOAD_LIBRARY(libfmt.so)
#include "DD4hep/Detector.h"
#include "DDRec/CellIDPositionConverter.h"
#include "dd4pod/Geant4ParticleCollection.h"
#include "dd4pod/TrackerHitCollection.h"
#include "edm4hep/MCParticleCollection.h"
#include "edm4hep/SimTrackerHitCollection.h"
/** Hit position example.
*
......@@ -50,9 +50,9 @@ void tutorial2_cell_size(const char* fname = "gem_tracker_sim.root") {
dd4hep::rec::CellIDPositionConverter cellid_converter(detector);
// 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;
for (const auto& h : hits) {
// The actual hit position:
......@@ -65,8 +65,8 @@ void tutorial2_cell_size(const char* fname = "gem_tracker_sim.root") {
fmt::print(" Hit Position : {},{},{}\n", pos0.x , pos0.y , pos0.z );
fmt::print("Segmentation-Cell Position : {},{},{}\n", pos1.x(), pos1.y(), pos1.z());
auto context = cellid_converter.findContext( h.cellID ) ;
dd4hep::Readout r = cellid_converter.findReadout( context->element ) ;
auto context = cellid_converter.findContext(h.cellID);
dd4hep::Readout r = cellid_converter.findReadout(context->element);
dd4hep::Segmentation seg = r.segmentation() ;
auto cell_dim = seg.cellDimensions(h.cellID);
std::cout << " dim ";
......@@ -96,7 +96,7 @@ 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) {
//.Filter([=](const std::vector<edm4hep::SimTrackerHitData>& 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)) {
......
......@@ -26,8 +26,8 @@ R__LOAD_LIBRARY(libfmt.so)
#include "DD4hep/Detector.h"
#include "DDRec/CellIDPositionConverter.h"
#include "dd4pod/Geant4ParticleCollection.h"
#include "dd4pod/TrackerHitCollection.h"
#include "edm4hep/MCParticleCollection.h"
#include "edm4hep/SimTrackerHitCollection.h"
/** Hit position example.
*
......@@ -57,16 +57,16 @@ void tutorial3_id_spec(const char* fname = "gem_tracker_sim.root") {
fmt::print(" \"layer\" index is {}.\n", layer_index);
// 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;
for (const auto& h : hits) {
result.push_back(h.position.z / 10.0);
}
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;
for (const auto& h : hits) {
// The actual hit position:
......@@ -84,8 +84,8 @@ void tutorial3_id_spec(const char* fname = "gem_tracker_sim.root") {
continue;
}
//auto context = cellid_converter.findContext( h.cellID ) ;
//dd4hep::Readout r = cellid_converter.findReadout( context->element ) ;
//auto context = cellid_converter.findContext(h.cellID);
//dd4hep::Readout r = cellid_converter.findReadout(context->element);
//dd4hep::Segmentation seg = r.segmentation() ;
//auto cell_dim = seg.cellDimensions(h.cellID);
//std::cout << " dim ";
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment