g4tools  5.4.0
Classes | Functions
tools::aida Namespace Reference

Classes

class  aida_base_col
 
class  aida_col
 
class  aida_col_ntu
 some special column that can't be done with aida_col<T> //// More...
 
class  base_col
 
class  base_looper
 
class  base_ntu
 
class  ntuple
 
class  stat_looper
 

Functions

const std::string & s_aida_type (short)
 
const std::string & s_aida_type (int)
 
const std::string & s_aida_type (float)
 
const std::string & s_aida_type (double)
 
const std::string & s_aida_type (bool)
 
const std::string & s_aida_type (const std::string &)
 
const std::string & s_aida_type (int64)
 
const std::string & s_aida_type_ituple ()
 
const std::string & s_aida_type (unsigned short)
 not AIDA ! ////////////////////////// More...
 
const std::string & s_aida_type (unsigned int)
 
const std::string & s_aida_type (uint64)
 
bool s__fill (const std::string &a_s, std::string &a_v)
 
bool s__fill (const std::string &a_s, char &a_v)
 
bool s__fill (const std::string &a_s, unsigned char &a_v)
 
bool s__fill (const std::string &a_s, bool &a_v)
 
bool s__fill (const std::string &a_s, short &a_v)
 
bool s__fill (const std::string &a_s, unsigned short &a_v)
 
bool s__fill (const std::string &a_s, int &a_v)
 
bool s__fill (const std::string &a_s, unsigned int &a_v)
 
bool s__fill (const std::string &a_s, int64 &a_v)
 
bool s__fill (const std::string &a_s, uint64 &a_v)
 
bool s__fill (const std::string &a_s, float &a_v)
 
bool s__fill (const std::string &a_s, double &a_v)
 
bool create_cols_from_vals (ntuple &a_ntu, const std::vector< value > &a_vars, bool a_verbose=false)
 
bool create_col (ntuple &a_ntu, const std::string &a_type, const std::string &a_name, const std::string &a_s, bool a_is_ntu)
 
bool create_cols_from_string (ntuple &a_ntu, const std::string &a_booking, bool a_verbose=false)
 
aida_col_ntufind_col_ntu (ntuple &a_ntu, const std::string &a_name)
 
template<class T >
bool column_infos (base_ntu &a_ntu, base_col &a_col, T &a_mn, T &a_mx, T &a_S, T &a_S2, uint64 &a_count)
 
base_colfind_leaf_column (const base_ntu &a_ntu, const std::string &a_name)
 
template<class T >
bool to_vector (base_ntu &a_ntu, std::vector< double > &a_vec, unsigned int a_col=0)
 
template<class T >
bool column_min (ntuple &a_ntu, unsigned int a_col, T &a_value)
 
template<class T >
bool column_max (ntuple &a_ntu, unsigned int a_col, T &a_value)
 

Function Documentation

◆ column_infos()

template<class T >
bool tools::aida::column_infos ( base_ntu a_ntu,
base_col a_col,
T &  a_mn,
T &  a_mx,
T &  a_S,
T &  a_S2,
uint64 a_count 
)
inline

Definition at line 1354 of file aida_ntuple.

1357  {
1358  stat_looper<T> lpr(a_ntu,a_col);
1359  bool status = lpr.process();
1360  a_mn = lpr.mn();
1361  a_mx = lpr.mx();
1362  a_S = lpr.S();
1363  a_S2 = lpr.S2();
1364  a_count = lpr.counter();
1365  if(!status) return false;
1366  if(!a_count) return false;
1367  return true;
1368 }

◆ column_max()

template<class T >
bool tools::aida::column_max ( ntuple a_ntu,
unsigned int  a_col,
T &  a_value 
)
inline

Definition at line 1413 of file aida_ntuple.

1413  {
1414  return a_ntu.column_max(a_col,a_value);
1415 }

◆ column_min()

template<class T >
bool tools::aida::column_min ( ntuple a_ntu,
unsigned int  a_col,
T &  a_value 
)
inline

Definition at line 1408 of file aida_ntuple.

1408  {
1409  return a_ntu.column_min(a_col,a_value);
1410 }

◆ create_col()

