Skip to content
Snippets Groups Projects
Select Git revision
  • 40-implement-sampling-calorimeter
  • master default
  • yezhenyu-btof-20210520
  • 41-detailed-zero-degree-calorimeter-hcal
  • testBranchRobin
  • 73-pion-rejection-yr-benchmark
  • default_visibilities
  • view_update
  • wdconinc-ecal-testing
  • 65-trigger-detector-benchmarks
  • upstream_trigger
  • 14-implement-cb_vtx_endcaps
  • 28-implement-ffi_offm_trk-2
  • 32-implement-ffi_rpot_d2
  • 27-implement-fi_b0_emcal
  • 15-implement-cb_sidiscs
  • 24-implement-ci_hcal
  • fix_ci_GEM
  • 8-implement-cb_ctd
  • Implement_AMEGOX_layers
  • yezhenyu_work_master
  • v0.2.0
  • v0.1.0
23 results

forward_rich.xml

Blame
  • example_dd4hep.cxx 910 B
    #include "DD4hep/Detector.h"
    #include "DDG4/Geant4Data.h"
    #include "DDRec/CellIDPositionConverter.h"
    #include "DDRec/SurfaceManager.h"
    #include "DDRec/Surface.h"
    
    
    #include "fmt/core.h"
    
    
    /** Example using dd4hep
     */
    void example_dd4hep(const char* fname = "test_tracker_disc.root"){
    
      using namespace ROOT::Math;
    
      // -------------------------
      // Get the DD4hep instance
      // Load the compact XML file
      // Initialize the position converter tool
      dd4hep::Detector& detector = dd4hep::Detector::getInstance();
      detector.fromCompact("athena.xml");
      dd4hep::rec::CellIDPositionConverter cellid_converter(detector);
    
      fmt::print("Detector Types:\n");
      for(const auto&  dtype : detector.detectorTypes() ) {
        fmt::print("  {}\n", dtype); 
      }
    
      fmt::print("\n");
      fmt::print("All detector subsystem names:\n");
      for(const auto&  d : detector.detectors() ) {
        fmt::print("  {}\n", d.first);
      }
    
    }