Belle II Software development
add_event_limit.py
1#!/usr/bin/env python
2# -*- coding: utf-8 -*-
3
4
11
12"""
13Create the payload with an object of EventLimit class for use in EventLimiter
14module. The payload interval of validity is set equal to the specified experiment
15and run; payload file is created in localdb directory.
16"""
17
18from ROOT import Belle2
19import argparse
20
21parser = argparse.ArgumentParser(description=__doc__)
22parser.add_argument('exp', type=int, help='Experiment number')
23parser.add_argument('run', type=int, help='Run number')
24parser.add_argument('limit', type=int, help='Event limit')
25args = parser.parse_args()
26
27DBOBJECT_NAME = 'EventLimit'
28
29# Payload creation code
30payload = Belle2.EventLimit(args.limit)
31
33iov = Belle2.IntervalOfValidity(args.exp, args.run, args.exp, args.run)
34db.storeData(DBOBJECT_NAME, payload, iov)
This dataobject is used by EventLimiter module to set event limit based on the value from the databas...
Definition: EventLimit.h:25
A class that describes the interval of experiments/runs for which an object in the database is valid.
static Database & Instance()
Instance of a singleton Database.
Definition: Database.cc:41