1 from __future__
import print_function
10 import FWCore.ParameterSet.Config
as cms
26 useRelValSample =
False 32 if useRelValSample ==
False :
39 globalTag =
'75X_dataRun2_HLT_v2' 43 sampleIdentifier =
'251162' 54 globalTag =
'auto:run1_mc' 59 sampleFromRelease =
'CMSSW_7_5_0' 64 dataset =
'RelValTTbar' 78 overrideGlobalTag =
False 81 if overrideGlobalTag ==
True :
82 myGlobalTag =
'GR_P_V28' 87 errorUserOptions =
False 90 readFiles = cms.untracked.vstring()
91 secFiles = cms.untracked.vstring()
92 selectedEvents = cms.untracked.VEventRange()
93 selectedLumis= cms.untracked.VLuminosityBlockRange()
97 if (useRelValSample ==
True)
and (useLocalFiles ==
False) :
101 print(
" Release: ", sampleFromRelease)
102 print(
" Dataset: ", dataset)
103 print(
" Data type: ", dataType)
114 myQuery =
'dataset release=' + sampleFromRelease
115 dasClientCommand =
'das_client.py --limit=0 --format=plain --query='+
'"'+myQuery+
'"' 116 datasets = os.popen(dasClientCommand)
120 dataset =
'/' + dataset +
'/' 121 sampleFromRelease = sampleFromRelease +
'-' 123 if 'start' in globalTag :
125 elif 'mc' in globalTag :
131 for line
in datasets.readlines() :
133 if sampleFromRelease
in line :
135 if dataType
in line :
136 if 'ALCA' not in line :
137 datasetName = line.strip(
' \n')
142 if datasetName ==
'' :
143 print(
"\n No dataset found.")
144 errorUserOptions =
True 146 if not errorUserOptions :
148 myQuery =
'file dataset=' +
'"' + datasetName +
'"' 149 dasClientCommand =
'das_client.py --limit=0 --format=plain --query=' +
'"' + myQuery +
'"' 150 data = os.popen(dasClientCommand)
151 filePaths = data.readlines()
154 print(
'\n das_client using the query')
156 print(
' retrieved the following files\n')
158 for line
in filePaths :
161 readFiles.extend(filePaths);
171 elif (useRelValSample ==
False)
and (useLocalFiles ==
False) :
175 if sampleIdentifier ==
'191833_RAW' :
177 dataset =
'/DoubleElectron/Run2012A-v1/RAW' 180 selectedLumis= cms.untracked.VLuminosityBlockRange(
183 selectedEvents = cms.untracked.VEventRange(
188 elif sampleIdentifier ==
'251162' :
190 dataset =
'/Run2015B/DoubleMuon/RAW' 194 '/store/data/Run2015B/DoubleMuon/RAW/v1/000/251/162/00000/9A6A3CB4-AD25-E511-84E5-02163E01264D.root' 198 elif sampleIdentifier ==
'191833_RECO' :
200 dataset =
'/DoubleElectron/Run2012A-PromptReco-v1/RECO' 203 selectedLumis= cms.untracked.VLuminosityBlockRange(
206 selectedEvents = cms.untracked.VEventRange(
211 elif sampleIdentifier ==
'191833_AOD' :
213 dataset =
'/DoubleElectron/Run2012A-PromptReco-v1/AOD' 216 selectedLumis= cms.untracked.VLuminosityBlockRange(
219 selectedEvents = cms.untracked.VEventRange(
225 elif sampleIdentifier ==
'187858' :
227 dataset =
'/Commissioning/Commissioning12-v1/RAW' 230 selectedLumis= cms.untracked.VLuminosityBlockRange(
234 selectedEvents = cms.untracked.VEventRange(
240 elif sampleIdentifier ==
'179828' :
242 dataset =
'/ZeroBiasHPF0/Run2011B-v1/RAW' 247 elif sampleIdentifier ==
'165633-CAFDQM' :
249 dataset =
'/ZeroBiasHPF0/Run2011B-v1/RAW' 253 'file:/afs/cern.ch/cms/CAF/CMSCOMM/COMM_DQM/DQMTest/MinimumBias__RAW__v1__165633__1CC420EE-B686-E011-A788-0030487CD6E8.root' 257 elif sampleIdentifier ==
'137028' :
259 dataset =
'/Run2010A/ZeroBias/RECO-v2' 263 '/store/data/Run2010A/ZeroBias/RECO/v2/000/137/028/08BF857D-2471-DF11-9CEB-003048D2BBF0.root' 267 elif sampleIdentifier ==
'StreamFile_105760' :
270 dataType =
'StreamFile' 273 'file:/lookarea_SM/MWGR_29.00105760.0001.A.storageManager.00.0000.dat' 277 elif sampleIdentifier ==
'205666.A.storageManager' :
279 dataset =
'A.storageManager' 280 dataType =
'StreamFile' 283 selectedEvents = cms.untracked.VEventRange(
284 '205666:101:125069341',
285 '205666:161:238160322',
286 '205666:281:443371795',
287 '205666:341:537654884',
288 '205666:361:567121052' 297 'file:/afs/cern.ch/user/g/ghete/work/L1Trigger/data/Data.00205666.0101.A.storageManager.05.0000.dat',
300 'file:/afs/cern.ch/user/g/ghete/work/L1Trigger/data/Data.00205666.0161.A.storageManager.08.0000.dat',
306 'file:/afs/cern.ch/user/g/ghete/work/L1Trigger/data/Data.00205666.0281.A.storageManager.14.0000.dat',
309 'file:/afs/cern.ch/user/g/ghete/work/L1Trigger/data/Data.00205666.0341.A.storageManager.01.0000.dat',
310 'file:/afs/cern.ch/user/g/ghete/work/L1Trigger/data/Data.00205666.0361.A.storageManager.02.0000.dat',
328 'file:/afs/cern.ch/user/g/ghete/work/L1Trigger/data/Data.00205666.0721.A.storageManager.04.0000.dat' 333 print(
'Error: sample identifier ', sampleIdentifier,
' not defined.\n')
334 errorUserOptions =
True 345 print(
" Run number: ", runNumber)
346 print(
" Dataset: ", dataset)
347 print(
" Data type: ", dataType)
354 myQuery =
'file dataset=' + dataset +
' run=' + runNumber
355 dasClientCommand =
'das_client.py --limit=0 --format=plain --query='+
'"'+myQuery+
'"' 356 data = os.popen(dasClientCommand)
357 filePaths = data.readlines()
360 print(
'\n das_client using the query')
362 print(
' retrieved the following files\n')
364 for line
in filePaths :
367 readFiles.extend(filePaths);
380 if sampleIdentifier ==
'dummy' :
383 'file:/afs/cern.ch/user/g/ghete/scratch0/CmsswTestFiles/LocalFile_source.root' 389 print(
'Local file(s)', readFiles)
391 if overrideGlobalTag ==
True :
392 globalTag = myGlobalTag
394 if globalTag.count(
'auto') :
395 from Configuration.AlCa.autoCond_condDBv2
import autoCond
396 useGlobalTag = autoCond[globalTag.replace(
'auto:',
'')]
398 useGlobalTag = globalTag
400 print(
"\n Using global tag ", useGlobalTag,
"\n")
S & print(S &os, JobReport::InputFile const &f)