ATLAS Offline Software
Classes | Public Member Functions | Private Member Functions | Private Attributes | List of all members
CoolQuery Class Reference

#include <CoolQuery.h>

Collaboration diagram for CoolQuery:

Classes

struct  L1CountFolderData
 
struct  LumiFolderData
 

Public Member Functions

 CoolQuery (const std::string &database, const std::string &triggerchain)
 
 ~CoolQuery ()
 
void setDb (const std::string &database)
 
void setTrigger (const std::string &triggerchain)
 
bool openDbConn ()
 
void setIOV (const cool::ValidityKey start, const cool::ValidityKey stop)
 
void setIOVForRun (unsigned int runnum)
 
cool::ChannelId getHLTChannelId (const std::string &trigger, const std::string &folder_name)
 
cool::ChannelId getL1ChannelId (const std::string &trigger, const std::string &folder_name)
 
cool::ChannelId getLumiChannelId (const std::string &lumimethod, const std::string &folder_name)
 
bool channelIdValid ()
 
std::string getHLTLowerChainName (const std::string &trigger, const std::string &folder_name)
 
cool::Int32 getL1PrescaleFromChannelId (const std::string &folder_name, const cool::ChannelId &id)
 
cool::Float getHLTPrescaleFromChannelId (const std::string &folder_name, const cool::ChannelId &id)
 
void printL1Triggers (const std::string &folder_name)
 
void printHLTTriggers (const std::string &folder_name)
 
template<class T >
std::map< cool::ValidityKey, T > getObjMapFromFolderAtChan (const std::string &obj_name, const std::string &folder_name, const cool::ChannelId &id)
 
template<class T >
std::map< cool::ValidityKey, T > getTrigObjMapFromFolderByName (const std::string &obj_name, const std::string &folder_name, const std::string &trigger)
 
template<class T >
std::map< cool::ValidityKey, T > getLumiIterator (const std::string &luminame, const std::string &folder_name, const std::string &tag, const cool::ChannelId &id)
 
unsigned int getTriggerLevel (const std::string &triggername)
 
std::map< cool::ValidityKey, LumiFolderDatagetLumiFolderData (const std::string &folder_name, const std::string &tag, const cool::ChannelId &id)
 
std::map< cool::ValidityKey, L1CountFolderDatagetL1CountFolderData (const std::string &folder_name, const cool::ChannelId &id)
 
template<class T >
IOVData< T > getIOVData (const std::string &name, const std::string &folder_name, const cool::ChannelId &id, const std::string &tag="")
 

Private Member Functions

std::string transConn (const std::string &inconn)
 

Private Attributes

coral::ConnectionService m_coralsvc
 
ReplicaSorterm_repsort
 
cool::IDatabasePtr m_sourceDbPtr
 
std::string m_database
 
std::string m_triggerchain
 
cool::ValidityKey m_VKstart
 
cool::ValidityKey m_VKstop
 
Root::TMsgLogger m_logger
 
bool m_valid
 

Detailed Description

Definition at line 217 of file CoolQuery.h.

Constructor & Destructor Documentation

◆ CoolQuery()

CoolQuery::CoolQuery ( const std::string &  database,
const std::string &  triggerchain 
)

Definition at line 9 of file CoolQuery.cxx.

9  :
10  m_repsort(0),
12  m_triggerchain(triggerchain),
13  m_VKstart(0),
14  m_VKstop(0),
15  m_logger( "CoolQuery" ),
16  m_valid(false)
17 {
18 
19 }

◆ ~CoolQuery()

CoolQuery::~CoolQuery ( )

Definition at line 22 of file CoolQuery.cxx.

22  {
23  if ( m_sourceDbPtr.use_count()>0 && m_sourceDbPtr->isOpen() ) {
24  m_logger << Root::kINFO << "Closing database '" << m_sourceDbPtr->databaseName() << Root::GEndl;
25  m_sourceDbPtr->closeDatabase();
26  }
27 }

Member Function Documentation

◆ channelIdValid()

bool CoolQuery::channelIdValid ( )

