-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathrun_heppy.py
More file actions
58 lines (45 loc) · 2.03 KB
/
run_heppy.py
File metadata and controls
58 lines (45 loc) · 2.03 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
# alphatwirl
from Core.EventReader import EventLoopRunner, MPEventLoopRunner, EventLoop
from Core.ProgressBar import ProgressBar,ProgressReport,ProgressMonitor,BProgressMonitor
from Core.Concurrently import CommunicationChannel,CommunicationChannel0
from Core.HeppyResult import HeppyResult,ComponentLoop
from Core.HeppyResult.BEventBuilder import BEventBuilder
from Core.HeppyResult.EventBuilder import EventBuilder
from Core.HeppyResult.UFEventReader import UFEventReader
from Core.HeppyResult.UFComponentReader import UFComponentReader
# Standard package
import imp,sys
cfgFileName = sys.argv[1]
file = open( cfgFileName,'r')
cfg = imp.load_source( 'UFHeppy.__cfg_to_run__', cfgFileName, file)
rootFileDir = "treeProducerSusyRPV"
rootFile = "tree.root"
rootTree = "tree"
nCores = cfg.nCores
inputDir = cfg.inputDir
componentList = cfg.componentList
nEvents = cfg.nEvents
disableProgressBar = cfg.disableProgressBar
sequence = cfg.sequence
outputInfo = cfg.outputInfo
progressBar = ProgressBar()
if nCores != 1:
progressMonitor = BProgressMonitor(progressBar)
communicationChannel = CommunicationChannel(nCores,progressMonitor)
else:
progressMonitor = ProgressMonitor(progressBar)
communicationChannel = CommunicationChannel0(progressMonitor)
pass
if not disableProgressBar: progressMonitor.begin()
communicationChannel.begin()
print "\nLoading samples:\n"
heppyResult = HeppyResult(inputDir,componentList)
eventLoopRunner = MPEventLoopRunner(communicationChannel)
eventBuilder = BEventBuilder(rootFileDir,rootFile,rootTree,nEvents)
componentReader = UFComponentReader(eventBuilder, eventLoopRunner, sequence, outputInfo)
componentLoop = ComponentLoop(componentReader)
print "\nBegin Running\n"
componentLoop(heppyResult.components())
print "\nEnd Running\n"
if not disableProgressBar: progressMonitor.end()
communicationChannel.end()