#ifndef __JDB__JSUPPORT__ #define __JDB__JSUPPORT__ #include #include #include "JLang/JType.hh" #include "JLang/JTypeList.hh" #include "JROOT/JTreeParameters.hh" #include "JDB/JDBTypes.hh" /** * \file * * ROOT TTree parameter settings.\n * Type lists for various collections of data types. * \author mdejong */ namespace JDATABASE { using JLANG::JType; using JROOT::JTreeParameters; /** * \param type data type * \return TTree parameters */ inline JTreeParameters getTreeParameters(const JType& type) { return JTreeParameters("DB_DETECTORS", "db_detectors", "", 2); } /** * \param type data type * \return TTree parameters */ inline JTreeParameters getTreeParameters(const JType& type) { return JTreeParameters("DB_RUNS", "db_runs", "", 2); } /** * \param type data type * \return TTree parameters */ inline JTreeParameters getTreeParameters(const JType& type) { return JTreeParameters("DATALOGNUMBERS", "", "datalognumbers", 2); } /** * \param type data type * \return TTree parameters */ inline JTreeParameters getTreeParameters(const JType& type) { return JTreeParameters("DATALOG", "", "datalog", 2); } /** * \param type data type * \return TTree parameters */ inline JTreeParameters getTreeParameters(const JType& type) { return JTreeParameters("VENDOR_HV", "vendor_hv", "", 2); } /** * \param type data type * \return TTree parameters */ inline JTreeParameters getTreeParameters(const JType& type) { return JTreeParameters("AHRS", "ahrs", "", 2); } /** * \param type data type * \return TTree parameters */ inline JTreeParameters getTreeParameters(const JType& type) { return JTreeParameters("AHRSCALIB", "ahrscalib", "", 2); } /** * \param type data type * \return TTree parameters */ inline JTreeParameters getTreeParameters(const JType& type) { return JTreeParameters("DB_ALLPARAMS", "db_allparams", "", 2); } /** * \param type data type * \return TTree parameters */ inline JTreeParameters getTreeParameters(const JType& type) { return JTreeParameters("HV_SETTINGS", "hv_settings", "", 2); } /** * \param type data type * \return TTree parameters */ inline JTreeParameters getTreeParameters(const JType& type) { return JTreeParameters("HV_RUN_SETTINGS", "hv_run_settings", "", 2); } /** * \param type data type * \return TTree parameters */ inline JTreeParameters getTreeParameters(const JType& type) { return JTreeParameters("BEST_HV_SETTINGS", "best_hv_settings", "", 2); } /** * \param type data type * \return TTree parameters */ inline JTreeParameters getTreeParameters(const JType& type) { return JTreeParameters("INTEGRATION", "integration", "", 2); } /** * \param type data type * \return TTree parameters */ inline JTreeParameters getTreeParameters(const JType& type) { return JTreeParameters("CLBMAP", "clbmap", "", 2); } /** * \param type data type * \return TTree parameters */ inline JTreeParameters getTreeParameters(const JType& type) { return JTreeParameters("PERSONS", "persons", "", 2); } /** * \param type data type * \return TTree parameters */ inline JTreeParameters getTreeParameters(const JType& type) { return JTreeParameters("DB_TOASHORT", "db_toashort", "", 2); } /** * \param type data type * \return TTree parameters */ inline JTreeParameters getTreeParameters(const JType& type) { return JTreeParameters("DB_RUNSUMMARYNUMBERS", "db_runsummarynumbers", "", 2); } /** * \param type data type * \return TTree parameters */ inline JTreeParameters getTreeParameters(const JType& type) { return JTreeParameters("DB_RUNQUALITY", "db_runquality", "", 2); } /** * \param type data type * \return TTree parameters */ inline JTreeParameters getTreeParameters(const JType& type) { return JTreeParameters("DB_RUNSETUPPARAMS", "db_runsetupparams", "", 2); } /** * \param type data type * \return TTree parameters */ inline JTreeParameters getTreeParameters(const JType& type) { return JTreeParameters("DB_CLBID", "db_clbid", "", 2); } /** * \param type data type * \return TTree parameters */ inline JTreeParameters getTreeParameters(const JType& type) { return JTreeParameters("DB_UPI", "db_upi", "", 2); } /** * Auxiliary method to get list of table names. */ template struct JQueries : public std::vector { /** * Default constructor. * * This constructor builds the list of queries from the given type list. */ JQueries() { JLANG::for_each(*this, JType()); } /** * Add data type. * * \param type data type */ template void operator()(const JType& type) { this->push_back(T::getName()); } }; /** * Get list of possible queries. * * \return list of possible queries */ template inline const std::vector& getQueries() { static const JQueries buffer; return buffer; } } /** * Type list of database data types for I/O. */ typedef JLANG::JTYPELIST::typelist JDBTypes_t; #endif