Skip to content

Commit

Permalink
Merge pull request #22 from arizzi/fixCmsRunPreprocessor
Browse files Browse the repository at this point in the history
fixes for cmsRun preprocessor
  • Loading branch information
cbernet committed Feb 18, 2015
2 parents 11457e2 + c65dd48 commit 90d8f6a
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
4 changes: 2 additions & 2 deletions PhysicsTools/Heppy/test/example_autofill_wCmsRun.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,8 +110,8 @@

sample = cfg.Component(
#specify the file you want to run on
files = ["/scratch/arizzi/Hbb/CMSSW_7_2_2_patch2/src/VHbbAnalysis/Heppy/test/ZLL-8A345C56-6665-E411-9C25-1CC1DE04DF20.root"],
# files = testfiles,
# files = ["/scratch/arizzi/Hbb/CMSSW_7_2_2_patch2/src/VHbbAnalysis/Heppy/test/ZLL-8A345C56-6665-E411-9C25-1CC1DE04DF20.root"],
files = testfiles,
name="SingleSample", isMC=False,isEmbed=False
)

Expand Down
1 change: 1 addition & 0 deletions PhysicsTools/HeppyCore/python/framework/heppy.py
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,7 @@ def main( options, args ):

parser.add_option("-N", "--nevents",
dest="nevents",
type="int",
help="number of events to process",
default=None)
parser.add_option("-p", "--nprint",
Expand Down
8 changes: 7 additions & 1 deletion PhysicsTools/HeppyCore/python/framework/looper.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,13 @@ def __init__( self, name,
if len(self.cfg_comp.files)==0:
errmsg = 'please provide at least an input file in the files attribute of this component\n' + str(self.cfg_comp)
raise ValueError( errmsg )
self.events = config.events_class(self.cfg_comp.files, tree_name)
if hasattr(config,"preprocessor") and config.preprocessor is not None :
self.cfg_comp = config.preprocessor.run(self.cfg_comp,self.outDir,firstEvent,nEvents)
if hasattr(self.cfg_comp,"options"):
print self.cfg_comp.files,self.cfg_comp.options
self.events = config.events_class(self.cfg_comp.files, tree_name,options=self.cfg_comp.options)
else :
self.events = config.events_class(self.cfg_comp.files, tree_name)
if hasattr(self.cfg_comp, 'fineSplit'):
fineSplitIndex, fineSplitFactor = self.cfg_comp.fineSplit
if fineSplitFactor > 1:
Expand Down

0 comments on commit 90d8f6a

Please sign in to comment.