bool tools::aida::create_col ( ntuple a_ntu,
const std::string &  a_type,
const std::string &  a_name,
const std::string &  a_s,
bool  a_is_ntu 
)
inline

Definition at line 822 of file aida_ntuple.

826  {
827 /*
828  if(a_type==s_aida_type((char)0)) {
829  char v = 0;
830  if(a_s.size()&&!to<char>(a_s,v)) {
831  a_ntu.out() << "tools::aida::create_col :"
832  << " can't convert def " << sout(a_s)
833  << " to a " << a_type
834  << std::endl;
835  return false;
836  }
837  if(!a_ntu.create_col<char>(a_name,v)) {
838  a_ntu.out() << "tools::aida::create_col :"
839  << " can't create column of type " << sout(a_type)
840  << std::endl;
841  return false;
842  }
843 
844  } else*/ if(a_type==s_aida_type((short)0)) {
845  short v = 0;
846  if(a_s.size()&&!to<short>(a_s,v)) {
847  a_ntu.out() << "tools::aida::create_col :"
848  << " can't convert def " << sout(a_s)
849  << " to a " << a_type
850  << std::endl;
851  return false;
852  }
853  if(!a_ntu.create_col<short>(a_name,v)) {
854  a_ntu.out() << "tools::aida::create_col :"
855  << " can't create column of type " << sout(a_type)
856  << std::endl;
857  return false;
858  }
859 
860  } else if(a_type==s_aida_type((int)0)) {
861  int v = 0;
862  if(a_s.size()&&!to<int>(a_s,v)) {
863  a_ntu.out() << "tools::aida::create_col :"
864  << " can't convert def " << sout(a_s)
865  << " to a " << a_type
866  << std::endl;
867  return false;
868  }
869  if(!a_ntu.create_col<int>(a_name,v)) {
870  a_ntu.out() << "tools::aida::create_col :"
871  << " can't create column of type " << sout(a_type)
872  << std::endl;
873  return false;
874  }
875 
876  } else if(a_type==s_aida_type((int64)0)) {
877  int64 v = 0;
878  if(a_s.size()&&!to<int64>(a_s,v)) {
879  a_ntu.out() << "tools::aida::create_col :"
880  << " can't convert def " << sout(a_s)
881  << " to a " << a_type
882  << std::endl;
883  return false;
884  }
885  if(!a_ntu.create_col<int64>(a_name,v)) {
886  a_ntu.out() << "tools::aida::create_col :"
887  << " can't create column of type " << sout(a_type)
888  << std::endl;
889  return false;
890  }
891 
892  } else if(a_type==s_aida_type((float)0)) {
893  float v = 0;
894  if(a_s.size()&&!to<float>(a_s,v)) {
895  a_ntu.out() << "tools::aida::create_col :"
896  << " can't convert def " << sout(a_s)
897  << " to a " << a_type
898  << std::endl;
899  return false;
900  }
901  if(!a_ntu.create_col<float>(a_name,v)) {
902  a_ntu.out() << "tools::aida::create_col :"
903  << " can't create column of type " << sout(a_type)
904  << std::endl;
905  return false;
906  }
907 
908 
909  } else if(a_type==s_aida_type((double)0)) {
910  double v = 0;
911  if(a_s.size()&&!to<double>(a_s,v)) {
912  a_ntu.out() << "tools::aida::create_col :"
913  << " can't convert def " << sout(a_s)
914  << " to a " << a_type
915  << std::endl;
916  return false;
917  }
918  if(!a_ntu.create_col<double>(a_name,v)) {
919  a_ntu.out() << "tools::aida::create_col :"
920  << " can't create column of type " << sout(a_type)
921  << std::endl;
922  return false;
923  }
924 
925 /* } else if(a_type==s_aida_type((unsigned char)0)) { //byte
926  unsigned int v = 0;
927  if(a_s.size()&&!to<unsigned int>(a_s,v)) {
928  a_ntu.out() << "tools::aida::create_col :"
929  << " can't convert def " << sout(a_s)
930  << " to a " << a_type
931  << std::endl;
932  return false;
933  }
934  if(v>=256) {
935  a_ntu.out() << "tools::aida::create_col :"
936  << " can't convert def " << sout(a_s)
937  << " to byte."
938  << std::endl;
939  return false;
940  }
941  if(!a_ntu.create_col<unsigned char>(a_name,v)) {
942  a_ntu.out() << "tools::aida::create_col :"
943  << " can't create column of type " << sout(a_type)
944  << std::endl;
945  return false;
946  }
947 */
948  } else if(a_type==s_aida_type((unsigned short)0)) {
949  unsigned short v = 0;
950  if(a_s.size()&&!to<unsigned short>(a_s,v)) {
951  a_ntu.out() << "tools::aida::create_col :"
952  << " can't convert def " << sout(a_s)
953  << " to a " << a_type
954  << std::endl;
955  return false;
956  }
957  if(!a_ntu.create_col<unsigned short>(a_name,v)) {
958  a_ntu.out() << "tools::aida::create_col :"
959  << " can't create column of type " << sout(a_type)
960  << std::endl;
961  return false;
962  }
963 
964  } else if(a_type==s_aida_type((unsigned int)0)) {
965  unsigned int v = 0;
966  if(a_s.size()&&!to<unsigned int>(a_s,v)) {
967  a_ntu.out() << "tools::aida::create_col :"
968  << " can't convert def " << sout(a_s)
969  << " to a " << a_type
970  << std::endl;
971  return false;
972  }
973  if(!a_ntu.create_col<unsigned int>(a_name,v)) {
974  a_ntu.out() << "tools::aida::create_col :"
975  << " can't create column of type " << sout(a_type)
976  << std::endl;
977  return false;
978  }
979 
980  } else if(a_type==s_aida_type((uint64)0)) {
981  uint64 v = 0;
982  if(a_s.size()&&!to<uint64>(a_s,v)) {
983  a_ntu.out() << "tools::aida::create_col :"
984  << " can't convert def " << sout(a_s)
985  << " to a " << a_type
986  << std::endl;
987  return false;
988  }
989  if(!a_ntu.create_col<uint64>(a_name,v)) {
990  a_ntu.out() << "tools::aida::create_col :"
991  << " can't create column of type " << sout(a_type)
992  << std::endl;
993  return false;
994  }
995 
998  } else if(a_type==s_aida_type((bool)true)) {
999  bool v = false;
1000  if(a_s.size()&&!to(a_s,v)) {
1001  a_ntu.out() << "tools::aida::create_col :"
1002  << " can't convert def " << sout(a_s)
1003  << " to a " << a_type
1004  << std::endl;
1005  return false;
1006  }
1007  if(!a_ntu.create_col<bool>(a_name,v)) {
1008  a_ntu.out() << "tools::aida::create_col :"
1009  << " can't create column of type " << sout(a_type)
1010  << std::endl;
1011  return false;
1012  }
1013 
1014  } else if(a_type==s_aida_type(std::string())) {
1015  if(!a_ntu.create_col<std::string>(a_name,a_s)) {
1016  a_ntu.out() << "tools::aida::create_col :"
1017  << " can't create column of type " << sout(a_type)
1018  << std::endl;
1019  return false;
1020  }
1021 
1022  } else if(a_type==s_aida_type((int64)0)) {
1023  int64 v = 0;
1024  if(a_s.size()&&!to<int64>(a_s,v)) {
1025  a_ntu.out() << "tools::aida::create_col :"
1026  << " can't convert def " << sout(a_s)
1027  << " to a " << a_type
1028  << std::endl;
1029  return false;
1030  }
1031  if(!a_ntu.create_col<int64>(a_name,v)) {
1032  a_ntu.out() << "tools::aida::create_col :"
1033  << " can't create column of type " << sout(a_type)
1034  << std::endl;
1035  return false;
1036  }
1037 
1038  } else if(a_type==s_aida_type_ituple()) {
1039  // we expect a booking string on a_s.
1040 
1041  if(!a_is_ntu) {
1042  a_ntu.out() << "tools::aida::create_col :"
1043  << " mismatch a_is_ntu/a_type."
1044  << std::endl;
1045  return false;
1046  }
1047  if(a_s.empty()) {
1048  a_ntu.out() << "tools::aida::create_col :"
1049  << " empty booking string."
1050  << std::endl;
1051  return false;
1052  }
1053 
1054  columns::finder f(a_ntu.out(),a_s);
1055  if(!f.find_variables()) {
1056  a_ntu.out() << "tools::aida::create_col :"
1057  << " find_variables() failed for " << sout(a_s) << "."
1058  << std::endl;
1059  return false;
1060  }
1061 
1062  aida_col_ntu* col_ntu = new aida_col_ntu(a_ntu.out(),a_name);
1063  //create columns on the fillable.
1064  base_ntu* sub_base_ntu = col_ntu->get_to_fill();
1065  if(!sub_base_ntu) {delete col_ntu;return false;}
1066  ntuple* sub_aida = safe_cast<base_ntu,ntuple>(*sub_base_ntu);
1067  if(!sub_aida) {delete col_ntu;return false;}
1068 
1069  std::vector<value> vars;f.result(vars);
1070  if(!create_cols_from_vals(*sub_aida,vars)) {
1072  delete col_ntu;
1073  return false;
1074  }
1076  a_ntu.add_column(col_ntu);
1077 
1078  //FIXME : double[]
1079 
1080  } else {
1081  a_ntu.out() << "tools::aida::create_col :"
1082  << " col type " << sout(a_type)
1083  << " not yet handled."
1084  << std::endl;
1085  return false;
1086  }
1087 
1088  return true;
1089 }

◆ create_cols_from_string()

bool tools::aida::create_cols_from_string ( ntuple a_ntu,
const std::string &  a_booking,
bool  a_verbose = false 
)
inline

Definition at line 1092 of file aida_ntuple.

1094  {
1095  a_ntu.clear();
1096  if(a_booking.empty()) {
1097  a_ntu.out() << "tools::aida::create_cols_from_string :"
1098  << " empty booking string."
1099  << std::endl;
1100  return false;
1101  }
1102 
1103  columns::finder f(a_ntu.out(),a_booking);
1104  if(!f.find_variables()) {
1105  a_ntu.out() << "tools::aida::create_cols_from_string :"
1106  << " find_variables() failed."
1107  << std::endl;
1108  return false;
1109  }
1110  std::vector<value> vars;f.result(vars);
1111  if(a_verbose) columns::dump_columns(a_ntu.out(),vars);
1112 
1113  if(!create_cols_from_vals(a_ntu,vars)) {
1115  a_ntu.clear();
1116  return false;
1117  }
1119  return true;
1120 }

◆ create_cols_from_vals()

bool tools::aida::create_cols_from_vals ( ntuple a_ntu,
const std::vector< value > &  a_vars,
bool  a_verbose = false 
)
inline

Definition at line 724 of file aida_ntuple.

