-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathFileConverterdattoroot.py
More file actions
58 lines (41 loc) · 1.6 KB
/
Copy pathFileConverterdattoroot.py
File metadata and controls
58 lines (41 loc) · 1.6 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
import FWCore.ParameterSet.Config as cms
import sys
import string
# Filenames for in and outfile
if len(sys.argv) != 3:
print 'Wrong number of Command line arguments. Usage: cmsRun', sys.argv[1], 'datafile!\n\n'
# runnumber = re.findall("USC.00000(\d+)",sys.argv[2])
infile = 'file:'+sys.argv[2]
outfile = infile[:-3]+'root'
outfile = outfile.replace("/dat/","/digis/")
print 'Reading file', infile
print 'Writing results to ', outfile
# process declaration
process = cms.Process("OFFLINE")
# message logger
process.load("FWCore.MessageLogger.MessageLogger_cfi")
process.MessageLogger.cerr.FwkReport.reportEvery = 10000
process.MessageLogger.cerr.threshold = 'WARNING'
process.MessageLogger.categories.append('OFFLINE')
process.MessageLogger.cerr.INFO = cms.untracked.PSet(
limit = cms.untracked.int32(-1)
)
process.source = cms.Source("NewEventStreamFileReader",
#fileNames = cms.untracked.vstring("file:/opt/cmssw/Data/closed/USC.00000089.0001.A.storageManager.00.0000.dat")
fileNames = cms.untracked.vstring( infile)
)
process.maxEvents = cms.untracked.PSet( input = cms.untracked.int32(-1) )
## EventContentAnalyzer
process.ana = cms.EDAnalyzer("EventContentAnalyzer")
## Output module
process.out = cms.OutputModule("PoolOutputModule",
# outputCommands = cms.untracked.vstring(
# 'keep *',
# 'drop *_SiStripDigiCondDataproducer_ConditionData_HLT'
## 'keep *_siStripDigis_*_*'
# ),
# fileName = cms.untracked.string('data_run'+sys.argv[-1]+'.root')
fileName = cms.untracked.string(outfile)
)
# process.p1 = cms.Path(process.ana)
process.p2 = cms.EndPath(process.out)