Definition at line 250 of file CoolQuery.cxx.

250  {
251  // m_logger << Root::kINFO << "channelIdValid = " << m_valid << Root::GEndl;
252  return m_valid;
253 }

◆ getHLTChannelId()

cool::ChannelId CoolQuery::getHLTChannelId ( const std::string &  trigger,
const std::string &  folder_name 
)

Definition at line 191 of file CoolQuery.cxx.

191  {
192 
193  // m_logger << Root::kINFO << "Getting channel id for HLT trigger [" << trigger << "] from folder [" << folder_name << "]" << Root::GEndl;
194 
195  m_valid = false;
196 
197  if (trigger == "") return UINT_MAX;
198 
199  cool::IFolderPtr folder_ptr = m_sourceDbPtr->getFolder(folder_name);
200  cool::IObjectIteratorPtr obj_itr=folder_ptr->browseObjects(m_VKstart,m_VKstart, cool::ChannelSelection::all());
201  // loop through all triggers
202  // loop through all triggers
203  while (obj_itr->goToNext()){
204  const cool::IRecord& payload=obj_itr->currentRef().payload();
205  if(payload["ChainName"].data<std::string>() == trigger){
206  m_valid = true;
207  // m_logger << Root::kINFO << "Found channel id: " << payload["ChainCounter"].data<cool::UInt32>() << Root::GEndl;
208  return payload["ChainCounter"].data<cool::UInt32>();
209  }
210  }
211 
212  if(!m_valid){
213  m_logger << Root::kERROR << "Couldn't find HLT trigger [" << trigger << "] in folder [" << folder_name << "]" << Root::GEndl;
214  }
215 
216  // Nonsense value
217  return UINT_MAX;
218 }

◆ getHLTLowerChainName()

std::string CoolQuery::getHLTLowerChainName ( const std::string &  trigger,
const std::string &  folder_name 
)

Definition at line 256 of file CoolQuery.cxx.

256  {
257 
258  // cout << "Getting lower chain name for trigger [" << trigger << "] from folder [" << folder_name << "] " << endl;
259  bool found = false;
260  cool::IFolderPtr folder_ptr = m_sourceDbPtr->getFolder(folder_name);
261  cool::IObjectIteratorPtr obj_itr=folder_ptr->browseObjects(m_VKstart,m_VKstart, cool::ChannelSelection::all());
262  // loop through all triggers
263  while (obj_itr->goToNext()){
264  const cool::IRecord& payload=obj_itr->currentRef().payload();
265  if(payload["ChainName"].data<std::string>() == trigger){
266  found = true;
267  return payload["LowerChainName"].data<std::string>();
268 
269  }
270  }
271 
272  if (!found) {
273  m_logger << Root::kERROR << "Couldn't find HLT trigger [" << trigger << "] in folder [" << folder_name << "]" << Root::GEndl;
274 
275  // m_logger << Root::kINFO << "List of triggers, hth: " << Root::GEndl;
276  // cool::IObjectIteratorPtr obj_itr2=folder_ptr->browseObjects(m_VKstart,m_VKstart, cool::ChannelSelection::all());
277  // while (obj_itr2->goToNext()){
278  // const cool::IRecord& payload2=obj_itr2->currentRef().payload();
279  // m_logger << Root::kINFO << payload2["ChainName"].data<std::string>() << ", ";
280  // }
281  // m_logger << Root::kINFO << Root::GEndl;
282  }
283 
284  return "";
285 
286 }

◆ getHLTPrescaleFromChannelId()

cool::Float CoolQuery::getHLTPrescaleFromChannelId ( const std::string &  folder_name,
const cool::ChannelId &  id 
)

Definition at line 123 of file CoolQuery.cxx.

123  {
124 
125  cool::IFolderPtr folder_ptr = m_sourceDbPtr->getFolder(folder_name);
126  cool::IObjectIteratorPtr itr = folder_ptr->browseObjects(m_VKstart, m_VKstop,id);
127 
128  // Need to iterate once to get to first valid record, do it this way to avoid Coverity warning
129  if (itr->goToNext()) {
130  const cool::IRecord& payload=itr->currentRef().payload();
131  return payload["Prescale"].data<cool::Float>();
132  }
133 
134  // Nonsense value
135  return -1.;
136 
137 }

