import FWCore.ParameterSet.Config as cms

print("Starting CSCTF Mode Filter")
process = cms.Process("SKIM")

process.load("FWCore.MessageService.MessageLogger_cfi")
process.MessageLogger.cerr.threshold = ""
process.MessageLogger.cerr.FwkReport.reportEvery = 1000
process.load("Configuration.StandardSequences.Services_cff")
process.load("Configuration.StandardSequences.FrontierConditions_GlobalTag_cff")

############################################################################
process.maxEvents = cms.untracked.PSet( input = cms.untracked.int32(1000))  
############################################################################


process.source = cms.Source("PoolSource",
    fileNames = cms.untracked.vstring()
)

process.source.fileNames.extend([
"/store/data/Run2011B/L1MuHPF/RAW/v1/000/178/208/FEAA124F-7EF3-E011-9208-003048673374.root",
"/store/data/Run2011B/L1MuHPF/RAW/v1/000/178/208/FE03EB11-5DF3-E011-B717-003048F117EC.root",
"/store/data/Run2011B/L1MuHPF/RAW/v1/000/178/208/FAB7E40D-76F3-E011-8566-BCAEC53296FF.root",
"/store/data/Run2011B/L1MuHPF/RAW/v1/000/178/208/FA1E6192-81F3-E011-B876-BCAEC53296FF.root",
"/store/data/Run2011B/L1MuHPF/RAW/v1/000/178/208/FA085011-7FF3-E011-9DE3-003048D2BC4C.root",
"/store/data/Run2011B/L1MuHPF/RAW/v1/000/178/208/F8A8B8E4-86F3-E011-BC5A-BCAEC53296F7.root",
"/store/data/Run2011B/L1MuHPF/RAW/v1/000/178/208/F8A32D30-80F3-E011-9CCE-001D09F24489.root",
"/store/data/Run2011B/L1MuHPF/RAW/v1/000/178/208/F86797FF-7DF3-E011-AC73-003048F024FE.root",
"/store/data/Run2011B/L1MuHPF/RAW/v1/000/178/208/F6C69A11-7FF3-E011-A256-001D09F24EAC.root",
"/store/data/Run2011B/L1MuHPF/RAW/v1/000/178/208/F62BF6A4-7BF3-E011-8A47-E0CB4E4408E3.root",
"/store/data/Run2011B/L1MuHPF/RAW/v1/000/178/208/F491E355-60F3-E011-9860-0030486780E6.root",
"/store/data/Run2011B/L1MuHPF/RAW/v1/000/178/208/F48347F8-7BF3-E011-9E99-BCAEC518FF67.root",
"/store/data/Run2011B/L1MuHPF/RAW/v1/000/178/208/F01B6D47-73F3-E011-BC71-003048F11C5C.root",
"/store/data/Run2011B/L1MuHPF/RAW/v1/000/178/208/F0189227-7BF3-E011-B9D8-BCAEC518FF68.root",
"/store/data/Run2011B/L1MuHPF/RAW/v1/000/178/208/EE06AC08-85F3-E011-84CE-BCAEC5364CFB.root",
"/store/data/Run2011B/L1MuHPF/RAW/v1/000/178/208/EAD69F21-66F3-E011-A288-003048F11CF0.root",
"/store/data/Run2011B/L1MuHPF/RAW/v1/000/178/208/EA299750-7EF3-E011-9625-001D09F24EAC.root",
"/store/data/Run2011B/L1MuHPF/RAW/v1/000/178/208/E6728314-7FF3-E011-B961-001D09F2AD84.root",
"/store/data/Run2011B/L1MuHPF/RAW/v1/000/178/208/E6018F67-7DF3-E011-9CDA-BCAEC518FF44.root",
"/store/data/Run2011B/L1MuHPF/RAW/v1/000/178/208/E4C5AB93-81F3-E011-AB33-BCAEC518FF91.root",
"/store/data/Run2011B/L1MuHPF/RAW/v1/000/178/208/E033AC44-7AF3-E011-B6D2-001D09F27003.root",
"/store/data/Run2011B/L1MuHPF/RAW/v1/000/178/208/DE171646-73F3-E011-A591-002481E0D7D8.root",
"/store/data/Run2011B/L1MuHPF/RAW/v1/000/178/208/DCEB8011-66F3-E011-A2C9-BCAEC5329701.root",
"/store/data/Run2011B/L1MuHPF/RAW/v1/000/178/208/DCC3E552-7EF3-E011-A4C1-001D09F24E39.root",
"/store/data/Run2011B/L1MuHPF/RAW/v1/000/178/208/D8B74B10-7FF3-E011-80B8-001D09F2545B.root",
"/store/data/Run2011B/L1MuHPF/RAW/v1/000/178/208/D84B6E6A-7DF3-E011-BC10-BCAEC5329727.root",
"/store/data/Run2011B/L1MuHPF/RAW/v1/000/178/208/D688572F-7BF3-E011-A87F-BCAEC53296F9.root",
"/store/data/Run2011B/L1MuHPF/RAW/v1/000/178/208/D4C0E6D0-82F3-E011-BEBD-001D09F24498.root",
"/store/data/Run2011B/L1MuHPF/RAW/v1/000/178/208/D44CFCE4-86F3-E011-8BFC-BCAEC518FF8C.root",
"/store/data/Run2011B/L1MuHPF/RAW/v1/000/178/208/D27A4C36-78F3-E011-A513-0019B9F72D71.root",
"/store/data/Run2011B/L1MuHPF/RAW/v1/000/178/208/CCEAC8A5-81F3-E011-8F05-003048F1C58C.root",
"/store/data/Run2011B/L1MuHPF/RAW/v1/000/178/208/C8FB422F-80F3-E011-81F8-001D09F251CC.root",
"/store/data/Run2011B/L1MuHPF/RAW/v1/000/178/208/C6BDC93B-78F3-E011-8831-001D09F24353.root",
"/store/data/Run2011B/L1MuHPF/RAW/v1/000/178/208/C696AE2F-80F3-E011-B565-001D09F28E80.root",
"/store/data/Run2011B/L1MuHPF/RAW/v1/000/178/208/C68ABE4B-60F3-E011-BEDB-BCAEC5329711.root",
"/store/data/Run2011B/L1MuHPF/RAW/v1/000/178/208/C4C6AC46-7EF3-E011-BFD8-BCAEC5329721.root",
"/store/data/Run2011B/L1MuHPF/RAW/v1/000/178/208/C4BD2523-78F3-E011-8188-BCAEC5329727.root",
"/store/data/Run2011B/L1MuHPF/RAW/v1/000/178/208/C2987CE4-86F3-E011-973C-BCAEC518FF80.root",
"/store/data/Run2011B/L1MuHPF/RAW/v1/000/178/208/C0537F92-81F3-E011-B190-002481E0DEC6.root",
"/store/data/Run2011B/L1MuHPF/RAW/v1/000/178/208/BEB76945-73F3-E011-A801-003048F024DC.root",
"/store/data/Run2011B/L1MuHPF/RAW/v1/000/178/208/BCEA7E22-78F3-E011-BD8A-BCAEC518FF44.root",
"/store/data/Run2011B/L1MuHPF/RAW/v1/000/178/208/B8BAACBE-7DF3-E011-9565-BCAEC5329713.root",
"/store/data/Run2011B/L1MuHPF/RAW/v1/000/178/208/B684714A-7EF3-E011-962D-BCAEC532972D.root",
"/store/data/Run2011B/L1MuHPF/RAW/v1/000/178/208/B0C4AD0F-66F3-E011-B8F6-BCAEC532972E.root",
"/store/data/Run2011B/L1MuHPF/RAW/v1/000/178/208/B0641606-85F3-E011-B600-BCAEC5329718.root",
"/store/data/Run2011B/L1MuHPF/RAW/v1/000/178/208/ACFE5843-60F3-E011-A461-BCAEC5329717.root",
"/store/data/Run2011B/L1MuHPF/RAW/v1/000/178/208/AAD01F4D-60F3-E011-9696-003048678098.root",
"/store/data/Run2011B/L1MuHPF/RAW/v1/000/178/208/A29E5140-7AF3-E011-909E-003048D3C932.root",
"/store/data/Run2011B/L1MuHPF/RAW/v1/000/178/208/9EC1D5C3-71F3-E011-8DE5-003048D3C980.root",
"/store/data/Run2011B/L1MuHPF/RAW/v1/000/178/208/9853CB9D-7AF3-E011-ADC0-001D09F27067.root",
"/store/data/Run2011B/L1MuHPF/RAW/v1/000/178/208/94D19B92-81F3-E011-9AA8-003048F117B6.root",
"/store/data/Run2011B/L1MuHPF/RAW/v1/000/178/208/9455B114-66F3-E011-B12A-001D09F291D2.root",
"/store/data/Run2011B/L1MuHPF/RAW/v1/000/178/208/92FFCD24-7DF3-E011-82FB-003048D2BDD8.root",
"/store/data/Run2011B/L1MuHPF/RAW/v1/000/178/208/92CE8513-5DF3-E011-B9D4-003048F024C2.root",
"/store/data/Run2011B/L1MuHPF/RAW/v1/000/178/208/90F71E67-62F3-E011-B70E-003048F1C424.root",
"/store/data/Run2011B/L1MuHPF/RAW/v1/000/178/208/8EBDEBBF-7DF3-E011-99F2-BCAEC53296FC.root",
"/store/data/Run2011B/L1MuHPF/RAW/v1/000/178/208/8EB4CF52-60F3-E011-B8E5-003048D37456.root",
"/store/data/Run2011B/L1MuHPF/RAW/v1/000/178/208/8AA848F6-7BF3-E011-9B14-BCAEC518FF62.root",
"/store/data/Run2011B/L1MuHPF/RAW/v1/000/178/208/84B88BCA-73F3-E011-85B0-003048F11C28.root",
"/store/data/Run2011B/L1MuHPF/RAW/v1/000/178/208/8477682C-7BF3-E011-9E87-BCAEC518FF7E.root",
"/store/data/Run2011B/L1MuHPF/RAW/v1/000/178/208/8296BA41-74F3-E011-9906-BCAEC5329732.root",
"/store/data/Run2011B/L1MuHPF/RAW/v1/000/178/208/805FEB25-66F3-E011-B168-001D09F28EA3.root",
"/store/data/Run2011B/L1MuHPF/RAW/v1/000/178/208/7C203767-62F3-E011-B5FE-001D09F251CC.root",
"/store/data/Run2011B/L1MuHPF/RAW/v1/000/178/208/7A104592-81F3-E011-9956-BCAEC518FF8E.root",
"/store/data/Run2011B/L1MuHPF/RAW/v1/000/178/208/78CEA791-81F3-E011-96FE-BCAEC5329717.root",
"/store/data/Run2011B/L1MuHPF/RAW/v1/000/178/208/781774DC-80F3-E011-9D51-BCAEC518FF69.root",
"/store/data/Run2011B/L1MuHPF/RAW/v1/000/178/208/7447855E-62F3-E011-8B81-BCAEC5329712.root",
"/store/data/Run2011B/L1MuHPF/RAW/v1/000/178/208/70683FD2-80F3-E011-A554-BCAEC53296FB.root",
"/store/data/Run2011B/L1MuHPF/RAW/v1/000/178/208/6EBEA048-73F3-E011-AA50-001D09F28D4A.root",
"/store/data/Run2011B/L1MuHPF/RAW/v1/000/178/208/6EB9B291-81F3-E011-98EF-0025B3244166.root",
"/store/data/Run2011B/L1MuHPF/RAW/v1/000/178/208/6C4F2C21-5DF3-E011-8C7C-001D09F24498.root",
"/store/data/Run2011B/L1MuHPF/RAW/v1/000/178/208/681C2E06-85F3-E011-BE92-BCAEC532971C.root",
"/store/data/Run2011B/L1MuHPF/RAW/v1/000/178/208/64FA22C1-73F3-E011-9608-003048F1BF66.root",
"/store/data/Run2011B/L1MuHPF/RAW/v1/000/178/208/64AED716-79F3-E011-8FFA-003048F024DA.root",
"/store/data/Run2011B/L1MuHPF/RAW/v1/000/178/208/603C6CCD-71F3-E011-B0AB-001D09F25460.root",
"/store/data/Run2011B/L1MuHPF/RAW/v1/000/178/208/5CEE0A25-78F3-E011-AD99-BCAEC518FF41.root",
"/store/data/Run2011B/L1MuHPF/RAW/v1/000/178/208/5C9BDF23-66F3-E011-A3E3-BCAEC5329712.root",
"/store/data/Run2011B/L1MuHPF/RAW/v1/000/178/208/5AEE6B6B-7DF3-E011-BE4C-BCAEC5329704.root",
"/store/data/Run2011B/L1MuHPF/RAW/v1/000/178/208/5A3B95E7-80F3-E011-B904-BCAEC53296FD.root",
"/store/data/Run2011B/L1MuHPF/RAW/v1/000/178/208/5A306A1A-66F3-E011-B75D-003048D37456.root",
"/store/data/Run2011B/L1MuHPF/RAW/v1/000/178/208/56EBF3C9-7FF3-E011-922D-BCAEC5329720.root",
"/store/data/Run2011B/L1MuHPF/RAW/v1/000/178/208/565A3793-81F3-E011-B961-BCAEC5329729.root",
"/store/data/Run2011B/L1MuHPF/RAW/v1/000/178/208/54F4407D-87F3-E011-889A-BCAEC5329713.root",
"/store/data/Run2011B/L1MuHPF/RAW/v1/000/178/208/544EEA90-7AF3-E011-83B3-001D09F27003.root",
"/store/data/Run2011B/L1MuHPF/RAW/v1/000/178/208/52DC296A-62F3-E011-93AC-001D09F24D8A.root",
"/store/data/Run2011B/L1MuHPF/RAW/v1/000/178/208/4C2296F7-82F3-E011-800E-001D09F250AF.root",
"/store/data/Run2011B/L1MuHPF/RAW/v1/000/178/208/4AD14E67-62F3-E011-8C46-003048F024FE.root",
"/store/data/Run2011B/L1MuHPF/RAW/v1/000/178/208/4A952712-7FF3-E011-A0DF-003048D2BEA8.root",
"/store/data/Run2011B/L1MuHPF/RAW/v1/000/178/208/4A7A7654-7CF3-E011-8EB7-003048F117B6.root",
"/store/data/Run2011B/L1MuHPF/RAW/v1/000/178/208/48BBC94B-7FF3-E011-857C-BCAEC5329703.root",
"/store/data/Run2011B/L1MuHPF/RAW/v1/000/178/208/483B13F4-7BF3-E011-BC1A-BCAEC518FF8E.root",
"/store/data/Run2011B/L1MuHPF/RAW/v1/000/178/208/481A5EDE-85F3-E011-BB07-001D09F2924F.root",
"/store/data/Run2011B/L1MuHPF/RAW/v1/000/178/208/469C5609-6FF3-E011-AEBC-003048F11C58.root",
"/store/data/Run2011B/L1MuHPF/RAW/v1/000/178/208/4699DF9F-75F3-E011-A4A7-003048F1BF68.root",
"/store/data/Run2011B/L1MuHPF/RAW/v1/000/178/208/44D16907-76F3-E011-9570-BCAEC5329714.root",
"/store/data/Run2011B/L1MuHPF/RAW/v1/000/178/208/40D03A45-71F3-E011-A7DF-0025B32035BC.root",
"/store/data/Run2011B/L1MuHPF/RAW/v1/000/178/208/40827107-76F3-E011-BC50-BCAEC518FF65.root",
"/store/data/Run2011B/L1MuHPF/RAW/v1/000/178/208/3EB05904-7EF3-E011-8D9F-BCAEC5364C42.root",
"/store/data/Run2011B/L1MuHPF/RAW/v1/000/178/208/3CBAAB92-81F3-E011-ACD2-00215AEDFD98.root",
"/store/data/Run2011B/L1MuHPF/RAW/v1/000/178/208/3C2E7605-85F3-E011-A569-BCAEC53296F7.root",
"/store/data/Run2011B/L1MuHPF/RAW/v1/000/178/208/38C45DE0-85F3-E011-8810-003048F117EA.root",
"/store/data/Run2011B/L1MuHPF/RAW/v1/000/178/208/341A2246-73F3-E011-B697-002481E0CC00.root",
"/store/data/Run2011B/L1MuHPF/RAW/v1/000/178/208/32CD5BE2-82F3-E011-81F7-0019B9F72F97.root",
"/store/data/Run2011B/L1MuHPF/RAW/v1/000/178/208/326E1156-7CF3-E011-BEA7-00237DDC5CB0.root",
"/store/data/Run2011B/L1MuHPF/RAW/v1/000/178/208/3209D592-81F3-E011-B98D-BCAEC5329732.root",
"/store/data/Run2011B/L1MuHPF/RAW/v1/000/178/208/309701D4-87F3-E011-A54B-003048D3C944.root",
"/store/data/Run2011B/L1MuHPF/RAW/v1/000/178/208/2C6D1510-7FF3-E011-97AD-001D09F29597.root",
"/store/data/Run2011B/L1MuHPF/RAW/v1/000/178/208/2AAA182B-7BF3-E011-871B-BCAEC53296F8.root",
"/store/data/Run2011B/L1MuHPF/RAW/v1/000/178/208/26D0A692-81F3-E011-83B9-BCAEC5364C6C.root",
"/store/data/Run2011B/L1MuHPF/RAW/v1/000/178/208/262DC82E-80F3-E011-96FD-003048F024FE.root",
"/store/data/Run2011B/L1MuHPF/RAW/v1/000/178/208/22454A4E-7FF3-E011-84FC-E0CB4E4408E7.root",
"/store/data/Run2011B/L1MuHPF/RAW/v1/000/178/208/1AB79992-81F3-E011-AD2D-0025B324400C.root",
"/store/data/Run2011B/L1MuHPF/RAW/v1/000/178/208/1682B742-74F3-E011-8298-003048F11CF0.root",
"/store/data/Run2011B/L1MuHPF/RAW/v1/000/178/208/163C8F48-73F3-E011-9DB3-BCAEC518FF68.root",
"/store/data/Run2011B/L1MuHPF/RAW/v1/000/178/208/14B93F91-81F3-E011-87D4-003048F11114.root",
"/store/data/Run2011B/L1MuHPF/RAW/v1/000/178/208/0EEAEA45-60F3-E011-B403-BCAEC518FF68.root",
"/store/data/Run2011B/L1MuHPF/RAW/v1/000/178/208/0C653535-80F3-E011-A446-0019B9F72CE5.root",
"/store/data/Run2011B/L1MuHPF/RAW/v1/000/178/208/0C425643-74F3-E011-AF53-00215AEDFD74.root",
"/store/data/Run2011B/L1MuHPF/RAW/v1/000/178/208/0AFAADAB-71F3-E011-B87A-001D09F23C73.root",
"/store/data/Run2011B/L1MuHPF/RAW/v1/000/178/208/0A3935CF-82F3-E011-8D4F-001D09F28F0C.root",
"/store/data/Run2011B/L1MuHPF/RAW/v1/000/178/208/0A13222E-80F3-E011-9E97-003048F117F6.root",
"/store/data/Run2011B/L1MuHPF/RAW/v1/000/178/208/045D3042-74F3-E011-AD31-003048F024DC.root",
"/store/data/Run2011B/L1MuHPF/RAW/v1/000/178/208/02F5BD40-7AF3-E011-AC3D-003048D3C980.root",
"/store/data/Run2011B/L1MuHPF/RAW/v1/000/178/208/00302009-85F3-E011-B174-E0CB4E4408E7.root"

])

process.load("EventFilter.CSCTFRawToDigi.csctfunpacker_cfi")

process.csctfFilter = cms.EDFilter("CSCTFFilter",
				modes = cms.untracked.vuint32(5,8,9,10),
				inputTag = cms.untracked.InputTag("csctfunpacker")
)

# Event Setup
##############
process.GlobalTag.globaltag ='GR_R_43_V3::All'

process.FEVT = cms.OutputModule("PoolOutputModule",
	fileName = cms.untracked.string("modeFiltered.root"),
  	SelectEvents = cms.untracked.PSet(
    	  SelectEvents = cms.vstring("p")
  	),
	outputCommands = cms.untracked.vstring(	
		"drop *",
		"keep *_csctfunpacker_*_*"
	)
)

process.p = cms.Path(process.csctfunpacker*process.csctfFilter)
process.endPath = cms.EndPath(process.FEVT)

