CMS 3D CMS Logo

/afs/cern.ch/work/a/aaltunda/public/www/CMSSW_6_2_5/src/DQM/L1TMonitor/python/inputsource_file_cfi.py

Go to the documentation of this file.
00001 #
00002 # provide online L1 Trigger DQM input from file(s)
00003 #
00004 # V M Ghete 2010-07-09
00005 
00006 import FWCore.ParameterSet.Config as cms
00007 
00008 ###################### user choices ######################
00009 
00010 # choose one sample identifier from the list of data samples 
00011 #
00012 #sampleIdentifier = '165633-CAFDQM'
00013 sampleIdentifier = '195378'
00014 
00015 maxNumberEvents = 5000
00016 
00017 ###################### end user choices ###################
00018 
00019 # initialize list of files, of secondary files, list of selected events and luminosity segments
00020 readFiles = cms.untracked.vstring()
00021 secFiles = cms.untracked.vstring() 
00022 selectedEvents = cms.untracked.VEventRange()
00023 selectedLumis= cms.untracked.VLuminosityBlockRange()
00024 
00025 
00026 maxEvents = cms.untracked.PSet(
00027     input = cms.untracked.int32(maxNumberEvents)
00028 )
00029 
00030 
00031 
00032 if sampleIdentifier == '195378' :
00033     runNumber = '195378'
00034     dataset = '/MinimumBias/Run2012B-v1/RAW'
00035     dataType = 'RAW'
00036     useDAS = True
00037     selectedLumis= cms.untracked.VLuminosityBlockRange(
00038                                                 '195378:1275-195378:max'
00039                                                 )
00040            
00041 elif sampleIdentifier == '195379' :
00042     runNumber = '195379'
00043     dataset = '/MinimumBias/Run2012B-v1/RAW'
00044     dataType = 'RAW'
00045     useDAS = True
00046            
00047 elif sampleIdentifier == '195390' :
00048     runNumber = '195390'
00049     dataset = '/MinimumBias/Run2012B-v1/RAW'
00050     dataType = 'RAW'
00051     useDAS = True
00052            
00053 # high PU run 2011   
00054 elif sampleIdentifier == '179828' :
00055     runNumber = '179828'
00056     dataset =  '/ZeroBiasHPF0/Run2011B-v1/RAW'
00057     dataType = 'RAW'
00058     useDAS = True
00059         
00060         
00061 elif sampleIdentifier == '165633-CAFDQM' :
00062     runNumber = '165633'
00063     dataset = '/ZeroBiasHPF0/Run2011B-v1/RAW'
00064     dataType = 'RAW'
00065     useDAS = False
00066     readFiles.extend( [ 
00067             'file:/afs/cern.ch/cms/CAF/CMSCOMM/COMM_DQM/DQMTest/MinimumBias__RAW__v1__165633__1CC420EE-B686-E011-A788-0030487CD6E8.root'                       
00068             ]);    
00069                                                                                                            
00070 elif sampleIdentifier == 'FileStream_105760' :
00071     runNumber = '105760'
00072     dataset = 'A_Stream'
00073     dataType = 'FileStream'
00074     useDAS = False
00075     readFiles.extend( [
00076             'file:/lookarea_SM/MWGR_29.00105760.0001.A.storageManager.00.0000.dat'       
00077             ] );
00078                 
00079 else :
00080     print 'Error: sample identifier ', sampleIdentifier, ' not defined.\n'
00081     errorUserOptions = True 
00082     runNumber = '0'
00083     dataset = 'None'
00084     dataType = 'None'
00085     useDAS = False
00086        
00087      
00088 #            
00089 # end of data samples 
00090 #            
00091 
00092 print "   Run number: ", runNumber
00093 print "   Dataset: ", dataset
00094 print "   Data type: ", dataType
00095 
00096 if useDAS :
00097     import das_client
00098     import os
00099 
00100     # query DAS
00101     myQuery =  'file dataset=' + dataset + ' run=' + runNumber
00102     dasClientCommand = 'das_client.py --limit=0 --format=plain --query='+'"'+myQuery+'"'
00103     data = os.popen(dasClientCommand)
00104     filePaths = data.readlines()
00105             
00106        
00107     print '\n   das_client using the query'
00108     print '      ', myQuery
00109     print '   retrieved the following files\n'
00110         
00111     for line in filePaths :
00112         print '      ', line
00113            
00114     readFiles.extend(filePaths);
00115         
00116         
00117     # nothing added to secondary files by DAS 
00118     secFiles.extend([
00119             ])
00120 
00121         
00122 # for RAW data, run first the RAWTODIGI 
00123 if dataType == 'StreamFile' :
00124     source = cms.Source("NewEventStreamFileReader", fileNames=readFiles)
00125 else :               
00126     source = cms.Source ('PoolSource', 
00127                             fileNames=readFiles, 
00128                             secondaryFileNames=secFiles,
00129                             lumisToProcess = selectedLumis,
00130                             eventsToProcess = selectedEvents
00131                             )
00132