◆ getIOVData()

template<class T >
IOVData< T > CoolQuery::getIOVData ( const std::string &  name,
const std::string &  folder_name,
const cool::ChannelId &  id,
const std::string &  tag = "" 
)

Definition at line 421 of file CoolQuery.h.

421  {
422 
423  IOVData<T> mydata;
424 
425  cool::IFolderPtr folder_ptr = m_sourceDbPtr->getFolder(folder_name);
426  cool::ChannelSelection chsel(id);
427  if(!folder_ptr->existsChannel(id)){
428  m_logger << Root::kWARNING << "Channel " << id << " does not exist in database " << folder_name << "!" << Root::GEndl;
429  return mydata;
430  }
431 
432  // Try with or without tag
433  cool::IObjectIteratorPtr itr;
434  if (folder_ptr->existsUserTag(tag)) {
435  itr = folder_ptr->browseObjects(m_VKstart, m_VKstop, id, tag);
436  } else {
437  itr = folder_ptr->browseObjects(m_VKstart, m_VKstop, id);
438  }
439 
440  while (itr->goToNext()) {
442  since.setRETime(itr->currentRef().since());
443  until.setRETime(itr->currentRef().until());
444 
446 
447  const cool::IRecord& payload=itr->currentRef().payload();
448 
449  mydata.add( range, payload[obj_name].data<T>() );
450  }
451 
452  return mydata;
453 }

◆ getL1ChannelId()

cool::ChannelId CoolQuery::getL1ChannelId ( const std::string &  trigger,
const std::string &  folder_name 
)

Definition at line 139 of file CoolQuery.cxx.

139  {
140 
141  // m_logger << Root::kINFO << "Getting channel id for L1 trigger [" << trigger << "] from folder [" << folder_name << "]" << Root::GEndl;
142 
143  m_valid = false;
144 
145  if (trigger == "") return UINT_MAX;
146 
147  cool::IFolderPtr folder_ptr = m_sourceDbPtr->getFolder(folder_name);
148  cool::IObjectIteratorPtr obj_itr=folder_ptr->browseObjects(m_VKstart,m_VKstart, cool::ChannelSelection::all());
149  // loop through all triggers
150  while (obj_itr->goToNext()){
151  const cool::IRecord& payload=obj_itr->currentRef().payload();
152  // find the L1 trigger chain
153  if(payload["ItemName"].data<std::string>() == trigger){
154  m_valid = true;
155  // cout << "Channel id: " << obj_itr->currentRef().channelId() << endl;
156  return obj_itr->currentRef().channelId();
157  }
158  }
159 
160  if(!m_valid){
161  m_logger << Root::kERROR << "Couldn't find L1 trigger [" << trigger << "] in folder [" << folder_name << "]" << Root::GEndl;
162  }
163 
164 
165  // Nonsense value
166  return UINT_MAX;
167 }

◆ getL1CountFolderData()

std::map< cool::ValidityKey, CoolQuery::L1CountFolderData > CoolQuery::getL1CountFolderData ( const std::string &  folder_name,
const cool::ChannelId &  id 
)

Definition at line 324 of file CoolQuery.cxx.

