Geant4 11.2.2
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
tools::aida Namespace Reference

Functions

template<class T >
bool to_vector (base_ntu &a_ntu, std::vector< T > &a_vec)
 

Function Documentation

◆ to_vector()

template<class T >
bool tools::aida::to_vector ( base_ntu & a_ntu,
std::vector< T > & a_vec )

Definition at line 44 of file G4XmlRNtupleManager.cc.

44 {
45 a_vec.clear();
46 const std::vector<base_col*>& cols = a_ntu.cols();
47 if(cols.empty()) return false;
48 base_col* _base_col = cols.front();
49 aida_col<T>* _col = safe_cast<base_col, aida_col<T> >(*_base_col);
50 if(!_col) return false;
51 a_ntu.start();
52 uint64 _rows = a_ntu.rows();
53 a_vec.resize(_rows);
54 T v;
55 {for(uint64 row=0;row<_rows;row++) {
56 if(!a_ntu.next()) {a_vec.clear();return false;}
57 if(!_col->get_entry(v)) {a_vec.clear();return false;}
58 a_vec[row] = v;
59 }}
60 return true;
61}