726  {
727  tools_vforcit(value,a_vars,it) {
728  if((*it).type()==value::VOID_STAR) {
729  if(a_verbose){
730  a_ntu.out() << "tools::aida::create_cols_from_vals :"
731  << " ITuple : " << (*it).label() << " : begin "
732  << std::endl;
733  }
734  std::vector<value>* vars = (std::vector<value>*)(*it).get_void_star();
735 
736  aida_col_ntu* col_ntu = new aida_col_ntu(a_ntu.out(),(*it).label());
737  // create sub columns on the "fillable" of col_ntu :
738  base_ntu* sub_base_ntu = col_ntu->get_to_fill();
739  if(!sub_base_ntu) {
740  delete col_ntu;
741  return false;
742  }
743  ntuple* sub_aida = safe_cast<base_ntu,ntuple>(*sub_base_ntu);
744  if(!sub_aida) {
745  delete col_ntu;
746  return false;
747  }
748 
749  if(!create_cols_from_vals(*sub_aida,*vars,a_verbose)) {
750  delete col_ntu;
751  return false;
752  }
753 
754  a_ntu.add_column(col_ntu);
755 
756  } else {
757  if(a_verbose){
758  std::string stype;
759  (*it).s_type(stype);
760  std::string sval;
761  (*it).tos(sval);
762  a_ntu.out() << "tools::aida::create_cols_from_vals :"
763  << " " << stype << " : "
764  << (*it).label() << " : "
765  << sval
766  << std::endl;
767  }
768 
769  // char,short,int,float,double
770  // byte,boolean,string,long(for int64)
771  // double[]
772 
773  base_col* col = 0;
774  /*if((*it).type()==value::CHAR) {
775  col = a_ntu.create_col<char>((*it).label(),(*it).get_char());
776  } else*/ if((*it).type()==value::SHORT) {
777  col = a_ntu.create_col<short>((*it).label(),(*it).get_short());
778  } else if((*it).type()==value::INT) {
779  col = a_ntu.create_col<int>((*it).label(),(*it).get_int());
780  } else if((*it).type()==value::INT64) {
781  col = a_ntu.create_col<int64>((*it).label(),(*it).get_int64());
782  } else if((*it).type()==value::FLOAT) {
783  col = a_ntu.create_col<float>((*it).label(),(*it).get_float());
784  } else if((*it).type()==value::DOUBLE) {
785  col = a_ntu.create_col<double>((*it).label(),(*it).get_double());
786 
787  //} else if((*it).type()==value::UNSIGNED_CHAR) {
788  // col = a_ntu.create_col<unsigned char>((*it).label(),(*it).get_unsigned_char());
789  } else if((*it).type()==value::UNSIGNED_SHORT) {
790  col = a_ntu.create_col<unsigned short>((*it).label(),(*it).get_unsigned_short());
791  } else if((*it).type()==value::UNSIGNED_INT) {
792  col = a_ntu.create_col<unsigned int>((*it).label(),(*it).get_unsigned_int());
793  } else if((*it).type()==value::UNSIGNED_INT64) {
794  col = a_ntu.create_col<uint64>((*it).label(),(*it).get_unsigned_int64());
795 
796  } else if((*it).type()==value::BOOL) {
797  col = a_ntu.create_col<bool>((*it).label(),(*it).get_bool());
798  } else if((*it).type()==value::STRING) {
799  col = a_ntu.create_col<std::string>((*it).label(),(*it).get_string());
800  } else if((*it).type()==value::INT64) {
801  col = a_ntu.create_col<int64>((*it).label(),(*it).get_int64());
802  }
803 
804  if(!col) {
805  std::string stype;
806  (*it).s_type(stype);
807  std::string sval;
808  (*it).tos(sval);
809  a_ntu.out() << "tools::aida::create_cols_from_vals :"
810  << " failed for " << stype << " : "
811  << (*it).label() << " : "
812  << sval
813  << std::endl;
814  return false;
815  }
816  }
817  }
818  return true;
819 }

◆ find_col_ntu()

aida_col_ntu* tools::aida::find_col_ntu ( ntuple a_ntu,
const std::string &  a_name 
)
inline

Definition at line 1122 of file aida_ntuple.

1122  {
1123  base_col* col = find_named<base_col>(a_ntu.columns(),a_name);
1124  if(!col) return 0;
1125  return safe_cast<base_col, aida_col_ntu >(*col);
1126 }

◆ find_leaf_column()

base_col* tools::aida::find_leaf_column ( const base_ntu a_ntu,
const std::string &  a_name 
)
inline

Definition at line 1370 of file aida_ntuple.

1370  {
1371  const std::vector<base_col*>& cols = a_ntu.columns();
1372  tools_vforcit(base_col*,cols,it) {
1373  aida_col_ntu* col = safe_cast<base_col,aida_col_ntu>(*(*it));
1374  if(col) {
1375  base_ntu* sub = col->get_to_fill(); //it holds the "sub" cols schema.
1376  if(!sub) return 0;
1377  base_col* fcol = find_leaf_column(*sub,a_name);
1378  if(fcol) return fcol;
1379  } else {
1380  if((*it)->name()==a_name) return *it;
1381  }
1382  }
1383  return 0;
1384 }

◆ s__fill() [1/12]

bool tools::aida::s__fill ( const std::string &  a_s,
bool &  a_v 
)
inline

Definition at line 363 of file aida_ntuple.

363  {
364  return to(a_s,a_v);
365 }

◆ s__fill() [2/12]

bool tools::aida::s__fill ( const std::string &  a_s,
char &  a_v 
)
inline

Definition at line 351 of file aida_ntuple.