324  {
325 
326  std::map<cool::ValidityKey, L1CountFolderData> mymap;
327  L1CountFolderData folderData;
328 
329  cool::IFolderPtr folder_ptr = m_sourceDbPtr->getFolder(folder_name);
330  // m_logger << Root::kWARNING << "Getting from database " << m_database << " tag " << tag << Root::GEndl;
331  if (!folder_ptr->existsChannel(id)) {
332  m_logger << Root::kWARNING << "Lumi channel id " << id << " does not exist in database " << folder_name << "!" << Root::GEndl;
333  return mymap;
334  }
335 
336  cool::IObjectIteratorPtr itr;
337 
338  itr = folder_ptr->browseObjects(m_VKstart, m_VKstop, id);
339 
340  while (itr->goToNext()) {
341  const cool::IRecord& payload=itr->currentRef().payload();
342  folderData.BeforePrescale = payload["BeforePrescale"].data<cool::UInt63>();
343  folderData.AfterPrescale = payload["AfterPrescale"].data<cool::UInt63>();
344  folderData.L1Accept = payload["L1Accept"].data<cool::UInt63>();
345  mymap.insert( std::pair<cool::ValidityKey, L1CountFolderData>(itr->currentRef().since(), folderData));
346  }
347 
348  return mymap;
349 
350 }

◆ getL1PrescaleFromChannelId()

cool::Int32 CoolQuery::getL1PrescaleFromChannelId ( const std::string &  folder_name,
const cool::ChannelId &  id 
)

Definition at line 107 of file CoolQuery.cxx.

107  {
108 
109  cool::IFolderPtr folder_ptr = m_sourceDbPtr->getFolder(folder_name);
110  cool::IObjectIteratorPtr itr = folder_ptr->browseObjects(m_VKstart, m_VKstop,id);
111 
112  // Need to iterate once to get to first valid record, do it this way to avoid Coverity warning
113  if (itr->goToNext()) {
114  const cool::IRecord& payload=itr->currentRef().payload();
115  return payload["Lvl1Prescale"].data<cool::Int32>();
116  }
117 
118  // Nonsense value
119  return UINT_MAX;
120 
121 }

◆ getLumiChannelId()

cool::ChannelId CoolQuery::getLumiChannelId ( const std::string &  lumimethod,
const std::string &  folder_name 
)

Definition at line 170 of file CoolQuery.cxx.

170  {
171 
172  m_valid = false;
173 
174  if (lumimethod == "") return UINT_MAX;
175 
176  // m_logger << Root::kINFO << "Getting channel id for Lumi method: " << lumimethod << " in folder " << folder_name << Root::GEndl;
177 
178  cool::IFolderPtr folder_ptr = m_sourceDbPtr->getFolder(folder_name);
179  if(folder_ptr->existsChannel(lumimethod)){
180  m_valid = true;
181  return folder_ptr->channelId(lumimethod);
182  }else{
183  m_logger << Root::kWARNING << "Couldn't find lumimethod: " << lumimethod << " in COOL database!" << Root::GEndl;
184  }
185 
186  // Nonsense value
187  return UINT_MAX;
188 }

◆ getLumiFolderData()

std::map< cool::ValidityKey, CoolQuery::LumiFolderData > CoolQuery::getLumiFolderData ( const std::string &  folder_name,
const std::string &  tag,
const cool::ChannelId &  id 
)

Definition at line 290 of file CoolQuery.cxx.

290  {
291 
292  std::map<cool::ValidityKey, LumiFolderData> mymap;
293  LumiFolderData folderData;
294 
295  cool::IFolderPtr folder_ptr = m_sourceDbPtr->getFolder(folder_name);
296  // m_logger << Root::kWARNING << "Getting from database " << m_database << " tag " << tag << Root::GEndl;
297  if (!folder_ptr->existsChannel(id)) {
298  m_logger << Root::kWARNING << "Lumi channel id " << id << " does not exist in database " << folder_name << "!" << Root::GEndl;
299  return mymap;
300  }
301 
302  cool::IObjectIteratorPtr itr;
303  if(folder_ptr->existsUserTag(tag)) {
304  itr = folder_ptr->browseObjects(m_VKstart, m_VKstop, id, tag);
305  } else {
306  // Try without specifying tag
307  itr = folder_ptr->browseObjects(m_VKstart, m_VKstop, id);
308  }
309 
310  while (itr->goToNext()) {
311  const cool::IRecord& payload=itr->currentRef().payload();
312  folderData.LBAvInstLumi = payload["LBAvInstLumi"].data<float>();
313  folderData.LBAvEvtsPerBX = payload["LBAvEvtsPerBX"].data<float>();
314  folderData.Valid = payload["Valid"].data<cool::UInt32>();
315  mymap.insert( std::pair<cool::ValidityKey, LumiFolderData>(itr->currentRef().since(), folderData));
316  }
317 
318  return mymap;
319 
320 }

