ATLAS Offline Software
Loading...
Searching...
No Matches
xAODRootTest.Analysis Class Reference
Collaboration diagram for xAODRootTest.Analysis:

Public Member Functions

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

Public Attributes

list algs = []
 event = RPyEvent()
 f = ROOT.TFile (ifname)
 fout = None

Detailed Description

Definition at line 383 of file xAODRootTest.py.

Constructor & Destructor Documentation

◆ __init__()

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()

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
bool add(const std::string &hname, TKey *tobj)
Definition fastadd.cxx:55

◆ finalize()

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()

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
Definition run.py:1
void fill(H5::Group &out_file, size_t iterations)

Member Data Documentation

◆ algs

list xAODRootTest.Analysis.algs = []

Definition at line 385 of file xAODRootTest.py.

◆ event

xAODRootTest.Analysis.event = RPyEvent()

Definition at line 388 of file xAODRootTest.py.

◆ f

xAODRootTest.Analysis.f = ROOT.TFile (ifname)

Definition at line 392 of file xAODRootTest.py.

◆ fout

xAODRootTest.Analysis.fout = None

Definition at line 395 of file xAODRootTest.py.


The documentation for this class was generated from the following file: