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 12 of file TTreeHelper.py.

Constructor & Destructor Documentation

◆ __init__()

def TTreeHelper.TTreeSelector.__init__ (   self,
args 
)

Definition at line 14 of file TTreeHelper.py.

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

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 26 of file TTreeHelper.py.

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

Member Data Documentation

◆ entries

TTreeHelper.TTreeSelector.entries

Definition at line 23 of file TTreeHelper.py.

◆ file

TTreeHelper.TTreeSelector.file

Definition at line 18 of file TTreeHelper.py.

◆ hashlist

TTreeHelper.TTreeSelector.hashlist

Definition at line 22 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:181
plotBeamSpotVxVal.range
range
Definition: plotBeamSpotVxVal.py:194
python.processes.powheg.ZZ.ZZ.__init__
def __init__(self, base_directory, **kwargs)
Constructor: all process options are set here.
Definition: ZZ.py:18