◆ getLumiIterator()

template<class T >
std::map< cool::ValidityKey, T > CoolQuery::getLumiIterator ( const std::string &  luminame,
const std::string &  folder_name,
const std::string &  tag,
const cool::ChannelId &  id 
)

Definition at line 397 of file CoolQuery.h.

397  {
398 
399  std::map<cool::ValidityKey, T> mymap;
400  cool::IFolderPtr folder_ptr = m_sourceDbPtr->getFolder(folder_name);
401  // m_logger << Root::kWARNING << "Getting from database " << m_database << " tag " << tag << Root::GEndl;
402  if(folder_ptr->existsChannel(id) && folder_ptr->existsUserTag(tag)){
403  cool::IObjectIteratorPtr itr = folder_ptr->browseObjects(m_VKstart, m_VKstop, id, tag);
404  while (itr->goToNext()) {
405  const cool::IRecord& payload=itr->currentRef().payload();
406  mymap.insert( std::pair<cool::ValidityKey, T>(itr->currentRef().since() ,payload[luminame].data<T>()));
407  }
408  }else if(folder_ptr->existsChannel(id) && !folder_ptr->existsUserTag(tag)){
409  // ok, tag doesn't exist, still try to use an untagged way of accessing data
410  mymap = CoolQuery::getObjMapFromFolderAtChan<T>(luminame, folder_name,id);
411  }else{
412  m_logger << Root::kWARNING << "Lumi tag " << tag << " does not exist, or Lumi channel id " << id << " does not exist in database." << Root::GEndl;
413  }
414  return mymap;
415 
416 }

◆ getObjMapFromFolderAtChan()

template<class T >
std::map< cool::ValidityKey, T > CoolQuery::getObjMapFromFolderAtChan ( const std::string &  obj_name,
const std::string &  folder_name,
const cool::ChannelId &  id 
)

Definition at line 375 of file CoolQuery.h.

375  {
376  // m_logger << Root::kWARNING << "Getting object [" << obj_name << "] from folder [" << folder_name << "], in channel: " << id << ", in LB range: " << (m_VKstart >> 32) << ", " << (m_VKstart & 0xFFFFFFFF) << " - " << (m_VKstop >> 32) << ","<< (m_VKstop & 0xFFFFFFFF) << Root::GEndl;
377  std::map<cool::ValidityKey, T> mymap;
378  cool::IFolderPtr folder_ptr = m_sourceDbPtr->getFolder(folder_name);
379  cool::ChannelSelection chsel(id);
380  if(folder_ptr->existsChannel(id)){
381  cool::IObjectIteratorPtr itr = folder_ptr->browseObjects(m_VKstart, m_VKstop,chsel);
382  while (itr->goToNext()) {
383  const cool::IRecord& payload=itr->currentRef().payload();
384  // std::cout << "Inserting: " << (itr->currentRef().since() >> 32) << " - " << (itr->currentRef().since() & 0xFFFFFF) << ", " << payload[obj_name].data<T>() << std::endl;
385  mymap.insert( std::pair<cool::ValidityKey, T>(itr->currentRef().since() ,payload[obj_name].data<T>()));
386  }
387  }else{
388  m_logger << Root::kWARNING << "Channel " << id << " does not exist in database." << Root::GEndl;
389 /* const std::map<cool::ChannelId,std::string> list = folder_ptr->listChannelsWithNames(); */
390  }
391  return mymap;
392 }

◆ getTriggerLevel()

unsigned int CoolQuery::getTriggerLevel ( const std::string &  triggername)

Definition at line 79 of file CoolQuery.cxx.

79  {
80 
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;
88  }
89 
90  // Indicate no valid trigger name passed
91  return 0;
92 
93 }

