ATLAS Offline Software
Public Member Functions | Public Attributes | List of all members
python.checkMetadata.ValidateMetadataAlg Class Reference
Inheritance diagram for python.checkMetadata.ValidateMetadataAlg:
Collaboration diagram for python.checkMetadata.ValidateMetadataAlg:

Public Member Functions

def __init__ (self, name="ValidateMetadataAlg", metadata=None)
 
def initialize (self)
 
def execute (self)
 
def finalize (self)
 

Public Attributes

 events
 
 Event
 
 metadata
 
 sg
 

Detailed Description

Definition at line 17 of file checkMetadata.py.

Constructor & Destructor Documentation

◆ __init__()

def python.checkMetadata.ValidateMetadataAlg.__init__ (   self,
  name = "ValidateMetadataAlg",
  metadata = None 
)

Definition at line 18 of file checkMetadata.py.

18  def __init__(self, name="ValidateMetadataAlg", metadata=None):
19  super(ValidateMetadataAlg, self).__init__(name=name)
20  self.events = set()
21  self.Event = namedtuple("Event", ["runNumber", "lumiBlock", "eventNumber"])
22  if metadata:
23  self.metadata = metadata
24  else:
25  self.metadata = defaultdict(list)
26  return
27 

Member Function Documentation

◆ execute()

def python.checkMetadata.ValidateMetadataAlg.execute (   self)

Definition at line 32 of file checkMetadata.py.

32  def execute(self):
33  # Read the event info and check the uniqueness of run/lb/evtnumber
34  if self.sg.contains("xAOD::EventInfo", "EventInfo"):
35  ei = self.sg.retrieve("xAOD::EventInfo", "EventInfo")
36  event = self.Event(
37  runNumber=ei.runNumber(),
38  lumiBlock=ei.lumiBlock(),
39  eventNumber=ei.eventNumber(),
40  )
41  if event in self.events:
42  logging.error("Event Data Validation FAILED!")
43  return StatusCode.Failure
44  else:
45  self.events.add(event)
46  else:
47  logging.error("Could NOT find xAOD::EventInfo!")
48  return StatusCode.Failure
49 
50  return StatusCode.Success
51 

◆ finalize()

def python.checkMetadata.ValidateMetadataAlg.finalize (   self)

Definition at line 52 of file checkMetadata.py.

52  def finalize(self):
53  if set([event.runNumber for event in self.events]) != set(
54  self.metadata["runNumbers"]
55  ) or set([event.lumiBlock for event in self.events]) != set(
56  self.metadata["lumiBlocks"]
57  ):
58  return StatusCode.Failure
59  return StatusCode.Success
60 
61 

◆ initialize()

def python.checkMetadata.ValidateMetadataAlg.initialize (   self)

Definition at line 28 of file checkMetadata.py.

28  def initialize(self):
29  self.sg = py_svc("StoreGateSvc")
30  return StatusCode.Success
31 

Member Data Documentation

◆ Event

python.checkMetadata.ValidateMetadataAlg.Event

Definition at line 21 of file checkMetadata.py.

◆ events

python.checkMetadata.ValidateMetadataAlg.events

Definition at line 20 of file checkMetadata.py.

◆ metadata

python.checkMetadata.ValidateMetadataAlg.metadata

Definition at line 23 of file checkMetadata.py.

◆ sg

python.checkMetadata.ValidateMetadataAlg.sg

Definition at line 29 of file checkMetadata.py.


The documentation for this class was generated from the following file:
python.PyKernel.retrieve
def retrieve(aClass, aKey=None)
Definition: PyKernel.py:110
python.tests.PyTestsLib.finalize
def finalize(self)
_info( "content of StoreGate..." ) self.sg.dump()
Definition: PyTestsLib.py:50
initialize
void initialize()
Definition: run_EoverP.cxx:894
LArG4FSStartPointFilterLegacy.execute
execute
Definition: LArG4FSStartPointFilterLegacy.py:20
python.Bindings.py_svc
def py_svc(svcName, createIf=True, iface=None)
Definition: Control/AthenaPython/python/Bindings.py:98
contains
bool contains(const std::string &s, const std::string &regx)
does a string contain the substring
Definition: hcg.cxx:111
add
bool add(const std::string &hname, TKey *tobj)
Definition: fastadd.cxx:55
CxxUtils::set
constexpr std::enable_if_t< is_bitmask_v< E >, E & > set(E &lhs, E rhs)
Convenience function to set bits in a class enum bitmask.
Definition: bitmask.h:232
python.processes.powheg.ZZ.ZZ.__init__
def __init__(self, base_directory, **kwargs)
Constructor: all process options are set here.
Definition: ZZ.py:18