Fork me on GitHub

source: git/python/DelphesAnalysis/DumpEventInfo.py@ 88a9b72

ImprovedOutputFile Timing dual_readout llp
Last change on this file since 88a9b72 was ae1d49f, checked in by pavel <pavel@…>, 12 years ago

add DelphesAnalysis

  • Property mode set to 100644
File size: 1.2 KB
RevLine 
[ae1d49f]1#!/usr/bin/env python
2import os
3import ROOT
4import Delphes
5from AnalysisEvent import AnalysisEvent
6import EventSelection
7from CPconfig import configuration, eventDumpConfig
8
9def DumpEventInfo(event=None, eventNumber=None, path="./"):
10 """Dump informations about a given event"""
11 # in case no event is provided, find it using eventNumber
12 if event is None:
13 if eventNumber is None:
14 print "DumpEventInfo Error: either pass an event or an event number"
15 return
16 # find event based on run and event
17 if os.path.isdir(path):
18 dirList=os.listdir(path)
19 files=[]
20 for fname in dirList:
21 files.append(path+fname)
22 elif os.path.isfile(path):
23 files=[path]
24 else:
25 files=[]
26 events = AnalysisEvent(files)
27 EventSelection.prepareAnalysisEvent(events)
28 DumpEventInfo(events[eventNumber])
29 return
30 # run the producers when we want to print the outcome, and mute unneeded collections
31 for product in eventDumpConfig.productsToPrint: getattr(event,product)
32 for collection in eventDumpConfig.collectionsToHide: event.removeCollection(collection)
33 # Now, we can go on with the printing.
34 print event
35
36if __name__=="__main__":
37 import sys
38 DumpEventInfo(eventNumber=int(sys.argv[1]), path=sys.argv[2])
39
Note: See TracBrowser for help on using the repository browser.