1 from __future__
import print_function
7 import FWCore.ParameterSet.Config
as cms
13 sampleIdentifier =
'165633-CAFDQM' 16 maxNumberEvents = 5000
21 readFiles = cms.untracked.vstring()
22 secFiles = cms.untracked.vstring()
23 selectedEvents = cms.untracked.VEventRange()
24 selectedLumis= cms.untracked.VLuminosityBlockRange()
27 maxEvents = cms.untracked.PSet(
28 input = cms.untracked.int32(maxNumberEvents)
33 if sampleIdentifier ==
'195378' :
35 dataset =
'/MinimumBias/Run2012B-v1/RAW' 38 selectedLumis= cms.untracked.VLuminosityBlockRange(
39 '195378:1275-195378:max' 42 elif sampleIdentifier ==
'195379' :
44 dataset =
'/MinimumBias/Run2012B-v1/RAW' 48 elif sampleIdentifier ==
'195390' :
50 dataset =
'/MinimumBias/Run2012B-v1/RAW' 55 elif sampleIdentifier ==
'179828' :
57 dataset =
'/ZeroBiasHPF0/Run2011B-v1/RAW' 62 elif sampleIdentifier ==
'165633-CAFDQM' :
64 dataset =
'/ZeroBiasHPF0/Run2011B-v1/RAW' 68 'file:/afs/cern.ch/cms/CAF/CMSCOMM/COMM_DQM/DQMTest/MinimumBias__RAW__v1__165633__1CC420EE-B686-E011-A788-0030487CD6E8.root' 71 elif sampleIdentifier ==
'FileStream_105760' :
74 dataType =
'FileStream' 77 'file:/lookarea_SM/MWGR_29.00105760.0001.A.storageManager.00.0000.dat' 81 print(
'Error: sample identifier ', sampleIdentifier,
' not defined.\n')
82 errorUserOptions =
True 93 print(
" Run number: ", runNumber)
94 print(
" Dataset: ", dataset)
95 print(
" Data type: ", dataType)
102 myQuery =
'file dataset=' + dataset +
' run=' + runNumber
103 dasClientCommand =
'das_client.py --limit=0 --format=plain --query='+
'"'+myQuery+
'"' 104 data = os.popen(dasClientCommand)
105 filePaths = data.readlines()
108 print(
'\n das_client using the query')
110 print(
' retrieved the following files\n')
112 for line
in filePaths :
115 readFiles.extend(filePaths);
124 if dataType ==
'StreamFile' :
125 source = cms.Source(
"NewEventStreamFileReader", fileNames=readFiles)
127 source = cms.Source (
'PoolSource',
129 secondaryFileNames=secFiles,
130 lumisToProcess = selectedLumis,
131 eventsToProcess = selectedEvents
S & print(S &os, JobReport::InputFile const &f)