CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
EcalCondDBInterface.h
Go to the documentation of this file.
1 /***********************************************/
2 /* EcalCondDBInterface.h */
3 /* */
4 /* $Id: EcalCondDBInterface.h,v 1.32 2010/12/21 16:56:16 organtin Exp $ */
5 /* */
6 /* Interface to the Ecal Conditions DB. */
7 /***********************************************/
8 
9 #ifndef ECALCONDDBINTERFACE_HH
10 #define ECALCONDDBINTERFACE_HH
11 
12 #include <iostream>
13 #include <string>
14 #include <vector>
15 #include <map>
16 #include <stdexcept>
18 
19 
35 
37  public:
38 
39  /******************\
40  - public methods -
41  \******************/
42 
52  EcalCondDBInterface( std::string host,
53  std::string sid,
54  std::string user,
55  std::string pass,
56  int port=1521 )
57  : EcalDBConnection( host, sid, user, pass, port )
58  {
59  // call the parent constructor
60 
61  // create a DateHandler
62  dh = new DateHandler(env, conn);
63  }
64 
65 
66 
74  EcalCondDBInterface( std::string sid,
75  std::string user,
76  std::string pass )
77  : EcalDBConnection( sid, user, pass )
78  {
79  // call the parent constructor
80 
81  // create a DateHandler
82  dh = new DateHandler(env, conn);
83  }
84 
85 
90  throw(std::runtime_error)
91  {
92  // call the parent destructor
93 
94  // destroy the DateHandler
95  delete(dh);
96  }
97 
98 
99 
104  {
105  return dh;
106  }
107 
108 
117  EcalLogicID getEcalLogicID( std::string name,
118  int id1 = EcalLogicID::NULLID,
119  int id2 = EcalLogicID::NULLID,
120  int id3 = EcalLogicID::NULLID,
121  std::string mapsTo = "" )
122  throw(std::runtime_error);
123 
130  EcalLogicID getEcalLogicID( int logicID )
131  throw(std::runtime_error);
132 
142  std::vector<EcalLogicID> getEcalLogicIDSet( std::string name,
143  int fromId1 = EcalLogicID::NULLID, int toId1 = EcalLogicID::NULLID,
144  int fromId2 = EcalLogicID::NULLID, int toId2 = EcalLogicID::NULLID,
145  int fromId3 = EcalLogicID::NULLID, int toId3 = EcalLogicID::NULLID,
146  std::string mapsTo = "" )
147  throw(std::runtime_error);
148 
149  std::map<int, int> getEcalLogicID2LmrMap();
150  std::vector<EcalLogicID> getEcalLogicIDSetOrdered( std::string name,
151  int fromId1, int toId1,
152  int fromId2 = EcalLogicID::NULLID, int toId2 = EcalLogicID::NULLID,
153  int fromId3 = EcalLogicID::NULLID, int toId3 = EcalLogicID::NULLID,
154  std::string mapsTo = "", int orderedBy= EcalLogicID::NULLID ) throw(std::runtime_error);
155 
156 
160  void insertRunIOV(RunIOV* iov)
161  throw(std::runtime_error);
162  // updates the end time of an iov
163  void updateRunIOV(RunIOV* iov)
164  throw(std::runtime_error);
166  throw(std::runtime_error);
168  throw(std::runtime_error);
169 
170  void updateRunConfig(ODRunConfigInfo* od) throw(std::runtime_error);
171 
172  void insertLmfIOV(LMFIOV* iov)
173  throw(std::runtime_error);
175  throw(std::runtime_error);
176  void insertLmfSeq(LMFSeqDat* iov)
177  throw(std::runtime_error);
179  throw(std::runtime_error);
180  void insertLmfDat(LMFDat* dat)
181  throw(std::runtime_error);
182  void insertLmfDat(std::list<LMFDat*> dat)
183  throw(std::runtime_error);
184 
189  throw(std::runtime_error);
190 
191 
192 
198  RunIOV fetchRunIOV(std::string location, run_t run)
199  throw(std::runtime_error);
200 
201 
202 
207  throw(std::runtime_error);
208 
209 
213  void insertDCUIOV(DCUIOV* iov)
214  throw(std::runtime_error);
215 
216 
220  MonRunIOV fetchMonRunIOV(RunTag* runtag, MonRunTag* montag, run_t run, subrun_t monrun)
221  throw(std::runtime_error);
222 
223 
227  DCUIOV fetchDCUIOV(DCUTag* tag, Tm evenTm)
228  throw(std::runtime_error);
229 
230 
231 
235  LMFRunIOV fetchLMFRunIOV(RunTag* runtag, LMFRunTag* lmftag, run_t run, subrun_t lmfrun)
236  throw(std::runtime_error);
237  bool fetchLMFRunIOV(const LMFSeqDat&, LMFRunIOV&, int lmr, int type,
238  int color) const;
239  RunIOV fetchLMFLastRun() const;
240 
244  CaliIOV fetchCaliIOV(CaliTag* tag, Tm evenTm)
245  throw(std::runtime_error);
246 
247 
251  RunList fetchRunList(RunTag tag) throw(std::runtime_error);
252  RunList fetchRunList(RunTag tag, int min_run, int max_run) throw(std::runtime_error);
253  RunList fetchRunListByLocation(RunTag tag, int min_run, int max_run , const LocationDef locDef) throw(std::runtime_error);
254  RunList fetchGlobalRunListByLocation(RunTag tag, int min_run, int max_run , const LocationDef locDef) throw(std::runtime_error);
255  RunList fetchRunListLastNRuns(RunTag tag, int max_run, int n_runs) throw(std::runtime_error);
256 
261  DCSPTMTempList fetchDCSPTMTempList(EcalLogicID ecid) throw(std::runtime_error);
262  DCSPTMTempList fetchDCSPTMTempList(EcalLogicID ecid, Tm start, Tm end) throw(std::runtime_error);
263 
264  MonRunList fetchMonRunList(RunTag tag, MonRunTag monruntag) throw(std::runtime_error);
265  MonRunList fetchMonRunList(RunTag tag, MonRunTag monruntag,int min_run, int max_run) throw(std::runtime_error);
266  MonRunList fetchMonRunListLastNRuns(RunTag tag, MonRunTag monruntag, int max_run, int n_runs) throw(std::runtime_error);
267 
268 
269 
270 
271  /*
272  * Insert a set of data at the given iov. If the iov does not yet
273  * exist in the database they will be written. Nothing is committed in the the event of
274  * an exception
275  */
276  // XXX TODO: Split declaration and definition using a macro
277  // XXX Naive method causes linker errors...
278  // XXX See example FWCore/Framework/interface/eventSetupGetImplementation.h
279 
280  template<class DATT, class IOVT>
281  void insertDataSet(const std::map< EcalLogicID, DATT >* data, IOVT* iov)
282  throw(std::runtime_error)
283  {
284  try {
285  iov->setConnection(env, conn);
286  // if it has not yet been written then write
287  if(iov->getID()==0){
288  std::cout<<"IOV was not set we retrieve it from DB"<<std::endl;
289  iov->fetchID();
290  }
291  if(iov->getID()==0){
292  std::cout<<"IOV was not written we write it"<<std::endl;
293  iov->writeDB();
294  }
295 
296  DATT dataIface;
297  dataIface.setConnection(env, conn);
298  dataIface.prepareWrite();
299 
300  const EcalLogicID* channel;
301  const DATT* dataitem;
302  typedef typename std::map< EcalLogicID, DATT >::const_iterator CI;
303  for (CI p = data->begin(); p != data->end(); ++p) {
304  channel = &(p->first);
305  dataitem = &(p->second);
306  dataIface.writeDB( channel, dataitem, iov);
307  }
308  conn->commit();
309  dataIface.terminateWriteStatement();
310  } catch (std::runtime_error &e) {
311  conn->rollback();
312  throw(e);
313  } catch (...) {
314  conn->rollback();
315  throw(std::runtime_error("EcalCondDBInterface::insertDataSet: Unknown exception caught"));
316  }
317  }
318 
319  //test for DB Array insertion
320  template<class DATT, class IOVT>
321  void insertDataArraySet(const std::map< EcalLogicID, DATT >* data, IOVT* iov)
322  throw(std::runtime_error)
323  {
324  try {
325  iov->setConnection(env, conn);
326  if(iov->getID()==0){
327  std::cout<<"IOV was not set we retrieve it from DB"<<std::endl;
328  iov->fetchID();
329  }
330  if(iov->getID()==0){
331  std::cout<<"IOV was not written we write it"<<std::endl;
332  iov->writeDB();
333  }
334 
335  std::cout<<"id="<<iov->getID()<<std::endl;
336 
337  DATT dataIface;
338  dataIface.setConnection(env, conn);
339  dataIface.prepareWrite();
340 
341  dataIface.writeArrayDB(data, iov);
342  conn->commit();
343 
344  dataIface.terminateWriteStatement();
345 
346  } catch (std::runtime_error &e) {
347  conn->rollback();
348  throw(e);
349  } catch (...) {
350  conn->rollback();
351  throw(std::runtime_error("EcalCondDBInterface::insertDataSet: Unknown exception caught"));
352  }
353  }
354 
355  template<class DATT, class IOVT>
356  void insertDataSetVector( std::vector<EcalLogicID> ecid, std::vector<IOVT> run_iov, std::vector<DATT> data )
357  throw(std::runtime_error)
358  {
359 
360  int nruns= run_iov.size();
361 
362  if(run_iov.size()!=ecid.size() &&ecid.size()!=data.size()){
363  throw(std::runtime_error("EcalCondDBInterface::insertDataSetVector: vector sizes are different.."));
364  }
365 
366 
367  try {
368 
369  DATT dataIface;
370  dataIface.setConnection(env, conn);
371  dataIface.prepareWrite();
372 
373  for (int i=0; i<nruns; i++){
374 
375  run_iov[i].setConnection(env, conn);
376  run_iov[i].writeDB();
377 
378  dataIface.writeDB( &ecid[i], &data[i], &run_iov[i]);
379 
380  conn->commit();
381  }
382  } catch (std::runtime_error &e) {
383  conn->rollback();
384  throw(e);
385  } catch (...) {
386  conn->rollback();
387  throw(std::runtime_error("EcalCondDBInterface::insertDataSet: Unknown exception caught"));
388  }
389  }
390 
391 
392 
393 
394 
395  // CONFIG DB methods
396 
397  template<class ICONF >
398  void insertConfigSet( ICONF* iconf)
399  throw(std::runtime_error)
400  {
401  try {
402  iconf->setConnection(env, conn);
403  iconf->prepareWrite();
404  // if it has not yet been written then write
405  iconf->writeDB();
406  std::cout<< "iconf inserted with ID="<<iconf->getId()<<std::endl;
407  conn->commit();
408  iconf->terminateWriteStatement();
409  } catch (std::runtime_error &e) {
410  conn->rollback();
411  throw(e);
412  } catch (...) {
413  conn->rollback();
414  throw(std::runtime_error("EcalCondDBInterface::insertDataSet: Unknown exception caught"));
415  }
416  }
417 
418  /*
419  * Fetch a config set
420  */
421  template<class ICONF>
422  void fetchConfigSet( ICONF* iconf)
423  throw(std::runtime_error)
424  {
425 
426  iconf->clear();
427  iconf->setConnection(env, conn);
428  iconf->createReadStatement();
429  iconf->fetchData(iconf);
430  iconf->terminateReadStatement();
431 
432  }
433 
434  /*
435  * Fetch a config set
436  */
437  template<class ICONF>
438  void fetchLastConfigSet( ICONF* iconf)
439  throw(std::runtime_error)
440  {
441 
442  iconf->clear();
443  iconf->setConnection(env, conn);
444  iconf->createReadStatement();
445  iconf->fetchLastData(iconf);
446  iconf->terminateReadStatement();
447 
448  }
449 
450 
451 
452  /*
453  * Insert a config data set
454  */
455  template<class DATT, class ICONF>
456  void insertConfigDataSet(const std::vector< DATT > data, ICONF* iconf)
457  throw(std::runtime_error)
458  {
459  try {
460  iconf->setConnection(env, conn);
461  // if it has not yet been written then write
462  if(iconf->getId()==0){
463  std::cout<<"EcalCondDBInterface>> config_id was not set we retrieve it from DB"<<std::endl;
464  iconf->fetchID();
465  }
466  if(iconf->getId()==0){
467  std::cout<<"EcalCondDBInterface>> configuration info was not written we write it"<<std::endl;
468  iconf->writeDB();
469  }
470 
471  DATT dataIface;
472  dataIface.setConnection(env, conn);
473  dataIface.prepareWrite();
474 
475  const DATT* dataitem;
476 
477  for (int p = 0; p != data->size(); ++p) {
478  dataitem = data[p];
479  dataIface.writeDB( dataitem, iconf);
480  }
481  conn->commit();
482  dataIface.terminateWriteStatement();
483  } catch (std::runtime_error &e) {
484  conn->rollback();
485  throw(e);
486  } catch (...) {
487  conn->rollback();
488  throw(std::runtime_error("EcalCondDBInterface::insertConfigDataSet: Unknown exception caught"));
489  }
490  }
491  /*
492  * insert a config data set array fast
493  */
494  template<class DATT, class ICONF>
495  void insertConfigDataArraySet(const std::vector< DATT > data, ICONF* iconf)
496  throw(std::runtime_error)
497  {
498  try {
499  iconf->setConnection(env, conn);
500  // if it has not yet been written then write
501  if(iconf->getId()==0){
502  std::cout<<"EcalCondDBInterface>> config_id was not set we retrieve it from DB"<<std::endl;
503  iconf->fetchID();
504  }
505  if(iconf->getId()==0){
506  std::cout<<"EcalCondDBInterface>> configuration info was not written we write it"<<std::endl;
507  iconf->writeDB();
508  }
509 
510  DATT dataIface;
511  dataIface.setConnection(env, conn);
512  dataIface.prepareWrite();
513 
514  dataIface.writeArrayDB(data, iconf);
515  conn->commit();
516 
517  dataIface.terminateWriteStatement();
518 
519  } catch (std::runtime_error &e) {
520  conn->rollback();
521  throw(e);
522  } catch (...) {
523  conn->rollback();
524  throw(std::runtime_error("EcalCondDBInterface::insertConfigDataArraySet: Unknown exception caught"));
525  }
526  }
527  /*
528  * Fetch a set of data based on an EXACT match of an iov
529  */
530  template<class DATT, class ICONF>
531  void fetchConfigDataSet(std::vector< DATT >* fillMap, ICONF* iconf)
532  throw(std::runtime_error)
533  {
534 
535  DATT datiface;
536  datiface.setConnection(env, conn);
537  datiface.createReadStatement();
538  datiface.setPrefetchRowCount(1024);
539  datiface.fetchData( fillMap, iconf );
540  datiface.terminateReadStatement();
541 
542  }
543 
544 
545 
546 
547 
548 
549 
550  /*
551  * Fetch a set of data based on an EXACT match of an iov
552  */
553  template<class DATT, class IOVT>
554  void fetchDataSet(std::map< EcalLogicID, DATT >* fillMap, IOVT* iov)
555  throw(std::runtime_error)
556  {
557  fillMap->clear();
558 
559  DATT datiface;
560  datiface.setConnection(env, conn);
561  datiface.createReadStatement();
562  datiface.setPrefetchRowCount(1024);
563  datiface.fetchData( fillMap, iov );
564  datiface.terminateReadStatement();
565 
566  }
567 
568 
569 
570 
571  /*
572  * Fetch a set of DCS data based on time stamp
573  */
574  template<class DATT>
575  void fetchDCSDataSet(std::list< std::pair< Tm, std::map< EcalLogicID, DATT > > >* fillMap, Tm t)
576  throw(std::runtime_error)
577  {
578  fillMap->clear();
579 
580  DATT datiface;
581  datiface.setConnection(env, conn);
582  datiface.createReadStatement();
583  datiface.setPrefetchRowCount(1024);
584  datiface.fetchHistoricalData( fillMap, t );
585  datiface.terminateReadStatement();
586 
587  }
588 
589 
590 
591 
592 
593  /*
594  * Fetch a set of data based on an EXACT match of an iov
595  * with a specific mapping name
596  */
597  template<class DATT, class IOVT>
598  void fetchDataSetWithMap(std::map< EcalLogicID, DATT >* fillMap, IOVT* iov, std::string mapping_name )
599  throw(std::runtime_error)
600  {
601  fillMap->clear();
602 
603  DATT datiface;
604  datiface.setConnection(env, conn);
605  datiface.createReadStatement();
606  datiface.setPrefetchRowCount(1024);
607  datiface.fetchData( fillMap, iov , mapping_name);
608  datiface.terminateReadStatement();
609 
610  }
611 
612  /*
613  * Fetch dataset that is valid for the given RunTag and run.
614  * Also fills the given IOV object with the IOV associated with the data
615  * run is optional, by default is set to infinity
616  * Note: ONLY works for Run*Dat objects
617  * TODO: Make this function (or similar) work for all *Dat objects
618  */
619  template<class DATT, class IOVT>
620  void fetchValidDataSet(std::map< EcalLogicID, DATT >* fillMap,
621  IOVT* fillIOV,
622  RunTag* tag, run_t run = (unsigned int)-1)
623  throw(std::runtime_error)
624  {
625  fillMap->clear();
626  DATT datiface;
627  fillIOV->setConnection(env, conn);
628  fillIOV->setByRecentData(datiface.getTable(), tag, run);
629  datiface.setConnection(env, conn);
630  datiface.createReadStatement();
631  datiface.setPrefetchRowCount(1024);
632  datiface.fetchData( fillMap, fillIOV );
633  datiface.terminateReadStatement();
634  }
635 
636  /*
637  * Fetch dataset that is valid for the given location and run.
638  * Also fills the given IOV object with the IOV associated with the data
639  * run is optional, by default is set to infinity
640  * Note: ONLY works for Run*Dat objects
641  * TODO: Make this function (or similar) work for all *Dat objects
642  */
643  template<class DATT, class IOVT>
644  void fetchValidDataSet(std::map< EcalLogicID, DATT >* fillMap,
645  IOVT* fillIOV,
646  std::string location, run_t run = (unsigned int)-1)
647  throw(std::runtime_error)
648  {
649  fillMap->clear();
650  DATT datiface;
651  fillIOV->setConnection(env, conn);
652  fillIOV->setByRecentData(datiface.getTable(), location, run);
653  datiface.setConnection(env, conn);
654  datiface.createReadStatement();
655  datiface.setPrefetchRowCount(1024);
656  datiface.fetchData( fillMap, fillIOV );
657  datiface.terminateReadStatement();
658  }
659 
660 
661 
662 
663 
664  void dummy();
665 
666  private:
667 
668  /*********************\
669  - private variables -
670  \*********************/
671 
673 
676 
677 
678 };
679 
680 #endif
std::vector< EcalLogicID > getEcalLogicIDSet(std::string name, int fromId1=EcalLogicID::NULLID, int toId1=EcalLogicID::NULLID, int fromId2=EcalLogicID::NULLID, int toId2=EcalLogicID::NULLID, int fromId3=EcalLogicID::NULLID, int toId3=EcalLogicID::NULLID, std::string mapsTo="")
type
Definition: HCALResponse.h:22
int i
Definition: DBlmapReader.cc:9
int run_t
Definition: CaliIOV.h:11
void insertRunIOV(RunIOV *iov)
Definition: RunTag.h:13
void insertConfigSet(ICONF *iconf)
RunList fetchRunListByLocation(RunTag tag, int min_run, int max_run, const LocationDef locDef)
DCSPTMTempList fetchDCSPTMTempList(EcalLogicID ecid)
void fetchValidDataSet(std::map< EcalLogicID, DATT > *fillMap, IOVT *fillIOV, RunTag *tag, run_t run=(unsigned int)-1)
void insertLmfDat(LMFDat *dat)
oracle::occi::Environment * env
RunIOV fetchRunIOV(RunTag *tag, run_t run)
void insertDataSetVector(std::vector< EcalLogicID > ecid, std::vector< IOVT > run_iov, std::vector< DATT > data)
void updateRunIOVStartTime(RunIOV *iov)
void insertLmfSeq(LMFSeqDat *iov)
Definition: DCUIOV.h:13
EcalCondDBInterface(std::string host, std::string sid, std::string user, std::string pass, int port=1521)
DCUIOV fetchDCUIOV(DCUTag *tag, Tm evenTm)
LMFRunIOV fetchLMFRunIOV(RunTag *runtag, LMFRunTag *lmftag, run_t run, subrun_t lmfrun)
dictionary map
Definition: Association.py:160
std::vector< EcalLogicID > getEcalLogicIDSetOrdered(std::string name, int fromId1, int toId1, int fromId2=EcalLogicID::NULLID, int toId2=EcalLogicID::NULLID, int fromId3=EcalLogicID::NULLID, int toId3=EcalLogicID::NULLID, std::string mapsTo="", int orderedBy=EcalLogicID::NULLID)
void fetchLastConfigSet(ICONF *iconf)
void fetchConfigDataSet(std::vector< DATT > *fillMap, ICONF *iconf)
DateHandler * getDateHandler()
CaliIOV fetchCaliIOV(CaliTag *tag, Tm evenTm)
void insertConfigDataArraySet(const std::vector< DATT > data, ICONF *iconf)
oracle::occi::Connection * conn
RunList fetchGlobalRunListByLocation(RunTag tag, int min_run, int max_run, const LocationDef locDef)
tuple iov
Definition: o2o.py:307
EcalCondDBInterface(std::string sid, std::string user, std::string pass)
RunList fetchRunList(RunTag tag)
void fetchDataSet(std::map< EcalLogicID, DATT > *fillMap, IOVT *iov)
MonRunList fetchMonRunListLastNRuns(RunTag tag, MonRunTag monruntag, int max_run, int n_runs)
Definition: LMFDat.h:19
std::map< int, int > getEcalLogicID2LmrMap()
int subrun_t
Definition: MODRunIOV.h:11
EcalLogicID getEcalLogicID(std::string name, int id1=EcalLogicID::NULLID, int id2=EcalLogicID::NULLID, int id3=EcalLogicID::NULLID, std::string mapsTo="")
RunIOV fetchLMFLastRun() const
void insertDCUIOV(DCUIOV *iov)
void insertConfigDataSet(const std::vector< DATT > data, ICONF *iconf)
#define end
Definition: vmac.h:38
void insertLmfRunIOV(LMFRunIOV *iov)
Definition: LMFIOV.h:17
void insertLmfIOV(LMFIOV *iov)
void updateRunConfig(ODRunConfigInfo *od)
MonRunList fetchMonRunList(RunTag tag, MonRunTag monruntag)
void fetchConfigSet(ICONF *iconf)
string const
Definition: compareJSON.py:14
void fetchDCSDataSet(std::list< std::pair< Tm, std::map< EcalLogicID, DATT > > > *fillMap, Tm t)
MonRunIOV fetchMonRunIOV(RunTag *runtag, MonRunTag *montag, run_t run, subrun_t monrun)
RunList fetchRunListLastNRuns(RunTag tag, int max_run, int n_runs)
void insertMonRunIOV(MonRunIOV *iov)
static const int NULLID
Definition: EcalLogicID.h:43
void insertDataArraySet(const std::map< EcalLogicID, DATT > *data, IOVT *iov)
tuple cout
Definition: gather_cfg.py:41
void insertDataSet(const std::map< EcalLogicID, DATT > *data, IOVT *iov)
void updateRunIOV(RunIOV *iov)
void updateRunIOVEndTime(RunIOV *iov)
void fillMap(Registry *reg, regmap_type &fillme)
Definition: Registry.cc:24
void fetchDataSetWithMap(std::map< EcalLogicID, DATT > *fillMap, IOVT *iov, std::string mapping_name)
Definition: RunIOV.h:13
void insertLmfLmrSubIOV(LMFLmrSubIOV *iov)
Definition: Tm.h:14
def template
Definition: svgfig.py:520
Definition: DCUTag.h:13
How EventSelector::AcceptEvent() decides whether to accept an event for output otherwise it is excluding the probing of A single or multiple positive and the trigger will pass if any such matching triggers are PASS or EXCEPTION[A criterion thatmatches no triggers at all is detected and causes a throw.] A single negative with an expectation of appropriate bit checking in the decision and the trigger will pass if any such matching triggers are FAIL or EXCEPTION A wildcarded negative criterion that matches more than one trigger in the trigger list("!*","!HLTx*"if it matches 2 triggers or more) will accept the event if all the matching triggers are FAIL.It will reject the event if any of the triggers are PASS or EXCEPTION(this matches the behavior of"!*"before the partial wildcard feature was incorporated).Triggers which are in the READY state are completely ignored.(READY should never be returned since the trigger paths have been run
void fetchValidDataSet(std::map< EcalLogicID, DATT > *fillMap, IOVT *fillIOV, std::string location, run_t run=(unsigned int)-1)