Geant4 10.7.0
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 39 of file G4XmlRNtupleManager.cc.

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