Skip to content

Commit d3486d9

Browse files
committed
not sure what I did :-/ !
1 parent 9bc9bc1 commit d3486d9

File tree

6 files changed

+22
-15
lines changed

6 files changed

+22
-15
lines changed

bin/.hidden

Whitespace-only changes.

framework/analyzer.py

+6-9
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
import os
2-
import logging
3-
1+
import os
2+
import logging
43

54
from statistics.counter import Counters
65
from statistics.average import Averages
@@ -10,7 +9,7 @@ class Analyzer(object):
109
1110
Your custom analyzers should inherit from this class
1211
"""
13-
12+
1413
def __init__(self, cfg_ana, cfg_comp, looperName ):
1514
"""Create an analyzer.
1615
@@ -20,7 +19,7 @@ def __init__(self, cfg_ana, cfg_comp, looperName ):
2019
looperName: name of the Looper which runs this analyzer.
2120
2221
Attributes:
23-
dirName : analyzer directory, where you can write anything you want
22+
dirName : analyzer directory, where you can write anything you want
2423
"""
2524
self.name = cfg_ana.name
2625
self.verbose = cfg_ana.verbose
@@ -39,9 +38,9 @@ def beginLoop(self):
3938
"""Automatically called by Looper, for all analyzers."""
4039
self.counters = Counters()
4140
self.averages = Averages()
42-
self.mainLogger.warning( 'beginLoop ' + self.cfg_ana.name )
41+
self.mainLogger.warning( 'beginLoop ' + self.cfg_ana.name )
4342
self.beginLoopCalled = True
44-
43+
4544
def endLoop(self):
4645
"""Automatically called by Looper, for all analyzers."""
4746
#print self.cfg_ana
@@ -72,5 +71,3 @@ def __str__(self):
7271
if hasattr(self, 'averages') and len( self.averages ) > 0:
7372
ave = '\n'.join(map(str, self.averages))
7473
return '\n'.join( [ana, count, ave] )
75-
76-

framework/config.py

+11-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from framework.weight import Weight
1+
from weight import Weight
22
import glob
33

44

@@ -141,6 +141,16 @@ def getWeight( self, intLumi = None):
141141
intLumi = None,
142142
addWeight = 1. )
143143

144+
class MCGenComponent( Component ):
145+
def __init__(self, name, xSection,
146+
nGenEvents, **kwargs ):
147+
super( MCComponent, self).__init__( name = name, **kwargs )
148+
self.xSection = xSection
149+
self.nGenEvents = nGenEvents
150+
self.isMC = True
151+
self.intLumi = 1.
152+
self.addWeight = 1.
153+
144154

145155
class MCComponent( Component ):
146156
def __init__(self, name, files, triggers, xSection,

framework/looper.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
import imp
44
import logging
55
import pprint
6-
from framework.chain import Chain as Events
7-
from framework.event import Event
6+
from chain import Chain as Events
7+
from event import Event
88

99
class Looper(object):
1010
"""Creates a set of analyzers, and schedules the event processing."""

framework/multiloop.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88
from multiprocessing import Pool
99
from pprint import pprint
1010

11-
from framework.looper import Looper
12-
from framework.anapath import analyzer_path
11+
from looper import Looper
12+
from anapath import analyzer_path
1313

1414
# global, to be used interactively when only one component is processed.
1515
loop = None

init.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,4 @@ export PATH=$HEPPY/bin:$PATH
1010
cd $HEPPY/bin
1111
ln -sf ../framework/multiloop.py
1212
chmod +x *
13-
cd ..
13+
cd ..

0 commit comments

Comments
 (0)