ATLAS Offline Software
Public Member Functions | Public Attributes | List of all members
xAODRootTest.Analysis Class Reference
Collaboration diagram for xAODRootTest.Analysis:

Public Member Functions

def __init__ (self, ifname, ofname=None, is_rntuple=False)
 
def add (self, alg)
 
def run (self, n=None)
 
def finalize (self)
 

Public Attributes

 algs
 
 event
 
 f
 
 fout
 

Detailed Description

Definition at line 383 of file xAODRootTest.py.

Constructor & Destructor Documentation

◆ __init__()

def xAODRootTest.Analysis.__init__ (   self,
  ifname,
  ofname = None,
  is_rntuple = False 
)

Definition at line 384 of file xAODRootTest.py.

384  def __init__ (self, ifname, ofname = None, is_rntuple = False):
385  self.algs = []
386  if is_rntuple:
387  from xAODRootAccess.RPyEvent import RPyEvent
388  self.event = RPyEvent()
389  CHECK (self.event.readFrom (ifname))
390  else:
391  from xAODRootAccess.TPyEvent import TPyEvent
392  self.f = ROOT.TFile (ifname)
393  self.event = TPyEvent (TPyEvent.kAthenaAccess)
394  CHECK (self.event.readFrom (self.f, True, 'CollectionTree'))
395  self.fout = None
396  if ofname:
397  self.fout = ROOT.TFile.Open (ofname, 'recreate')
398  CHECK (self.event.writeTo (self.fout))
399  return
400 

Member Function Documentation

◆ add()

def xAODRootTest.Analysis.add (   self,
  alg 
)

Definition at line 401 of file xAODRootTest.py.

401  def add (self, alg):
402  self.algs.append (alg)
403  return
404 

◆ finalize()

def xAODRootTest.Analysis.finalize (   self)

Definition at line 418 of file xAODRootTest.py.

418  def finalize (self):
419  if self.fout:
420  CHECK (self.event.finishWritingTo (self.fout))
421  return
422 
423 

◆ run()

def xAODRootTest.Analysis.run (   self,
  n = None 
)

Definition at line 405 of file xAODRootTest.py.

405  def run (self, n=None):
406  nent = self.event.getEntries()
407  if n != None:
408  nent = min (n, nent)
409  for i in range(nent):
410  self.event.getEntry(i)
411  print ('---> Event', i)
412  for a in self.algs:
413  a.execute (self.event)
414  if self.fout != None:
415  self.event.fill()
416  return
417 

Member Data Documentation

◆ algs

xAODRootTest.Analysis.algs

Definition at line 385 of file xAODRootTest.py.

◆ event

xAODRootTest.Analysis.event

Definition at line 388 of file xAODRootTest.py.

◆ f

xAODRootTest.Analysis.f

Definition at line 392 of file xAODRootTest.py.

◆ fout

xAODRootTest.Analysis.fout

Definition at line 395 of file xAODRootTest.py.


The documentation for this class was generated from the following file:
python.tests.PyTestsLib.finalize
def finalize(self)
_info( "content of StoreGate..." ) self.sg.dump()
Definition: PyTestsLib.py:50
run
int run(int argc, char *argv[])
Definition: ttree2hdf5.cxx:28
python.processes.powheg.ZZj_MiNNLO.ZZj_MiNNLO.__init__
def __init__(self, base_directory, **kwargs)
Constructor: all process options are set here.
Definition: ZZj_MiNNLO.py:18
plotBeamSpotVxVal.range
range
Definition: plotBeamSpotVxVal.py:194
add
bool add(const std::string &hname, TKey *tobj)
Definition: fastadd.cxx:55
lumiFormat.fill
fill
Definition: lumiFormat.py:104