Jpp
JDB/JSupport.hh
Go to the documentation of this file.
1 #ifndef __JDB__JSUPPORT__
2 #define __JDB__JSUPPORT__
3 
4 #include <string>
5 #include <vector>
6 
7 #include "JLang/JType.hh"
8 #include "JLang/JTypeList.hh"
10 #include "JDB/JDBTypes.hh"
11 
12 
13 /**
14  * \file
15  *
16  * ROOT TTree parameter settings.\n
17  * Type lists for various collections of data types.
18  * \author mdejong
19  */
20 
21 using JLANG::JTYPELIST;
22 using JLANG::JType;
24 
25 /**
26  * \param type data type
27  * \return TTree parameters
28  */
30 {
31  return JTreeParameters("DB_DETECTORS", "db_detectors", "", 2);
32 }
33 
34 /**
35  * \param type data type
36  * \return TTree parameters
37  */
39 {
40  return JTreeParameters("DB_RUNS", "db_runs", "", 2);
41 }
42 
43 /**
44  * \param type data type
45  * \return TTree parameters
46  */
48 {
49  return JTreeParameters("DATALOGNUMBERS", "", "datalognumbers", 2);
50 }
51 
52 /**
53  * \param type data type
54  * \return TTree parameters
55  */
57 {
58  return JTreeParameters("DATALOG", "", "datalog", 2);
59 }
60 
61 /**
62  * \param type data type
63  * \return TTree parameters
64  */
66 {
67  return JTreeParameters("VENDOR_HV", "vendor_hv", "", 2);
68 }
69 
70 /**
71  * \param type data type
72  * \return TTree parameters
73  */
75 {
76  return JTreeParameters("AHRS", "ahrs", "", 2);
77 }
78 
79 /**
80  * \param type data type
81  * \return TTree parameters
82  */
84 {
85  return JTreeParameters("DB_ALLPARAMS", "db_allparams", "", 2);
86 }
87 
88 /**
89  * \param type data type
90  * \return TTree parameters
91  */
93 {
94  return JTreeParameters("HV_SETTINGS", "hv_settings", "", 2);
95 }
96 
97 /**
98  * \param type data type
99  * \return TTree parameters
100  */
102 {
103  return JTreeParameters("HV_RUN_SETTINGS", "hv_run_settings", "", 2);
104 }
105 
106 /**
107  * \param type data type
108  * \return TTree parameters
109  */
111 {
112  return JTreeParameters("BEST_HV_SETTINGS", "best_hv_settings", "", 2);
113 }
114 
115 /**
116  * \param type data type
117  * \return TTree parameters
118  */
120 {
121  return JTreeParameters("INTEGRATION", "integration", "", 2);
122 }
123 
124 /**
125  * \param type data type
126  * \return TTree parameters
127  */
129 {
130  return JTreeParameters("CLBMAP", "clbmap", "", 2);
131 }
132 
133 /**
134  * \param type data type
135  * \return TTree parameters
136  */
138 {
139  return JTreeParameters("PERSONS", "persons", "", 2);
140 }
141 
142 /**
143  * \param type data type
144  * \return TTree parameters
145  */
147 {
148  return JTreeParameters("DB_TOASHORT", "db_toashort", "", 2);
149 }
150 
151 /**
152  * \param type data type
153  * \return TTree parameters
154  */
156 {
157  return JTreeParameters("DB_RUNSUMMARYNUMBERS", "db_runsummarynumbers", "", 2);
158 }
159 
160 /**
161  * \param type data type
162  * \return TTree parameters
163  */
165 {
166  return JTreeParameters("DB_RUNQUALITY", "db_runquality", "", 2);
167 }
168 
169 /**
170  * \param type data type
171  * \return TTree parameters
172  */
174 {
175  return JTreeParameters("DB_RUNSETUPPARAMS", "db_runsetupparams", "", 2);
176 }
177 
178 /**
179  * Type list of database data types for I/O.
180  */
194  //JDATABASE::JRunSummaryNumbers,
197 
198 
199 namespace JDATABASE {
200 
201  /**
202  * Auxiliary method to get list of table names.
203  */
204  template<class JTypelist_t>
205  struct JQueries :
206  public std::vector<std::string>
207  {
208  /**
209  * Default constructor.
210  *
211  * This constructor builds the list of queries from the given type list.
212  */
214  {
216  }
217 
218 
219  /**
220  * Add data type.
221  *
222  * \param type data type
223  */
224  template<class T>
225  void operator()(const JType<T>& type)
226  {
227  this->push_back(T::getName());
228  }
229  };
230 
231 
232  /**
233  * Get list of possible queries.
234  *
235  * \return list of possible queries
236  */
237  template<class JTypelist_t>
239  {
240  static const JQueries<JTypelist_t> buffer;
241 
242  return buffer;
243  }
244 }
245 
246 #endif
JDATABASE::JDatalogNumbers
Definition: JDatalogNumbers.hh:17
JLANG::JType
Auxiliary class for a type holder.
Definition: JType.hh:19
JDBTypes.hh
JTreeParameters.hh
JDATABASE::JPMTHVSettings
Definition: JPMTHVSettings.hh:17
std::vector
Definition: JSTDTypes.hh:12
JDATABASE::JToAshort
Definition: JToAshort.hh:17
JLANG::JTYPELIST
Auxiliary class for recursive type list generation.
Definition: JTypeList.hh:377
JDATABASE::JVendorHV
Definition: JVendorHV.hh:16
JDATABASE::JQueries
Auxiliary method to get list of table names.
Definition: JDB/JSupport.hh:205
JDATABASE::JPersons
Definition: JPersons.hh:17
JDATABASE
Auxiliary classes and methods for database I/O.
Definition: JAHRS.hh:12
JDATABASE::getQueries
const std::vector< std::string > & getQueries()
Get list of possible queries.
Definition: JDB/JSupport.hh:238
JDATABASE::JAHRS
Definition: JAHRS.hh:17
JDATABASE::JQueries::JQueries
JQueries()
Default constructor.
Definition: JDB/JSupport.hh:213
JDATABASE::JPMTHVRunSettings
Definition: JPMTHVRunSettings.hh:17
JDATABASE::JCLBMap
Definition: JCLBMap.hh:17
JLANG::for_each
JObject_t & for_each(JObject_t &object, JType< JTypeList< JHead_t, JTail_t > > typelist)
For each data type method.
Definition: JTypeList.hh:572
JDATABASE::JRunQuality
Auxiliary data structure for data quality.
Definition: JRunQuality.hh:31
JDATABASE::JAllParams
Definition: JAllParams.hh:18
JDATABASE::JQueries::operator()
void operator()(const JType< T > &type)
Add data type.
Definition: JDB/JSupport.hh:225
JROOT::getName
const char * getName()
Get ROOT name of given data type.
Definition: JRootToolkit.hh:45
getTreeParameters
JTreeParameters getTreeParameters(const JType< JDATABASE::JDetectors > &type)
Definition: JDB/JSupport.hh:29
JTypeList.hh
JDATABASE::JRunsetupParams
Definition: JRunsetupParams.hh:17
JDATABASE::JPMTBestHVSettings
Definition: JPMTBestHVSettings.hh:17
JDATABASE::JDetectors
Definition: JDetectors.hh:18
JDATABASE::JRuns
Definition: JRuns.hh:17
JDATABASE::JProductIntegration
Definition: JProductIntegration.hh:17
JDBTypes_t
JTYPELIST< JDATABASE::JDetectors, JDATABASE::JRuns, JDATABASE::JDatalogNumbers, JDATABASE::JVendorHV, JDATABASE::JAHRS, JDATABASE::JAllParams, JDATABASE::JPMTHVSettings, JDATABASE::JPMTHVRunSettings, JDATABASE::JPMTBestHVSettings, JDATABASE::JProductIntegration, JDATABASE::JCLBMap, JDATABASE::JPersons, JDATABASE::JToAshort, JDATABASE::JRunQuality, JDATABASE::JRunsetupParams >::typelist JDBTypes_t
Type list of database data types for I/O.
Definition: JDB/JSupport.hh:196
JType.hh
JROOT::JTreeParameters
Data structure for TTree parameters.
Definition: JTreeParameters.hh:26