◆ getTrigObjMapFromFolderByName()

template<class T >
std::map< cool::ValidityKey, T > CoolQuery::getTrigObjMapFromFolderByName ( const std::string &  obj_name,
const std::string &  folder_name,
const std::string &  trigger 
)

Definition at line 345 of file CoolQuery.h.

345  {
346  // m_logger << Root::kWARNING << "Getting object [" << obj_name << "] from folder [" << folder_name << "], in LB range: " << (m_VKstart >> 32) << ", " << (m_VKstart & 0xFFFFFFFF) << " - " << (m_VKstop >> 32) << ","<< (m_VKstop & 0xFFFFFFFF) << Root::GEndl;
347  std::map<cool::ValidityKey, T> mymap;
348  bool found = false;
349  cool::IFolderPtr folder_ptr = m_sourceDbPtr->getFolder(folder_name);
350  cool::IObjectIteratorPtr obj_itr=folder_ptr->browseObjects(m_VKstart,m_VKstart, cool::ChannelSelection::all());
351  // loop through all triggers
352  while (obj_itr->goToNext()){
353 
354  const cool::IRecord& payload=obj_itr->currentRef().payload();
355  // std::cout << "ChainNames: " << payload["ChainName"].data<std::string>() << std::endl;
356 
357  if(payload["ChainName"].data<std::string>() == trigger){
358  found = true;
359  const cool::IRecord& payload=obj_itr->currentRef().payload();
360  // std::cout << "Inserting: " << (obj_itr->currentRef().since() >> 32) << " - " << (obj_itr->currentRef().since() & 0xFFFFFF) << ", " << payload[obj_name].data<T>() << std::endl;
361  mymap.insert( std::pair<cool::ValidityKey, T>(obj_itr->currentRef().since() ,payload[obj_name].data<T>()));
362  }
363  }
364 
365  if(!found){
366  m_logger << Root::kERROR << "Couldn't find HLT trigger [" << trigger << "] in folder [" << folder_name << "]" << Root::GEndl;
367  }
368 
369  return mymap;
370 }

◆ openDbConn()

bool CoolQuery::openDbConn ( )

Definition at line 30 of file CoolQuery.cxx.

30  {
31 
32  m_logger << Root::kINFO << "Trying to connect to database " << m_database << "..." << Root::GEndl;
33 
34  // CoraCoolDatabaseSvc& corasvc = CoraCoolDatabaseSvcFactory::databaseService();
35 
36  cool::IDatabaseSvc& databasesvc = cool::DatabaseSvcFactory::databaseService();
37  //std::cout << "Done the CoraCool initialisation" << std::endl;
38  //std::cout << "Opening CORAL database" << std::endl;
39  try {
41  coral::IConnectionServiceConfiguration& csconfig=m_coralsvc.configuration();
42  csconfig.setReplicaSortingAlgorithm(*m_repsort);
43 
44  m_sourceDbPtr = databasesvc.openDatabase(m_database,true);// true --> readonly
45  // m_sourceCoraPtr=corasvc.openDatabase(m_database,true);// true --> readonly
46  //std::cout << "....database connections open OK" << std::endl;
47  return true;
48  }
49  catch (std::exception&e) {
50  m_logger << Root::kERROR << "Problem opening CORAL database: " << e.what() << Root::GEndl;
51  return false;
52  }
53  // std::cout << "Done the database opening" << std::endl;
54 
55  // list the COOL folders found in the database
56 
57 // const std::vector<std::string>& folders=m_sourceDbPtr->listAllNodes();
58 // std::cout << "COOL database has " << folders.size() << " folders defined"
59 // << std::endl;
60 // for (std::vector<std::string>::const_iterator itr=folders.begin();
61 // itr!=folders.end();++itr) std::cout << *itr << std::endl;
62 
63  return false;
64 
65 }

◆ printHLTTriggers()

void CoolQuery::printHLTTriggers ( const std::string &  folder_name)

Definition at line 235 of file CoolQuery.cxx.

