ATLAS Offline Software
Loading...
Searching...
No Matches
TTreeHelper.TTreeSelector Class Reference
Inheritance diagram for TTreeHelper.TTreeSelector:
Collaboration diagram for TTreeHelper.TTreeSelector:

Public Types

typedef HLT::TypeInformation::for_each_type_c< typenameEDMLIST::map, my_functor, my_result<>, my_arg< HLT::TypeInformation::get_cont, CONTAINER > >::type result

Public Member Functions

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

Public Attributes

 file = TFile.Open(args[0])
 hashlist = self.file.GetListOfKeys()
 entries = self.hashlist.GetEntries()

Detailed Description

TreePlotter helper class in python

Definition at line 12 of file TTreeHelper.py.

Member Typedef Documentation

◆ result

Definition at line 90 of file EDM_MasterSearch.h.

Constructor & Destructor Documentation

◆ __init__()

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
TGraphErrors * GetEntries(TH2F *histo)

Member Function Documentation

◆ loadTrees()

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
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,...

Member Data Documentation

◆ entries

TTreeHelper.TTreeSelector.entries = self.hashlist.GetEntries()

Definition at line 23 of file TTreeHelper.py.

◆ file

TTreeHelper.TTreeSelector.file = TFile.Open(args[0])

Definition at line 18 of file TTreeHelper.py.

◆ hashlist

TTreeHelper.TTreeSelector.hashlist = self.file.GetListOfKeys()

Definition at line 22 of file TTreeHelper.py.


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