Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
  fs::path path = m_path;
  std::cout << "stem          = " << path.stem().string() << "\n";            // e158-r0150-s00-c00
  std::cout << "extension()   = " << path.extension().string() << "\n";       // .xtc
  std::cout << "filename()    = " << path.filename().string() << "\n";        // e158-r0150-s00-c00.xtc
  std::cout << "parent_path() = " << path.parent_path().string() << "\n";     // /reg/d/psdm/CXI/cxi49012/xtc

ndarray and shared pointer

Example of how to access ndarray data in psana module through the shared pointer and construct ndarray<const T,NDim>

Code Block
        shared_ptr< ndarray<T,NDim> > shp = evt.get(m_source, m_key, &m_src);
        if (shp.get()) {

          ndarray<T,NDim>* pnda = shp.get();
          ndarray<const T,NDim> nda_const(pnda->data(), pnda->shape());

          ndarray<const T,NDim> nda_const(shp->data(), shp->shape());
        }

 

 

 

Singleton

InputParameters.h :

...