9 import FWCore.ParameterSet.Config
as cms
25 useRelValSample =
False
31 if useRelValSample ==
False :
38 globalTag =
'75X_dataRun2_HLT_v2'
42 sampleIdentifier =
'251162'
53 globalTag =
'auto:run1_mc'
58 sampleFromRelease =
'CMSSW_7_5_0'
63 dataset =
'RelValTTbar'
77 overrideGlobalTag =
False
80 if overrideGlobalTag ==
True :
81 myGlobalTag =
'GR_P_V28'
86 errorUserOptions =
False
89 readFiles = cms.untracked.vstring()
90 secFiles = cms.untracked.vstring()
91 selectedEvents = cms.untracked.VEventRange()
92 selectedLumis= cms.untracked.VLuminosityBlockRange()
96 if (useRelValSample ==
True)
and (useLocalFiles ==
False) :
100 print " Release: ", sampleFromRelease
101 print " Dataset: ", dataset
102 print " Data type: ", dataType
113 myQuery =
'dataset release=' + sampleFromRelease
114 dasClientCommand =
'das_client.py --limit=0 --format=plain --query='+
'"'+myQuery+
'"'
115 datasets = os.popen(dasClientCommand)
119 dataset =
'/' + dataset +
'/'
120 sampleFromRelease = sampleFromRelease +
'-'
122 if 'start' in globalTag :
124 elif 'mc' in globalTag :
130 for line
in datasets.readlines() :
132 if sampleFromRelease
in line :
134 if dataType
in line :
135 if 'ALCA' not in line :
136 datasetName = line.strip(
' \n')
141 if datasetName ==
'' :
142 print "\n No dataset found."
143 errorUserOptions =
True
145 if not errorUserOptions :
147 myQuery =
'file dataset=' +
'"' + datasetName +
'"'
148 dasClientCommand =
'das_client.py --limit=0 --format=plain --query=' +
'"' + myQuery +
'"'
149 data = os.popen(dasClientCommand)
150 filePaths = data.readlines()
153 print '\n das_client using the query'
155 print ' retrieved the following files\n'
157 for line
in filePaths :
160 readFiles.extend(filePaths);
170 elif (useRelValSample ==
False)
and (useLocalFiles ==
False) :
174 if sampleIdentifier ==
'191833_RAW' :
176 dataset =
'/DoubleElectron/Run2012A-v1/RAW'
179 selectedLumis= cms.untracked.VLuminosityBlockRange(
182 selectedEvents = cms.untracked.VEventRange(
187 elif sampleIdentifier ==
'251162' :
189 dataset =
'/Run2015B/DoubleMuon/RAW'
193 '/store/data/Run2015B/DoubleMuon/RAW/v1/000/251/162/00000/9A6A3CB4-AD25-E511-84E5-02163E01264D.root'
197 elif sampleIdentifier ==
'191833_RECO' :
199 dataset =
'/DoubleElectron/Run2012A-PromptReco-v1/RECO'
202 selectedLumis= cms.untracked.VLuminosityBlockRange(
205 selectedEvents = cms.untracked.VEventRange(
210 elif sampleIdentifier ==
'191833_AOD' :
212 dataset =
'/DoubleElectron/Run2012A-PromptReco-v1/AOD'
215 selectedLumis= cms.untracked.VLuminosityBlockRange(
218 selectedEvents = cms.untracked.VEventRange(
224 elif sampleIdentifier ==
'187858' :
226 dataset =
'/Commissioning/Commissioning12-v1/RAW'
229 selectedLumis= cms.untracked.VLuminosityBlockRange(
233 selectedEvents = cms.untracked.VEventRange(
239 elif sampleIdentifier ==
'179828' :
241 dataset =
'/ZeroBiasHPF0/Run2011B-v1/RAW'
246 elif sampleIdentifier ==
'165633-CAFDQM' :
248 dataset =
'/ZeroBiasHPF0/Run2011B-v1/RAW'
252 'file:/afs/cern.ch/cms/CAF/CMSCOMM/COMM_DQM/DQMTest/MinimumBias__RAW__v1__165633__1CC420EE-B686-E011-A788-0030487CD6E8.root'
256 elif sampleIdentifier ==
'137028' :
258 dataset =
'/Run2010A/ZeroBias/RECO-v2'
262 '/store/data/Run2010A/ZeroBias/RECO/v2/000/137/028/08BF857D-2471-DF11-9CEB-003048D2BBF0.root'
266 elif sampleIdentifier ==
'StreamFile_105760' :
269 dataType =
'StreamFile'
272 'file:/lookarea_SM/MWGR_29.00105760.0001.A.storageManager.00.0000.dat'
276 elif sampleIdentifier ==
'205666.A.storageManager' :
278 dataset =
'A.storageManager'
279 dataType =
'StreamFile'
282 selectedEvents = cms.untracked.VEventRange(
283 '205666:101:125069341',
284 '205666:161:238160322',
285 '205666:281:443371795',
286 '205666:341:537654884',
287 '205666:361:567121052'
296 'file:/afs/cern.ch/user/g/ghete/work/L1Trigger/data/Data.00205666.0101.A.storageManager.05.0000.dat',
299 'file:/afs/cern.ch/user/g/ghete/work/L1Trigger/data/Data.00205666.0161.A.storageManager.08.0000.dat',
305 'file:/afs/cern.ch/user/g/ghete/work/L1Trigger/data/Data.00205666.0281.A.storageManager.14.0000.dat',
308 'file:/afs/cern.ch/user/g/ghete/work/L1Trigger/data/Data.00205666.0341.A.storageManager.01.0000.dat',
309 'file:/afs/cern.ch/user/g/ghete/work/L1Trigger/data/Data.00205666.0361.A.storageManager.02.0000.dat',
327 'file:/afs/cern.ch/user/g/ghete/work/L1Trigger/data/Data.00205666.0721.A.storageManager.04.0000.dat'
332 print 'Error: sample identifier ', sampleIdentifier,
' not defined.\n'
333 errorUserOptions =
True
344 print " Run number: ", runNumber
345 print " Dataset: ", dataset
346 print " Data type: ", dataType
353 myQuery =
'file dataset=' + dataset +
' run=' + runNumber
354 dasClientCommand =
'das_client.py --limit=0 --format=plain --query='+
'"'+myQuery+
'"'
355 data = os.popen(dasClientCommand)
356 filePaths = data.readlines()
359 print '\n das_client using the query'
361 print ' retrieved the following files\n'
363 for line
in filePaths :
366 readFiles.extend(filePaths);
379 if sampleIdentifier ==
'dummy' :
382 'file:/afs/cern.ch/user/g/ghete/scratch0/CmsswTestFiles/LocalFile_source.root'
388 print 'Local file(s)', readFiles
390 if overrideGlobalTag ==
True :
391 globalTag = myGlobalTag
393 if globalTag.count(
'auto') :
394 from Configuration.AlCa.autoCond_condDBv2
import autoCond
395 useGlobalTag = autoCond[globalTag.replace(
'auto:',
'')]
397 useGlobalTag = globalTag
399 print "\n Using global tag ", useGlobalTag,
"\n"