351  {
352  //for exlib/cbk/aida_ntu
353  if(a_s.empty()) return false;
354  a_v = a_s[0];
355  return true;
356 }

◆ s__fill() [3/12]

bool tools::aida::s__fill ( const std::string &  a_s,
double &  a_v 
)
inline

Definition at line 387 of file aida_ntuple.

387  {
388  return to<double>(a_s,a_v);
389 }

◆ s__fill() [4/12]

bool tools::aida::s__fill ( const std::string &  a_s,
float &  a_v 
)
inline

Definition at line 384 of file aida_ntuple.

384  {
385  return to<float>(a_s,a_v);
386 }

◆ s__fill() [5/12]

bool tools::aida::s__fill ( const std::string &  a_s,
int &  a_v 
)
inline

Definition at line 372 of file aida_ntuple.

372  {
373  return to<int>(a_s,a_v);
374 }

◆ s__fill() [6/12]

bool tools::aida::s__fill ( const std::string &  a_s,
int64 a_v 
)
inline

Definition at line 378 of file aida_ntuple.

378  {
379  return to<int64>(a_s,a_v);
380 }

◆ s__fill() [7/12]

bool tools::aida::s__fill ( const std::string &  a_s,
short &  a_v 
)
inline

Definition at line 366 of file aida_ntuple.

366  {
367  return to<short>(a_s,a_v);
368 }

◆ s__fill() [8/12]

bool tools::aida::s__fill ( const std::string &  a_s,
std::string &  a_v 
)
inline

Definition at line 347 of file aida_ntuple.

347  {
348  a_v = a_s;
349  return true;
350 }

◆ s__fill() [9/12]

bool tools::aida::s__fill ( const std::string &  a_s,
uint64 a_v 
)
inline

Definition at line 381 of file aida_ntuple.

381  {
382  return to<uint64>(a_s,a_v);
383 }

◆ s__fill() [10/12]

bool tools::aida::s__fill ( const std::string &  a_s,
unsigned char &  a_v 
)
inline

Definition at line 357 of file aida_ntuple.

357  {
358  //for exlib/cbk/aida_ntu
359  if(a_s.empty()) return false;
360  a_v = a_s[0];
361  return true;
362 }

◆ s__fill() [11/12]

bool tools::aida::s__fill ( const std::string &  a_s,
unsigned int &  a_v 
)
inline

Definition at line 375 of file aida_ntuple.

375  {
376  return to<unsigned int>(a_s,a_v);
377 }

◆ s__fill() [12/12]

bool tools::aida::s__fill ( const std::string &  a_s,
unsigned short &  a_v 
)
inline

Definition at line 369 of file aida_ntuple.

369  {
370  return to<unsigned short>(a_s,a_v);
371 }

◆ s_aida_type() [1/10]

const std::string& tools::aida::s_aida_type ( bool  )
inline

Definition at line 278 of file aida_ntuple.

278  {
279  static const std::string s_v("boolean");
280  return s_v;
281 }

◆ s_aida_type() [2/10]

const std::string& tools::aida::s_aida_type ( const std::string &  )
inline

Definition at line 282 of file aida_ntuple.

282  {
283  static const std::string s_v("string");
284  return s_v;
285 }

◆ s_aida_type() [3/10]

const std::string& tools::aida::s_aida_type ( double  )
inline

Definition at line 266 of file aida_ntuple.

266  {
267  static const std::string s_v("double");
268  return s_v;
269 }

◆ s_aida_type() [4/10]

const std::string& tools::aida::s_aida_type ( float  )
inline

Definition at line 262 of file aida_ntuple.

262  {
263  static const std::string s_v("float");
264  return s_v;
265 }

◆ s_aida_type() [5/10]

const std::string& tools::aida::s_aida_type ( int  )
inline

Definition at line 258 of file aida_ntuple.

258  {
259  static const std::string s_v("int");
260  return s_v;
261 }

◆ s_aida_type() [6/10]

const std::string& tools::aida::s_aida_type ( int64  )
inline

Definition at line 286 of file aida_ntuple.

286  {
287  static const std::string s_v("long");
288  return s_v;
289 }

◆ s_aida_type() [7/10]

const std::string& tools::aida::s_aida_type ( short  )
inline

Definition at line 254 of file aida_ntuple.

254  {
255  static const std::string s_v("short");
256  return s_v;
257 }

◆ s_aida_type() [8/10]

const std::string& tools::aida::s_aida_type ( uint64  )
inline

Definition at line 312 of file aida_ntuple.

312  {
313  static const std::string s_v("ulong");
314  return s_v;
315 }

◆ s_aida_type() [9/10]

const std::string& tools::aida::s_aida_type ( unsigned int  )
inline

Definition at line 308 of file aida_ntuple.

308  {
309  static const std::string s_v("uint");
310  return s_v;
311 }

◆ s_aida_type() [10/10]

const std::string& tools::aida::s_aida_type ( unsigned short  )
inline

not AIDA ! //////////////////////////

Definition at line 304 of file aida_ntuple.

304  {
305  static const std::string s_v("ushort");
306  return s_v;
307 }

◆ s_aida_type_ituple()

const std::string& tools::aida::s_aida_type_ituple ( )
inline

Definition at line 296 of file aida_ntuple.

296  {
297  static const std::string s_v("ITuple");
298  return s_v;
299 }

◆ to_vector()

template<class T >
bool tools::aida::to_vector ( base_ntu a_ntu,
std::vector< double > &  a_vec,
unsigned int  a_col = 0 
)
inline

Definition at line 1387 of file aida_ntuple.

1387  {
1388  a_vec.clear();
1389  const std::vector<base_col*>& cols = a_ntu.columns();
1390  if(cols.empty()) return false;
1391  if(a_col>=cols.size()) return false;
1392  base_col* _base_col = cols[a_col];
1393  aida_col<T>* _col = safe_cast<base_col, aida_col<T> >(*_base_col);
1394  if(!_col) return false;
1395  a_ntu.start();
1396  uint64 _rows = a_ntu.rows();
1397  a_vec.resize(_rows);
1398  T v;
1399  {for(uint64 row=0;row<_rows;row++) {
1400  if(!a_ntu.next()) {a_vec.clear();return false;}
1401  if(!_col->get_entry(v)) {}
1402  a_vec[row] = v;
1403  }}
1404  return true;
1405 }
tools::sub
bool sub(std::vector< T > &a_vec, const std::vector< T > &a_v)
Definition: vmanip:283
tools::uint64
unsigned long long uint64
Definition: typedefs:72
tools::aida::find_leaf_column
base_col * find_leaf_column(const base_ntu &a_ntu, const std::string &a_name)
Definition: aida_ntuple:1370
tools::int64
long long int64
Definition: typedefs:67
tools::aida::create_cols_from_vals
bool create_cols_from_vals(ntuple &a_ntu, const std::vector< value > &a_vars, bool a_verbose=false)
Definition: aida_ntuple:724
tools::wroot::streamer__info::DOUBLE
@ DOUBLE
Definition: element:28
tools::wroot::streamer__info::SHORT
@ SHORT
Definition: element:25
tools::aida::s_aida_type_ituple
const std::string & s_aida_type_ituple()
Definition: aida_ntuple:296
tools::wroot::streamer__info::FLOAT
@ FLOAT
Definition: element:27
tools::to
std::vector< std::string > to(int a_argc, char **a_argv)
Definition: args:507
tools::wroot::streamer__info::BOOL
@ BOOL
Definition: element:32
tools::columns::dump_columns
void dump_columns(std::ostream &a_out, const std::vector< value > &a_vars, const std::string &a_margin="")
Definition: columns:153
tools::aida::s_aida_type
const std::string & s_aida_type(uint64)
Definition: aida_ntuple:312
tools::wroot::streamer__info::UNSIGNED_SHORT
@ UNSIGNED_SHORT
Definition: element:30
tools::columns::delete_columns
void delete_columns(std::vector< value > &a_vars)
Definition: columns:124
tools_vforcit
#define tools_vforcit(a__T, a__v, a__it)
Definition: forit:7
tools::stype
const std::string & stype(const mat4f &)
Definition: mat4f:73
tools::wroot::streamer__info::UNSIGNED_INT
@ UNSIGNED_INT
Definition: element:31
tools::wroot::streamer__info::INT
@ INT
Definition: element:26