Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-10-08 05:12:07

0001 import os
0002 import FWCore.ParameterSet.Config as cms
0003 
0004 process = cms.Process("TEST")
0005 
0006 import FWCore.ParameterSet.VarParsing as VarParsing
0007 options = VarParsing.VarParsing ('standard')
0008 options.register('GlobalTag', "", VarParsing.VarParsing.multiplicity.singleton, VarParsing.VarParsing.varType.string, "GlobalTag to use (default abort)")
0009 options.register('Redigi'   , 1, VarParsing.VarParsing.multiplicity.singleton, VarParsing.VarParsing.varType.int, "Rerun digi from sim (default true)")
0010 options.register('SLHC'   , 0, VarParsing.VarParsing.multiplicity.singleton, VarParsing.VarParsing.varType.int, "Run SLHC mode (default false) doesn't do anything yet.")
0011 
0012 options.parseArguments()
0013 print(options)
0014 
0015 ### RANDOM setting (change last digit(s) to make runs different !)
0016 process.load("Configuration.StandardSequences.SimulationRandomNumberGeneratorSeeds_cff")
0017 
0018 process.load("SimCalorimetry.Configuration.hcalDigiSequence_cff")
0019 process.load("SimGeneral.MixingModule.mixNoPU_cfi")
0020 process.load("RecoLocalCalo.Configuration.hcalLocalReco_cff")
0021 process.load("RecoLocalCalo.Configuration.hcalGlobalReco_cff")
0022 process.load("RecoMET.METProducers.hcalnoiseinfoproducer_cfi")
0023 process.load("RecoJets.Configuration.CaloTowersRec_cff")
0024 process.load("RecoLocalCalo.EcalRecAlgos.EcalSeverityLevelESProducer_cfi")
0025 process.load("EventFilter.HcalRawToDigi.HcalDigiToRaw_cfi")
0026 process.load("EventFilter.HcalRawToDigi.HcalRawToDigi_cfi")
0027 process.load("EventFilter.RawDataCollector.rawDataCollector_cfi")
0028 process.load("Configuration.StandardSequences.FrontierConditions_GlobalTag_cff")
0029 
0030 #from Configuration.AlCa.autoCond import autoCond
0031 #process.GlobalTag.globaltag = autoCond['startup']
0032 if(options.GlobalTag == ""):
0033     print("\n==================================================================================================")
0034     print("| No global tag set.  Please use option GlobalTag=XXXXXX::All to set the approperite global tag. |")
0035     print("==================================================================================================\n")
0036     exit()
0037 process.GlobalTag.globaltag = cms.string(options.GlobalTag)
0038 
0039 
0040 process.load("Configuration.StandardSequences.GeometryDB_cff")
0041 process.load("Configuration.StandardSequences.MagneticField_cff")
0042 
0043 
0044 #process.load("DQMServices.Core.DQM_cfg")
0045 #process.DQM.collectorHost = ''
0046 
0047 process.load("DQMServices.Core.DQMStore_cfi")
0048 process.load("DQMServices.Components.MEtoEDMConverter_cfi")
0049 
0050 process.load("FWCore.MessageLogger.MessageLogger_cfi")
0051 process.MessageLogger.cerr.FwkReport.reportEvery = 100
0052 
0053 process.maxEvents = cms.untracked.PSet(
0054     input = cms.untracked.int32(-1) 
0055 )
0056 # Input source
0057 process.source = cms.Source("PoolSource",
0058 #    noEventSort = cms.untracked.bool(True),
0059 #    duplicateCheckMode = cms.untracked.string('noDuplicateCheck'),
0060     fileNames = cms.untracked.vstring(
0061        '/store/relval/CMSSW_7_3_0/RelValQCD_Pt_3000_3500_13/GEN-SIM-RECO/MCRUN2_73_V7-v1/00000/0A15667E-7B81-E411-A10B-0025905A6068.root',
0062        '/store/relval/CMSSW_7_3_0/RelValQCD_Pt_3000_3500_13/GEN-SIM-RECO/MCRUN2_73_V7-v1/00000/161A8A1B-7781-E411-867C-00259059649C.root',
0063        '/store/relval/CMSSW_7_3_0/RelValQCD_Pt_3000_3500_13/GEN-SIM-RECO/MCRUN2_73_V7-v1/00000/2653E680-7B81-E411-92BB-0025905A48B2.root',
0064        '/store/relval/CMSSW_7_3_0/RelValQCD_Pt_3000_3500_13/GEN-SIM-RECO/MCRUN2_73_V7-v1/00000/8245EF1E-7781-E411-919E-0025905B85AA.root'
0065     ) ,
0066     secondaryFileNames = cms.untracked.vstring(
0067        '/store/relval/CMSSW_7_3_0/RelValQCD_Pt_3000_3500_13/GEN-SIM-DIGI-RAW-HLTDEBUG/MCRUN2_73_V7-v1/00000/029B8EF8-5581-E411-B6D7-0025905B85AE.root',
0068        '/store/relval/CMSSW_7_3_0/RelValQCD_Pt_3000_3500_13/GEN-SIM-DIGI-RAW-HLTDEBUG/MCRUN2_73_V7-v1/00000/16A64AB2-5781-E411-A7C6-0025905B85AA.root',
0069        '/store/relval/CMSSW_7_3_0/RelValQCD_Pt_3000_3500_13/GEN-SIM-DIGI-RAW-HLTDEBUG/MCRUN2_73_V7-v1/00000/383DFC62-5581-E411-A822-0025905B85E8.root',
0070        '/store/relval/CMSSW_7_3_0/RelValQCD_Pt_3000_3500_13/GEN-SIM-DIGI-RAW-HLTDEBUG/MCRUN2_73_V7-v1/00000/44733F41-5681-E411-ADD1-002618943966.root',
0071        '/store/relval/CMSSW_7_3_0/RelValQCD_Pt_3000_3500_13/GEN-SIM-DIGI-RAW-HLTDEBUG/MCRUN2_73_V7-v1/00000/7859B8B3-5581-E411-BC59-0025905B85AE.root',
0072        '/store/relval/CMSSW_7_3_0/RelValQCD_Pt_3000_3500_13/GEN-SIM-DIGI-RAW-HLTDEBUG/MCRUN2_73_V7-v1/00000/94DD3149-5681-E411-8BA5-0025905A6082.root',
0073        '/store/relval/CMSSW_7_3_0/RelValQCD_Pt_3000_3500_13/GEN-SIM-DIGI-RAW-HLTDEBUG/MCRUN2_73_V7-v1/00000/AE6D3B5F-5581-E411-934A-0025905A6090.root',
0074        '/store/relval/CMSSW_7_3_0/RelValQCD_Pt_3000_3500_13/GEN-SIM-DIGI-RAW-HLTDEBUG/MCRUN2_73_V7-v1/00000/D2190515-5681-E411-B04F-002590596484.root'
0075     )
0076 )
0077 
0078 if(options.Redigi):
0079     process.source.inputCommands = cms.untracked.vstring('keep *',
0080                                          'drop *_MEtoEDMConverter_*_*',
0081                                          'drop HBHEDataFramesSorted_*__*',
0082                                          'drop HODataFramesSorted_*__*',
0083                                          'drop HFDataFramesSorted_*__*',
0084                                          'drop *_MEtoEDMConverter_*_*'
0085                                          )
0086 
0087 
0088 process.FEVT = cms.OutputModule("PoolOutputModule",
0089      outputCommands = cms.untracked.vstring('drop *', 'keep *_MEtoEDMConverter_*_*'),
0090      splitLevel = cms.untracked.int32(0),
0091      fileName = cms.untracked.string("output.root")
0092 )
0093 
0094 from DQMServices.Core.DQMEDAnalyzer import DQMEDAnalyzer
0095 process.HcalSimHitsAnalyser = DQMEDAnalyzer('HcalSimHitsValidation',
0096     outputFile = cms.untracked.string('HcalSimHitsValidation.root')
0097 )   
0098 
0099 process.hcalDigiAnalyzer = DQMEDAnalyzer('HcalDigisValidation',
0100     outputFile            = cms.untracked.string('HcalDigisValidationRelVal.root'),
0101     digiLabel             = cms.InputTag("hcalDigis"),
0102     zside             = cms.untracked.string('*'),
0103     mode              = cms.untracked.string('multi'),
0104 
0105     hcalselector          = cms.untracked.string('all'),
0106     mc                = cms.untracked.string('yes') # 'yes' for MC
0107 )   
0108 
0109 process.hcalRecoAnalyzer = DQMEDAnalyzer('HcalRecHitsValidation',
0110     outputFile                = cms.untracked.string('HcalRecHitValidationRelVal.root'),
0111     HBHERecHitCollectionLabel = cms.untracked.InputTag("hbhereco"),
0112     HFRecHitCollectionLabel   = cms.untracked.InputTag("hfreco"),
0113     HORecHitCollectionLabel   = cms.untracked.InputTag("horeco"),
0114     eventype                  = cms.untracked.string('single'),
0115     ecalselector              = cms.untracked.string('yes'),
0116     hcalselector              = cms.untracked.string('all'),
0117     mc                        = cms.untracked.string('yes')  # default !
0118 )
0119 
0120 process.hcalTowerAnalyzer = DQMEDAnalyzer('CaloTowersValidation',
0121     outputFile               = cms.untracked.string('CaloTowersValidationRelVal.root'),
0122     CaloTowerCollectionLabel = cms.untracked.InputTag('towerMaker'),
0123     hcalselector             = cms.untracked.string('all'),
0124     mc                       = cms.untracked.string('yes')  # default!
0125 )
0126 
0127 #--- EventFilter/HcalRawToDigi/python/HcalRawToDigi_cfi.py
0128 process.hcalDigis.UnpackZDC =  cms.untracked.bool(False)
0129 
0130 process.hcalDigis.InputLabel = 'rawDataCollector'
0131 
0132 #--- replace hbhereco with hbheprereco
0133 delattr(process,"hbhereco")
0134 process.hbhereco = process.hbheprereco.clone()
0135 process.hcalLocalRecoSequence = cms.Sequence(process.hbhereco+process.hfreco+process.horeco)
0136 
0137 
0138 #---  Mixing:  ECAL and HCAL
0139 process.mix.digitizers = cms.PSet(
0140 #      ecal = cms.PSet(
0141 #        process.ecalDigitizer
0142 #      ),
0143       hcal = cms.PSet(
0144         process.hcalDigitizer
0145       )
0146 )
0147 process.simCastorDigis = cms.EDAlias()
0148 process.simSiPixelDigis = cms.EDAlias()
0149 process.simSiStripDigis = cms.EDAlias()
0150 process.simEcalUnsuppressedDigis = cms.EDAlias()
0151 
0152 process.load('Configuration/StandardSequences/EDMtoMEAtRunEnd_cff')
0153 process.dqmSaver.referenceHandling = cms.untracked.string('all')
0154 
0155 cmssw_version = os.environ.get('CMSSW_VERSION','CMSSW_X_Y_Z')
0156 Workflow = '/HcalValidation/'+'Harvesting/'+str(cmssw_version)
0157 process.dqmSaver.workflow = Workflow
0158 
0159 if(options.Redigi):
0160     process.p = cms.Path(
0161         process.mix *
0162         process.hcalDigiSequence *
0163         process.hcalRawData *
0164         process.rawDataCollector *
0165         process.hcalDigis *
0166         process.hcalLocalRecoSequence *
0167         process.caloTowersRec *
0168         process.hcalnoise *
0169         process.hcalDigiAnalyzer *
0170         process.hcalTowerAnalyzer *
0171         process.hcalRecoAnalyzer *
0172         process.dqmSaver
0173         )
0174 else:
0175     process.p = cms.Path(
0176         process.hcalDigiSequence *
0177         process.hcalRawData *
0178         process.rawDataCollector *
0179         process.hcalDigis *
0180         process.hcalLocalRecoSequence *
0181         process.caloTowersRec *
0182         process.hcalnoise *
0183         process.hcalDigiAnalyzer *
0184         process.hcalTowerAnalyzer *
0185         process.hcalRecoAnalyzer *
0186         process.dqmSaver
0187 
0188         )
0189 
0190 #process.outpath = cms.EndPath(process.FEVT)
0191 
0192 # Customization
0193 
0194 from SLHCUpgradeSimulations.Configuration.postLS1Customs import customise_Digi
0195 customise_Digi(process)