ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/andersj/HcalPlotter/tests.py
(Generate patch)

Comparing UserCode/andersj/HcalPlotter/tests.py (file contents):
Revision 1.4 by andersj, Fri Oct 14 17:51:23 2011 UTC vs.
Revision 1.7 by andersj, Fri Oct 21 19:25:18 2011 UTC

# Line 1 | Line 1
1   import FWCore.ParameterSet.Config as cms
2   import sys
3 + import os
4 + import re
5  
6   process = cms.Process("Demo")
7  
# Line 15 | Line 17 | if len(sys.argv) > 2:
17      #print sys.argv
18      arg1 = sys.argv[2]
19      RUNNUMBER = int(arg1)
20 +    inputieta = int(sys.argv[3])
21 +    inputiphi = int(sys.argv[4])
22      #print arg1
23   else:
24      RUNNUMBER = 0
25   if (RUNNUMBER < 1):
26 <    print "Enter Runnumber: "
27 <    rn = sys.stdin.readline()
28 <    RUNNUMBER = int(rn.strip())
29 < print "Running on: {0:08d}".format(RUNNUMBER)
26 >    rn = input("Enter Runnumber: ")
27 >    RUNNUMBER = int(rn)
28 >    tmp = input("Enter hb table ieta: ")
29 >    inputieta = int(tmp)
30 >    tmp = input("Enter hb table iphi: ")
31 >    inputiphi = int(tmp)
32 > print "Running on: {0:08d} table coordinates ({1},{2})".format(RUNNUMBER,
33 >                                                               inputieta,
34 >                                                               inputiphi)
35  
36   process.maxEvents = cms.untracked.PSet(
37      input = cms.untracked.int32(-1)
38   )
39  
40 + datadir = 'tb_data'
41 +
42 + files = ['file:{0}/{1}'.format(datadir,x) for x in os.listdir(datadir) \
43 +         if re.search('_{0:08d}\.\d+'.format(RUNNUMBER), x)]
44 +
45 + #print files
46 +
47   process.source = cms.Source("PoolSource",
48 <    fileNames = cms.untracked.vstring(
33 <    "file:moe5/EcalHcalCombined2011_{0:08d}.0.root".format(RUNNUMBER),
48 >    fileNames = cms.untracked.vstring(files
49      )
50   )
51  
52 + #process.source.fileNames.extend(files)
53 +
54 + print process.source.fileNames
55 +
56   process.TFileService = cms.Service("TFileService",
57      fileName = cms.string('test/tb2011_{0:08d}.root'.format(RUNNUMBER))
58   )
# Line 119 | Line 138 | process.plotanal=cms.EDAnalyzer(
138          beamGeVhi  = cms.double(500),
139          #beamGeVhi  = cms.double(80*200),
140          timeNSlo   = cms.double(50),
141 <        timeNShi   = cms.double(250)
141 >        timeNShi   = cms.double(250),
142 >        ieta = cms.int32(inputieta),
143 >        iphi = cms.int32(inputiphi)
144          )
145      )
146  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines