12 m_triggerchain(triggerchain),
15 m_logger(
"CoolQuery" ),
36 cool::IDatabaseSvc& databasesvc = cool::DatabaseSvcFactory::databaseService();
41 coral::IConnectionServiceConfiguration& csconfig=
m_coralsvc.configuration();
42 csconfig.setReplicaSortingAlgorithm(*
m_repsort);
71 if (inconn.find(
'/')==std::string::npos) {
72 return "sqlite://X;schema=mycool.db;dbname="+inconn;
81 size_t found = triggername.find_first_of(
'_');
82 if(
found != std::string::npos){
83 std::string s_lvl = triggername.substr(0,
found);
84 if(s_lvl ==
"EF")
return 3;
85 if(s_lvl ==
"L2")
return 2;
86 if(s_lvl ==
"L1")
return 1;
87 if(s_lvl ==
"HLT")
return 2;
109 cool::IFolderPtr folder_ptr =
m_sourceDbPtr->getFolder(folder_name);
110 cool::IObjectIteratorPtr itr = folder_ptr->browseObjects(
m_VKstart,
m_VKstop,
id);
113 if (itr->goToNext()) {
114 const cool::IRecord&
payload=itr->currentRef().payload();
115 return payload[
"Lvl1Prescale"].data<cool::Int32>();
125 cool::IFolderPtr folder_ptr =
m_sourceDbPtr->getFolder(folder_name);
126 cool::IObjectIteratorPtr itr = folder_ptr->browseObjects(
m_VKstart,
m_VKstop,
id);
129 if (itr->goToNext()) {
130 const cool::IRecord&
payload=itr->currentRef().payload();
131 return payload[
"Prescale"].data<cool::Float>();
145 if (trigger ==
"")
return UINT_MAX;
147 cool::IFolderPtr folder_ptr =
m_sourceDbPtr->getFolder(folder_name);
150 while (obj_itr->goToNext()){
151 const cool::IRecord&
payload=obj_itr->currentRef().payload();
153 if(
payload[
"ItemName"].data<std::string>() == trigger){
156 return obj_itr->currentRef().channelId();
174 if (lumimethod ==
"")
return UINT_MAX;
178 cool::IFolderPtr folder_ptr =
m_sourceDbPtr->getFolder(folder_name);
179 if(folder_ptr->existsChannel(lumimethod)){
181 return folder_ptr->channelId(lumimethod);
197 if (trigger ==
"")
return UINT_MAX;
199 cool::IFolderPtr folder_ptr =
m_sourceDbPtr->getFolder(folder_name);
203 while (obj_itr->goToNext()){
204 const cool::IRecord&
payload=obj_itr->currentRef().payload();
205 if(
payload[
"ChainName"].data<std::string>() == trigger){
208 return payload[
"ChainCounter"].data<cool::UInt32>();
225 cool::IFolderPtr folder_ptr =
m_sourceDbPtr->getFolder(folder_name);
227 while (obj_itr->goToNext()){
228 const cool::IRecord&
payload=obj_itr->currentRef().payload();
239 cool::IFolderPtr folder_ptr =
m_sourceDbPtr->getFolder(folder_name);
241 while (obj_itr2->goToNext()){
242 const cool::IRecord& payload2=obj_itr2->currentRef().payload();
244 m_logger <<
Root::kINFO << payload2[
"ChainName"].data<std::string>() <<
"(" << payload2[
"Prescale"].data<cool::Float>() <<
", " << payload2[
"ChainCounter"].data<cool::UInt32>() <<
"), ";
260 cool::IFolderPtr folder_ptr =
m_sourceDbPtr->getFolder(folder_name);
263 while (obj_itr->goToNext()){
264 const cool::IRecord&
payload=obj_itr->currentRef().payload();
265 if(
payload[
"ChainName"].data<std::string>() == trigger){
267 return payload[
"LowerChainName"].data<std::string>();
289 std::map<cool::ValidityKey, CoolQuery::LumiFolderData>
292 std::map<cool::ValidityKey, LumiFolderData> mymap;
295 cool::IFolderPtr folder_ptr =
m_sourceDbPtr->getFolder(folder_name);
297 if (!folder_ptr->existsChannel(
id)) {
302 cool::IObjectIteratorPtr itr;
303 if(folder_ptr->existsUserTag(
tag)) {
310 while (itr->goToNext()) {
311 const cool::IRecord&
payload=itr->currentRef().payload();
314 folderData.
Valid =
payload[
"Valid"].data<cool::UInt32>();
315 mymap.insert( std::pair<cool::ValidityKey, LumiFolderData>(itr->currentRef().since(), folderData));
323 std::map<cool::ValidityKey, CoolQuery::L1CountFolderData>
326 std::map<cool::ValidityKey, L1CountFolderData> mymap;
329 cool::IFolderPtr folder_ptr =
m_sourceDbPtr->getFolder(folder_name);
331 if (!folder_ptr->existsChannel(
id)) {
336 cool::IObjectIteratorPtr itr;
340 while (itr->goToNext()) {
341 const cool::IRecord&
payload=itr->currentRef().payload();
345 mymap.insert( std::pair<cool::ValidityKey, L1CountFolderData>(itr->currentRef().since(), folderData));