235  {
236 
237  m_logger << Root::kINFO << "Listing available triggers [triggername(prescale, chanid)]: " << Root::GEndl;
238 
239  cool::IFolderPtr folder_ptr = m_sourceDbPtr->getFolder(folder_name);
240  cool::IObjectIteratorPtr obj_itr2=folder_ptr->browseObjects(m_VKstart,m_VKstart, cool::ChannelSelection::all());
241  while (obj_itr2->goToNext()){
242  const cool::IRecord& payload2=obj_itr2->currentRef().payload();
243  // m_logger << Root::kINFO << payload2["ChainName"].data<std::string>() << ", ";
244  m_logger << Root::kINFO << payload2["ChainName"].data<std::string>() << "(" << payload2["Prescale"].data<cool::Float>() << ", " << payload2["ChainCounter"].data<cool::UInt32>() << "), ";
245  }
247 }

◆ printL1Triggers()

void CoolQuery::printL1Triggers ( const std::string &  folder_name)

Definition at line 221 of file CoolQuery.cxx.

221  {
222 
223  m_logger << Root::kINFO << "Listing available triggers [triggername(prescale, chanid)]: " << Root::GEndl;
224 
225  cool::IFolderPtr folder_ptr = m_sourceDbPtr->getFolder(folder_name);
226  cool::IObjectIteratorPtr obj_itr=folder_ptr->browseObjects(m_VKstart,m_VKstart, cool::ChannelSelection::all());
227  while (obj_itr->goToNext()){
228  const cool::IRecord& payload=obj_itr->currentRef().payload();
229  m_logger << Root::kINFO << payload["ItemName"].data<std::string>() << "(" << this->getL1PrescaleFromChannelId("/TRIGGER/LVL1/Prescales",this->getL1ChannelId(payload["ItemName"].data<std::string>(), folder_name)) << ", " << obj_itr->currentRef().channelId() << "), ";
230  }
232 }

◆ setDb()

void CoolQuery::setDb ( const std::string &  database)
inline

Definition at line 232 of file CoolQuery.h.

◆ setIOV()

void CoolQuery::setIOV ( const cool::ValidityKey  start,
const cool::ValidityKey  stop 
)

Definition at line 96 of file CoolQuery.cxx.

96  {
97  m_VKstart = start;
98  m_VKstop = stop;
99 }

◆ setIOVForRun()

void CoolQuery::setIOVForRun ( unsigned int  runnum)

Definition at line 101 of file CoolQuery.cxx.

101  {
102  cool::ValidityKey run = runnum;
103  m_VKstart = (run << 32);
104  m_VKstop = ((run+1) << 32) - 1;
105 }

◆ setTrigger()

void CoolQuery::setTrigger ( const std::string &  triggerchain)
inline

Definition at line 235 of file CoolQuery.h.

◆ transConn()

std::string CoolQuery::transConn ( const std::string &  inconn)
private

Definition at line 68 of file CoolQuery.cxx.

68  {
69  // translate simple connection string (no slash) to mycool.db with given
70  // instance name, all others are left alone
71  if (inconn.find('/')==std::string::npos) {
72  return "sqlite://X;schema=mycool.db;dbname="+inconn;
73  } else {
74  return inconn;
75  }
76 }

Member Data Documentation

◆ m_coralsvc

coral::ConnectionService CoolQuery::m_coralsvc
private

Definition at line 326 of file CoolQuery.h.

◆ m_database

std::string CoolQuery::m_database
private

Definition at line 329 of file CoolQuery.h.

◆ m_logger

Root::TMsgLogger CoolQuery::m_logger
private

Definition at line 334 of file CoolQuery.h.

◆ m_repsort

ReplicaSorter* CoolQuery::m_repsort
private

Definition at line 327 of file CoolQuery.h.

◆ m_sourceDbPtr

cool::IDatabasePtr CoolQuery::m_sourceDbPtr
private

Definition at line 328 of file CoolQuery.h.

◆ m_triggerchain

std::string CoolQuery::m_triggerchain
private

Definition at line 330 of file CoolQuery.h.

