This repository has been archived by the owner on Jan 30, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 20
/
ATLASEventService.py
54 lines (39 loc) · 1.78 KB
/
ATLASEventService.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
# Class definition:
# ATLASEventService
# This class is inheriting from the main Event Service class
# Instances are generated with ExperimentFactory via pUtil::getEventService()
# Implemented as a singleton class
# http://stackoverflow.com/questions/42558/python-and-the-singleton-pattern
# PanDA Pilot modules
from EventService import EventService
from PilotErrors import PilotErrors
from pUtil import tolog # Dump to pilot log
from pUtil import readpar # Used to read values from the schedconfig DB (queuedata)
# Standard python modules
import os
import re
import commands
class ATLASEventService(EventService):
# private data members
__experiment = "ATLAS" # String defining the experiment
__instance = None # Boolean used by subclasses to become a Singleton
__error = PilotErrors() # PilotErrors object
def __init__(self):
""" Default initialization """
# e.g. self.__errorLabel = errorLabel
pass
def __new__(cls, *args, **kwargs):
""" Override the __new__ method to make the class a singleton """
if not cls.__instance:
cls.__instance = super(ATLASEventService, cls).__new__(cls, *args, **kwargs)
return cls.__instance
def getEventService(self):
""" Return a string with the experiment name """
return self.__experiment
def processEvents(self):
""" Process events from Event Server """
# In development: the idea is that the pilot will not process events from staged-in input files,
# but download events from an Event Server and then process them.
# This method is used to process events downloaded from an Event Server
import time
time.sleep(4)