diff --git a/scripts/tutorial3_id_spec.cxx b/scripts/tutorial3_id_spec.cxx index 0eb3b9870e1c90916a29e60ce0baf25b30d1e0e8..3e95d71fbf191ac61957a00624468c8ea8b90dba 100644 --- a/scripts/tutorial3_id_spec.cxx +++ b/scripts/tutorial3_id_spec.cxx @@ -32,7 +32,7 @@ R__LOAD_LIBRARY(libfmt.so) /** Hit position example. * */ -void tutorial2_cell_size(const char* fname = "gem_tracker_sim.root") { +void tutorial3_id_spec(const char* fname = "gem_tracker_sim.root") { using namespace ROOT::Math; TChain* t = new TChain("events"); @@ -49,10 +49,12 @@ void tutorial2_cell_size(const char* fname = "gem_tracker_sim.root") { detector.fromCompact("gem_tracker.xml"); dd4hep::rec::CellIDPositionConverter cellid_converter(detector); + fmt::print("--------------------------"); + fmt::print("ID specification:"); auto decoder = detector.readout("GEMTrackerHits").idSpec().decoder(); fmt::print("{}\n", decoder->fieldDescription()); auto layer_index = decoder->index("layer"); - fmt::print(" layer index is {}.\n", layer_index); + 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(); }; @@ -101,16 +103,16 @@ 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"});