####################################################################### import user # look for .pythonrc.py for user init import ROOT import PyCintex import AthenaROOTAccess.transientTree v = ROOT.TLorentzVector() spartyjetdir = '/lapp_data/atlas/delsart/testARA/spartyjet/libs/' ROOT.gSystem.Load(spartyjetdir+"libJetCore.so") # ROOT.gSystem.Load(spartyjetdir+"libCDFJet.so") ROOT.gSystem.Load(spartyjetdir+"libFastJet.so") # ROOT.gSystem.Load(spartyjetdir+"libExtras.so") # ROOT.gSystem.Load(spartyjetdir+"libATLASJet.so") SJ = ROOT.SpartyJet ####################################################################### ## Ususal ARA set-up ################################################## # Put your AOD file here. aodFile = 'test.AOD.root' f = ROOT.TFile.Open (aodFile) assert f.IsOpen() c = ROOT.ClusterExample # Fill this in if you want to change the names of the transient branches. branchNames = {} #branchNames['ElectronCollection'] = 'ele' #branchNames['PhotonCollection'] = 'gam' tt = AthenaROOTAccess.transientTree.makeTree(f, branchNames = branchNames) # tt is the transient tree "CollectionTree_trans" containing the (proxies) to # all available transient data object in the file f. # The original, persistent tree is declared as a friend # of CollectionTree_trans, so that the transient tree will provide # access to both transient data objects and to their persistent counterparts. ####################################################################### ## Set-up SpartyJet ################################################### # instantiate an ARA jet maker : jetmaker = ROOT.ARAJetMaker() # give it the TTree and input collection name jetmaker.configure_cluster_input(tt, "CaloCalTopoCluster") # # configure algorithms -------------------------------------- fj = SJ.fastjet.FastJetFinder("FastJet",False,False) sc = SJ.fastjet.SISConeFinder("SISCone") ############################################################################## # # Now you should be able to do things like: # def event_analysis(ievt): print 'analyzing ', ievt jetmaker.load_input(ievt) jcoll_kt = jetmaker.get_jets(fj) print jcoll_kt, jcoll_kt.size() jcoll_sc = jetmaker.get_jets(sc) print jcoll_sc, jcoll_sc.size() event_analysis(0) event_analysis(1)