ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/VHbb/python/write_systematics.py
(Generate patch)

Comparing UserCode/VHbb/python/write_systematics.py (file contents):
Revision 1.3 by peller, Thu May 10 16:16:05 2012 UTC vs.
Revision 1.4 by peller, Sat May 12 06:50:49 2012 UTC

# Line 9 | Line 9 | import shutil
9   from ROOT import TFile
10   import ROOT
11   from array import array
12 + import warnings
13 + warnings.filterwarnings( action='ignore', category=RuntimeWarning, message='creating converter.*' )
14 +
15  
16   #usage: ./write_systematic.py path
17  
# Line 78 | Line 81 | for job in info:
81          EventForTraining = array('f',[0])
82          newtree.Branch('EventForTraining',EventForTraining,'EventForTraining/F')
83          
84 <        iter=0
84 >        #iter=0
85 >        
86 >        TFlag=ROOT.TTreeFormula("EventForTraining","EVENT.event%2",tree)
87          
88          for entry in range(0,nEntries):
89              tree.GetEntry(entry)
90  
91              #fill training flag
92 <            iter+=1
93 <            if (iter%2==0):
94 <                EventForTraining[0]=1
95 <            else:
96 <                EventForTraining[0]=0
92 >            #iter+=1
93 >            #if (iter%2==0):
94 >            #    EventForTraining[0]=1
95 >            #else:
96 >            #    EventForTraining[0]=0
97 >            #iter+=1
98 >            
99 >            EventForTraining[0]=int(not TFlag.EvalInstance())
100  
101              #get
102              hJet_pt0 = tree.hJet_pt[0]

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines