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

Public Member Functions

def __init__ (self, *args)
 
def loadTrees (self, arg)
 

Public Attributes

 file
 
 hashlist
 
 entries
 

Detailed Description

TreePlotter helper class in python

Definition at line 13 of file TTreeHelper.py.

Constructor & Destructor Documentation

◆ __init__()

def TTreeHelper.TTreeSelector.__init__ (   self,
args 
)

Definition at line 15 of file TTreeHelper.py.

15  def __init__(self, *args):
16  super(TTreeSelector, self).__init__()
17  # open the file
18  try :
19  self.file = TFile.Open(args[0])
20  except IndexError :
21  print ('[!] You need to specify a file name in the argument list')
22  # get the hashlist and entries
23  self.hashlist = self.file.GetListOfKeys()
24  self.entries = self.hashlist.GetEntries()
25  print ('[>] File [',args[0],'] sucessfully loaded')
26 

Member Function Documentation

◆ loadTrees()

def TTreeHelper.TTreeSelector.loadTrees (   self,
  arg 
)
load Trees method: loads trees that match one of the arguments in name

Definition at line 27 of file TTreeHelper.py.

27  def loadTrees(self, arg):
28  """load Trees method: loads trees that match one of the arguments in name"""
29  treedict = {}
30  for itree in range(0,self.entries):
31  treename = self.hashlist.At(itree).GetName()
32  if treename.find(arg) >= 0 :
33  tree = self.file.Get(treename)
34  treedict[treename] = tree
35  print ('[>] ',len(treedict),'Trees loaded matching the selection:', arg)
36  return treedict

Member Data Documentation

◆ entries

TTreeHelper.TTreeSelector.entries

Definition at line 24 of file TTreeHelper.py.

◆ file

TTreeHelper.TTreeSelector.file

Definition at line 19 of file TTreeHelper.py.

◆ hashlist

TTreeHelper.TTreeSelector.hashlist

Definition at line 23 of file TTreeHelper.py.


The documentation for this class was generated from the following file:
GetEntries
TGraphErrors * GetEntries(TH2F *histo)
Definition: TRTCalib_makeplots.cxx:4019
Get
T * Get(TFile &f, const std::string &n, const std::string &dir="", const chainmap_t *chainmap=0, std::vector< std::string > *saved=0)
get a histogram given a path, and an optional initial directory if histogram is not found,...
Definition: comparitor.cxx:179
plotBeamSpotVxVal.range
range
Definition: plotBeamSpotVxVal.py:195
python.processes.powheg.ZZ.ZZ.__init__
def __init__(self, base_directory, **kwargs)
Constructor: all process options are set here.
Definition: ZZ.py:18