◆ m_valid

bool CoolQuery::m_valid
private

Definition at line 336 of file CoolQuery.h.

◆ m_VKstart

cool::ValidityKey CoolQuery::m_VKstart
private

Definition at line 331 of file CoolQuery.h.

◆ m_VKstop

cool::ValidityKey CoolQuery::m_VKstop
private

Definition at line 332 of file CoolQuery.h.


The documentation for this class was generated from the following files:
CoolQuery::m_logger
Root::TMsgLogger m_logger
Definition: CoolQuery.h:334
python.utils.AtlRunQueryDQUtils.runnum
runnum
Definition: AtlRunQueryDQUtils.py:214
AllowedVariables::e
e
Definition: AsgElectronSelectorTool.cxx:37
CoolQuery::m_database
std::string m_database
Definition: CoolQuery.h:329
CoolQuery::m_triggerchain
std::string m_triggerchain
Definition: CoolQuery.h:330
Root::kWARNING
@ kWARNING
Definition: TMsgLogger.h:51
IOVRange
Validity Range object. Holds two IOVTimes (start and stop)
Definition: IOVRange.h:30
CoolQuery::m_VKstop
cool::ValidityKey m_VKstop
Definition: CoolQuery.h:332
IOVData
Definition: CoolQuery.h:54
mergePhysValFiles.start
start
Definition: DataQuality/DataQualityUtils/scripts/mergePhysValFiles.py:14
CoolQuery::getL1PrescaleFromChannelId
cool::Int32 getL1PrescaleFromChannelId(const std::string &folder_name, const cool::ChannelId &id)
Definition: CoolQuery.cxx:107
Root::kERROR
@ kERROR
Definition: TMsgLogger.h:52
PixelModuleFeMask_create_db.stop
int stop
Definition: PixelModuleFeMask_create_db.py:76
GEndl
#define GEndl
Definition: TMsgLogger.h:151
dq_defect_copy_defect_database.since
def since
Definition: dq_defect_copy_defect_database.py:54
dq_defect_copy_defect_database.until
def until
Definition: dq_defect_copy_defect_database.py:55
IOVTime
Basic time unit for IOVSvc. Hold time as a combination of run and event numbers.
Definition: IOVTime.h:33
CoolQuery::m_coralsvc
coral::ConnectionService m_coralsvc
Definition: CoolQuery.h:326
python.subdetectors.mmg.database
database
Definition: mmg.py:6
Root::kINFO
@ kINFO
Definition: TMsgLogger.h:50
calibdata.exception
exception
Definition: calibdata.py:496
plotBeamSpotVxVal.range
range
Definition: plotBeamSpotVxVal.py:195
CoolQuery::m_valid
bool m_valid
Definition: CoolQuery.h:336
IOVData::add
void add(IOVRange range, T val)
Definition: CoolQuery.h:92
run
Definition: run.py:1
Cut::all
@ all
Definition: SUSYToolsAlg.cxx:67
PixelModuleFeMask_create_db.payload
string payload
Definition: PixelModuleFeMask_create_db.py:69
CoolQuery::m_sourceDbPtr
cool::IDatabasePtr m_sourceDbPtr
Definition: CoolQuery.h:328
CondAlgsOpts.found
int found
Definition: CondAlgsOpts.py:101
CoolQuery::m_repsort
ReplicaSorter * m_repsort
Definition: CoolQuery.h:327
CaloCondBlobAlgs_fillNoiseFromASCII.tag
string tag
Definition: CaloCondBlobAlgs_fillNoiseFromASCII.py:24
CoolQuery::m_VKstart
cool::ValidityKey m_VKstart
Definition: CoolQuery.h:331
ReplicaSorter
Definition: Database/CoolConvUtilities/src/ReplicaSorter.h:12
TSU::T
unsigned long long T
Definition: L1TopoDataTypes.h:35
CoolQuery::getL1ChannelId
cool::ChannelId getL1ChannelId(const std::string &trigger, const std::string &folder_name)
Definition: CoolQuery.cxx:139