Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 13:10:32

0001 from __future__ import print_function
0002 #
0003 # provide online L1 Trigger DQM input from file(s)
0004 #
0005 # V M Ghete 2010-07-09
0006 
0007 import FWCore.ParameterSet.Config as cms
0008 
0009 ###################### user choices ######################
0010 
0011 # choose one sample identifier from the list of data samples 
0012 #
0013 sampleIdentifier = '165633-CAFDQM'
0014 #sampleIdentifier = '195378'
0015 
0016 maxNumberEvents = 5000
0017 
0018 ###################### end user choices ###################
0019 
0020 # initialize list of files, of secondary files, list of selected events and luminosity segments
0021 readFiles = cms.untracked.vstring()
0022 secFiles = cms.untracked.vstring() 
0023 selectedEvents = cms.untracked.VEventRange()
0024 selectedLumis= cms.untracked.VLuminosityBlockRange()
0025 
0026 
0027 maxEvents = cms.untracked.PSet(
0028     input = cms.untracked.int32(maxNumberEvents)
0029 )
0030 
0031 
0032 
0033 if sampleIdentifier == '195378' :
0034     runNumber = '195378'
0035     dataset = '/MinimumBias/Run2012B-v1/RAW'
0036     dataType = 'RAW'
0037     useDAS = True
0038     selectedLumis= cms.untracked.VLuminosityBlockRange(
0039                                                 '195378:1275-195378:max'
0040                                                 )
0041            
0042 elif sampleIdentifier == '195379' :
0043     runNumber = '195379'
0044     dataset = '/MinimumBias/Run2012B-v1/RAW'
0045     dataType = 'RAW'
0046     useDAS = True
0047            
0048 elif sampleIdentifier == '195390' :
0049     runNumber = '195390'
0050     dataset = '/MinimumBias/Run2012B-v1/RAW'
0051     dataType = 'RAW'
0052     useDAS = True
0053            
0054 # high PU run 2011   
0055 elif sampleIdentifier == '179828' :
0056     runNumber = '179828'
0057     dataset =  '/ZeroBiasHPF0/Run2011B-v1/RAW'
0058     dataType = 'RAW'
0059     useDAS = True
0060         
0061         
0062 elif sampleIdentifier == '165633-CAFDQM' :
0063     runNumber = '165633'
0064     dataset = '/ZeroBiasHPF0/Run2011B-v1/RAW'
0065     dataType = 'RAW'
0066     useDAS = False
0067     readFiles.extend( [ 
0068             'file:/afs/cern.ch/cms/CAF/CMSCOMM/COMM_DQM/DQMTest/MinimumBias__RAW__v1__165633__1CC420EE-B686-E011-A788-0030487CD6E8.root'
0069             ]);    
0070                                                                                                            
0071 elif sampleIdentifier == 'FileStream_105760' :
0072     runNumber = '105760'
0073     dataset = 'A_Stream'
0074     dataType = 'FileStream'
0075     useDAS = False
0076     readFiles.extend( [
0077             'file:/lookarea_SM/MWGR_29.00105760.0001.A.storageManager.00.0000.dat'       
0078             ] );
0079                 
0080 else :
0081     print('Error: sample identifier ', sampleIdentifier, ' not defined.\n')
0082     errorUserOptions = True 
0083     runNumber = '0'
0084     dataset = 'None'
0085     dataType = 'None'
0086     useDAS = False
0087        
0088      
0089 #            
0090 # end of data samples 
0091 #            
0092 
0093 print("   Run number: ", runNumber)
0094 print("   Dataset: ", dataset)
0095 print("   Data type: ", dataType)
0096 
0097 if useDAS :
0098     import das_client
0099     import os
0100 
0101     # query DAS
0102     myQuery =  'file dataset=' + dataset + ' run=' + runNumber
0103     dasClientCommand = 'das_client.py --limit=0 --format=plain --query='+'"'+myQuery+'"'
0104     data = os.popen(dasClientCommand)
0105     filePaths = data.readlines()
0106             
0107        
0108     print('\n   das_client using the query')
0109     print('      ', myQuery)
0110     print('   retrieved the following files\n')
0111         
0112     for line in filePaths :
0113         print('      ', line)
0114            
0115     readFiles.extend(filePaths);
0116         
0117         
0118     # nothing added to secondary files by DAS 
0119     secFiles.extend([
0120             ])
0121 
0122         
0123 # for RAW data, run first the RAWTODIGI 
0124 if dataType == 'StreamFile' :
0125     source = cms.Source("NewEventStreamFileReader", fileNames=readFiles)
0126 else :               
0127     source = cms.Source ('PoolSource', 
0128                             fileNames=readFiles, 
0129                             secondaryFileNames=secFiles,
0130                             lumisToProcess = selectedLumis,
0131                             eventsToProcess = selectedEvents
0132                             )
0133